From d5277d5f27e3ed57aae2ccc0c8751a540d9ce88c Mon Sep 17 00:00:00 2001 From: Dan Cline <6798349+Rjected@users.noreply.github.com> Date: Wed, 5 Feb 2025 19:02:12 -0500 Subject: [PATCH] chore: remove usages of reth_primitives from reth bin (#14252) --- Cargo.lock | 1 + bin/reth/Cargo.toml | 1 + bin/reth/src/commands/debug_cmd/build_block.rs | 8 ++++---- bin/reth/src/commands/debug_cmd/execution.rs | 2 +- bin/reth/src/commands/debug_cmd/in_memory_merkle.rs | 9 +++++---- bin/reth/src/commands/debug_cmd/merkle.rs | 8 ++++---- bin/reth/src/commands/debug_cmd/mod.rs | 2 +- 7 files changed, 17 insertions(+), 14 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index dc9d22480..869089387 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -6448,6 +6448,7 @@ dependencies = [ "reth-errors", "reth-ethereum-cli", "reth-ethereum-payload-builder", + "reth-ethereum-primitives", "reth-evm", "reth-execution-types", "reth-exex", diff --git a/bin/reth/Cargo.toml b/bin/reth/Cargo.toml index ec397cafb..d6eb957a0 100644 --- a/bin/reth/Cargo.toml +++ b/bin/reth/Cargo.toml @@ -57,6 +57,7 @@ reth-trie-db = { workspace = true, features = ["metrics"] } reth-node-api.workspace = true reth-node-core.workspace = true reth-ethereum-payload-builder.workspace = true +reth-ethereum-primitives.workspace = true reth-node-ethereum = { workspace = true, features = ["js-tracer"] } reth-node-builder.workspace = true reth-node-events.workspace = true diff --git a/bin/reth/src/commands/debug_cmd/build_block.rs b/bin/reth/src/commands/debug_cmd/build_block.rs index a4a428708..b1a5cf04a 100644 --- a/bin/reth/src/commands/debug_cmd/build_block.rs +++ b/bin/reth/src/commands/debug_cmd/build_block.rs @@ -17,16 +17,16 @@ use reth_cli_runner::CliContext; use reth_consensus::{Consensus, FullConsensus}; use reth_errors::{ConsensusError, RethResult}; use reth_ethereum_payload_builder::EthereumBuilderConfig; +use reth_ethereum_primitives::{EthPrimitives, Transaction, TransactionSigned}; use reth_evm::execute::{BlockExecutorProvider, Executor}; use reth_execution_types::ExecutionOutcome; use reth_fs_util as fs; use reth_node_api::{BlockTy, EngineApiMessageVersion, PayloadBuilderAttributes}; use reth_node_ethereum::{consensus::EthBeaconConsensus, EthEvmConfig, EthExecutorProvider}; -use reth_primitives::{ - transaction::SignedTransactionIntoRecoveredExt, EthPrimitives, SealedBlock, SealedHeader, - Transaction, TransactionSigned, +use reth_primitives_traits::{ + transaction::signed::SignedTransactionIntoRecoveredExt, Block as _, SealedBlock, SealedHeader, + SignedTransaction, }; -use reth_primitives_traits::{Block as _, SignedTransaction}; use reth_provider::{ providers::{BlockchainProvider, ProviderNodeTypes}, BlockHashReader, BlockReader, BlockWriter, ChainSpecProvider, ProviderFactory, diff --git a/bin/reth/src/commands/debug_cmd/execution.rs b/bin/reth/src/commands/debug_cmd/execution.rs index 8011ba86a..bcf79ebf3 100644 --- a/bin/reth/src/commands/debug_cmd/execution.rs +++ b/bin/reth/src/commands/debug_cmd/execution.rs @@ -18,6 +18,7 @@ use reth_downloaders::{ headers::reverse_headers::ReverseHeadersDownloaderBuilder, }; use reth_errors::ConsensusError; +use reth_ethereum_primitives::EthPrimitives; use reth_exex::ExExManagerHandle; use reth_network::{BlockDownloaderProvider, NetworkHandle}; use reth_network_api::NetworkInfo; @@ -25,7 +26,6 @@ use reth_network_p2p::{headers::client::HeadersClient, EthBlockClient}; use reth_node_api::NodeTypesWithDBAdapter; use reth_node_ethereum::{consensus::EthBeaconConsensus, EthExecutorProvider}; use reth_node_events::node::NodeEvent; -use reth_primitives::EthPrimitives; use reth_provider::{ providers::ProviderNodeTypes, ChainSpecProvider, ProviderFactory, StageCheckpointReader, }; diff --git a/bin/reth/src/commands/debug_cmd/in_memory_merkle.rs b/bin/reth/src/commands/debug_cmd/in_memory_merkle.rs index d385eca16..ce85aaed1 100644 --- a/bin/reth/src/commands/debug_cmd/in_memory_merkle.rs +++ b/bin/reth/src/commands/debug_cmd/in_memory_merkle.rs @@ -15,13 +15,14 @@ use reth_cli_commands::common::{AccessRights, CliNodeTypes, Environment, Environ use reth_cli_runner::CliContext; use reth_cli_util::get_secret_key; use reth_config::Config; +use reth_ethereum_primitives::EthPrimitives; use reth_evm::execute::{BlockExecutorProvider, Executor}; use reth_execution_types::ExecutionOutcome; use reth_network::{BlockDownloaderProvider, NetworkHandle}; use reth_network_api::NetworkInfo; use reth_node_api::NodePrimitives; use reth_node_ethereum::{consensus::EthBeaconConsensus, EthExecutorProvider}; -use reth_primitives::{EthPrimitives, SealedBlock}; +use reth_primitives_traits::SealedBlock; use reth_provider::{ providers::ProviderNodeTypes, AccountExtReader, ChainSpecProvider, DatabaseProviderFactory, HashedPostStateProvider, HashingWriter, LatestStateProviderRef, OriginalValuesKnown, @@ -61,9 +62,9 @@ impl> Command { N: ProviderNodeTypes< ChainSpec = C::ChainSpec, Primitives: NodePrimitives< - Block = reth_primitives::Block, - Receipt = reth_primitives::Receipt, - BlockHeader = reth_primitives::Header, + Block = reth_ethereum_primitives::Block, + Receipt = reth_ethereum_primitives::Receipt, + BlockHeader = alloy_consensus::Header, >, >, >( diff --git a/bin/reth/src/commands/debug_cmd/merkle.rs b/bin/reth/src/commands/debug_cmd/merkle.rs index d7f351650..aa94afc06 100644 --- a/bin/reth/src/commands/debug_cmd/merkle.rs +++ b/bin/reth/src/commands/debug_cmd/merkle.rs @@ -13,13 +13,13 @@ use reth_config::Config; use reth_consensus::{Consensus, ConsensusError}; use reth_db::tables; use reth_db_api::{cursor::DbCursorRO, transaction::DbTx}; +use reth_ethereum_primitives::EthPrimitives; use reth_evm::execute::{BatchExecutor, BlockExecutorProvider}; use reth_network::{BlockDownloaderProvider, NetworkHandle}; use reth_network_api::NetworkInfo; use reth_network_p2p::full_block::FullBlockClient; use reth_node_api::{BlockTy, NodePrimitives}; use reth_node_ethereum::{consensus::EthBeaconConsensus, EthExecutorProvider}; -use reth_primitives::EthPrimitives; use reth_provider::{ providers::ProviderNodeTypes, BlockNumReader, BlockWriter, ChainSpecProvider, DatabaseProviderFactory, HeaderProvider, LatestStateProviderRef, OriginalValuesKnown, @@ -61,9 +61,9 @@ impl> Command { N: ProviderNodeTypes< ChainSpec = C::ChainSpec, Primitives: NodePrimitives< - Block = reth_primitives::Block, - Receipt = reth_primitives::Receipt, - BlockHeader = reth_primitives::Header, + Block = reth_ethereum_primitives::Block, + Receipt = reth_ethereum_primitives::Receipt, + BlockHeader = alloy_consensus::Header, >, >, >( diff --git a/bin/reth/src/commands/debug_cmd/mod.rs b/bin/reth/src/commands/debug_cmd/mod.rs index 26077a127..d4b03fd81 100644 --- a/bin/reth/src/commands/debug_cmd/mod.rs +++ b/bin/reth/src/commands/debug_cmd/mod.rs @@ -5,8 +5,8 @@ use reth_chainspec::ChainSpec; use reth_cli::chainspec::ChainSpecParser; use reth_cli_commands::common::CliNodeTypes; use reth_cli_runner::CliContext; +use reth_ethereum_primitives::EthPrimitives; use reth_node_ethereum::EthEngineTypes; -use reth_primitives::EthPrimitives; mod build_block; mod execution;