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))]
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, TrieInputSorted};
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, TrieChangeSetsEntry};
40
41mod subnode;
42pub use subnode::StoredSubNode;
43
44mod trie;
45pub use trie::{ProofTrieNode, TrieMasks};
46
47/// The implementation of a container for storing intermediate changes to a trie.
48/// The container indicates when the trie has been modified.
49pub mod prefix_set;
50
51mod proofs;
52#[cfg(any(test, feature = "test-utils"))]
53pub use proofs::triehash;
54pub use proofs::*;
55
56pub mod root;
57
58/// Buffer for trie updates.
59pub mod updates;
60
61pub mod added_removed_keys;
62
63/// Utilities used by other modules in this crate.
64mod utils;
65
66/// Bincode-compatible serde implementations for trie types.
67///
68/// `bincode` crate allows for more efficient serialization of trie types, because it allows
69/// non-string map keys.
70///
71/// Read more: <https://github.com/paradigmxyz/reth/issues/11370>
72#[cfg(all(feature = "serde", feature = "serde-bincode-compat"))]
73pub mod serde_bincode_compat {
74    pub use super::updates::serde_bincode_compat as updates;
75}
76
77/// Re-export
78pub use alloy_trie::{nodes::*, proof, BranchNodeCompact, HashBuilder, TrieMask, EMPTY_ROOT_HASH};