Skip to content

Commit

Permalink
Merge pull request #19 from vulcanize/calc_gas_limit
Browse files Browse the repository at this point in the history
Calc gas limit
  • Loading branch information
i-norden authored Dec 11, 2019
2 parents 7842864 + 3187d3f commit d15006b
Show file tree
Hide file tree
Showing 17 changed files with 184 additions and 52 deletions.
2 changes: 1 addition & 1 deletion accounts/abi/bind/backends/simulated.go
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ func (b *SimulatedBackend) callContract(ctx context.Context, call ethereum.CallM
gaspool := new(core.GasPool).AddGas(math.MaxUint64)
var gp1559 *core.GasPool
if b.config.IsEIP1559(block.Number()) {
gp1559 = new(core.GasPool).AddGas(params.MaxGasEIP1559)
gp1559 = new(core.GasPool).AddGas(math.MaxUint64)
}

return core.NewStateTransition(vmenv, msg, gaspool, gp1559).TransitionDb()
Expand Down
13 changes: 9 additions & 4 deletions cmd/geth/retesteth.go
Original file line number Diff line number Diff line change
Expand Up @@ -491,11 +491,16 @@ func (api *RetestethAPI) mineBlock() error {
if api.chainConfig.DAOForkSupport && api.chainConfig.DAOForkBlock != nil && api.chainConfig.DAOForkBlock.Cmp(header.Number) == 0 {
misc.ApplyDAOHardFork(statedb)
}
gasPool := new(core.GasPool).AddGas(header.GasLimit)

var gp1559 *core.GasPool
var gasPool *core.GasPool
if api.chainConfig.IsEIP1559(header.Number) {
gp1559 = new(core.GasPool).AddGas(params.MaxGasEIP1559)
gasPool = new(core.GasPool).AddGas(params.MaxGasEIP1559 - header.GasLimit)
gp1559 = new(core.GasPool).AddGas(header.GasLimit)
} else {
gasPool = new(core.GasPool).AddGas(header.GasLimit)
}

txCount := 0
var txs []*types.Transaction
var receipts []*types.Receipt
Expand Down Expand Up @@ -664,7 +669,7 @@ func (api *RetestethAPI) AccountRange(ctx context.Context,
vmenv := vm.NewEVM(context, statedb, api.blockchain.Config(), vm.Config{})
var gp1559 *core.GasPool
if vmenv.ChainConfig().IsEIP1559(block.Number()) {
gp1559 = new(core.GasPool).AddGas(params.MaxGasEIP1559)
gp1559 = new(core.GasPool).AddGas(tx.Gas())
}
if _, _, _, err := core.ApplyMessage(vmenv, msg, new(core.GasPool).AddGas(tx.Gas()), gp1559); err != nil {
return AccountRangeResult{}, fmt.Errorf("transaction %#x failed: %v", tx.Hash(), err)
Expand Down Expand Up @@ -781,7 +786,7 @@ func (api *RetestethAPI) StorageRangeAt(ctx context.Context,
vmenv := vm.NewEVM(context, statedb, api.blockchain.Config(), vm.Config{})
var gp1559 *core.GasPool
if vmenv.ChainConfig().IsEIP1559(block.Number()) {
gp1559 = new(core.GasPool).AddGas(params.MaxGasEIP1559)
gp1559 = new(core.GasPool).AddGas(tx.Gas())
}
if _, _, _, err := core.ApplyMessage(vmenv, msg, new(core.GasPool).AddGas(tx.Gas()), gp1559); err != nil {
return StorageRangeResult{}, fmt.Errorf("transaction %#x failed: %v", tx.Hash(), err)
Expand Down
10 changes: 5 additions & 5 deletions consensus/ethash/consensus.go
Original file line number Diff line number Diff line change
Expand Up @@ -260,8 +260,8 @@ func (ethash *Ethash) verifyHeader(chain consensus.ChainReader, header, parent *
return fmt.Errorf("invalid difficulty: have %v, want %v", header.Difficulty, expected)
}

// If we have not reached the EIP1559 finalization block we need to verify that the GasLimit field is valid
if !chain.Config().IsEIP1559Finalized(header.Number) {
// If EIP1559 is not active we need to verify that the GasLimit field is valid according to the legacy rules
if !chain.Config().IsEIP1559(header.Number) {
// Verify that the gas limit is <= 2^63-1
cap := uint64(0x7fffffffffffffff)
if header.GasLimit > cap {
Expand All @@ -282,9 +282,9 @@ func (ethash *Ethash) verifyHeader(chain consensus.ChainReader, header, parent *
if uint64(diff) >= limit || header.GasLimit < params.MinGasLimit {
return fmt.Errorf("invalid gas limit: have %d, want %d += %d", header.GasLimit, parent.GasLimit, limit)
}
} else if header.GasLimit != 0 {
// If EIP1559 is finalized, GasLimit should be 0
return errGasLimitSet
// If EIP1559 is active, assert that the GasLimit field is valid according to the EIP1559 rules
} else if err := misc.VerifyEIP1559GasLimit(chain.Config(), header); err != nil {
return err
}

// Verify that the block number is parent's +1
Expand Down
34 changes: 27 additions & 7 deletions consensus/misc/forks.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,12 @@ import (
)

var (
errInvalidInitialBaseFee = fmt.Errorf("initial BaseFee must equal %d", params.EIP1559InitialBaseFee)
errInvalidBaseFee = errors.New("invalid BaseFee")
errMissingParentBaseFee = errors.New("parent header is missing BaseFee")
errMissingBaseFee = errors.New("current header is missing BaseFee")
errHaveBaseFee = fmt.Errorf("BaseFee should not be set before block %d", params.EIP1559ForkBlockNumber)
errInvalidInitialBaseFee = fmt.Errorf("initial BaseFee must equal %d", params.EIP1559InitialBaseFee)
errInvalidBaseFee = errors.New("invalid BaseFee")
errMissingParentBaseFee = errors.New("parent header is missing BaseFee")
errMissingBaseFee = errors.New("current header is missing BaseFee")
errHaveBaseFee = fmt.Errorf("BaseFee should not be set before block %d", params.EIP1559ForkBlockNumber)
errInvalidEIP1559FinalizedGasLimit = fmt.Errorf("after EIP1559 finalization, GasLimit must equal %d", params.MaxGasEIP1559)
)

// VerifyForkHashes verifies that blocks conforming to network hard-forks do have
Expand Down Expand Up @@ -61,7 +62,7 @@ func VerifyEIP1559BaseFee(config *params.ChainConfig, header, parent *types.Head
}
return nil
}
// Verify the BaseFee is valid if we are past the EIP1559 initialization block
// Verify the BaseFee is valid if we are past the EIP1559 activation block
if config.IsEIP1559(header.Number) {
// A valid BASEFEE is one such that abs(BASEFEE - PARENT_BASEFEE) <= max(1, PARENT_BASEFEE // BASEFEE_MAX_CHANGE_DENOMINATOR)
if parent.BaseFee == nil {
Expand All @@ -83,9 +84,28 @@ func VerifyEIP1559BaseFee(config *params.ChainConfig, header, parent *types.Head
}
return nil
}
// If we are before the EIP1559 initialization block the current and parent BaseFees should be nil
// If we are before the EIP1559 activation block the current and parent BaseFees should be nil
if header.BaseFee != nil || parent.BaseFee != nil {
return errHaveBaseFee
}
return nil
}

// VerifyEIP1559GasLimit verifies that the header.GasLimit field is valid for the current block height
// Only call this after activation has been confirmed (config.IsEIP1559(header.Number) == true)
func VerifyEIP1559GasLimit(config *params.ChainConfig, header *types.Header) error {
// If EIP1559 has been finalized then header.GasLimit should be equal to the MaxGasEIP1559 (entire limit is in EIP1559 pool)
if config.IsEIP1559Finalized(header.Number) {
if header.GasLimit != params.MaxGasEIP1559 {
return errInvalidEIP1559FinalizedGasLimit
}
return nil
}
// Else if we are between activation and finalization, header.GasLimit must be valid based on the decay function
numOfIncrements := new(big.Int).Sub(header.Number, config.EIP1559Block).Uint64()
expectedGasLimit := (params.MaxGasEIP1559 / 2) + (numOfIncrements * params.EIP1559GasIncrementAmount)
if header.GasLimit != expectedGasLimit {
return fmt.Errorf("invalid GasLimit: have %d, need %d", header.GasLimit, expectedGasLimit)
}
return nil
}
65 changes: 65 additions & 0 deletions core/block_validator.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ package core

import (
"fmt"
"math/big"

"github.com/ethereum/go-ethereum/common"

"github.com/ethereum/go-ethereum/consensus"
"github.com/ethereum/go-ethereum/core/state"
Expand Down Expand Up @@ -137,3 +140,65 @@ func CalcGasLimit(parent *types.Block, gasFloor, gasCeil uint64) uint64 {
}
return limit
}

func CalcGasLimitAndBaseFee(config *params.ChainConfig, parent *types.Block, gasFloor, gasCeil uint64) (uint64, *big.Int) {
if !config.IsEIP1559(new(big.Int).Add(parent.Number(), common.Big1)) {
return CalcGasLimit(parent, gasFloor, gasCeil), nil
}
return calcGasLimitAndBaseFee(config, parent)
}

// start at 50 : 50 and then shift to 0 : 100
// calcGasLimitAndBaseFee returns the EIP1559GasLimit and the BaseFee
// The GasLimit for the legacy pool is (params.MaxGasEIP1559 - EIP1559GasLimit)
func calcGasLimitAndBaseFee(config *params.ChainConfig, parent *types.Block) (uint64, *big.Int) {
// panic if we do not have a block number set for EIP1559 activation
if config.EIP1559Block == nil {
panic("chain config is missing EIP1559Block")
}
height := new(big.Int).Add(parent.Number(), common.Big1)

// If we are at the block of EIP1559 activation then the BaseFee is set to the initial value
// and the GasLimit is split evenly between the two pools
if config.EIP1559Block.Cmp(height) == 0 {
return params.MaxGasEIP1559 / 2, new(big.Int).SetUint64(params.EIP1559InitialBaseFee)
}

/*
Otherwise, calculate the BaseFee
As a default strategy, miners set BASEFEE as follows. Let delta = block.gas_used - TARGET_GASUSED (possibly negative).
Set BASEFEE = PARENT_BASEFEE + PARENT_BASEFEE * delta // TARGET_GASUSED // BASEFEE_MAX_CHANGE_DENOMINATOR,
clamping this result inside of the allowable bounds if needed (with the parameter setting above clamping will not be required).
*/

delta := new(big.Int).Sub(new(big.Int).SetUint64(parent.GasUsed()), new(big.Int).SetUint64(params.TargetGasUsed))
mul := new(big.Int).Mul(parent.BaseFee(), delta)
div := new(big.Int).Div(mul, new(big.Int).SetUint64(params.TargetGasUsed))
div2 := new(big.Int).Div(div, new(big.Int).SetUint64(params.BaseFeeMaxChangeDenominator))
baseFee := new(big.Int).Add(parent.BaseFee(), div2)

// Panic is the BaseFee is not valid
// A valid BASEFEE is one such that abs(BASEFEE - PARENT_BASEFEE) <= max(1, PARENT_BASEFEE // BASEFEE_MAX_CHANGE_DENOMINATOR)
diff := new(big.Int).Sub(baseFee, parent.BaseFee())
if diff.Sign() < 0 {
diff.Neg(diff)
}
max := new(big.Int).Div(parent.BaseFee(), new(big.Int).SetUint64(params.BaseFeeMaxChangeDenominator))
if max.Cmp(common.Big1) < 0 {
max = common.Big1
}
if diff.Cmp(max) > 0 {
panic("invalid BaseFee")
}

// If EIP1559 is finalized, our limit for the EIP1559 pool is the entire max limit
if config.IsEIP1559Finalized(new(big.Int).Add(parent.Number(), common.Big1)) {
return params.MaxGasEIP1559, baseFee
}

// Otherwise calculate how much of the MaxGasEIP1559 serves as the limit for the EIP1559 pool
// The GasLimit for the legacy pool is (params.MaxGasEIP1559 - eip1559GasLimit)
numOfIncrements := new(big.Int).Sub(height, config.EIP1559Block).Uint64()
eip1559GasLimit := (params.MaxGasEIP1559 / 2) + (numOfIncrements * params.EIP1559GasIncrementAmount)
return eip1559GasLimit, baseFee
}
19 changes: 14 additions & 5 deletions core/chain_makers.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,16 @@ func (b *BlockGen) SetCoinbase(addr common.Address) {
panic("coinbase can only be set once")
}
b.header.Coinbase = addr
b.gasPool = new(GasPool).AddGas(b.header.GasLimit)
// If EIP1559 is initialized then header.GasLimit is for the EIP1559 pool
// and the difference between the MaxGasEIP1559 and header.GasLimit is the limit for the legacy pool
// Once EIP1559 is finalized the header.GasLimit is the entire MaxGasEIP1559
// so no gas will be allocated to the legacy pool
if b.config.IsEIP1559(b.header.Number) {
b.gasPool = new(GasPool).AddGas(params.MaxGasEIP1559 - b.header.GasLimit)
b.gasPool1559 = new(GasPool).AddGas(b.header.GasLimit)
} else { // If we are before EIP1559 activation then we use header.GasLimit for the legacy pool
b.gasPool = new(GasPool).AddGas(b.header.GasLimit)
}
}

// SetExtra sets the extra data field of the generated block.
Expand Down Expand Up @@ -103,9 +112,7 @@ func (b *BlockGen) AddTxWithChain(bc *BlockChain, tx *types.Transaction) {
if b.gasPool == nil {
b.SetCoinbase(common.Address{})
}
if b.gasPool1559 == nil && b.config.IsEIP1559(b.header.Number) {
b.gasPool1559 = new(GasPool).AddGas(params.MaxGasEIP1559)
}

b.statedb.Prepare(tx.Hash(), common.Hash{}, len(b.txs))
receipt, err := ApplyTransaction(b.config, bc, &b.header.Coinbase, b.gasPool, b.gasPool1559, b.statedb, b.header, tx, &b.header.GasUsed, vm.Config{})
if err != nil {
Expand Down Expand Up @@ -252,6 +259,7 @@ func makeHeader(chain consensus.ChainReader, parent *types.Block, state *state.S
time = parent.Time() + 10 // block time is fixed at 10 seconds
}

gasLimit, baseFee := CalcGasLimitAndBaseFee(chain.Config(), parent, parent.GasLimit(), parent.GasLimit())
return &types.Header{
Root: state.IntermediateRoot(chain.Config().IsEIP158(parent.Number())),
ParentHash: parent.Hash(),
Expand All @@ -262,7 +270,8 @@ func makeHeader(chain consensus.ChainReader, parent *types.Block, state *state.S
Difficulty: parent.Difficulty(),
UncleHash: parent.UncleHash(),
}),
GasLimit: CalcGasLimit(parent, parent.GasLimit(), parent.GasLimit()),
GasLimit: gasLimit,
BaseFee: baseFee,
Number: new(big.Int).Add(parent.Number(), common.Big1),
Time: time,
}
Expand Down
11 changes: 9 additions & 2 deletions core/state_prefetcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,18 @@ func newStatePrefetcher(config *params.ChainConfig, bc *BlockChain, engine conse
func (p *statePrefetcher) Prefetch(block *types.Block, statedb *state.StateDB, cfg vm.Config, interrupt *uint32) {
var (
header = block.Header()
gaspool = new(GasPool).AddGas(block.GasLimit())
gaspool *GasPool
gp1559 *GasPool
)
// If EIP1559 is initialized then header.GasLimit is for the EIP1559 pool
// and the difference between the MaxGasEIP1559 and header.GasLimit is the limit for the legacy pool
// Once EIP1559 is finalized the header.GasLimit is the entire MaxGasEIP1559
// so no gas will be allocated to the legacy pool
if p.config.IsEIP1559(block.Number()) {
gp1559 = new(GasPool).AddGas(params.MaxGasEIP1559)
gaspool = new(GasPool).AddGas(params.MaxGasEIP1559 - block.GasLimit())
gp1559 = new(GasPool).AddGas(block.GasLimit())
} else { // If we are before EIP1559 activation then we use header.GasLimit for the legacy pool
gaspool = new(GasPool).AddGas(block.GasLimit())
}
// Iterate over and process the individual transactions
for i, tx := range block.Transactions() {
Expand Down
12 changes: 10 additions & 2 deletions core/state_processor.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,20 @@ func (p *StateProcessor) Process(block *types.Block, statedb *state.StateDB, cfg
usedGas = new(uint64)
header = block.Header()
allLogs []*types.Log
gp = new(GasPool).AddGas(block.GasLimit())
gp *GasPool
gp1559 *GasPool
)
// If EIP1559 is initialized then header.GasLimit is for the EIP1559 pool
// and the difference between the MaxGasEIP1559 and header.GasLimit is the limit for the legacy pool
// Once EIP1559 is finalized the header.GasLimit is the entire MaxGasEIP1559
// so no gas will be allocated to the legacy pool
if p.config.IsEIP1559(block.Number()) {
gp1559 = new(GasPool).AddGas(params.MaxGasEIP1559)
gp = new(GasPool).AddGas(params.MaxGasEIP1559 - block.GasLimit())
gp1559 = new(GasPool).AddGas(block.GasLimit())
} else { // If we are before EIP1559 activation then we use header.GasLimit for the legacy pool
gp = new(GasPool).AddGas(block.GasLimit())
}

// Mutate the block and state according to any hard-fork specs
if p.config.DAOForkSupport && p.config.DAOForkBlock != nil && p.config.DAOForkBlock.Cmp(block.Number()) == 0 {
misc.ApplyDAOHardFork(statedb)
Expand Down
4 changes: 2 additions & 2 deletions core/state_transition.go
Original file line number Diff line number Diff line change
Expand Up @@ -223,15 +223,15 @@ func (st *StateTransition) preCheck() error {
if st.evm.ChainConfig().IsEIP1559Finalized(st.evm.BlockNumber) && !st.isEIP1559 {
return ErrTxNotEIP1559
}
// If we are before the EIP1559 initialization block, throw an error if we have EIP1559 fields or do not have a GasPrice
// If we are before the EIP1559 activation block, throw an error if we have EIP1559 fields or do not have a GasPrice
if !st.evm.ChainConfig().IsEIP1559(st.evm.BlockNumber) && (st.msg.GasPremium() != nil || st.msg.FeeCap() != nil || st.gp1559 != nil || st.evm.BaseFee != nil || st.msg.GasPrice() == nil) {
return ErrTxIsEIP1559
}
// If transaction has both legacy and EIP1559 fields, throw an error
if (st.msg.GasPremium() != nil || st.msg.FeeCap() != nil) && st.msg.GasPrice() != nil {
return ErrTxSetsLegacyAndEIP1559Fields
}
// We need a BaseFee if we are past EIP1559 initialization
// We need a BaseFee if we are past EIP1559 activation
if st.evm.ChainConfig().IsEIP1559(st.evm.BlockNumber) && st.evm.BaseFee == nil {
return ErrNoBaseFee
}
Expand Down
4 changes: 2 additions & 2 deletions core/tx_pool.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,15 +81,15 @@ var (
// and the input transaction does not conform to with EIP1559
ErrTxNotEIP1559 = fmt.Errorf("after block %d EIP1559 is finalized and transactions must contain a GasPremium and FeeCap and not contain a GasPrice", params.EIP1559ForkFinalizedBlockNumber)

// ErrTxIsEIP1559 is returned if we have not reached the EIP1559 initialization block height
// ErrTxIsEIP1559 is returned if we have not reached the EIP1559 activation block height
// and the input transaction is not of the legacy type
ErrTxIsEIP1559 = fmt.Errorf("before block %d EIP1559 is not activated and transactions must contain a GasPrice and not contain a GasPremium or FeeCap", params.EIP1559ForkBlockNumber)

// ErrTxSetsLegacyAndEIP1559Fields is returned if a transaction attempts to set
// both legacy (GasPrice) and EIP1559 (GasPremium and FeeCap) fields
ErrTxSetsLegacyAndEIP1559Fields = errors.New("transaction sets both legacy and EIP1559 fields")

// ErrNoBaseFee is returned if we are past the EIP1559 initialization block but
// ErrNoBaseFee is returned if we are past the EIP1559 activation block but
// the current header does not provide a BaseFee
ErrNoBaseFee = errors.New("current header does not provide the BaseFee needed to process EIP1559 transactions")

Expand Down
10 changes: 4 additions & 6 deletions eth/api_tracer.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@ import (
"sync"
"time"

"github.com/ethereum/go-ethereum/params"

"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common/hexutil"
"github.com/ethereum/go-ethereum/core"
Expand Down Expand Up @@ -505,7 +503,7 @@ func (api *PrivateDebugAPI) traceBlock(ctx context.Context, block *types.Block,
vmctx := core.NewEVMContext(msg, block.Header(), api.eth.blockchain, nil)

if api.eth.blockchain.Config().IsEIP1559(block.Number()) {
gp1559 = new(core.GasPool).AddGas(params.MaxGasEIP1559)
gp1559 = new(core.GasPool).AddGas(msg.Gas())
}
vmenv := vm.NewEVM(vmctx, statedb, api.eth.blockchain.Config(), vm.Config{})
if _, _, _, err := core.ApplyMessage(vmenv, msg, new(core.GasPool).AddGas(msg.Gas()), gp1559); err != nil {
Expand Down Expand Up @@ -604,7 +602,7 @@ func (api *PrivateDebugAPI) standardTraceBlockToFile(ctx context.Context, block
// Execute the transaction and flush any traces to disk
vmenv := vm.NewEVM(vmctx, statedb, api.eth.blockchain.Config(), vmConf)
if api.eth.blockchain.Config().IsEIP1559(block.Number()) {
gp1559 = new(core.GasPool).AddGas(params.MaxGasEIP1559)
gp1559 = new(core.GasPool).AddGas(msg.Gas())
}
_, _, _, err = core.ApplyMessage(vmenv, msg, new(core.GasPool).AddGas(msg.Gas()), gp1559)
if writer != nil {
Expand Down Expand Up @@ -740,7 +738,7 @@ func (api *PrivateDebugAPI) traceTx(ctx context.Context, message core.Message, v
gp1559 *core.GasPool
)
if api.eth.blockchain.Config().IsEIP1559(vmctx.BlockNumber) {
gp1559 = new(core.GasPool).AddGas(params.MaxGasEIP1559)
gp1559 = new(core.GasPool).AddGas(message.Gas())
}
switch {
case config != nil && config.Tracer != nil:
Expand Down Expand Up @@ -826,7 +824,7 @@ func (api *PrivateDebugAPI) computeTxEnv(blockHash common.Hash, txIndex int, ree
}
var gp1559 *core.GasPool
if api.eth.blockchain.Config().IsEIP1559(block.Number()) {
gp1559 = new(core.GasPool).AddGas(params.MaxGasEIP1559)
gp1559 = new(core.GasPool).AddGas(tx.Gas())
}
// Not yet the searched for transaction, execute on top of the current state
vmenv := vm.NewEVM(context, statedb, api.eth.blockchain.Config(), vm.Config{})
Expand Down
2 changes: 1 addition & 1 deletion eth/tracers/tracers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ func TestCallTracer(t *testing.T) {
}
var gp1559 *core.GasPool
if test.Genesis.Config.IsEIP1559(context.BlockNumber) {
gp1559 = new(core.GasPool).AddGas(params.MaxGasEIP1559)
gp1559 = new(core.GasPool).AddGas(tx.Gas())
}
st := core.NewStateTransition(evm, msg, new(core.GasPool).AddGas(tx.Gas()), gp1559)
if _, _, _, err = st.TransitionDb(); err != nil {
Expand Down
2 changes: 1 addition & 1 deletion internal/ethapi/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -882,7 +882,7 @@ func DoCall(ctx context.Context, b Backend, args CallArgs, blockNrOrHash rpc.Blo
gp := new(core.GasPool).AddGas(math.MaxUint64)
var gp1559 *core.GasPool
if evm.ChainConfig().IsEIP1559(header.Number) {
gp1559 = new(core.GasPool).AddGas(params.MaxGasEIP1559)
gp1559 = new(core.GasPool).AddGas(math.MaxUint64)
}
res, gas, failed, err := core.ApplyMessage(evm, msg, gp, gp1559)
if err := vmError(); err != nil {
Expand Down
Loading

0 comments on commit d15006b

Please sign in to comment.