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: 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§