diff --git a/core/vm/runtime/env.go b/core/vm/runtime/env.go index 89d44ad833113..d525e8b312a55 100644 --- a/core/vm/runtime/env.go +++ b/core/vm/runtime/env.go @@ -35,6 +35,7 @@ func NewEnv(cfg *Config) *vm.EVM { Time: cfg.Time, Difficulty: cfg.Difficulty, GasLimit: cfg.GasLimit, + BaseFee: cfg.BaseFee, } return vm.NewEVM(blockContext, txContext, cfg.State, nil, cfg.ChainConfig, cfg.EVMConfig) diff --git a/core/vm/runtime/runtime.go b/core/vm/runtime/runtime.go index db5a79ae2f3dc..14964385c2ded 100644 --- a/core/vm/runtime/runtime.go +++ b/core/vm/runtime/runtime.go @@ -43,6 +43,7 @@ type Config struct { Value *big.Int Debug bool EVMConfig vm.Config + BaseFee *big.Int State *state.StateDB GetHashFn func(n uint64) common.Hash @@ -68,6 +69,7 @@ func setDefaults(cfg *Config) { LondonBlock: new(big.Int), MergeBlock: new(big.Int), ShanghaiBlock: new(big.Int), + Eip1559Block: new(big.Int), } } @@ -94,6 +96,9 @@ func setDefaults(cfg *Config) { return common.BytesToHash(crypto.Keccak256([]byte(new(big.Int).SetUint64(n).String()))) } } + if cfg.BaseFee == nil { + cfg.BaseFee = big.NewInt(params.InitialBaseFee) + } } // Execute executes the code using the input as call data during the execution.