Crate reth_trie

Source
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.
metricsmetrics
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_utilstest-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§

AccountProof
The merkle proof with the relevant account info.
BranchNode
A branch node in an Ethereum Merkle Patricia Trie.
BranchNodeCompact
A struct representing a branch node in an Ethereum trie.
BranchNodeRef
A reference to BranchNode and its state mask. NOTE: The stack may contain more items that specified in the state mask.
ExtensionNode
An extension node in an Ethereum Merkle Patricia Trie.
ExtensionNodeRef
Reference to the extension node. See ExtensionNode from more information.
HashBuilder
A component used to construct the root hash of the trie.
HashedAccountsSorted
Sorted account state optimized for iterating during state trie calculation.
HashedPostState
Representation of in-memory hashed state.
HashedPostStateSorted
Sorted hashed post state optimized for iterating during state trie calculation.
HashedStorage
Representation of in-memory hashed storage.
HashedStorageSorted
Sorted hashed storage optimized for iterating during state trie calculation.
IntermediateStateRootState
The intermediate state of the state root computation.
KeccakKeyHasher
A key hasher that uses the Keccak-256 hash function.
LeafNode
A leaf node represents the endpoint or terminal node in the trie. In other words, a leaf node is where actual values are stored.
LeafNodeRef
Reference to the leaf node. See LeafNode from more information.
MultiProof
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.
MultiProofTargets
Proof targets map.
Nibbles
Structure representing a sequence of nibbles.
RlpNode
An RLP-encoded node.
StateRoot
StateRoot is used to compute the root node of a state trie.
StorageMultiProof
The merkle multiproof of storage trie.
StorageProof
The merkle proof of the storage entry.
StorageRoot
StorageRoot is used to compute the root node of an account storage trie.
StorageTrieEntry
Account storage trie node.
StoredNibbles
The representation of nibbles of the merkle trie stored in the database.
StoredNibblesSubKey
The representation of nibbles of the merkle trie stored in the database.
StoredSubNode
Walker sub node for storing intermediate state root calculation state in the database.
TrieAccount
An Ethereum account as represented in the trie.
TrieInput
Inputs for trie-related computations.
TrieMask
A struct representing a mask of 16 bits, used for Ethereum trie operations.

Enums§

StateRootProgress
The progress of the state root computation.
TrieNode
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_nodeDeprecated
Given an RLP-encoded node, returns it either as rlp(node) or rlp(keccak(rlp(node))).
word_rlpDeprecated
Optimization for quick RLP-encoding of a 32-byte word.