From 31b281906637ddc867eeabaa0ab23494228d9dc1 Mon Sep 17 00:00:00 2001 From: Matthias Seitz Date: Tue, 18 Feb 2025 15:56:49 +0100 Subject: [PATCH] fix: add clear tx l1 cost back (#14564) --- crates/optimism/rpc/src/eth/block.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/crates/optimism/rpc/src/eth/block.rs b/crates/optimism/rpc/src/eth/block.rs index 83a9ce7f2..72ddfa0df 100644 --- a/crates/optimism/rpc/src/eth/block.rs +++ b/crates/optimism/rpc/src/eth/block.rs @@ -59,6 +59,11 @@ where timestamp, }; + // We must clear this cache as different L2 transactions can have different + // L1 costs. A potential improvement here is to only clear the cache if the + // new transaction input has changed, since otherwise the L1 cost wouldn't. + l1_block_info.clear_tx_l1_cost(); + Ok(OpReceiptBuilder::new( &self.inner.eth_api.provider().chain_spec(), tx,