From 22ba0adae08019c95db25264b39c6fc135875da6 Mon Sep 17 00:00:00 2001 From: yjh Date: Wed, 3 Jan 2024 21:12:24 +0800 Subject: [PATCH] chore: simplify some features for env (#5928) --- crates/primitives/src/revm/env.rs | 17 +++-------------- crates/revm/src/processor.rs | 2 -- 2 files changed, 3 insertions(+), 16 deletions(-) diff --git a/crates/primitives/src/revm/env.rs b/crates/primitives/src/revm/env.rs index 3d890bc71e..6741d191c0 100644 --- a/crates/primitives/src/revm/env.rs +++ b/crates/primitives/src/revm/env.rs @@ -246,9 +246,6 @@ pub fn fill_tx_env( tx_env.access_list.clear(); tx_env.blob_hashes.clear(); tx_env.max_fee_per_blob_gas.take(); - - #[cfg(feature = "optimism")] - fill_op_tx_env(tx_env, transaction, envelope); } Transaction::Eip2930(tx) => { tx_env.gas_limit = tx.gas_limit; @@ -272,9 +269,6 @@ pub fn fill_tx_env( .collect(); tx_env.blob_hashes.clear(); tx_env.max_fee_per_blob_gas.take(); - - #[cfg(feature = "optimism")] - fill_op_tx_env(tx_env, transaction, envelope); } Transaction::Eip1559(tx) => { tx_env.gas_limit = tx.gas_limit; @@ -298,9 +292,6 @@ pub fn fill_tx_env( .collect(); tx_env.blob_hashes.clear(); tx_env.max_fee_per_blob_gas.take(); - - #[cfg(feature = "optimism")] - fill_op_tx_env(tx_env, transaction, envelope); } Transaction::Eip4844(tx) => { tx_env.gas_limit = tx.gas_limit; @@ -324,9 +315,6 @@ pub fn fill_tx_env( .collect(); tx_env.blob_hashes = tx.blob_versioned_hashes.clone(); tx_env.max_fee_per_blob_gas = Some(U256::from(tx.max_fee_per_blob_gas)); - - #[cfg(feature = "optimism")] - fill_op_tx_env(tx_env, transaction, envelope); } #[cfg(feature = "optimism")] Transaction::Deposit(tx) => { @@ -342,10 +330,11 @@ pub fn fill_tx_env( tx_env.data = tx.input.clone(); tx_env.chain_id = None; tx_env.nonce = None; - - fill_op_tx_env(tx_env, transaction, envelope); } } + + #[cfg(feature = "optimism")] + fill_op_tx_env(tx_env, transaction, envelope); } #[cfg(feature = "optimism")] diff --git a/crates/revm/src/processor.rs b/crates/revm/src/processor.rs index a63e493daa..594327da7a 100644 --- a/crates/revm/src/processor.rs +++ b/crates/revm/src/processor.rs @@ -462,8 +462,6 @@ impl<'a> BlockExecutor for EVMProcessor<'a> { cumulative_gas_used, // convert to reth log logs: result.into_logs().into_iter().map(into_reth_log).collect(), - #[cfg(feature = "optimism")] - deposit_nonce: None, }); }