reth_storage_api

Trait StateProofProvider

Source
pub trait StateProofProvider: Send + Sync {
    // Required methods
    fn proof(
        &self,
        input: TrieInput,
        address: Address,
        slots: &[B256],
    ) -> ProviderResult<AccountProof>;
    fn multiproof(
        &self,
        input: TrieInput,
        targets: MultiProofTargets,
    ) -> ProviderResult<MultiProof>;
    fn witness(
        &self,
        input: TrieInput,
        target: HashedPostState,
    ) -> ProviderResult<B256HashMap<Bytes>>;
}
Expand description

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

Required Methods§

Source

fn proof( &self, input: TrieInput, address: Address, slots: &[B256], ) -> ProviderResult<AccountProof>

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

Source

fn multiproof( &self, input: TrieInput, targets: MultiProofTargets, ) -> ProviderResult<MultiProof>

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

Source

fn witness( &self, input: TrieInput, target: HashedPostState, ) -> ProviderResult<B256HashMap<Bytes>>

Get trie witness for provided state.

Implementations on Foreign Types§

Source§

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

Source§

fn proof( &self, input: TrieInput, address: Address, slots: &[B256], ) -> ProviderResult<AccountProof>

Source§

fn multiproof( &self, input: TrieInput, targets: MultiProofTargets, ) -> ProviderResult<MultiProof>

Source§

fn witness( &self, input: TrieInput, target: HashedPostState, ) -> ProviderResult<B256HashMap<Bytes>>

Source§

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

Source§

fn proof( &self, input: TrieInput, address: Address, slots: &[B256], ) -> ProviderResult<AccountProof>

Source§

fn multiproof( &self, input: TrieInput, targets: MultiProofTargets, ) -> ProviderResult<MultiProof>

Source§

fn witness( &self, input: TrieInput, target: HashedPostState, ) -> ProviderResult<B256HashMap<Bytes>>

Source§

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

Source§

fn proof( &self, input: TrieInput, address: Address, slots: &[B256], ) -> ProviderResult<AccountProof>

Source§

fn multiproof( &self, input: TrieInput, targets: MultiProofTargets, ) -> ProviderResult<MultiProof>

Source§

fn witness( &self, input: TrieInput, target: HashedPostState, ) -> ProviderResult<B256HashMap<Bytes>>

Implementors§

Source§

impl<C: Send + Sync, N: NodePrimitives> StateProofProvider for NoopProvider<C, N>