From 2f765bf5a1df0a6e5a62600629f9edde67c88be2 Mon Sep 17 00:00:00 2001 From: Guillaume Ballet <3272758+gballet@users.noreply.github.com> Date: Mon, 22 Jan 2024 10:57:22 +0100 Subject: [PATCH 1/2] force activation of EIP-6780 --- core/vm/interpreter.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/core/vm/interpreter.go b/core/vm/interpreter.go index 1bc0e80dfc44..337c48847112 100644 --- a/core/vm/interpreter.go +++ b/core/vm/interpreter.go @@ -59,6 +59,9 @@ func NewEVMInterpreter(evm *EVM) *EVMInterpreter { case evm.chainRules.IsPrague: // TODO replace with prooper instruction set when fork is specified table = &shanghaiInstructionSet + if err := EnableEIP(6780, table); err != nil { + panic(err) + } case evm.chainRules.IsCancun: table = &cancunInstructionSet case evm.chainRules.IsShanghai: From f12a559f85ab01a2915ae0994f3332bd65ff2381 Mon Sep 17 00:00:00 2001 From: Guillaume Ballet <3272758+gballet@users.noreply.github.com> Date: Mon, 22 Jan 2024 11:09:54 +0100 Subject: [PATCH 2/2] rework the PR in a more manageable way --- core/vm/interpreter.go | 5 +---- core/vm/jump_table.go | 7 +++++++ 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/core/vm/interpreter.go b/core/vm/interpreter.go index 337c48847112..17b30fae1203 100644 --- a/core/vm/interpreter.go +++ b/core/vm/interpreter.go @@ -58,10 +58,7 @@ func NewEVMInterpreter(evm *EVM) *EVMInterpreter { switch { case evm.chainRules.IsPrague: // TODO replace with prooper instruction set when fork is specified - table = &shanghaiInstructionSet - if err := EnableEIP(6780, table); err != nil { - panic(err) - } + table = &pragueInstructionSet case evm.chainRules.IsCancun: table = &cancunInstructionSet case evm.chainRules.IsShanghai: diff --git a/core/vm/jump_table.go b/core/vm/jump_table.go index 0a881236f64e..5dcabe387d6f 100644 --- a/core/vm/jump_table.go +++ b/core/vm/jump_table.go @@ -57,6 +57,7 @@ var ( mergeInstructionSet = newMergeInstructionSet() shanghaiInstructionSet = newShanghaiInstructionSet() cancunInstructionSet = newCancunInstructionSet() + pragueInstructionSet = newPragueInstructionSet() ) // JumpTable contains the EVM opcodes supported at a given fork. @@ -80,6 +81,12 @@ func validate(jt JumpTable) JumpTable { return jt } +func newPragueInstructionSet() JumpTable { + instructionSet := newShanghaiInstructionSet() + enable6780(&instructionSet) + return validate(instructionSet) +} + func newCancunInstructionSet() JumpTable { instructionSet := newShanghaiInstructionSet() enable4844(&instructionSet) // EIP-4844 (DATAHASH opcode)