Skip to content

Commit dc19f96

Browse files
zhiqiangxublockchaindevsh
authored andcommitted
add missing calls for AccessEvents
1 parent 48cf9ac commit dc19f96

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
@@ -602,12 +602,20 @@ func (st *StateTransition) innerTransitionDb() (*ExecutionResult, error) {
602602
return nil, fmt.Errorf("optimism gas cost overflows U256: %d", gasCost)
603603
}
604604
st.state.AddBalance(params.OptimismBaseFeeRecipient, amtU256, tracing.BalanceIncreaseRewardTransactionFee)
605+
// add the OptimismBaseFeeRecipient to the witness iff base fee is greater than 0
606+
if rules.IsEIP4762 && amtU256.Sign() != 0 {
607+
st.evm.AccessEvents.AddAccount(params.OptimismBaseFeeRecipient, true)
608+
}
605609
if l1Cost := st.evm.Context.L1CostFunc(st.msg.RollupCostData, st.evm.Context.Time); l1Cost != nil {
606610
amtU256, overflow = uint256.FromBig(l1Cost)
607611
if overflow {
608612
return nil, fmt.Errorf("optimism l1 cost overflows U256: %d", l1Cost)
609613
}
610614
st.state.AddBalance(params.OptimismL1FeeRecipient, amtU256, tracing.BalanceIncreaseRewardTransactionFee)
615+
// add the OptimismL1FeeRecipient to the witness iff l1 fee is greater than 0
616+
if rules.IsEIP4762 && amtU256.Sign() != 0 {
617+
st.evm.AccessEvents.AddAccount(params.OptimismL1FeeRecipient, true)
618+
}
611619
}
612620
}
613621
}

0 commit comments

Comments
 (0)