Skip to content

Commit

Permalink
Avoid add l1Cost twice when GasFeeCap is nil (#391)
Browse files Browse the repository at this point in the history
  • Loading branch information
zhiqiangxu authored Oct 27, 2024
1 parent 7b56c73 commit c6b531b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions core/state_transition.go
Original file line number Diff line number Diff line change
Expand Up @@ -261,11 +261,11 @@ func (st *StateTransition) buyGas() error {
if st.msg.GasFeeCap != nil {
balanceCheck.SetUint64(st.msg.GasLimit)
balanceCheck = balanceCheck.Mul(balanceCheck, st.msg.GasFeeCap)
if l1Cost != nil {
balanceCheck.Add(balanceCheck, l1Cost)
}
}
balanceCheck.Add(balanceCheck, st.msg.Value)
if l1Cost != nil {
balanceCheck.Add(balanceCheck, l1Cost)
}

if st.evm.ChainConfig().IsCancun(st.evm.Context.BlockNumber, st.evm.Context.Time) {
if blobGas := st.blobGasUsed(); blobGas > 0 {
Expand Down

0 comments on commit c6b531b

Please sign in to comment.