Trait reth_storage_api::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: HashMap<B256, HashSet<B256>>,
    ) -> ProviderResult<MultiProof>;
    fn witness(
        &self,
        input: TrieInput,
        target: HashedPostState,
    ) -> ProviderResult<HashMap<B256, 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: HashMap<B256, HashSet<B256>>, ) -> ProviderResult<MultiProof>

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

source

fn witness( &self, input: TrieInput, target: HashedPostState, ) -> ProviderResult<HashMap<B256, 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: HashMap<B256, HashSet<B256>>, ) -> ProviderResult<MultiProof>

source§

fn witness( &self, input: TrieInput, target: HashedPostState, ) -> ProviderResult<HashMap<B256, 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: HashMap<B256, HashSet<B256>>, ) -> ProviderResult<MultiProof>

source§

fn witness( &self, input: TrieInput, target: HashedPostState, ) -> ProviderResult<HashMap<B256, 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: HashMap<B256, HashSet<B256>>, ) -> ProviderResult<MultiProof>

source§

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

Implementors§