mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
chore(trie): move prefix sets to reth_trie_common (#12860)
This commit is contained in:
1
Cargo.lock
generated
1
Cargo.lock
generated
@ -9381,6 +9381,7 @@ dependencies = [
|
||||
"alloy-trie",
|
||||
"arbitrary",
|
||||
"bytes",
|
||||
"criterion",
|
||||
"derive_more 1.0.0",
|
||||
"hash-db",
|
||||
"itertools 0.13.0",
|
||||
|
||||
@ -35,12 +35,14 @@ arbitrary = { workspace = true, features = ["derive"], optional = true }
|
||||
|
||||
[dev-dependencies]
|
||||
alloy-primitives = { workspace = true, features = ["getrandom"] }
|
||||
arbitrary = { workspace = true, features = ["derive"] }
|
||||
proptest.workspace = true
|
||||
proptest-arbitrary-interop.workspace = true
|
||||
alloy-trie = { workspace = true, features = ["arbitrary"] }
|
||||
hash-db = "=0.15.2"
|
||||
plain_hasher = "0.2"
|
||||
serde_json.workspace = true
|
||||
arbitrary = { workspace = true, features = ["derive"] }
|
||||
proptest.workspace = true
|
||||
proptest-arbitrary-interop.workspace = true
|
||||
criterion.workspace = true
|
||||
|
||||
[features]
|
||||
test-utils = [
|
||||
@ -60,3 +62,7 @@ arbitrary = [
|
||||
"revm-primitives/arbitrary",
|
||||
"reth-codecs/arbitrary",
|
||||
]
|
||||
|
||||
[[bench]]
|
||||
name = "prefix_set"
|
||||
harness = false
|
||||
|
||||
@ -7,7 +7,7 @@ use proptest::{
|
||||
strategy::ValueTree,
|
||||
test_runner::{basic_result_cache, TestRunner},
|
||||
};
|
||||
use reth_trie::{
|
||||
use reth_trie_common::{
|
||||
prefix_set::{PrefixSet, PrefixSetMut},
|
||||
Nibbles,
|
||||
};
|
||||
@ -26,6 +26,10 @@ pub use storage::StorageTrieEntry;
|
||||
mod subnode;
|
||||
pub use subnode::StoredSubNode;
|
||||
|
||||
/// The implementation of a container for storing intermediate changes to a trie.
|
||||
/// The container indicates when the trie has been modified.
|
||||
pub mod prefix_set;
|
||||
|
||||
mod proofs;
|
||||
#[cfg(any(test, feature = "test-utils"))]
|
||||
pub use proofs::triehash;
|
||||
@ -33,4 +37,5 @@ pub use proofs::*;
|
||||
|
||||
pub mod root;
|
||||
|
||||
/// Re-export
|
||||
pub use alloy_trie::{nodes::*, proof, BranchNodeCompact, HashBuilder, TrieMask, EMPTY_ROOT_HASH};
|
||||
|
||||
@ -73,7 +73,7 @@ pub struct TriePrefixSets {
|
||||
/// # Examples
|
||||
///
|
||||
/// ```
|
||||
/// use reth_trie::{prefix_set::PrefixSetMut, Nibbles};
|
||||
/// use reth_trie_common::{prefix_set::PrefixSetMut, Nibbles};
|
||||
///
|
||||
/// let mut prefix_set_mut = PrefixSetMut::default();
|
||||
/// prefix_set_mut.insert(Nibbles::from_nibbles_unchecked(&[0xa, 0xb]));
|
||||
@ -211,8 +211,8 @@ impl PrefixSet {
|
||||
}
|
||||
|
||||
impl<'a> IntoIterator for &'a PrefixSet {
|
||||
type Item = &'a reth_trie_common::Nibbles;
|
||||
type IntoIter = std::slice::Iter<'a, reth_trie_common::Nibbles>;
|
||||
type Item = &'a Nibbles;
|
||||
type IntoIter = std::slice::Iter<'a, Nibbles>;
|
||||
fn into_iter(self) -> Self::IntoIter {
|
||||
self.iter()
|
||||
}
|
||||
@ -85,10 +85,6 @@ test-utils = [
|
||||
"reth-stages-types/test-utils"
|
||||
]
|
||||
|
||||
[[bench]]
|
||||
name = "prefix_set"
|
||||
harness = false
|
||||
|
||||
[[bench]]
|
||||
name = "hash_post_state"
|
||||
harness = false
|
||||
|
||||
@ -17,10 +17,6 @@
|
||||
mod constants;
|
||||
pub use constants::*;
|
||||
|
||||
/// The implementation of a container for storing intermediate changes to a trie.
|
||||
/// The container indicates when the trie has been modified.
|
||||
pub mod prefix_set;
|
||||
|
||||
/// The implementation of forward-only in-memory cursor.
|
||||
pub mod forward_cursor;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user