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, TrieType};
41
42/// Utilities for state root checkpoint progress.
43mod progress;
44pub use progress::{
45 IntermediateStateRootState, IntermediateStorageRootState, StateRootProgress,
46 StorageRootProgress,
47};
48
49/// Trie calculation stats.
50pub mod stats;
51
52// re-export for convenience
53pub use reth_trie_common::*;
54
55/// Trie calculation metrics.
56#[cfg(feature = "metrics")]
57pub mod metrics;
58
59/// Collection of trie-related test utilities.
60#[cfg(any(test, feature = "test-utils"))]
61pub mod test_utils;
62
63/// Collection of mock types for testing.
64#[cfg(test)]
65pub mod mock;