pub trait StateRangeProvider {
// Required methods
fn account_range(
&self,
start: B256,
limit: B256,
response_bytes: usize,
) -> RangeResult<(B256, Account)>;
fn storage_root_by_hash(&self, hashed_address: B256) -> ProviderResult<B256>;
fn storage_range(
&self,
hashed_address: B256,
start: B256,
limit: B256,
response_bytes: usize,
) -> StorageRangeResult;
fn account_range_proof(&self, keys: &[B256]) -> ProviderResult<Vec<Bytes>>;
fn storage_range_proof(
&self,
hashed_address: B256,
keys: &[B256],
) -> ProviderResult<Vec<Bytes>>;
}Expand description
A type that can iterate over consecutive hashed accounts and storage slots, and generate
boundary proofs for them, for serving snap/2 (EIP-8189) GetAccountRange/GetStorageRanges
requests. Hash-native throughout, unlike StorageRootProvider.
Required Methods§
Sourcefn account_range(
&self,
start: B256,
limit: B256,
response_bytes: usize,
) -> RangeResult<(B256, Account)>
fn account_range( &self, start: B256, limit: B256, response_bytes: usize, ) -> RangeResult<(B256, Account)>
Returns accounts (hash, account) in [start, limit], bounded by response_bytes.
Sourcefn storage_root_by_hash(&self, hashed_address: B256) -> ProviderResult<B256>
fn storage_root_by_hash(&self, hashed_address: B256) -> ProviderResult<B256>
Returns the storage root for hashed_address without needing its address preimage.
Sourcefn storage_range(
&self,
hashed_address: B256,
start: B256,
limit: B256,
response_bytes: usize,
) -> StorageRangeResult
fn storage_range( &self, hashed_address: B256, start: B256, limit: B256, response_bytes: usize, ) -> StorageRangeResult
Same as Self::account_range, but for the storage slots of hashed_address.
Returns None if hashed_address isn’t present in the account trie at the pinned state
root, distinct from an account that is present but has no storage.
Sourcefn account_range_proof(&self, keys: &[B256]) -> ProviderResult<Vec<Bytes>>
fn account_range_proof(&self, keys: &[B256]) -> ProviderResult<Vec<Bytes>>
Returns an account-trie boundary proof for the already-hashed keys.
Sourcefn storage_range_proof(
&self,
hashed_address: B256,
keys: &[B256],
) -> ProviderResult<Vec<Bytes>>
fn storage_range_proof( &self, hashed_address: B256, keys: &[B256], ) -> ProviderResult<Vec<Bytes>>
Same as Self::account_range_proof, but for the storage trie of hashed_address.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".