fix blob gas awards

This commit is contained in:
Nikola Bebić‮ 2024-06-20 12:44:19 +02:00
parent ea8ada3431
commit 8cbb3beab7
2 changed files with 14 additions and 1 deletions

View file

@ -27,6 +27,11 @@ import (
"github.com/tenderly/binance-geth/rpc"
)
// Binance: SystemAddress
var (
SystemAddress = common.HexToAddress("0xffffFFFfFFffffffffffffffFfFFFfffFFFfFFfE")
)
// ChainHeaderReader defines a small collection of methods needed to access the local
// blockchain during header verification.
type ChainHeaderReader interface {

View file

@ -24,6 +24,7 @@ import (
"github.com/tenderly/binance-geth/common"
cmath "github.com/tenderly/binance-geth/common/math"
"github.com/tenderly/binance-geth/consensus"
"github.com/tenderly/binance-geth/core/types"
"github.com/tenderly/binance-geth/core/vm"
"github.com/tenderly/binance-geth/params"
@ -440,7 +441,14 @@ func (st *StateTransition) TransitionDb() (*ExecutionResult, error) {
} else {
fee := new(big.Int).SetUint64(st.gasUsed())
fee.Mul(fee, effectiveTip)
st.state.AddBalance(st.evm.Context.Coinbase, fee)
st.state.AddBalance(consensus.SystemAddress, fee)
// add extra blob fee reward
if rules.IsCancun {
blobFee := new(big.Int).SetUint64(st.blobGasUsed())
blobFee.Mul(blobFee, st.evm.Context.BlobBaseFee)
st.state.AddBalance(consensus.SystemAddress, blobFee)
}
}
return &ExecutionResult{