fix(op-rpc): l2 withdrawals root not included in debug exec witness (#16062)

This commit is contained in:
Emilia Hane
2025-05-05 12:42:30 +02:00
committed by GitHub
parent 698e9f05db
commit bdbefd0003

View File

@@ -24,7 +24,7 @@ use reth_evm::{
use reth_execution_types::ExecutionOutcome;
use reth_optimism_evm::OpNextBlockEnvAttributes;
use reth_optimism_forks::OpHardforks;
use reth_optimism_primitives::transaction::OpTransaction;
use reth_optimism_primitives::{transaction::OpTransaction, ADDRESS_L2_TO_L1_MESSAGE_PASSER};
use reth_optimism_txpool::{
interop::{is_valid_interop, MaybeInteropTransaction},
OpPooledTx,
@@ -381,6 +381,12 @@ impl<Txs> OpBuilder<'_, Txs> {
ctx.execute_sequencer_transactions(&mut builder)?;
builder.into_executor().apply_post_execution_changes()?;
if ctx.chain_spec.is_isthmus_active_at_timestamp(ctx.attributes().timestamp()) {
// force load `L2ToL1MessagePasser.sol` so l2 withdrawals root can be computed even if
// no l2 withdrawals in block
_ = db.load_cache_account(ADDRESS_L2_TO_L1_MESSAGE_PASSER)?;
}
let ExecutionWitnessRecord { hashed_state, codes, keys, lowest_block_number: _ } =
ExecutionWitnessRecord::from_executed_state(&db);
let state = state_provider.witness(Default::default(), hashed_state)?;