Skip to content

Commit 11f8343

Browse files
qinglin89shekhirin
authored andcommitted
core/vm: better handle error on eip activation check (ethereum#25131)
* core/vm: correct logic for eip check of NewEVMInterpreter * refactor
1 parent 029f4ed commit 11f8343

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

core/vm/interpreter.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,15 +90,18 @@ func NewEVMInterpreter(evm *EVM, cfg Config) *EVMInterpreter {
9090
default:
9191
cfg.JumpTable = &frontierInstructionSet
9292
}
93-
for i, eip := range cfg.ExtraEips {
93+
var extraEips []int
94+
for _, eip := range cfg.ExtraEips {
9495
copy := *cfg.JumpTable
9596
if err := EnableEIP(eip, &copy); err != nil {
9697
// Disable it, so caller can check if it's activated or not
97-
cfg.ExtraEips = append(cfg.ExtraEips[:i], cfg.ExtraEips[i+1:]...)
9898
log.Error("EIP activation failed", "eip", eip, "error", err)
99+
} else {
100+
extraEips = append(extraEips, eip)
99101
}
100102
cfg.JumpTable = &copy
101103
}
104+
cfg.ExtraEips = extraEips
102105
}
103106

104107
return &EVMInterpreter{

0 commit comments

Comments
 (0)