pub trait StateProofProvider {
// Required methods
fn proof(
&self,
address: Address,
slots: &[FixedBytes<32>],
) -> Result<AccountProof, ProviderError>;
fn multiproof_v2(
&self,
targets: MultiProofTargetsV2,
requires_masks: bool,
) -> Result<DecodedMultiProofV2, ProviderError>;
fn witness(
&self,
target: HashedPostState,
mode: ExecutionWitnessMode,
) -> Result<Vec<Bytes>, ProviderError>;
}Expand description
A type that can generate state proofs and execution witnesses.
Required Methods§
Sourcefn proof(
&self,
address: Address,
slots: &[FixedBytes<32>],
) -> Result<AccountProof, ProviderError>
fn proof( &self, address: Address, slots: &[FixedBytes<32>], ) -> Result<AccountProof, ProviderError>
Get account and storage proofs for the target keys against the provider’s state.
Sourcefn multiproof_v2(
&self,
targets: MultiProofTargetsV2,
requires_masks: bool,
) -> Result<DecodedMultiProofV2, ProviderError>
fn multiproof_v2( &self, targets: MultiProofTargetsV2, requires_masks: bool, ) -> Result<DecodedMultiProofV2, ProviderError>
Generate a V2 decoded multiproof for target hashed accounts and storage slots against the provider’s state.
A storage address with no slot targets requests its storage root node. Empty targets return an empty proof.
Set requires_masks when the hash and tree masks of returned branch nodes must match the
stored trie, as required to produce trie updates from them. Otherwise node hashes are still
exact, but masks are not guaranteed to match.
Sourcefn witness(
&self,
target: HashedPostState,
mode: ExecutionWitnessMode,
) -> Result<Vec<Bytes>, ProviderError>
fn witness( &self, target: HashedPostState, mode: ExecutionWitnessMode, ) -> Result<Vec<Bytes>, ProviderError>
Get a trie witness for applying the target state on top of the provider’s state.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementations on Foreign Types§
Source§impl<'a, T> StateProofProvider for &'a Twhere
T: 'a + StateProofProvider + ?Sized,
impl<'a, T> StateProofProvider for &'a Twhere
T: 'a + StateProofProvider + ?Sized,
fn proof( &self, address: Address, slots: &[FixedBytes<32>], ) -> Result<AccountProof, ProviderError>
fn multiproof_v2( &self, targets: MultiProofTargetsV2, requires_masks: bool, ) -> Result<DecodedMultiProofV2, ProviderError>
fn witness( &self, target: HashedPostState, mode: ExecutionWitnessMode, ) -> Result<Vec<Bytes>, ProviderError>
Source§impl<Provider, N> StateProofProvider for OverlayStateProvider<Provider, N>where
N: NodePrimitives,
Provider: Deref,
<Provider as Deref>::Target: DBProvider + StageCheckpointReader + PruneCheckpointReader + ChangeSetReader + StorageChangeSetReader + BlockNumReader + StorageSettingsCache,
impl<Provider, N> StateProofProvider for OverlayStateProvider<Provider, N>where
N: NodePrimitives,
Provider: Deref,
<Provider as Deref>::Target: DBProvider + StageCheckpointReader + PruneCheckpointReader + ChangeSetReader + StorageChangeSetReader + BlockNumReader + StorageSettingsCache,
fn proof( &self, address: Address, slots: &[FixedBytes<32>], ) -> Result<AccountProof, ProviderError>
fn multiproof_v2( &self, targets: MultiProofTargetsV2, requires_masks: bool, ) -> Result<DecodedMultiProofV2, ProviderError>
fn witness( &self, target: HashedPostState, mode: ExecutionWitnessMode, ) -> Result<Vec<Bytes>, ProviderError>
Source§impl<T> StateProofProvider for Arc<T>where
T: StateProofProvider + ?Sized,
impl<T> StateProofProvider for Arc<T>where
T: StateProofProvider + ?Sized,
fn proof( &self, address: Address, slots: &[FixedBytes<32>], ) -> Result<AccountProof, ProviderError>
fn multiproof_v2( &self, targets: MultiProofTargetsV2, requires_masks: bool, ) -> Result<DecodedMultiProofV2, ProviderError>
fn witness( &self, target: HashedPostState, mode: ExecutionWitnessMode, ) -> Result<Vec<Bytes>, ProviderError>
Source§impl<T> StateProofProvider for Box<T>where
T: StateProofProvider + ?Sized,
impl<T> StateProofProvider for Box<T>where
T: StateProofProvider + ?Sized,
fn proof( &self, address: Address, slots: &[FixedBytes<32>], ) -> Result<AccountProof, ProviderError>
fn multiproof_v2( &self, targets: MultiProofTargetsV2, requires_masks: bool, ) -> Result<DecodedMultiProofV2, ProviderError>
fn witness( &self, target: HashedPostState, mode: ExecutionWitnessMode, ) -> Result<Vec<Bytes>, ProviderError>
Implementors§
impl<'a, Provider: DBProvider + BlockHashReader + StorageSettingsCache> StateProofProvider for LatestStateProvider<Provider>
impl<C, N> StateProofProvider for NoopProvider<C, N>
impl<Provider: DBProvider + StorageSettingsCache> StateProofProvider for LatestStateProviderRef<'_, Provider>
impl<T, ChainSpec> StateProofProvider for MockEthProvider<T, ChainSpec>
test-utils only.