Skip to content

Commit e182cdd

Browse files
committed
fix e2e tests
1 parent f5e1c19 commit e182cdd

2 files changed

Lines changed: 22 additions & 13 deletions

File tree

crates/ev-revm/src/tx_env.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,11 @@ impl SponsorPayerTx for EvTxEnv {
310310

311311
impl BatchCallsTx for EvTxEnv {
312312
fn batch_calls(&self) -> Option<&[Call]> {
313-
Some(&self.calls)
313+
if self.calls.is_empty() {
314+
None
315+
} else {
316+
Some(&self.calls)
317+
}
314318
}
315319

316320
fn batch_total_value(&self) -> U256 {

crates/node/src/executor.rs

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//! Helpers to build the ev-reth executor with EV-specific hooks applied.
22
33
use alloy_consensus::{BlockHeader, Header};
4-
use alloy_eips::Decodable2718;
4+
use alloy_eips::{eip1559::INITIAL_BASE_FEE, Decodable2718};
55
use alloy_evm::{eth::spec::EthExecutorSpec, FromRecoveredTx, FromTxWithEncoded};
66
use alloy_primitives::U256;
77
use alloy_rpc_types_engine::ExecutionData;
@@ -212,22 +212,27 @@ where
212212
}
213213
});
214214

215-
let (gas_limit, basefee) = if self
216-
.chain_spec()
215+
// Calculate base fee for the next block
216+
let mut basefee = chain_spec.next_block_base_fee(parent, attributes.timestamp);
217+
218+
let mut gas_limit = attributes.gas_limit;
219+
220+
// If we are on the London fork boundary, we need to multiply the parent's gas limit by the
221+
// elasticity multiplier to get the new gas limit.
222+
if chain_spec
217223
.fork(reth_ethereum_forks::EthereumHardfork::London)
218224
.transitions_at_block(parent.number + 1)
219225
{
220-
let elasticity_multiplier = self
221-
.chain_spec()
226+
let elasticity_multiplier = chain_spec
222227
.base_fee_params_at_timestamp(attributes.timestamp)
223228
.elasticity_multiplier;
224-
(
225-
parent.gas_limit * elasticity_multiplier as u64,
226-
Some(alloy_eips::eip1559::INITIAL_BASE_FEE),
227-
)
228-
} else {
229-
(parent.gas_limit, None)
230-
};
229+
230+
// multiply the gas limit by the elasticity multiplier
231+
gas_limit *= elasticity_multiplier as u64;
232+
233+
// set the base fee to the initial base fee from the EIP-1559 spec
234+
basefee = Some(INITIAL_BASE_FEE);
235+
}
231236

232237
let block_env = BlockEnv {
233238
number: U256::from(parent.number + 1),

0 commit comments

Comments
 (0)