diff --git a/Cargo.lock b/Cargo.lock index 27a33b69f..39900bf5e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -8118,6 +8118,7 @@ dependencies = [ name = "reth-node-builder" version = "1.1.3" dependencies = [ + "alloy-eips", "alloy-primitives", "alloy-rpc-types", "aquamarine", @@ -8170,7 +8171,6 @@ dependencies = [ "reth-tokio-util", "reth-tracing", "reth-transaction-pool", - "revm-primitives", "secp256k1", "tempfile", "tokio", @@ -9497,7 +9497,8 @@ dependencies = [ "reth-storage-api", "reth-tasks", "reth-tracing", - "revm", + "revm-interpreter", + "revm-primitives", "rustc-hash 2.1.0", "schnellru", "serde", diff --git a/Cargo.toml b/Cargo.toml index 20f7ba19f..ee6282b21 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -429,6 +429,7 @@ reth-zstd-compressors = { path = "crates/storage/zstd-compressors", default-feat revm = { version = "18.0.0", features = ["std"], default-features = false } revm-inspectors = "0.13.0" revm-primitives = { version = "14.0.0", default-features = false } +revm-interpreter = { version = "14.0.0", default-features = false } # eth alloy-chains = { version = "0.1.32", default-features = false } diff --git a/bin/reth/Cargo.toml b/bin/reth/Cargo.toml index cf9c53261..fb86a8ced 100644 --- a/bin/reth/Cargo.toml +++ b/bin/reth/Cargo.toml @@ -68,7 +68,7 @@ reth-engine-util.workspace = true reth-prune.workspace = true # crypto -alloy-eips.workspace = true +alloy-eips = { workspace = true, features = ["kzg"] } alloy-rlp.workspace = true alloy-rpc-types = { workspace = true, features = ["engine"] } alloy-consensus.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 0e4d3f718..41a9d9f4f 100644 --- a/bin/reth/src/commands/debug_cmd/build_block.rs +++ b/bin/reth/src/commands/debug_cmd/build_block.rs @@ -1,6 +1,9 @@ //! Command for debugging block building. use alloy_consensus::TxEip4844; -use alloy_eips::{eip2718::Encodable2718, eip4844::BlobTransactionSidecar}; +use alloy_eips::{ + eip2718::Encodable2718, + eip4844::{env_settings::EnvKzgSettings, BlobTransactionSidecar}, +}; use alloy_primitives::{Address, Bytes, B256, U256}; use alloy_rlp::Decodable; use alloy_rpc_types::engine::{BlobsBundleV1, PayloadAttributes}; @@ -33,11 +36,7 @@ use reth_provider::{ BlockHashReader, BlockReader, BlockWriter, ChainSpecProvider, ProviderFactory, StageCheckpointReader, StateProviderFactory, }; -use reth_revm::{ - cached::CachedReads, - database::StateProviderDatabase, - primitives::{EnvKzgSettings, KzgSettings}, -}; +use reth_revm::{cached::CachedReads, database::StateProviderDatabase, primitives::KzgSettings}; use reth_stages::StageId; use reth_transaction_pool::{ blobstore::InMemoryBlobStore, BlobStore, EthPooledTransaction, PoolConfig, TransactionOrigin, diff --git a/crates/node/builder/Cargo.toml b/crates/node/builder/Cargo.toml index 1a0b5bad0..51409a6f8 100644 --- a/crates/node/builder/Cargo.toml +++ b/crates/node/builder/Cargo.toml @@ -61,7 +61,7 @@ reth-transaction-pool.workspace = true ## ethereum alloy-primitives.workspace = true alloy-rpc-types = { workspace = true, features = ["engine"] } -revm-primitives.workspace = true +alloy-eips = { workspace = true, features = ["kzg"] } ## async futures.workspace = true diff --git a/crates/node/builder/src/builder/mod.rs b/crates/node/builder/src/builder/mod.rs index e38882fa5..98c831f2f 100644 --- a/crates/node/builder/src/builder/mod.rs +++ b/crates/node/builder/src/builder/mod.rs @@ -9,6 +9,7 @@ use crate::{ rpc::{RethRpcAddOns, RethRpcServerHandles, RpcContext}, DefaultNodeLauncher, LaunchNode, Node, NodeHandle, }; +use alloy_eips::eip4844::env_settings::EnvKzgSettings; use futures::Future; use reth_blockchain_tree::externals::NodeTypesForTree; use reth_chainspec::{EthChainSpec, EthereumHardforks, Hardforks}; @@ -38,7 +39,6 @@ use reth_provider::{ }; use reth_tasks::TaskExecutor; use reth_transaction_pool::{PoolConfig, PoolTransaction, TransactionPool}; -use revm_primitives::EnvKzgSettings; use secp256k1::SecretKey; use std::sync::Arc; use tracing::{info, trace, warn}; diff --git a/crates/transaction-pool/Cargo.toml b/crates/transaction-pool/Cargo.toml index 214633188..f25860599 100644 --- a/crates/transaction-pool/Cargo.toml +++ b/crates/transaction-pool/Cargo.toml @@ -23,10 +23,11 @@ reth-execution-types.workspace = true reth-fs-util.workspace = true reth-storage-api.workspace = true reth-tasks.workspace = true -revm.workspace = true +revm-primitives.workspace = true +revm-interpreter.workspace = true # ethereum -alloy-eips.workspace = true +alloy-eips = { workspace = true, features = ["kzg"] } alloy-primitives.workspace = true alloy-rlp.workspace = true alloy-consensus.workspace = true @@ -85,9 +86,10 @@ serde = [ "bitflags/serde", "parking_lot/serde", "rand?/serde", - "revm/serde", "smallvec/serde", "reth-primitives-traits/serde", + "revm-interpreter/serde", + "revm-primitives/serde" ] test-utils = [ "rand", @@ -97,7 +99,6 @@ test-utils = [ "reth-chainspec/test-utils", "reth-primitives/test-utils", "reth-provider/test-utils", - "revm/test-utils", "reth-primitives-traits/test-utils", ] arbitrary = [ @@ -110,9 +111,10 @@ arbitrary = [ "alloy-eips/arbitrary", "alloy-primitives/arbitrary", "bitflags/arbitrary", - "revm/arbitrary", "reth-primitives-traits/arbitrary", "smallvec/arbitrary", + "revm-interpreter/arbitrary", + "revm-primitives/arbitrary" ] [[bench]] diff --git a/crates/transaction-pool/src/validate/eth.rs b/crates/transaction-pool/src/validate/eth.rs index 998de5ffb..bc26014f4 100644 --- a/crates/transaction-pool/src/validate/eth.rs +++ b/crates/transaction-pool/src/validate/eth.rs @@ -18,16 +18,12 @@ use alloy_consensus::{ }, BlockHeader, }; -use alloy_eips::eip4844::MAX_BLOBS_PER_BLOCK; +use alloy_eips::eip4844::{env_settings::EnvKzgSettings, MAX_BLOBS_PER_BLOCK}; use reth_chainspec::{ChainSpec, EthereumHardforks}; use reth_primitives::{InvalidTransactionError, SealedBlock}; use reth_primitives_traits::GotExpected; use reth_storage_api::{AccountReader, StateProviderFactory}; use reth_tasks::TaskSpawner; -use revm::{ - interpreter::gas::validate_initial_tx_gas, - primitives::{EnvKzgSettings, SpecId}, -}; use std::{ marker::PhantomData, sync::{atomic::AtomicBool, Arc}, @@ -807,6 +803,7 @@ pub fn ensure_intrinsic_gas( transaction: &T, fork_tracker: &ForkTracker, ) -> Result<(), InvalidPoolTransactionError> { + use revm_primitives::SpecId; let spec_id = if fork_tracker.is_prague_activated() { SpecId::PRAGUE } else if fork_tracker.is_shanghai_activated() { @@ -815,7 +812,7 @@ pub fn ensure_intrinsic_gas( SpecId::MERGE }; - let gas_after_merge = validate_initial_tx_gas( + let gas_after_merge = revm_interpreter::gas::validate_initial_tx_gas( spec_id, transaction.input(), transaction.is_create(),