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