trie: clean up reth-primitives imports (#10757)

This commit is contained in:
Thomas Coratger
2024-09-06 13:19:50 -07:00
committed by GitHub
parent d1d544e23c
commit 423e0221f7
20 changed files with 27 additions and 18 deletions

1
Cargo.lock generated
View File

@ -8772,6 +8772,7 @@ dependencies = [
name = "reth-trie"
version = "1.0.6"
dependencies = [
"alloy-primitives",
"alloy-rlp",
"auto_impl",
"criterion",

View File

@ -23,6 +23,7 @@ revm.workspace = true
# alloy
alloy-rlp.workspace = true
alloy-primitives.workspace = true
# tracing
tracing.workspace = true

View File

@ -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;

View File

@ -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.

View File

@ -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.

View File

@ -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;

View File

@ -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.

View File

@ -1,5 +1,5 @@
use crate::Nibbles;
use reth_primitives::B256;
use alloy_primitives::B256;
use std::{
collections::{HashMap, HashSet},
sync::Arc,

View File

@ -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.

View File

@ -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,
};

View File

@ -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,

View File

@ -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].

View File

@ -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")]

View File

@ -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;

View File

@ -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.

View File

@ -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.

View File

@ -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)]

View File

@ -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.

View File

@ -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;

View File

@ -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,
};