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/paradigmxyz/reth/issues/"
7)]
8#![cfg_attr(not(test), warn(unused_crate_dependencies))]
9#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))]
10#![cfg_attr(not(feature = "std"), no_std)]
11
12extern crate alloc;
13
14/// In-memory hashed state.
15mod hashed_state;
16pub use hashed_state::*;
17
18/// Input for trie computation.
19mod input;
20pub use input::TrieInput;
21
22/// The implementation of hash builder.
23pub mod hash_builder;
24
25/// Constants related to the trie computation.
26mod constants;
27pub use constants::*;
28
29mod account;
30pub use account::TrieAccount;
31
32mod key;
33pub use key::{KeccakKeyHasher, KeyHasher};
34
35mod nibbles;
36pub use nibbles::{Nibbles, StoredNibbles, StoredNibblesSubKey};
37
38mod storage;
39pub use storage::StorageTrieEntry;
40
41mod subnode;
42pub use subnode::StoredSubNode;
43
44/// The implementation of a container for storing intermediate changes to a trie.
45/// The container indicates when the trie has been modified.
46pub mod prefix_set;
47
48mod proofs;
49#[cfg(any(test, feature = "test-utils"))]
50pub use proofs::triehash;
51pub use proofs::*;
52
53pub mod root;
54
55/// Buffer for trie updates.
56pub mod updates;
57
58/// Bincode-compatible serde implementations for trie types.
59///
60/// `bincode` crate allows for more efficient serialization of trie types, because it allows
61/// non-string map keys.
62///
63/// Read more: <https://github.com/paradigmxyz/reth/issues/11370>
64#[cfg(all(feature = "serde", feature = "serde-bincode-compat"))]
65pub mod serde_bincode_compat {
66    pub use super::updates::serde_bincode_compat as updates;
67}
68
69/// Re-export
70pub use alloy_trie::{nodes::*, proof, BranchNodeCompact, HashBuilder, TrieMask, EMPTY_ROOT_HASH};