reth_revm::database

Trait EvmStateProvider

Source
pub trait EvmStateProvider: Send + Sync {
    // Required methods
    fn basic_account(&self, address: Address) -> ProviderResult<Option<Account>>;
    fn block_hash(&self, number: BlockNumber) -> ProviderResult<Option<B256>>;
    fn bytecode_by_hash(
        &self,
        code_hash: B256,
    ) -> ProviderResult<Option<Bytecode>>;
    fn storage(
        &self,
        account: Address,
        storage_key: StorageKey,
    ) -> ProviderResult<Option<StorageValue>>;
}
Expand description

A helper trait responsible for providing state necessary for EVM execution.

This serves as the data layer for Database.

Required Methods§

Source

fn basic_account(&self, address: Address) -> ProviderResult<Option<Account>>

Get basic account information.

Returns None if the account doesn’t exist.

Source

fn block_hash(&self, number: BlockNumber) -> ProviderResult<Option<B256>>

Get the hash of the block with the given number. Returns None if no block with this number exists.

Source

fn bytecode_by_hash(&self, code_hash: B256) -> ProviderResult<Option<Bytecode>>

Get account code by hash.

Source

fn storage( &self, account: Address, storage_key: StorageKey, ) -> ProviderResult<Option<StorageValue>>

Get storage of the given account.

Implementors§