Skip to content

Commit

Permalink
Merge pull request #953 from qinglin89/fix-evm
Browse files Browse the repository at this point in the history
correct logic for eip check of NewEVMInterpreter
  • Loading branch information
brilliant-lx authored Jun 24, 2022
2 parents 6ec6eda + 0137f20 commit 128977c
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions core/vm/interpreter.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,13 +122,16 @@ func NewEVMInterpreter(evm *EVM, cfg Config) *EVMInterpreter {
default:
jt = frontierInstructionSet
}
for i, eip := range cfg.ExtraEips {
var extraEips []int
for _, eip := range cfg.ExtraEips {
if err := EnableEIP(eip, &jt); err != nil {
// Disable it, so caller can check if it's activated or not
cfg.ExtraEips = append(cfg.ExtraEips[:i], cfg.ExtraEips[i+1:]...)
log.Error("EIP activation failed", "eip", eip, "error", err)
} else {
extraEips = append(extraEips, eip)
}
}
cfg.ExtraEips = extraEips
cfg.JumpTable = jt
}
evmInterpreter := EVMInterpreterPool.Get().(*EVMInterpreter)
Expand Down

0 comments on commit 128977c

Please sign in to comment.