Skip to main content

reth_trie/
lib.rs

1//! The implementation of Merkle Patricia Trie, a cryptographically
2//! authenticated radix trie that is used to store key-value bindings.
3//! <https://ethereum.org/en/developers/docs/data-structures-and-encoding/patricia-merkle-trie/>
4//!
5//! ## Feature Flags
6//!
7//! - `test-utils`: Export utilities for testing
8
9#![doc(
10    html_logo_url = "https://raw.githubusercontent.com/paradigmxyz/reth/main/assets/reth-docs.png",
11    html_favicon_url = "https://avatars0.githubusercontent.com/u/97369466?s=256",
12    issue_tracker_base_url = "https://github.com/paradigmxyz/reth/issues/"
13)]
14#![cfg_attr(docsrs, feature(doc_cfg))]
15
16/// The implementation of forward-only in-memory cursor.
17pub mod forward_cursor;
18
19/// The cursor implementations for navigating account and storage tries.
20pub mod trie_cursor;
21
22/// The cursor implementations for navigating hashed state.
23pub mod hashed_cursor;
24
25/// The trie walker for iterating over the trie nodes.
26pub mod walker;
27
28/// The iterators for traversing existing intermediate hashes and updated trie leaves.
29pub mod node_iter;
30
31/// Merkle proof generation.
32pub mod proof;
33
34/// Merkle proof generation v2 (leaf-only implementation).
35pub mod proof_v2;
36
37/// Trie witness generation.
38pub mod witness;
39
40/// Trie changeset computation.
41pub mod changesets;
42
43/// The implementation of the Merkle Patricia Trie.
44mod trie;
45pub use trie::{StateRoot, StorageRoot, TrieType};
46
47/// Utilities for state root checkpoint progress.
48mod progress;
49pub use progress::{
50    IntermediateStateRootState, IntermediateStorageRootState, StateRootProgress,
51    StorageRootProgress,
52};
53
54/// Trie calculation stats.
55pub mod stats;
56
57// re-export for convenience
58pub use reth_trie_common::*;
59
60/// Trie calculation metrics.
61#[cfg(feature = "metrics")]
62pub mod metrics;
63
64/// Collection of trie-related test utilities.
65#[cfg(any(test, feature = "test-utils"))]
66pub mod test_utils;
67
68/// Collection of mock types for testing.
69#[cfg(any(test, feature = "test-utils"))]
70pub mod mock;
71
72/// Verification of existing stored trie nodes against state data.
73pub mod verify;