Skip to main content

Module trie

Module trie 

Source
Available on crate feature trie only.
Expand description

Re-exported reth trie types

Modules§

changesets
Trie changeset computation. Trie changeset computation.
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.
mocktest-utils
Collection of mock types for testing.
node_iter
The iterators for traversing existing intermediate hashes and updated trie leaves.
ordered_root
Incremental ordered trie root computation. Incremental ordered trie root computation for append-only streams.
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.
proof_v2
Merkle proof generation v2 (leaf-only implementation). Proof calculation version 2 using leaf data and cached branch hashes.
range_proof
Merkle Patricia trie range-proof verification. Merkle Patricia trie range-proof verification.
root
Common root computation functions.
serde_bincode_compatserde-bincode-compat and serde
Bincode-compatible serde implementations for trie types.
stats
Trie calculation stats.
target_v2
V2 proof targets and chunking. V2 proof targets and chunking.
test_utilstest-utils
Collection of trie-related test utilities.
trie_cursor
The cursor implementations for navigating account and storage tries.
triehashtest-utils
Implementation of hasher using our keccak256 hashing function for compatibility with triehash crate.
updates
Buffer for trie updates.
verify
Verification of existing stored trie nodes against state data.
walker
The trie walker for iterating over the trie nodes.
witness
Trie witness generation.

Macros§

with_adaptertrie-db
Dispatches a trie operation using the correct TrieKeyAdapter based on storage settings.

Structs§

AccountProof
The merkle proof with the relevant account info.
BranchNode
Re-export A branch node in an Ethereum Merkle Patricia Trie.
BranchNodeCompact
Re-export A struct representing a branch node in an Ethereum trie.
BranchNodeMasks
Branch node masks containing hash_mask and tree_mask.
BranchNodeRef
Re-export A reference to BranchNode and its state mask. NOTE: The stack may contain more items that specified in the state mask.
BranchNodeV2
A branch node in an Ethereum Merkle Patricia Trie.
ChunkedHashedPostState
An iterator that yields chunks of the state updates of at most size account and storage targets.
ChunkedMultiProofTargets
An iterator that yields chunks of the proof targets of at most size account and storage targets.
ChunkedMultiProofTargetsV2
An iterator that yields chunks of V2 proof targets of at most size account and storage targets.
DatabaseAccountTrieCursortrie-db
A cursor over the account trie.
DatabaseHashedAccountCursortrie-db
A struct wrapping database cursor over hashed accounts implementing HashedCursor for iterating over accounts.
DatabaseHashedCursorFactorytrie-db
A struct wrapping database transaction that implements HashedCursorFactory.
DatabaseHashedStorageCursortrie-db
The structure wrapping a database cursor for hashed storage and a target hashed address. Implements HashedCursor and HashedStorageCursor for iterating over hashed storage.
DatabaseStorageTrieCursortrie-db
A cursor over the storage tries stored in the database.
DatabaseTrieCursorFactorytrie-db
Wrapper struct for database transaction implementing trie cursor factory trait.
DecodedAccountProof
The merkle proof with the relevant account info.
DecodedMultiProof
This is a type of MultiProof that uses decoded proofs, meaning these proofs are stored as a collection of TrieNodes instead of RLP-encoded bytes.
DecodedMultiProofV2
V2 decoded multiproof which contains the results of both account and storage V2 proof calculations.
DecodedStorageMultiProof
The decoded merkle multiproof for a storage trie.
DecodedStorageProof
The merkle proof of the storage entry, using decoded proofs.
ExtensionNode
Re-export An extension node in an Ethereum Merkle Patricia Trie.
ExtensionNodeRef
Re-export Reference to the extension node. See ExtensionNode from more information.
HashBuilder
Re-export A component used to construct the root hash of the trie.
HashedPostState
In-memory hashed state that stores account and storage changes with keccak256-hashed keys in hash maps.
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.
IntermediateStorageRootState
The intermediate state of a storage root computation along with the account.
KeccakKeyHasher
A key hasher that uses the Keccak-256 hash function.
LazyTrieData
Lazily initialized trie data containing sorted hashed state and trie updates.
LeafNode
Re-export 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
Re-export Reference to the leaf node. See LeafNode from more information.
LegacyKeyAdaptertrie-db
Legacy (v1) nibble encoding: 1 nibble per byte, 65-byte subkeys.
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.
MultiProofTargetsV2
A set of account and storage V2 proof targets. The account and storage targets do not need to necessarily overlap.
Nibbles
Structure representing a sequence of nibbles.
PackedAccountsTrietrie-db
Packed-encoding view of the AccountsTrie table.
PackedKeyAdaptertrie-db
Packed (v2) nibble encoding: 2 nibbles per byte, 33-byte subkeys.
PackedStorageTrieEntry
Account storage trie node with packed nibble encoding (storage v2).
PackedStoragesTrietrie-db
Packed-encoding view of the StoragesTrie table.
PackedStoredNibbles
Packed representation of nibbles for the AccountsTrie (storage v2).
PackedStoredNibblesSubKey
Packed representation of nibbles as a DupSort subkey for StoragesTrie (storage v2).
ProofTrieNode
Carries all information needed by a sparse trie to reveal a particular node.
ProofTrieNodeV2
Carries all information needed by a sparse trie to reveal a particular node.
ProofV2Target
Target describes a proof target. For every proof target given, a proof calculator will calculate and return all nodes whose path is a prefix of the target’s key_nibbles.
ProofV2TargetParent
The already-revealed parent branch of a ProofV2Target.
RlpNode
Re-export An RLP-encoded node.
SortedTrieData
Container for sorted trie data: hashed state and trie updates.
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.
TrieAccountethereum
Re-export for convenience. Represents an TrieAccount in the account trie.
TrieInput
Inputs for trie-related computations.
TrieInputSorted
Sorted variant of TrieInput for efficient proof generation.
TrieMask
Re-export A struct representing a mask of 16 bits, used for Ethereum trie operations.
TrieMaskIter
Re-export An iterator over the set bit indices of a TrieMask.

Enums§

ExecutionWitnessMode
Controls how execution witnesses are generated.
StateRootProgress
The progress of the state root computation.
StorageRootProgress
The progress of a storage root calculation.
TrieNode
Re-export Enum representing an MPT trie node.
TrieNodeV2
Enum representing an MPT trie node.
TrieType
Trie type for differentiating between various trie calculations.

Constants§

CHILD_INDEX_RANGE
Re-export The range of valid child indexes.
EMPTY_ROOT_HASH
Re-export 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§

DatabaseHashedPostStatetrie-db
Extends HashedPostStateSorted with operations specific for working with a database transaction.
DatabaseProoftrie-db
Extends Proof with operations specific for working with a database transaction.
DatabaseStateRoottrie-db
Extends StateRoot with operations specific for working with a database transaction.
DatabaseStorageProoftrie-db
Extends StorageProof with operations specific for working with a database transaction.
DatabaseStorageRoottrie-db
Extends StorageRoot with operations specific for working with a database transaction.
KeyHasher
Trait for hashing keys in state.
StorageTrieEntryLiketrie-db
Trait for storage trie entry types that carry a subkey and node.
TrieKeyAdaptertrie-db
Trait abstracting nibble encoding for trie keys.
TrieTableAdaptertrie-db
Maps a TrieKeyAdapter to account and storage trie tables using its key and value types.

Functions§

compute_block_trie_changesetstrie-db
Computes trie changesets for a block.
compute_range_trie_changesetstrie-db
Computes aggregate trie changesets for an inclusive block range.
depth_first_cmp
Compares two Nibbles in depth-first order.
encode_path_leaf
Re-export Encodes a given path leaf as a compact array of bytes.
hashed_storage_from_reverts_with_providertrie-db
Initializes HashedStorage from reverts using a provider.
load_prefix_sets_with_providertrie-db
Load prefix sets using a provider that implements ChangeSetReader. This function can read changesets from both static files and database.
rlp_nodeDeprecated
Re-export Given an RLP-encoded node, returns it either as rlp(node) or rlp(keccak(rlp(node))).
word_rlpDeprecated
Re-export Optimization for quick RLP-encoding of a 32-byte word.

Type Aliases§

BranchNodeMasksMap
Map from nibble path to branch node masks.