Skip to content

Commit

Permalink
add missing calls for AccessEvents
Browse files Browse the repository at this point in the history
  • Loading branch information
zhiqiangxu committed Oct 27, 2024
1 parent 7b56c73 commit c7e4999
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions core/state_transition.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}
}

Expand Down

0 comments on commit c7e4999

Please sign in to comment.