force activation of EIP-6780 (#338)

* force activation of EIP-6780

* rework the PR in a more manageable way
This commit is contained in:
Guillaume Ballet 2024-01-26 11:14:52 +01:00
parent f46632148c
commit 7757a53d47
2 changed files with 8 additions and 1 deletions

View file

@ -58,7 +58,7 @@ func NewEVMInterpreter(evm *EVM) *EVMInterpreter {
switch { switch {
case evm.chainRules.IsPrague: case evm.chainRules.IsPrague:
// TODO replace with prooper instruction set when fork is specified // TODO replace with prooper instruction set when fork is specified
table = &shanghaiInstructionSet table = &pragueInstructionSet
case evm.chainRules.IsCancun: case evm.chainRules.IsCancun:
table = &cancunInstructionSet table = &cancunInstructionSet
case evm.chainRules.IsShanghai: case evm.chainRules.IsShanghai:

View file

@ -57,6 +57,7 @@ var (
mergeInstructionSet = newMergeInstructionSet() mergeInstructionSet = newMergeInstructionSet()
shanghaiInstructionSet = newShanghaiInstructionSet() shanghaiInstructionSet = newShanghaiInstructionSet()
cancunInstructionSet = newCancunInstructionSet() cancunInstructionSet = newCancunInstructionSet()
pragueInstructionSet = newPragueInstructionSet()
) )
// JumpTable contains the EVM opcodes supported at a given fork. // JumpTable contains the EVM opcodes supported at a given fork.
@ -80,6 +81,12 @@ func validate(jt JumpTable) JumpTable {
return jt return jt
} }
func newPragueInstructionSet() JumpTable {
instructionSet := newShanghaiInstructionSet()
enable6780(&instructionSet)
return validate(instructionSet)
}
func newCancunInstructionSet() JumpTable { func newCancunInstructionSet() JumpTable {
instructionSet := newShanghaiInstructionSet() instructionSet := newShanghaiInstructionSet()
enable4844(&instructionSet) // EIP-4844 (DATAHASH opcode) enable4844(&instructionSet) // EIP-4844 (DATAHASH opcode)