diff --git a/Cargo.lock b/Cargo.lock index 9ae517c84..17a339ec9 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -9335,9 +9335,10 @@ dependencies = [ "proptest", "proptest-arbitrary-interop", "rayon", + "reth-ethereum-primitives", "reth-execution-errors", "reth-metrics", - "reth-primitives", + "reth-primitives-traits", "reth-stages-types", "reth-storage-errors", "reth-trie-common", diff --git a/crates/trie/trie/Cargo.toml b/crates/trie/trie/Cargo.toml index 4fa525a74..867474d0f 100644 --- a/crates/trie/trie/Cargo.toml +++ b/crates/trie/trie/Cargo.toml @@ -14,7 +14,7 @@ workspace = true [dependencies] # reth reth-execution-errors.workspace = true -reth-primitives.workspace = true +reth-primitives-traits.workspace = true reth-stages-types.workspace = true reth-storage-errors.workspace = true reth-trie-sparse.workspace = true @@ -46,7 +46,8 @@ triehash = { version = "0.8", optional = true } [dev-dependencies] # reth -reth-primitives = { workspace = true, features = ["test-utils", "arbitrary"] } +reth-primitives-traits = { workspace = true, features = ["test-utils"] } +reth-ethereum-primitives = { workspace = true, features = ["arbitrary", "std"] } reth-trie-common = { workspace = true, features = ["test-utils", "arbitrary"] } # trie @@ -67,12 +68,14 @@ serde = [ "alloy-eips/serde", "revm/serde", "reth-trie-common/serde", + "reth-primitives-traits/serde", ] test-utils = [ "triehash", "revm/test-utils", - "reth-primitives/test-utils", + "reth-primitives-traits/test-utils", "reth-trie-common/test-utils", + "reth-ethereum-primitives/test-utils", "reth-trie-sparse/test-utils", "reth-stages-types/test-utils", ] diff --git a/crates/trie/trie/benches/trie_root.rs b/crates/trie/trie/benches/trie_root.rs index 5c93abc8a..625f66fd4 100644 --- a/crates/trie/trie/benches/trie_root.rs +++ b/crates/trie/trie/benches/trie_root.rs @@ -1,9 +1,10 @@ #![allow(missing_docs, unreachable_pub)] +use alloy_consensus::ReceiptWithBloom; use alloy_primitives::B256; use criterion::{criterion_group, criterion_main, Criterion}; use proptest::{prelude::*, strategy::ValueTree, test_runner::TestRunner}; use proptest_arbitrary_interop::arb; -use reth_primitives::{Receipt, ReceiptWithBloom}; +use reth_ethereum_primitives::Receipt; use reth_trie::triehash::KeccakHasher; use std::hint::black_box; @@ -47,7 +48,6 @@ mod implementations { use alloy_eips::eip2718::Encodable2718; use alloy_rlp::Encodable; use alloy_trie::root::adjust_index_for_rlp; - use reth_primitives::Receipt; use reth_trie_common::{HashBuilder, Nibbles}; pub fn trie_hash_ordered_trie_root(receipts: &[ReceiptWithBloom]) -> B256 { diff --git a/crates/trie/trie/src/hashed_cursor/mod.rs b/crates/trie/trie/src/hashed_cursor/mod.rs index 1101f5078..67c6d1d01 100644 --- a/crates/trie/trie/src/hashed_cursor/mod.rs +++ b/crates/trie/trie/src/hashed_cursor/mod.rs @@ -1,5 +1,5 @@ use alloy_primitives::{B256, U256}; -use reth_primitives::Account; +use reth_primitives_traits::Account; use reth_storage_errors::db::DatabaseError; /// Implementation of hashed state cursor traits for the post state. diff --git a/crates/trie/trie/src/hashed_cursor/noop.rs b/crates/trie/trie/src/hashed_cursor/noop.rs index 07b2cba96..58b78dc24 100644 --- a/crates/trie/trie/src/hashed_cursor/noop.rs +++ b/crates/trie/trie/src/hashed_cursor/noop.rs @@ -1,6 +1,6 @@ use super::{HashedCursor, HashedCursorFactory, HashedStorageCursor}; use alloy_primitives::{B256, U256}; -use reth_primitives::Account; +use reth_primitives_traits::Account; use reth_storage_errors::db::DatabaseError; /// Noop hashed cursor factory. diff --git a/crates/trie/trie/src/hashed_cursor/post_state.rs b/crates/trie/trie/src/hashed_cursor/post_state.rs index a4ab1fa52..cf16c26f0 100644 --- a/crates/trie/trie/src/hashed_cursor/post_state.rs +++ b/crates/trie/trie/src/hashed_cursor/post_state.rs @@ -4,7 +4,7 @@ use crate::{ HashedStorageSorted, }; use alloy_primitives::{map::B256HashSet, B256, U256}; -use reth_primitives::Account; +use reth_primitives_traits::Account; use reth_storage_errors::db::DatabaseError; /// The hashed cursor factory for the post state. diff --git a/crates/trie/trie/src/state.rs b/crates/trie/trie/src/state.rs index 81b8d6b03..1791bf7b3 100644 --- a/crates/trie/trie/src/state.rs +++ b/crates/trie/trie/src/state.rs @@ -9,7 +9,7 @@ use alloy_primitives::{ }; use itertools::Itertools; use rayon::prelude::{IntoParallelIterator, ParallelIterator}; -use reth_primitives::Account; +use reth_primitives_traits::Account; use reth_trie_common::KeyHasher; use revm::db::{AccountStatus, BundleAccount}; use std::borrow::Cow; diff --git a/crates/trie/trie/src/test_utils.rs b/crates/trie/trie/src/test_utils.rs index 7fa224ab4..ebd976b18 100644 --- a/crates/trie/trie/src/test_utils.rs +++ b/crates/trie/trie/src/test_utils.rs @@ -1,6 +1,6 @@ use alloy_primitives::{Address, B256, U256}; use alloy_rlp::encode_fixed_size; -use reth_primitives::Account; +use reth_primitives_traits::Account; use reth_trie_common::triehash::KeccakHasher; /// Re-export of [triehash].