From 72eabe057900877d5f9af7df711eeb4b616cb486 Mon Sep 17 00:00:00 2001 From: Matthias Seitz Date: Sat, 4 Jan 2025 18:04:40 +0100 Subject: [PATCH] chore: replace trie-common dep with alloy-trie (#13652) --- Cargo.lock | 2 -- crates/chainspec/Cargo.toml | 5 +---- crates/chainspec/src/spec.rs | 13 +++++-------- crates/optimism/consensus/Cargo.toml | 1 - 4 files changed, 6 insertions(+), 15 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 085ce63a9..087fd7798 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -6747,7 +6747,6 @@ dependencies = [ "reth-ethereum-forks", "reth-network-peers", "reth-primitives-traits", - "reth-trie-common", "serde_json", ] @@ -8416,7 +8415,6 @@ dependencies = [ "reth-optimism-forks", "reth-optimism-primitives", "reth-primitives", - "reth-trie-common", "tracing", ] diff --git a/crates/chainspec/Cargo.toml b/crates/chainspec/Cargo.toml index b050a0d90..c70b5f154 100644 --- a/crates/chainspec/Cargo.toml +++ b/crates/chainspec/Cargo.toml @@ -14,7 +14,7 @@ workspace = true # reth reth-ethereum-forks.workspace = true reth-network-peers.workspace = true -reth-trie-common.workspace = true +alloy-trie = { workspace = true, features = ["ethereum"] } reth-primitives-traits.workspace = true # ethereum @@ -52,14 +52,12 @@ std = [ "reth-ethereum-forks/std", "derive_more/std", "reth-network-peers/std", - "reth-trie-common/std", "serde_json/std" ] arbitrary = [ "alloy-chains/arbitrary", "reth-ethereum-forks/arbitrary", "reth-primitives-traits/arbitrary", - "reth-trie-common/arbitrary", "alloy-consensus/arbitrary", "alloy-eips/arbitrary", "alloy-primitives/arbitrary", @@ -67,5 +65,4 @@ arbitrary = [ ] test-utils = [ "reth-primitives-traits/test-utils", - "reth-trie-common/test-utils" ] diff --git a/crates/chainspec/src/spec.rs b/crates/chainspec/src/spec.rs index 085d280b3..372891cb2 100644 --- a/crates/chainspec/src/spec.rs +++ b/crates/chainspec/src/spec.rs @@ -18,6 +18,7 @@ use alloy_eips::{ }; use alloy_genesis::Genesis; use alloy_primitives::{address, b256, Address, BlockNumber, B256, U256}; +use alloy_trie::root::state_root_ref_unhashed; use derive_more::From; use reth_ethereum_forks::{ ChainHardforks, DisplayHardforks, EthereumHardfork, EthereumHardforks, ForkCondition, @@ -28,7 +29,6 @@ use reth_network_peers::{ sepolia_nodes, NodeRecord, }; use reth_primitives_traits::SealedHeader; -use reth_trie_common::root::state_root_ref_unhashed; /// The Ethereum mainnet spec pub static MAINNET: LazyLock> = LazyLock::new(|| { @@ -1023,17 +1023,14 @@ pub fn test_fork_ids(spec: &ChainSpec, cases: &[(Head, ForkId)]) { #[cfg(test)] mod tests { - use core::ops::Deref; - use std::{collections::HashMap, str::FromStr}; - + use super::*; use alloy_chains::Chain; use alloy_genesis::{ChainConfig, GenesisAccount}; use alloy_primitives::{b256, hex}; - use alloy_trie::EMPTY_ROOT_HASH; + use alloy_trie::{TrieAccount, EMPTY_ROOT_HASH}; + use core::ops::Deref; use reth_ethereum_forks::{ForkCondition, ForkHash, ForkId, Head}; - use reth_trie_common::TrieAccount; - - use super::*; + use std::{collections::HashMap, str::FromStr}; fn test_hardfork_fork_ids(spec: &ChainSpec, cases: &[(EthereumHardfork, ForkId)]) { for (hardfork, expected_id) in cases { diff --git a/crates/optimism/consensus/Cargo.toml b/crates/optimism/consensus/Cargo.toml index b9060c5e6..23f5206c6 100644 --- a/crates/optimism/consensus/Cargo.toml +++ b/crates/optimism/consensus/Cargo.toml @@ -17,7 +17,6 @@ reth-chainspec.workspace = true reth-consensus-common.workspace = true reth-consensus.workspace = true reth-primitives.workspace = true -reth-trie-common.workspace = true # op-reth reth-optimism-forks.workspace = true