diff --git a/crates/interfaces/src/executor.rs b/crates/interfaces/src/executor.rs index 3ca47013539..fa677ad814c 100644 --- a/crates/interfaces/src/executor.rs +++ b/crates/interfaces/src/executor.rs @@ -1,8 +1,8 @@ use crate::RethError; use reth_primitives::{ - BlockNumHash, Bloom, GotExpected, GotExpectedBoxed, PruneSegmentError, B256, + revm_primitives::EVMError, BlockNumHash, Bloom, GotExpected, GotExpectedBoxed, + PruneSegmentError, B256, }; -use revm_primitives::EVMError; use thiserror::Error; /// Transaction validation errors diff --git a/crates/payload/builder/src/database.rs b/crates/payload/builder/src/database.rs index 2631503cd48..04998c45b7e 100644 --- a/crates/payload/builder/src/database.rs +++ b/crates/payload/builder/src/database.rs @@ -1,10 +1,13 @@ //! Database adapters for payload building. -use reth_primitives::U256; -use revm_primitives::{ - db::{Database, DatabaseRef}, - AccountInfo, Address, Bytecode, B256, +use reth_primitives::{ + revm_primitives::{ + db::{Database, DatabaseRef}, + AccountInfo, Address, Bytecode, B256, + }, + U256, }; + use std::{ cell::RefCell, collections::{hash_map::Entry, HashMap}, diff --git a/crates/payload/builder/src/error.rs b/crates/payload/builder/src/error.rs index 0a597a4745f..7d836086480 100644 --- a/crates/payload/builder/src/error.rs +++ b/crates/payload/builder/src/error.rs @@ -1,9 +1,8 @@ //! Error types emitted by types or implementations of this crate. use reth_interfaces::RethError; -use reth_primitives::B256; +use reth_primitives::{revm_primitives::EVMError, B256}; use reth_transaction_pool::BlobStoreError; -use revm_primitives::EVMError; use tokio::sync::oneshot; /// Possible error variants during payload building. diff --git a/crates/payload/builder/src/payload.rs b/crates/payload/builder/src/payload.rs index b3e68da2b8a..e360cfefaa2 100644 --- a/crates/payload/builder/src/payload.rs +++ b/crates/payload/builder/src/payload.rs @@ -2,8 +2,9 @@ use alloy_rlp::{Encodable, Error as DecodeError}; use reth_primitives::{ - revm::config::revm_spec_by_timestamp_after_merge, Address, BlobTransactionSidecar, ChainSpec, - Header, SealedBlock, Withdrawal, B256, U256, + revm::config::revm_spec_by_timestamp_after_merge, + revm_primitives::{BlobExcessGasAndPrice, BlockEnv, CfgEnv, SpecId}, + Address, BlobTransactionSidecar, ChainSpec, Header, SealedBlock, Withdrawal, B256, U256, }; use reth_rpc_types::engine::{ ExecutionPayloadEnvelopeV2, ExecutionPayloadEnvelopeV3, ExecutionPayloadV1, PayloadAttributes, @@ -14,7 +15,6 @@ use reth_rpc_types_compat::engine::payload::{ block_to_payload_v3, convert_block_to_payload_field_v2, convert_standalone_withdraw_to_withdrawal, try_block_to_payload_v1, }; -use revm_primitives::{BlobExcessGasAndPrice, BlockEnv, CfgEnv, SpecId}; #[cfg(feature = "optimism")] use reth_primitives::TransactionSigned; diff --git a/crates/primitives/src/account.rs b/crates/primitives/src/account.rs index 390663b0c09..ab6761e4153 100644 --- a/crates/primitives/src/account.rs +++ b/crates/primitives/src/account.rs @@ -1,8 +1,10 @@ -use crate::{B256, KECCAK_EMPTY, U256}; +use crate::{ + revm_primitives::{Bytecode as RevmBytecode, BytecodeState, Bytes, JumpMap}, + B256, KECCAK_EMPTY, U256, +}; use byteorder::{BigEndian, ReadBytesExt}; use bytes::Buf; use reth_codecs::{main_codec, Compact}; -use revm_primitives::{Bytecode as RevmBytecode, BytecodeState, Bytes, JumpMap}; use serde::{Deserialize, Serialize}; use std::ops::Deref; diff --git a/crates/primitives/src/chain/spec.rs b/crates/primitives/src/chain/spec.rs index 3a545f3e23f..4f5e4f6374c 100644 --- a/crates/primitives/src/chain/spec.rs +++ b/crates/primitives/src/chain/spec.rs @@ -6,11 +6,11 @@ use crate::{ forkid::ForkFilterKey, header::Head, proofs::genesis_state_root, + revm_primitives::{address, b256}, Address, BlockNumber, Chain, ForkFilter, ForkHash, ForkId, Genesis, Hardfork, Header, SealedHeader, B256, EMPTY_OMMER_ROOT_HASH, U256, }; use once_cell::sync::Lazy; -use revm_primitives::{address, b256}; use serde::{Deserialize, Serialize}; use std::{ collections::BTreeMap, diff --git a/crates/primitives/src/constants/mod.rs b/crates/primitives/src/constants/mod.rs index e6ec8a0e72f..2e3c691d9c1 100644 --- a/crates/primitives/src/constants/mod.rs +++ b/crates/primitives/src/constants/mod.rs @@ -1,7 +1,9 @@ //! Ethereum protocol-related constants -use crate::{Address, B256, U256}; -use revm_primitives::{address, b256}; +use crate::{ + revm_primitives::{address, b256}, + Address, B256, U256, +}; use std::time::Duration; /// [EIP-4844](https://eips.ethereum.org/EIPS/eip-4844#parameters) constants. diff --git a/crates/primitives/src/eip4844.rs b/crates/primitives/src/eip4844.rs index c93017e8dda..4f65cc7ee06 100644 --- a/crates/primitives/src/eip4844.rs +++ b/crates/primitives/src/eip4844.rs @@ -6,7 +6,9 @@ use crate::{constants::eip4844::VERSIONED_HASH_VERSION_KZG, B256}; use sha2::{Digest, Sha256}; // re-exports from revm for calculating blob fee -pub use revm_primitives::{calc_blob_gasprice, calc_excess_blob_gas as calculate_excess_blob_gas}; +pub use crate::revm_primitives::{ + calc_blob_gasprice, calc_excess_blob_gas as calculate_excess_blob_gas, +}; /// Calculates the versioned hash for a KzgCommitment /// diff --git a/crates/primitives/src/forkid.rs b/crates/primitives/src/forkid.rs index 3de97bf3c29..89ef34a52bd 100644 --- a/crates/primitives/src/forkid.rs +++ b/crates/primitives/src/forkid.rs @@ -379,8 +379,7 @@ impl Cache { #[cfg(test)] mod tests { use super::*; - use crate::hex_literal::hex; - use revm_primitives::b256; + use crate::{hex_literal::hex, revm_primitives::b256}; const GENESIS_HASH: B256 = b256!("d4e56740f876aef8c010b86a40d5f56745a118d0906a34e69aec8c0db1cb8fa3"); diff --git a/crates/primitives/src/transaction/optimism.rs b/crates/primitives/src/transaction/optimism.rs index 7f4076322c6..133a507b3b9 100644 --- a/crates/primitives/src/transaction/optimism.rs +++ b/crates/primitives/src/transaction/optimism.rs @@ -147,10 +147,9 @@ impl TxDeposit { #[cfg(test)] mod tests { use super::*; - use crate::{Bytes, TransactionSigned}; + use crate::{revm_primitives::hex_literal::hex, Bytes, TransactionSigned}; use alloy_rlp::Decodable; use bytes::BytesMut; - use revm_primitives::hex_literal::hex; #[test] fn test_rlp_roundtrip() { diff --git a/crates/rpc/rpc/src/debug.rs b/crates/rpc/rpc/src/debug.rs index 7bad7e8c4e2..b8b313d804b 100644 --- a/crates/rpc/rpc/src/debug.rs +++ b/crates/rpc/rpc/src/debug.rs @@ -14,8 +14,12 @@ use alloy_rlp::{Decodable, Encodable}; use async_trait::async_trait; use jsonrpsee::core::RpcResult; use reth_primitives::{ - revm::env::tx_env_with_recovered, Account, Address, Block, BlockId, BlockNumberOrTag, Bytes, - TransactionSigned, B256, + revm::env::tx_env_with_recovered, + revm_primitives::{ + db::{DatabaseCommit, DatabaseRef}, + BlockEnv, CfgEnv, + }, + Account, Address, Block, BlockId, BlockNumberOrTag, Bytes, TransactionSigned, B256, }; use reth_provider::{BlockReaderIdExt, HeaderProvider, StateProviderBox}; use reth_revm::{ @@ -38,10 +42,6 @@ use revm::{ db::{CacheDB, EmptyDB}, primitives::Env, }; -use revm_primitives::{ - db::{DatabaseCommit, DatabaseRef}, - BlockEnv, CfgEnv, -}; use std::sync::Arc; use tokio::sync::{mpsc, AcquireError, OwnedSemaphorePermit}; use tokio_stream::{wrappers::ReceiverStream, StreamExt}; diff --git a/crates/rpc/rpc/src/eth/api/mod.rs b/crates/rpc/rpc/src/eth/api/mod.rs index ef40989df40..39b241beba1 100644 --- a/crates/rpc/rpc/src/eth/api/mod.rs +++ b/crates/rpc/rpc/src/eth/api/mod.rs @@ -14,6 +14,7 @@ use async_trait::async_trait; use reth_interfaces::RethResult; use reth_network_api::NetworkInfo; use reth_primitives::{ + revm_primitives::{BlockEnv, CfgEnv}, Address, BlockId, BlockNumberOrTag, ChainInfo, SealedBlock, B256, U256, U64, }; use reth_provider::{ @@ -22,7 +23,6 @@ use reth_provider::{ use reth_rpc_types::{SyncInfo, SyncStatus}; use reth_tasks::{TaskSpawner, TokioTaskExecutor}; use reth_transaction_pool::TransactionPool; -use revm_primitives::{BlockEnv, CfgEnv}; use std::{ future::Future, sync::Arc, diff --git a/crates/rpc/rpc/src/eth/api/pending_block.rs b/crates/rpc/rpc/src/eth/api/pending_block.rs index f17d3b8799a..827dfec1a17 100644 --- a/crates/rpc/rpc/src/eth/api/pending_block.rs +++ b/crates/rpc/rpc/src/eth/api/pending_block.rs @@ -5,6 +5,9 @@ use reth_primitives::{ constants::{eip4844::MAX_DATA_GAS_PER_BLOCK, BEACON_NONCE}, proofs, revm::{compat::into_reth_log, env::tx_env_with_recovered}, + revm_primitives::{ + BlockEnv, CfgEnv, EVMError, Env, InvalidTransaction, ResultAndState, SpecId, + }, Block, BlockId, BlockNumberOrTag, ChainSpec, Header, IntoRecoveredTransaction, Receipt, Receipts, SealedBlock, SealedHeader, B256, EMPTY_OMMER_ROOT_HASH, U256, }; @@ -15,9 +18,6 @@ use reth_revm::{ }; use reth_transaction_pool::TransactionPool; use revm::{db::states::bundle_state::BundleRetention, Database, DatabaseCommit, State}; -use revm_primitives::{ - BlockEnv, CfgEnv, EVMError, Env, InvalidTransaction, ResultAndState, SpecId, -}; use std::time::Instant; /// Configured [BlockEnv] and [CfgEnv] for a pending block diff --git a/crates/rpc/rpc/src/eth/api/server.rs b/crates/rpc/rpc/src/eth/api/server.rs index 687f35c3753..08bfa54db03 100644 --- a/crates/rpc/rpc/src/eth/api/server.rs +++ b/crates/rpc/rpc/src/eth/api/server.rs @@ -399,7 +399,7 @@ mod tests { use reth_network_api::noop::NoopNetwork; use reth_primitives::{ basefee::calculate_next_block_base_fee, constants::ETHEREUM_BLOCK_GAS_LIMIT, BaseFeeParams, - Block, BlockNumberOrTag, Header, TransactionSigned, U256, + Block, BlockNumberOrTag, Header, TransactionSigned, B256, U256, }; use reth_provider::{ test_utils::{MockEthProvider, NoopProvider}, @@ -408,7 +408,6 @@ mod tests { use reth_rpc_api::EthApiServer; use reth_rpc_types::FeeHistory; use reth_transaction_pool::test_utils::{testing_pool, TestPool}; - use revm_primitives::B256; fn build_test_eth_api< P: BlockReaderIdExt diff --git a/crates/rpc/rpc/src/eth/api/transactions.rs b/crates/rpc/rpc/src/eth/api/transactions.rs index 130231d9680..4989be42197 100644 --- a/crates/rpc/rpc/src/eth/api/transactions.rs +++ b/crates/rpc/rpc/src/eth/api/transactions.rs @@ -16,6 +16,7 @@ use reth_network_api::NetworkInfo; use reth_primitives::{ eip4844::calc_blob_gasprice, revm::env::{fill_block_env_with_coinbase, tx_env_with_recovered}, + revm_primitives::{db::DatabaseCommit, Env, ExecutionResult, ResultAndState, SpecId, State}, Address, BlockId, BlockNumberOrTag, Bytes, FromRecoveredPooledTransaction, Header, IntoRecoveredTransaction, Receipt, SealedBlock, TransactionKind::{Call, Create}, @@ -39,7 +40,6 @@ use revm::{ primitives::{BlockEnv, CfgEnv}, Inspector, }; -use revm_primitives::{db::DatabaseCommit, Env, ExecutionResult, ResultAndState, SpecId, State}; #[cfg(feature = "optimism")] use crate::eth::api::optimism::OptimismTxMeta; diff --git a/crates/rpc/rpc/src/eth/bundle.rs b/crates/rpc/rpc/src/eth/bundle.rs index 0ce269b8190..4f52e0579d7 100644 --- a/crates/rpc/rpc/src/eth/bundle.rs +++ b/crates/rpc/rpc/src/eth/bundle.rs @@ -9,14 +9,17 @@ use crate::{ }, BlockingTaskGuard, }; -use reth_primitives::{keccak256, U256}; +use reth_primitives::{ + keccak256, + revm_primitives::db::{DatabaseCommit, DatabaseRef}, + U256, +}; use reth_revm::database::StateProviderDatabase; use reth_rpc_types::{EthCallBundle, EthCallBundleResponse, EthCallBundleTransactionResult}; use revm::{ db::CacheDB, primitives::{Env, ResultAndState, TxEnv}, }; -use revm_primitives::db::{DatabaseCommit, DatabaseRef}; use std::sync::Arc; /// `Eth` bundle implementation. diff --git a/crates/rpc/rpc/src/eth/error.rs b/crates/rpc/rpc/src/eth/error.rs index 491c35c3cd0..1b682aed9c1 100644 --- a/crates/rpc/rpc/src/eth/error.rs +++ b/crates/rpc/rpc/src/eth/error.rs @@ -7,7 +7,7 @@ use jsonrpsee::{ types::{error::CALL_EXECUTION_FAILED_CODE, ErrorObject}, }; use reth_interfaces::RethError; -use reth_primitives::{Address, Bytes, U256}; +use reth_primitives::{revm_primitives::InvalidHeader, Address, Bytes, U256}; use reth_revm::tracing::js::JsInspectorError; use reth_rpc_types::{error::EthRpcErrorCode, BlockError, CallInputError}; use reth_transaction_pool::error::{ @@ -15,7 +15,6 @@ use reth_transaction_pool::error::{ PoolTransactionError, }; use revm::primitives::{EVMError, ExecutionResult, Halt, OutOfGasError}; -use revm_primitives::InvalidHeader; use std::time::Duration; /// Result alias diff --git a/crates/rpc/rpc/src/trace.rs b/crates/rpc/rpc/src/trace.rs index d81c6430316..5399ec49071 100644 --- a/crates/rpc/rpc/src/trace.rs +++ b/crates/rpc/rpc/src/trace.rs @@ -11,7 +11,8 @@ use async_trait::async_trait; use jsonrpsee::core::RpcResult as Result; use reth_consensus_common::calc::{base_block_reward, block_reward}; use reth_primitives::{ - revm::env::tx_env_with_recovered, BlockId, BlockNumberOrTag, Bytes, SealedHeader, B256, U256, + revm::env::tx_env_with_recovered, revm_primitives::db::DatabaseCommit, BlockId, + BlockNumberOrTag, Bytes, SealedHeader, B256, U256, }; use reth_provider::{BlockReader, ChainSpecProvider, EvmEnvProvider, StateProviderFactory}; use reth_revm::{ @@ -25,7 +26,6 @@ use reth_rpc_types::{ BlockError, BlockOverrides, CallRequest, Index, }; use revm::{db::CacheDB, primitives::Env}; -use revm_primitives::db::DatabaseCommit; use std::{collections::HashSet, sync::Arc}; use tokio::sync::{AcquireError, OwnedSemaphorePermit};