diff --git a/Cargo.lock b/Cargo.lock index 3bf7e7f4c..6fde8edd7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -6702,7 +6702,6 @@ dependencies = [ "reth-net-common", "reth-net-nat", "reth-network-peers", - "reth-primitives", "reth-tracing", "schnellru", "secp256k1", @@ -6717,6 +6716,7 @@ dependencies = [ name = "reth-discv5" version = "1.0.0-rc.1" dependencies = [ + "alloy-primitives", "alloy-rlp", "derive_more", "discv5", @@ -6728,9 +6728,9 @@ dependencies = [ "multiaddr", "rand 0.8.5", "reth-chainspec", + "reth-ethereum-forks", "reth-metrics", "reth-network-peers", - "reth-primitives", "reth-tracing", "secp256k1", "thiserror", @@ -7003,9 +7003,9 @@ dependencies = [ name = "reth-etl" version = "1.0.0-rc.1" dependencies = [ + "alloy-primitives", "rayon", "reth-db-api", - "reth-primitives", "tempfile", ] diff --git a/crates/etl/Cargo.toml b/crates/etl/Cargo.toml index e05524306..1ca10d620 100644 --- a/crates/etl/Cargo.toml +++ b/crates/etl/Cargo.toml @@ -13,4 +13,4 @@ reth-db-api.workspace = true rayon.workspace = true [dev-dependencies] -reth-primitives.workspace = true +alloy-primitives.workspace = true diff --git a/crates/etl/src/lib.rs b/crates/etl/src/lib.rs index 2dbf4cada..137a96fff 100644 --- a/crates/etl/src/lib.rs +++ b/crates/etl/src/lib.rs @@ -271,7 +271,7 @@ impl EtlFile { #[cfg(test)] mod tests { - use reth_primitives::{TxHash, TxNumber}; + use alloy_primitives::{TxHash, TxNumber}; use super::*; diff --git a/crates/net/discv4/Cargo.toml b/crates/net/discv4/Cargo.toml index 5e6a9e411..8c823d520 100644 --- a/crates/net/discv4/Cargo.toml +++ b/crates/net/discv4/Cargo.toml @@ -45,7 +45,6 @@ serde = { workspace = true, optional = true } [dev-dependencies] reth-chainspec.workspace = true -reth-primitives.workspace = true assert_matches.workspace = true rand.workspace = true tokio = { workspace = true, features = ["macros"] } diff --git a/crates/net/discv4/src/lib.rs b/crates/net/discv4/src/lib.rs index 47f810d96..50311fd3c 100644 --- a/crates/net/discv4/src/lib.rs +++ b/crates/net/discv4/src/lib.rs @@ -2285,10 +2285,11 @@ pub enum DiscoveryUpdate { mod tests { use super::*; use crate::test_utils::{create_discv4, create_discv4_with_config, rng_endpoint, rng_record}; + use alloy_primitives::hex; use alloy_rlp::{Decodable, Encodable}; use rand::{thread_rng, Rng}; use reth_chainspec::net::mainnet_nodes; - use reth_primitives::{hex, EnrForkIdEntry, ForkHash}; + use reth_ethereum_forks::{EnrForkIdEntry, ForkHash}; use std::future::poll_fn; #[tokio::test] diff --git a/crates/net/discv4/src/proto.rs b/crates/net/discv4/src/proto.rs index 610628d56..6d2639f2d 100644 --- a/crates/net/discv4/src/proto.rs +++ b/crates/net/discv4/src/proto.rs @@ -542,10 +542,11 @@ mod tests { test_utils::{rng_endpoint, rng_ipv4_record, rng_ipv6_record, rng_message}, DEFAULT_DISCOVERY_PORT, SAFE_MAX_DATAGRAM_NEIGHBOUR_RECORDS, }; + use alloy_primitives::hex; use assert_matches::assert_matches; use enr::EnrPublicKey; use rand::{thread_rng, Rng, RngCore}; - use reth_primitives::{hex, ForkHash}; + use reth_ethereum_forks::ForkHash; #[test] fn test_endpoint_ipv_v4() { diff --git a/crates/net/discv5/Cargo.toml b/crates/net/discv5/Cargo.toml index 1ba0fa47f..e92618466 100644 --- a/crates/net/discv5/Cargo.toml +++ b/crates/net/discv5/Cargo.toml @@ -14,11 +14,12 @@ workspace = true [dependencies] # reth reth-chainspec.workspace = true -reth-primitives.workspace = true +reth-ethereum-forks.workspace = true reth-metrics.workspace = true reth-network-peers = { workspace = true, features = ["secp256k1"] } # ethereum +alloy-primitives.workspace = true alloy-rlp.workspace = true discv5 = { workspace = true, features = ["libp2p"] } enr.workspace = true diff --git a/crates/net/discv5/src/config.rs b/crates/net/discv5/src/config.rs index e2808a03c..9cb5cf041 100644 --- a/crates/net/discv5/src/config.rs +++ b/crates/net/discv5/src/config.rs @@ -6,11 +6,12 @@ use std::{ net::{IpAddr, Ipv4Addr, Ipv6Addr, SocketAddr, SocketAddrV4, SocketAddrV6}, }; +use alloy_primitives::Bytes; use derive_more::Display; use discv5::ListenConfig; use multiaddr::{Multiaddr, Protocol}; +use reth_ethereum_forks::{EnrForkIdEntry, ForkId}; use reth_network_peers::NodeRecord; -use reth_primitives::{Bytes, EnrForkIdEntry, ForkId}; use tracing::warn; use crate::{enr::discv4_id_to_multiaddr_id, filter::MustNotIncludeKeys, NetworkStackId}; @@ -448,7 +449,7 @@ impl BootNode { mod test { use std::net::SocketAddrV4; - use reth_primitives::hex; + use alloy_primitives::hex; use super::*; diff --git a/crates/net/discv5/src/error.rs b/crates/net/discv5/src/error.rs index 277631464..73b05ee81 100644 --- a/crates/net/discv5/src/error.rs +++ b/crates/net/discv5/src/error.rs @@ -17,7 +17,7 @@ pub enum Error { /// Missing key used to identify rlpx network. #[error("fork missing on enr, key missing")] ForkMissing(&'static [u8]), - /// Failed to decode [`ForkId`](reth_primitives::ForkId) rlp value. + /// Failed to decode [`ForkId`](reth_ethereum_forks::ForkId) rlp value. #[error("failed to decode fork id, 'eth': {0:?}")] ForkIdDecodeError(#[from] alloy_rlp::Error), /// Peer is unreachable over discovery. diff --git a/crates/net/discv5/src/lib.rs b/crates/net/discv5/src/lib.rs index 728c44791..4061f20e8 100644 --- a/crates/net/discv5/src/lib.rs +++ b/crates/net/discv5/src/lib.rs @@ -17,13 +17,14 @@ use std::{ }; use ::enr::Enr; +use alloy_primitives::bytes::Bytes; use discv5::ListenConfig; use enr::{discv4_id_to_discv5_id, EnrCombinedKeyWrapper}; use futures::future::join_all; use itertools::Itertools; use rand::{Rng, RngCore}; +use reth_ethereum_forks::{EnrForkIdEntry, ForkId}; use reth_network_peers::{NodeRecord, PeerId}; -use reth_primitives::{bytes::Bytes, EnrForkIdEntry, ForkId}; use secp256k1::SecretKey; use tokio::{sync::mpsc, task}; use tracing::{debug, error, trace}; @@ -777,11 +778,11 @@ mod test { #[allow(unused)] #[allow(clippy::assign_op_pattern)] mod sigp { + use alloy_primitives::U256; use enr::{ k256::sha2::digest::generic_array::{typenum::U32, GenericArray}, NodeId, }; - use reth_primitives::U256; /// A `Key` is a cryptographic hash, identifying both the nodes participating in /// the Kademlia DHT, as well as records stored in the DHT. diff --git a/crates/net/discv5/src/network_stack_id.rs b/crates/net/discv5/src/network_stack_id.rs index 5fcb1ae41..e41284c31 100644 --- a/crates/net/discv5/src/network_stack_id.rs +++ b/crates/net/discv5/src/network_stack_id.rs @@ -1,5 +1,5 @@ -//! Keys of ENR [`ForkId`](reth_primitives::ForkId) kv-pair. Identifies which network stack a node -//! belongs to. +//! Keys of ENR [`ForkId`](reth_ethereum_forks::ForkId) kv-pair. Identifies which network stack a +//! node belongs to. use reth_chainspec::ChainSpec;