diff --git a/core/state_transition.go b/core/state_transition.go index f8b7d27565..0fe3bbac62 100644 --- a/core/state_transition.go +++ b/core/state_transition.go @@ -594,12 +594,20 @@ func (st *StateTransition) innerTransitionDb() (*ExecutionResult, error) { return nil, fmt.Errorf("optimism gas cost overflows U256: %d", gasCost) } st.state.AddBalance(params.OptimismBaseFeeRecipient, amtU256, tracing.BalanceIncreaseRewardTransactionFee) + // add the OptimismBaseFeeRecipient to the witness iff base fee is greater than 0 + if rules.IsEIP4762 && amtU256.Sign() != 0 { + st.evm.AccessEvents.AddAccount(params.OptimismBaseFeeRecipient, true) + } if l1Cost := st.evm.Context.L1CostFunc(st.msg.RollupCostData, st.evm.Context.Time); l1Cost != nil { amtU256, overflow = uint256.FromBig(l1Cost) if overflow { return nil, fmt.Errorf("optimism l1 cost overflows U256: %d", l1Cost) } st.state.AddBalance(params.OptimismL1FeeRecipient, amtU256, tracing.BalanceIncreaseRewardTransactionFee) + // add the OptimismL1FeeRecipient to the witness iff l1 fee is greater than 0 + if rules.IsEIP4762 && amtU256.Sign() != 0 { + st.evm.AccessEvents.AddAccount(params.OptimismL1FeeRecipient, true) + } } }