@@ -13,13 +13,15 @@ import (
1313 "github.com/ava-labs/libevm/core/vm"
1414 "github.com/ava-labs/libevm/libevm"
1515 "github.com/ava-labs/libevm/libevm/legacy"
16+ "github.com/holiman/uint256"
1617
1718 "github.com/ava-labs/avalanchego/graft/coreth/nativeasset"
1819 "github.com/ava-labs/avalanchego/graft/coreth/params/extras"
1920 "github.com/ava-labs/avalanchego/graft/coreth/plugin/evm/customheader"
2021 "github.com/ava-labs/avalanchego/graft/coreth/precompile/contract"
2122 "github.com/ava-labs/avalanchego/graft/coreth/precompile/modules"
2223 "github.com/ava-labs/avalanchego/graft/coreth/precompile/precompileconfig"
24+ "github.com/ava-labs/avalanchego/graft/evm/constants"
2325 "github.com/ava-labs/avalanchego/snow"
2426 "github.com/ava-labs/avalanchego/utils/set"
2527 "github.com/ava-labs/avalanchego/vms/evm/predicate"
@@ -63,6 +65,20 @@ func (r RulesExtra) MinimumGasConsumption(limit uint64) uint64 {
6365 return (ethparams.NOOPHooks {}).MinimumGasConsumption (limit )
6466}
6567
68+ // AfterExecutingTransaction credits the base fee to [constants.BlackholeAddr].
69+ // The C-Chain has historically credited the full fee (base + priority) to the
70+ // blackhole address, but libevm's state transition only credits the priority
71+ // fee to the coinbase (the blackhole address) and discards the base fee.
72+ func (RulesExtra ) AfterExecutingTransaction (sdb libevm.StateDB , baseFee * big.Int , gasUsed uint64 ) {
73+ if baseFee == nil {
74+ return
75+ }
76+ burned := new (uint256.Int ).SetUint64 (gasUsed )
77+ bf := uint256 .MustFromBig (baseFee )
78+ burned .Mul (burned , bf )
79+ sdb .AddBalance (constants .BlackholeAddr , burned )
80+ }
81+
6682// AccessListGas computes the intrinsic gas for an access list.
6783// When predicaters exist, it calculates gas per-tuple, delegating to predicate
6884// contracts for addresses that have them. Otherwise, it returns override=false
0 commit comments