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, doc_auto_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/// Trie witness generation.
36pub mod witness;
37
38/// The implementation of the Merkle Patricia Trie.
39mod trie;
40pub use trie::{StateRoot, StorageRoot};
41
42/// Utilities for state root checkpoint progress.
43mod progress;
44pub use progress::{IntermediateStateRootState, StateRootProgress};
45
46/// Trie calculation stats.
47pub mod stats;
48
49// re-export for convenience
50pub use reth_trie_common::*;
51
52/// Trie calculation metrics.
53#[cfg(feature = "metrics")]
54pub mod metrics;
55
56/// Collection of trie-related test utilities.
57#[cfg(any(test, feature = "test-utils"))]
58pub mod test_utils;