reth::providers

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>, FxBuildHasherInner>, FxBuildHasherInner>,
    ) -> Result<MultiProof, ProviderError>;
    fn witness(
        &self,
        input: TrieInput,
        target: HashedPostState,
    ) -> Result<HashMap<FixedBytes<32>, Bytes, FxBuildHasherInner>, 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>, FxBuildHasherInner>, FxBuildHasherInner>, ) -> 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, FxBuildHasherInner>, ProviderError>

Get trie witness for provided state.

Implementations on Foreign Types§

§

impl StateProofProvider for MemoryOverlayStateProvider

§

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>, FxBuildHasherInner>, FxBuildHasherInner>, ) -> Result<MultiProof, ProviderError>

§

fn witness( &self, input: TrieInput, target: HashedPostState, ) -> Result<HashMap<FixedBytes<32>, Bytes, FxBuildHasherInner>, 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>, FxBuildHasherInner>, FxBuildHasherInner>, ) -> Result<MultiProof, ProviderError>

§

fn witness( &self, input: TrieInput, target: HashedPostState, ) -> Result<HashMap<FixedBytes<32>, Bytes, FxBuildHasherInner>, 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>, FxBuildHasherInner>, FxBuildHasherInner>, ) -> Result<MultiProof, ProviderError>

§

fn witness( &self, input: TrieInput, target: HashedPostState, ) -> Result<HashMap<FixedBytes<32>, Bytes, FxBuildHasherInner>, 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>, FxBuildHasherInner>, FxBuildHasherInner>, ) -> Result<MultiProof, ProviderError>

§

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

Implementors§