mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-06-26 00:16:18 +00:00
core/vm: evm fix panic (#23047)
This commit is contained in:
parent
18bc355e89
commit
c7d49072f1
2 changed files with 6 additions and 0 deletions
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
|
|
|
|||
Loading…
Reference in a new issue