mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 02:49:55 +00:00
trie: clean up reth-primitives imports (#10757)
This commit is contained in:
1
Cargo.lock
generated
1
Cargo.lock
generated
@ -8772,6 +8772,7 @@ dependencies = [
|
||||
name = "reth-trie"
|
||||
version = "1.0.6"
|
||||
dependencies = [
|
||||
"alloy-primitives",
|
||||
"alloy-rlp",
|
||||
"auto_impl",
|
||||
"criterion",
|
||||
|
||||
@ -23,6 +23,7 @@ revm.workspace = true
|
||||
|
||||
# alloy
|
||||
alloy-rlp.workspace = true
|
||||
alloy-primitives.workspace = true
|
||||
|
||||
# tracing
|
||||
tracing.workspace = true
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
#![allow(missing_docs, unreachable_pub)]
|
||||
use alloy_primitives::{keccak256, Address, B256, U256};
|
||||
use criterion::{criterion_group, criterion_main, BenchmarkId, Criterion};
|
||||
use proptest::{prelude::*, strategy::ValueTree, test_runner::TestRunner};
|
||||
use reth_primitives::{keccak256, Address, B256, U256};
|
||||
use reth_trie::{HashedPostState, HashedStorage};
|
||||
use revm::db::{states::BundleBuilder, BundleAccount};
|
||||
use std::collections::HashMap;
|
||||
|
||||
@ -1,8 +1,9 @@
|
||||
#![allow(missing_docs, unreachable_pub)]
|
||||
use alloy_primitives::B256;
|
||||
use criterion::{black_box, criterion_group, criterion_main, Criterion};
|
||||
use proptest::{prelude::*, strategy::ValueTree, test_runner::TestRunner};
|
||||
use proptest_arbitrary_interop::arb;
|
||||
use reth_primitives::{ReceiptWithBloom, B256};
|
||||
use reth_primitives::ReceiptWithBloom;
|
||||
use reth_trie::triehash::KeccakHasher;
|
||||
|
||||
/// Benchmarks different implementations of the root calculation.
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
use reth_primitives::{Account, B256, U256};
|
||||
use alloy_primitives::{B256, U256};
|
||||
use reth_primitives::Account;
|
||||
use reth_storage_errors::db::DatabaseError;
|
||||
|
||||
/// Implementation of hashed state cursor traits for the post state.
|
||||
|
||||
@ -3,7 +3,8 @@ use crate::{
|
||||
forward_cursor::ForwardInMemoryCursor, HashedAccountsSorted, HashedPostStateSorted,
|
||||
HashedStorageSorted,
|
||||
};
|
||||
use reth_primitives::{Account, B256, U256};
|
||||
use alloy_primitives::{B256, U256};
|
||||
use reth_primitives::Account;
|
||||
use reth_storage_errors::db::DatabaseError;
|
||||
use std::collections::HashSet;
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
use crate::{hashed_cursor::HashedCursor, trie_cursor::TrieCursor, walker::TrieWalker, Nibbles};
|
||||
use reth_primitives::B256;
|
||||
use alloy_primitives::B256;
|
||||
use reth_storage_errors::db::DatabaseError;
|
||||
|
||||
/// Represents a branch node in the trie.
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
use crate::Nibbles;
|
||||
use reth_primitives::B256;
|
||||
use alloy_primitives::B256;
|
||||
use std::{
|
||||
collections::{HashMap, HashSet},
|
||||
sync::Arc,
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
use crate::{hash_builder::HashBuilder, trie_cursor::CursorSubNode, updates::TrieUpdates};
|
||||
use reth_primitives::B256;
|
||||
use alloy_primitives::B256;
|
||||
use reth_stages_types::MerkleCheckpoint;
|
||||
|
||||
/// The progress of the state root computation.
|
||||
|
||||
@ -6,9 +6,9 @@ use crate::{
|
||||
walker::TrieWalker,
|
||||
HashBuilder, Nibbles,
|
||||
};
|
||||
use alloy_primitives::{keccak256, Address, B256};
|
||||
use alloy_rlp::{BufMut, Encodable};
|
||||
use reth_execution_errors::trie::StateProofError;
|
||||
use reth_primitives::{keccak256, Address, B256};
|
||||
use reth_trie_common::{
|
||||
proof::ProofRetainer, AccountProof, MultiProof, StorageMultiProof, TrieAccount,
|
||||
};
|
||||
|
||||
@ -2,9 +2,10 @@ use crate::{
|
||||
prefix_set::{PrefixSetMut, TriePrefixSetsMut},
|
||||
Nibbles,
|
||||
};
|
||||
use alloy_primitives::{keccak256, Address, B256, U256};
|
||||
use itertools::Itertools;
|
||||
use rayon::prelude::{IntoParallelIterator, ParallelIterator};
|
||||
use reth_primitives::{keccak256, Account, Address, B256, U256};
|
||||
use reth_primitives::Account;
|
||||
use revm::db::{states::CacheAccount, AccountStatus, BundleAccount};
|
||||
use std::{
|
||||
borrow::Cow,
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
use alloy_primitives::{Address, B256, U256};
|
||||
use alloy_rlp::encode_fixed_size;
|
||||
use reth_primitives::{Account, Address, B256, U256};
|
||||
use reth_primitives::Account;
|
||||
use reth_trie_common::{triehash::KeccakHasher, TrieAccount};
|
||||
|
||||
/// Re-export of [triehash].
|
||||
|
||||
@ -9,9 +9,10 @@ use crate::{
|
||||
walker::TrieWalker,
|
||||
HashBuilder, Nibbles, TrieAccount,
|
||||
};
|
||||
use alloy_primitives::{keccak256, Address, B256};
|
||||
use alloy_rlp::{BufMut, Encodable};
|
||||
use reth_execution_errors::{StateRootError, StorageRootError};
|
||||
use reth_primitives::{constants::EMPTY_ROOT_HASH, keccak256, Address, B256};
|
||||
use reth_primitives::constants::EMPTY_ROOT_HASH;
|
||||
use tracing::trace;
|
||||
|
||||
#[cfg(feature = "metrics")]
|
||||
|
||||
@ -3,7 +3,7 @@ use crate::{
|
||||
forward_cursor::ForwardInMemoryCursor,
|
||||
updates::{StorageTrieUpdatesSorted, TrieUpdatesSorted},
|
||||
};
|
||||
use reth_primitives::B256;
|
||||
use alloy_primitives::B256;
|
||||
use reth_storage_errors::db::DatabaseError;
|
||||
use reth_trie_common::{BranchNodeCompact, Nibbles};
|
||||
use std::collections::HashSet;
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
use crate::{BranchNodeCompact, Nibbles};
|
||||
use reth_primitives::B256;
|
||||
use alloy_primitives::B256;
|
||||
use reth_storage_errors::db::DatabaseError;
|
||||
|
||||
/// In-memory implementations of trie cursors.
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
use super::{TrieCursor, TrieCursorFactory};
|
||||
use crate::{BranchNodeCompact, Nibbles};
|
||||
use reth_primitives::B256;
|
||||
use alloy_primitives::B256;
|
||||
use reth_storage_errors::db::DatabaseError;
|
||||
|
||||
/// Noop trie cursor factory.
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
use crate::{BranchNodeCompact, Nibbles, StoredSubNode, CHILD_INDEX_RANGE};
|
||||
use reth_primitives::B256;
|
||||
use alloy_primitives::B256;
|
||||
|
||||
/// Cursor for iterating over a subtrie.
|
||||
#[derive(Clone)]
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
use crate::{walker::TrieWalker, BranchNodeCompact, HashBuilder, Nibbles};
|
||||
use reth_primitives::B256;
|
||||
use alloy_primitives::B256;
|
||||
use std::collections::{HashMap, HashSet};
|
||||
|
||||
/// The aggregation of trie updates.
|
||||
|
||||
@ -3,7 +3,7 @@ use crate::{
|
||||
trie_cursor::{CursorSubNode, TrieCursor},
|
||||
BranchNodeCompact, Nibbles,
|
||||
};
|
||||
use reth_primitives::B256;
|
||||
use alloy_primitives::B256;
|
||||
use reth_storage_errors::db::DatabaseError;
|
||||
use std::collections::HashSet;
|
||||
|
||||
|
||||
@ -2,10 +2,11 @@ use crate::{
|
||||
hashed_cursor::HashedCursorFactory, prefix_set::TriePrefixSetsMut, proof::Proof,
|
||||
trie_cursor::TrieCursorFactory, HashedPostState,
|
||||
};
|
||||
use alloy_primitives::{keccak256, Bytes, B256};
|
||||
use alloy_rlp::{BufMut, Decodable, Encodable};
|
||||
use itertools::Either;
|
||||
use reth_execution_errors::{StateProofError, TrieWitnessError};
|
||||
use reth_primitives::{constants::EMPTY_ROOT_HASH, keccak256, Bytes, B256};
|
||||
use reth_primitives::constants::EMPTY_ROOT_HASH;
|
||||
use reth_trie_common::{
|
||||
BranchNode, HashBuilder, Nibbles, TrieAccount, TrieNode, CHILD_INDEX_RANGE,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user