Expand description
The implementation of Merkle Patricia Trie, a cryptographically authenticated radix trie that is used to store key-value bindings. https://ethereum.org/en/developers/docs/data-structures-and-encoding/patricia-merkle-trie/
§Feature Flags
test-utils
: Export utilities for testing
Modules§
- forward_
cursor - The implementation of forward-only in-memory cursor.
- hash_
builder - The implementation of hash builder. MPT hash builder implementation.
- hashed_
cursor - The cursor implementations for navigating hashed state.
- metrics
metrics
- Trie calculation metrics.
- node_
iter - The iterators for traversing existing intermediate hashes and updated trie leaves.
- prefix_
set - The implementation of a container for storing intermediate changes to a trie. The container indicates when the trie has been modified.
- proof
- Merkle proof generation.
- root
- Common root computation functions.
- serde_
bincode_ compat - Bincode-compatible serde implementations for trie types.
- stats
- Trie calculation stats.
- test_
utils test-utils
- Collection of trie-related test utilities.
- trie_
cursor - The cursor implementations for navigating account and storage tries.
- triehash
- Implementation of hasher using our keccak256 hashing function
for compatibility with
triehash
crate. - updates
- Buffer for trie updates.
- walker
- The trie walker for iterating over the trie nodes.
- witness
- Trie witness generation.
Structs§
- Account
Proof - The merkle proof with the relevant account info.
- Branch
Node - A branch node in an Ethereum Merkle Patricia Trie.
- Branch
Node Compact - A struct representing a branch node in an Ethereum trie.
- Branch
Node Ref - A reference to BranchNode and its state mask. NOTE: The stack may contain more items that specified in the state mask.
- Extension
Node - An extension node in an Ethereum Merkle Patricia Trie.
- Extension
Node Ref - Reference to the extension node. See ExtensionNode from more information.
- Hash
Builder - A component used to construct the root hash of the trie.
- Hashed
Accounts Sorted - Sorted account state optimized for iterating during state trie calculation.
- Hashed
Post State - Representation of in-memory hashed state.
- Hashed
Post State Sorted - Sorted hashed post state optimized for iterating during state trie calculation.
- Hashed
Storage - Representation of in-memory hashed storage.
- Hashed
Storage Sorted - Sorted hashed storage optimized for iterating during state trie calculation.
- Intermediate
State Root State - The intermediate state of the state root computation.
- Keccak
KeyHasher - A key hasher that uses the Keccak-256 hash function.
- Leaf
Node - A leaf node represents the endpoint or terminal node in the trie. In other words, a leaf node is where actual values are stored.
- Leaf
Node Ref - Reference to the leaf node. See LeafNode from more information.
- Multi
Proof - The state multiproof of target accounts and multiproofs of their storage tries. Multiproof is effectively a state subtrie that only contains the nodes in the paths of target accounts.
- Multi
Proof Targets - Proof targets map.
- Nibbles
- Structure representing a sequence of nibbles.
- RlpNode
- An RLP-encoded node.
- State
Root StateRoot
is used to compute the root node of a state trie.- Storage
Multi Proof - The merkle multiproof of storage trie.
- Storage
Proof - The merkle proof of the storage entry.
- Storage
Root StorageRoot
is used to compute the root node of an account storage trie.- Storage
Trie Entry - Account storage trie node.
- Stored
Nibbles - The representation of nibbles of the merkle trie stored in the database.
- Stored
Nibbles SubKey - The representation of nibbles of the merkle trie stored in the database.
- Stored
SubNode - Walker sub node for storing intermediate state root calculation state in the database.
- Trie
Account - An Ethereum account as represented in the trie.
- Trie
Input - Inputs for trie-related computations.
- Trie
Mask - A struct representing a mask of 16 bits, used for Ethereum trie operations.
Enums§
- State
Root Progress - The progress of the state root computation.
- Trie
Node - Enum representing an MPT trie node.
Constants§
- CHILD_
INDEX_ RANGE - The range of valid child indexes.
- EMPTY_
ROOT_ HASH - Root hash of an empty trie.
- TRIE_
ACCOUNT_ RLP_ MAX_ SIZE - The maximum size of RLP encoded trie account in bytes. 2 (header) + 4 * 1 (field lens) + 8 (nonce) + 32 * 3 (balance, storage root, code hash)
Traits§
- KeyHasher
- Trait for hashing keys in state.
Functions§
- encode_
path_ leaf - Encodes a given path leaf as a compact array of bytes.
- rlp_
node Deprecated - Given an RLP-encoded node, returns it either as
rlp(node)
orrlp(keccak(rlp(node)))
. - word_
rlp Deprecated - Optimization for quick RLP-encoding of a 32-byte word.