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/// The implementation of the Merkle Patricia Trie.
42mod trie;
43pub use trie::{StateRoot, StorageRoot, TrieType};
44
45/// Utilities for state root checkpoint progress.
46mod progress;
47pub use progress::{
48    IntermediateStateRootState, IntermediateStorageRootState, StateRootProgress,
49    StorageRootProgress,
50};
51
52/// Trie calculation stats.
53pub mod stats;
54
55// re-export for convenience
56pub use reth_trie_common::*;
57
58/// Trie calculation metrics.
59#[cfg(feature = "metrics")]
60pub mod metrics;
61
62/// Collection of trie-related test utilities.
63#[cfg(any(test, feature = "test-utils"))]
64pub mod test_utils;
65
66/// Collection of mock types for testing.
67#[cfg(any(test, feature = "test-utils"))]
68pub mod mock;
69
70/// Verification of existing stored trie nodes against state data.
71pub mod verify;