Skip to main content

Module state

Module state 

Source
Expand description

Support for generating the state root for memdb storage

Re-exportsยง

use alloy_primitives::B256; ๐Ÿ”’
use alloy_primitives::Bytes; ๐Ÿ”’
use alloy_primitives::U256; ๐Ÿ”’
use alloy_primitives::keccak256; ๐Ÿ”’
use alloy_primitives::map::AddressMap; ๐Ÿ”’
use alloy_primitives::map::B256Map; ๐Ÿ”’
use alloy_primitives::map::HashSet; ๐Ÿ”’
use alloy_primitives::map::U256Map; ๐Ÿ”’
use alloy_rlp::Encodable; ๐Ÿ”’
use alloy_trie::EMPTY_ROOT_HASH; ๐Ÿ”’
use alloy_trie::HashBuilder; ๐Ÿ”’
use alloy_trie::Nibbles; ๐Ÿ”’
use alloy_trie::TrieMask; ๐Ÿ”’
use alloy_trie::nodes::BranchNodeRef; ๐Ÿ”’
use alloy_trie::nodes::ExtensionNodeRef; ๐Ÿ”’
use alloy_trie::nodes::LeafNodeRef; ๐Ÿ”’
use alloy_trie::nodes::RlpNode; ๐Ÿ”’
use revm::database::AccountState; ๐Ÿ”’
use revm::database::DbAccount; ๐Ÿ”’
use revm::state::Account; ๐Ÿ”’
use revm::state::AccountInfo; ๐Ÿ”’
use std::array; ๐Ÿ”’
use std::mem; ๐Ÿ”’

Structsยง

DirtyAccount ๐Ÿ”’
IncrementalStateTrie ๐Ÿ”’
IncrementalTrie ๐Ÿ”’
A mutable Merkle Patricia trie that caches the RLP reference for every unchanged node.
StateRootCache
Incrementally maintains the state trie used for block headers.
TrieNode ๐Ÿ”’

Enumsยง

TrieNodeKind ๐Ÿ”’

Functionsยง

build_root
state_root
Builds state root from the given accounts
state_trie_witness
Builds the state trie for the given accounts and returns its root together with the RLP encoding of every node of the account trie and all storage tries.
storage_root
Builds storage root from the given storage
trie_account_rlp
Returns the RLP for this account.
trie_account_rlp_with_storage_root ๐Ÿ”’
Returns the RLP for this account with an already computed storage root.
trie_accounts
Builds iterator over stored key-value pairs ready for account trie root calculation.
trie_storage
Builds iterator over stored key-value pairs ready for storage trie root calculation.