Skip to content

Commit c7e4999

Browse files
committed
add missing calls for AccessEvents
1 parent 7b56c73 commit c7e4999

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

core/state_transition.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -594,12 +594,20 @@ func (st *StateTransition) innerTransitionDb() (*ExecutionResult, error) {
594594
return nil, fmt.Errorf("optimism gas cost overflows U256: %d", gasCost)
595595
}
596596
st.state.AddBalance(params.OptimismBaseFeeRecipient, amtU256, tracing.BalanceIncreaseRewardTransactionFee)
597+
// add the OptimismBaseFeeRecipient to the witness iff base fee is greater than 0
598+
if rules.IsEIP4762 && amtU256.Sign() != 0 {
599+
st.evm.AccessEvents.AddAccount(params.OptimismBaseFeeRecipient, true)
600+
}
597601
if l1Cost := st.evm.Context.L1CostFunc(st.msg.RollupCostData, st.evm.Context.Time); l1Cost != nil {
598602
amtU256, overflow = uint256.FromBig(l1Cost)
599603
if overflow {
600604
return nil, fmt.Errorf("optimism l1 cost overflows U256: %d", l1Cost)
601605
}
602606
st.state.AddBalance(params.OptimismL1FeeRecipient, amtU256, tracing.BalanceIncreaseRewardTransactionFee)
607+
// add the OptimismL1FeeRecipient to the witness iff l1 fee is greater than 0
608+
if rules.IsEIP4762 && amtU256.Sign() != 0 {
609+
st.evm.AccessEvents.AddAccount(params.OptimismL1FeeRecipient, true)
610+
}
603611
}
604612
}
605613

0 commit comments

Comments
 (0)