diff --git a/Cargo.lock b/Cargo.lock index bfbaf3ac792b..00f3bdd96844 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -7188,6 +7188,7 @@ dependencies = [ name = "reth-ethereum-consensus" version = "1.0.7" dependencies = [ + "alloy-primitives", "reth-chainspec", "reth-consensus", "reth-consensus-common", @@ -7199,6 +7200,8 @@ dependencies = [ name = "reth-ethereum-engine-primitives" version = "1.0.7" dependencies = [ + "alloy-eips", + "alloy-primitives", "alloy-rlp", "reth-chain-state", "reth-chainspec", @@ -7235,6 +7238,7 @@ dependencies = [ name = "reth-ethereum-payload-builder" version = "1.0.7" dependencies = [ + "alloy-primitives", "reth-basic-payload-builder", "reth-chain-state", "reth-errors", @@ -7288,6 +7292,7 @@ name = "reth-evm-ethereum" version = "1.0.7" dependencies = [ "alloy-eips", + "alloy-primitives", "alloy-sol-types", "reth-chainspec", "reth-ethereum-consensus", diff --git a/crates/ethereum/consensus/Cargo.toml b/crates/ethereum/consensus/Cargo.toml index 25c865a2bc18..02d217b63b27 100644 --- a/crates/ethereum/consensus/Cargo.toml +++ b/crates/ethereum/consensus/Cargo.toml @@ -17,4 +17,7 @@ reth-consensus-common.workspace = true reth-primitives.workspace = true reth-consensus.workspace = true +# alloy +alloy-primitives.workspace = true + tracing.workspace = true diff --git a/crates/ethereum/consensus/src/lib.rs b/crates/ethereum/consensus/src/lib.rs index 15b9ed09164f..896975bb41dd 100644 --- a/crates/ethereum/consensus/src/lib.rs +++ b/crates/ethereum/consensus/src/lib.rs @@ -8,6 +8,7 @@ #![cfg_attr(not(test), warn(unused_crate_dependencies))] #![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))] +use alloy_primitives::U256; use reth_chainspec::{EthChainSpec, EthereumHardfork, EthereumHardforks}; use reth_consensus::{Consensus, ConsensusError, PostExecutionInput}; use reth_consensus_common::validation::{ @@ -18,7 +19,7 @@ use reth_consensus_common::validation::{ }; use reth_primitives::{ constants::MINIMUM_GAS_LIMIT, BlockWithSenders, Header, SealedBlock, SealedHeader, - EMPTY_OMMER_ROOT_HASH, U256, + EMPTY_OMMER_ROOT_HASH, }; use std::{fmt::Debug, sync::Arc, time::SystemTime}; @@ -232,8 +233,9 @@ impl<ChainSpec: Send + Sync + EthChainSpec + EthereumHardforks + Debug> Consensu #[cfg(test)] mod tests { use super::*; + use alloy_primitives::{Sealable, B256}; use reth_chainspec::{ChainSpec, ChainSpecBuilder}; - use reth_primitives::{alloy_primitives::Sealable, proofs, B256}; + use reth_primitives::proofs; fn header_with_gas_limit(gas_limit: u64) -> SealedHeader { let header = Header { gas_limit: gas_limit.into(), ..Default::default() }; diff --git a/crates/ethereum/consensus/src/validation.rs b/crates/ethereum/consensus/src/validation.rs index df966bc3c64a..1da648cb3ca6 100644 --- a/crates/ethereum/consensus/src/validation.rs +++ b/crates/ethereum/consensus/src/validation.rs @@ -1,8 +1,7 @@ +use alloy_primitives::{Bloom, B256}; use reth_chainspec::EthereumHardforks; use reth_consensus::ConsensusError; -use reth_primitives::{ - gas_spent_by_transactions, BlockWithSenders, Bloom, GotExpected, Receipt, Request, B256, -}; +use reth_primitives::{gas_spent_by_transactions, BlockWithSenders, GotExpected, Receipt, Request}; /// Validate a block with regard to execution results: /// diff --git a/crates/ethereum/engine-primitives/Cargo.toml b/crates/ethereum/engine-primitives/Cargo.toml index 8785b96f63b9..cfeac285328e 100644 --- a/crates/ethereum/engine-primitives/Cargo.toml +++ b/crates/ethereum/engine-primitives/Cargo.toml @@ -21,6 +21,10 @@ reth-rpc-types-compat.workspace = true alloy-rlp.workspace = true reth-chain-state.workspace = true +# alloy +alloy-primitives.workspace = true +alloy-eips.workspace = true + # misc serde.workspace = true sha2.workspace = true diff --git a/crates/ethereum/engine-primitives/src/payload.rs b/crates/ethereum/engine-primitives/src/payload.rs index c3edab111f85..e22012b6c3d3 100644 --- a/crates/ethereum/engine-primitives/src/payload.rs +++ b/crates/ethereum/engine-primitives/src/payload.rs @@ -1,9 +1,11 @@ //! Contains types required for building a payload. +use alloy_eips::eip4844::BlobTransactionSidecar; +use alloy_primitives::{Address, B256, U256}; use alloy_rlp::Encodable; use reth_chain_state::ExecutedBlock; use reth_payload_primitives::{BuiltPayload, PayloadBuilderAttributes}; -use reth_primitives::{Address, BlobTransactionSidecar, SealedBlock, Withdrawals, B256, U256}; +use reth_primitives::{SealedBlock, Withdrawals}; use reth_rpc_types::engine::{ ExecutionPayloadEnvelopeV2, ExecutionPayloadEnvelopeV3, ExecutionPayloadEnvelopeV4, ExecutionPayloadV1, PayloadAttributes, PayloadId, diff --git a/crates/ethereum/evm/Cargo.toml b/crates/ethereum/evm/Cargo.toml index 25f2d9c6af78..f5af92b157a7 100644 --- a/crates/ethereum/evm/Cargo.toml +++ b/crates/ethereum/evm/Cargo.toml @@ -25,6 +25,7 @@ reth-execution-types.workspace = true revm-primitives.workspace = true # Alloy +alloy-primitives.workspace = true alloy-eips.workspace = true alloy-sol-types.workspace = true diff --git a/crates/ethereum/evm/src/dao_fork.rs b/crates/ethereum/evm/src/dao_fork.rs index 66e772c4cf4e..aed10d324c4f 100644 --- a/crates/ethereum/evm/src/dao_fork.rs +++ b/crates/ethereum/evm/src/dao_fork.rs @@ -1,7 +1,7 @@ //! DAO Fork related constants from [EIP-779](https://eips.ethereum.org/EIPS/eip-779). //! It happened on Ethereum block 1_920_000 -use reth_primitives::{address, Address}; +use alloy_primitives::{address, Address}; /// Dao hardfork beneficiary that received ether from accounts from DAO and DAO creator children. pub static DAO_HARDFORK_BENEFICIARY: Address = address!("bf4ed7b27f1d666546e30d74d50d173d20bca754"); diff --git a/crates/ethereum/evm/src/eip6110.rs b/crates/ethereum/evm/src/eip6110.rs index 605427276ae0..e78becd960cf 100644 --- a/crates/ethereum/evm/src/eip6110.rs +++ b/crates/ethereum/evm/src/eip6110.rs @@ -1,11 +1,11 @@ //! EIP-6110 deposit requests parsing use alloc::{string::ToString, vec::Vec}; use alloy_eips::eip6110::{DepositRequest, MAINNET_DEPOSIT_CONTRACT_ADDRESS}; +use alloy_primitives::Log; use alloy_sol_types::{sol, SolEvent}; use reth_chainspec::ChainSpec; use reth_evm::execute::BlockValidationError; use reth_primitives::{Receipt, Request}; -use revm_primitives::Log; sol! { #[allow(missing_docs)] diff --git a/crates/ethereum/evm/src/execute.rs b/crates/ethereum/evm/src/execute.rs index b0ab89a7e031..3e574147f272 100644 --- a/crates/ethereum/evm/src/execute.rs +++ b/crates/ethereum/evm/src/execute.rs @@ -5,6 +5,7 @@ use crate::{ EthEvmConfig, }; use alloc::{boxed::Box, sync::Arc, vec, vec::Vec}; +use alloy_primitives::{BlockNumber, U256}; use core::fmt::Display; use reth_chainspec::{ChainSpec, EthereumHardforks, MAINNET}; use reth_ethereum_consensus::validate_block_post_execution; @@ -20,9 +21,7 @@ use reth_evm::{ ConfigureEvm, }; use reth_execution_types::ExecutionOutcome; -use reth_primitives::{ - BlockNumber, BlockWithSenders, EthereumHardfork, Header, Receipt, Request, U256, -}; +use reth_primitives::{BlockWithSenders, EthereumHardfork, Header, Receipt, Request}; use reth_prune_types::PruneModes; use reth_revm::{ batch::BlockBatchRecord, @@ -478,17 +477,17 @@ mod tests { eip4788::{BEACON_ROOTS_ADDRESS, BEACON_ROOTS_CODE, SYSTEM_ADDRESS}, eip7002::{WITHDRAWAL_REQUEST_PREDEPLOY_ADDRESS, WITHDRAWAL_REQUEST_PREDEPLOY_CODE}, }; + use alloy_primitives::{b256, fixed_bytes, keccak256, Bytes, TxKind, B256}; use reth_chainspec::{ChainSpecBuilder, ForkCondition}; use reth_primitives::{ constants::{EMPTY_ROOT_HASH, ETH_TO_WEI}, - keccak256, public_key_to_address, Account, Block, BlockBody, Transaction, TxKind, TxLegacy, - B256, + public_key_to_address, Account, Block, BlockBody, Transaction, TxLegacy, }; use reth_revm::{ database::StateProviderDatabase, test_utils::StateProviderTest, TransitionState, }; use reth_testing_utils::generators::{self, sign_tx_with_key_pair}; - use revm_primitives::{b256, fixed_bytes, Bytes, BLOCKHASH_SERVE_WINDOW}; + use revm_primitives::BLOCKHASH_SERVE_WINDOW; use secp256k1::{Keypair, Secp256k1}; use std::collections::HashMap; diff --git a/crates/ethereum/evm/src/lib.rs b/crates/ethereum/evm/src/lib.rs index 2c9471b777c8..f791b80f3c06 100644 --- a/crates/ethereum/evm/src/lib.rs +++ b/crates/ethereum/evm/src/lib.rs @@ -12,12 +12,12 @@ extern crate alloc; use alloc::vec::Vec; +use alloy_primitives::{Address, Bytes, TxKind, U256}; use reth_chainspec::{ChainSpec, Head}; use reth_evm::{ConfigureEvm, ConfigureEvmEnv, NextBlockEnvAttributes}; -use reth_primitives::{transaction::FillTxEnv, Address, Header, TransactionSigned, U256}; +use reth_primitives::{transaction::FillTxEnv, Header, TransactionSigned}; use revm_primitives::{ - AnalysisKind, BlobExcessGasAndPrice, BlockEnv, Bytes, CfgEnv, CfgEnvWithHandlerCfg, Env, - SpecId, TxEnv, TxKind, + AnalysisKind, BlobExcessGasAndPrice, BlockEnv, CfgEnv, CfgEnvWithHandlerCfg, Env, SpecId, TxEnv, }; use std::sync::Arc; @@ -194,11 +194,12 @@ impl ConfigureEvm for EthEvmConfig { #[cfg(test)] mod tests { use super::*; + use alloy_primitives::{B256, U256}; use reth_chainspec::{Chain, ChainSpec, MAINNET}; use reth_evm::execute::ProviderError; use reth_primitives::{ revm_primitives::{BlockEnv, CfgEnv, SpecId}, - Genesis, Header, B256, KECCAK_EMPTY, U256, + Genesis, Header, KECCAK_EMPTY, }; use reth_revm::{ db::{CacheDB, EmptyDBTyped}, diff --git a/crates/ethereum/payload/Cargo.toml b/crates/ethereum/payload/Cargo.toml index a5f53264c6e5..d67e39c17d34 100644 --- a/crates/ethereum/payload/Cargo.toml +++ b/crates/ethereum/payload/Cargo.toml @@ -30,5 +30,8 @@ reth-chain-state.workspace = true # ethereum revm.workspace = true +# alloy +alloy-primitives.workspace = true + # misc tracing.workspace = true diff --git a/crates/ethereum/payload/src/lib.rs b/crates/ethereum/payload/src/lib.rs index 168b514447ca..744ad38b13ab 100644 --- a/crates/ethereum/payload/src/lib.rs +++ b/crates/ethereum/payload/src/lib.rs @@ -9,6 +9,7 @@ #![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))] #![allow(clippy::useless_let_if_seq)] +use alloy_primitives::U256; use reth_basic_payload_builder::{ commit_withdrawals, is_better_payload, BuildArguments, BuildOutcome, PayloadBuilder, PayloadConfig, WithdrawalsOutcome, @@ -33,7 +34,7 @@ use reth_primitives::{ proofs::{self, calculate_requests_root}, revm_primitives::{BlockEnv, CfgEnvWithHandlerCfg}, Block, BlockBody, EthereumHardforks, Header, IntoRecoveredTransaction, Receipt, - EMPTY_OMMER_ROOT_HASH, U256, + EMPTY_OMMER_ROOT_HASH, }; use reth_provider::StateProviderFactory; use reth_revm::database::StateProviderDatabase;