diff --git a/consensus/consensus.go b/consensus/consensus.go index b47caf33a0..22bac9d6a8 100644 --- a/consensus/consensus.go +++ b/consensus/consensus.go @@ -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 { diff --git a/core/state_transition.go b/core/state_transition.go index 8092394f2a..56e1b6fcd5 100644 --- a/core/state_transition.go +++ b/core/state_transition.go @@ -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{