reth_trie_common/
lib.rs

1//! Commonly used types for trie usage.
2
3#![doc(
4    html_logo_url = "https://raw.githubusercontent.com/paradigmxyz/reth/main/assets/reth-docs.png",
5    html_favicon_url = "https://avatars0.githubusercontent.com/u/97369466?s=256",
6    issue_tracker_base_url = "https://github.com/SeismicSystems/seismic-reth/issues/"
7)]
8#![cfg_attr(not(test), warn(unused_crate_dependencies))]
9#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))]
10
11/// The implementation of hash builder.
12pub mod hash_builder;
13
14/// Constants related to the trie computation.
15mod constants;
16pub use constants::*;
17
18mod account;
19pub use account::TrieAccount;
20
21mod key;
22pub use key::{KeccakKeyHasher, KeyHasher};
23
24mod nibbles;
25pub use nibbles::{Nibbles, StoredNibbles, StoredNibblesSubKey};
26
27mod storage;
28pub use storage::StorageTrieEntry;
29
30mod subnode;
31pub use subnode::StoredSubNode;
32
33/// The implementation of a container for storing intermediate changes to a trie.
34/// The container indicates when the trie has been modified.
35pub mod prefix_set;
36
37mod proofs;
38#[cfg(any(test, feature = "test-utils"))]
39pub use proofs::triehash;
40pub use proofs::*;
41
42pub mod root;
43
44/// Buffer for trie updates.
45pub mod updates;
46
47/// Bincode-compatible serde implementations for trie types.
48///
49/// `bincode` crate allows for more efficient serialization of trie types, because it allows
50/// non-string map keys.
51///
52/// Read more: <https://github.com/paradigmxyz/reth/issues/11370>
53#[cfg(all(feature = "serde", feature = "serde-bincode-compat"))]
54pub mod serde_bincode_compat {
55    pub use super::updates::serde_bincode_compat as updates;
56}
57
58/// Re-export
59pub use alloy_trie::{nodes::*, proof, BranchNodeCompact, HashBuilder, TrieMask, EMPTY_ROOT_HASH};