reth_provider

Trait StateProofProvider

pub trait StateProofProvider: Send + Sync {
    // Required methods
    fn proof(
        &self,
        input: TrieInput,
        address: Address,
        slots: &[FixedBytes<32>],
    ) -> Result<AccountProof, ProviderError>;
    fn multiproof(
        &self,
        input: TrieInput,
        targets: HashMap<FixedBytes<32>, HashSet<FixedBytes<32>, RandomState>, RandomState>,
    ) -> Result<MultiProof, ProviderError>;
    fn witness(
        &self,
        input: TrieInput,
        target: HashedPostState,
    ) -> Result<HashMap<FixedBytes<32>, Bytes, RandomState>, ProviderError>;
}
Expand description

A type that can generate state proof on top of a given post state.

Required Methods§

fn proof( &self, input: TrieInput, address: Address, slots: &[FixedBytes<32>], ) -> Result<AccountProof, ProviderError>

Get account and storage proofs of target keys in the HashedPostState on top of the current state.

fn multiproof( &self, input: TrieInput, targets: HashMap<FixedBytes<32>, HashSet<FixedBytes<32>, RandomState>, RandomState>, ) -> Result<MultiProof, ProviderError>

Generate [MultiProof] for target hashed account and corresponding hashed storage slot keys.

fn witness( &self, input: TrieInput, target: HashedPostState, ) -> Result<HashMap<FixedBytes<32>, Bytes, RandomState>, ProviderError>

Get trie witness for provided state.

Implementations on Foreign Types§

§

impl StateProofProvider for StateProviderTest

§

fn proof( &self, _input: TrieInput, _address: Address, _slots: &[FixedBytes<32>], ) -> Result<AccountProof, ProviderError>

§

fn multiproof( &self, _input: TrieInput, _targets: HashMap<FixedBytes<32>, HashSet<FixedBytes<32>, RandomState>, RandomState>, ) -> Result<MultiProof, ProviderError>

§

fn witness( &self, _input: TrieInput, _target: HashedPostState, ) -> Result<HashMap<FixedBytes<32>, Bytes, RandomState>, ProviderError>

§

impl<'a, N> StateProofProvider for MemoryOverlayStateProviderRef<'a, N>
where N: NodePrimitives,

§

fn proof( &self, input: TrieInput, address: Address, slots: &[FixedBytes<32>], ) -> Result<AccountProof, ProviderError>

§

fn multiproof( &self, input: TrieInput, targets: HashMap<FixedBytes<32>, HashSet<FixedBytes<32>, RandomState>, RandomState>, ) -> Result<MultiProof, ProviderError>

§

fn witness( &self, input: TrieInput, target: HashedPostState, ) -> Result<HashMap<FixedBytes<32>, Bytes, RandomState>, ProviderError>

§

impl<'a, T> StateProofProvider for &'a T
where T: 'a + StateProofProvider + ?Sized, &'a T: Send + Sync,

§

fn proof( &self, input: TrieInput, address: Address, slots: &[FixedBytes<32>], ) -> Result<AccountProof, ProviderError>

§

fn multiproof( &self, input: TrieInput, targets: HashMap<FixedBytes<32>, HashSet<FixedBytes<32>, RandomState>, RandomState>, ) -> Result<MultiProof, ProviderError>

§

fn witness( &self, input: TrieInput, target: HashedPostState, ) -> Result<HashMap<FixedBytes<32>, Bytes, RandomState>, ProviderError>

§

impl<N> StateProofProvider for MemoryOverlayStateProvider<N>
where N: NodePrimitives,

§

fn proof( &self, input: TrieInput, address: Address, slots: &[FixedBytes<32>], ) -> Result<AccountProof, ProviderError>

§

fn multiproof( &self, input: TrieInput, targets: HashMap<FixedBytes<32>, HashSet<FixedBytes<32>, RandomState>, RandomState>, ) -> Result<MultiProof, ProviderError>

§

fn witness( &self, input: TrieInput, target: HashedPostState, ) -> Result<HashMap<FixedBytes<32>, Bytes, RandomState>, ProviderError>

§

impl<T> StateProofProvider for Box<T>
where T: StateProofProvider + ?Sized, Box<T>: Send + Sync,

§

fn proof( &self, input: TrieInput, address: Address, slots: &[FixedBytes<32>], ) -> Result<AccountProof, ProviderError>

§

fn multiproof( &self, input: TrieInput, targets: HashMap<FixedBytes<32>, HashSet<FixedBytes<32>, RandomState>, RandomState>, ) -> Result<MultiProof, ProviderError>

§

fn witness( &self, input: TrieInput, target: HashedPostState, ) -> Result<HashMap<FixedBytes<32>, Bytes, RandomState>, ProviderError>

§

impl<T> StateProofProvider for Arc<T>
where T: StateProofProvider + ?Sized, Arc<T>: Send + Sync,

§

fn proof( &self, input: TrieInput, address: Address, slots: &[FixedBytes<32>], ) -> Result<AccountProof, ProviderError>

§

fn multiproof( &self, input: TrieInput, targets: HashMap<FixedBytes<32>, HashSet<FixedBytes<32>, RandomState>, RandomState>, ) -> Result<MultiProof, ProviderError>

§

fn witness( &self, input: TrieInput, target: HashedPostState, ) -> Result<HashMap<FixedBytes<32>, Bytes, RandomState>, ProviderError>

Implementors§