Skip to content

Commit

Permalink
force activation of EIP-6780 (#338)
Browse files Browse the repository at this point in the history
* force activation of EIP-6780

* rework the PR in a more manageable way
  • Loading branch information
gballet committed May 8, 2024
1 parent b92212b commit f83a94d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion core/vm/interpreter.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ func NewEVMInterpreter(evm *EVM) *EVMInterpreter {
switch {
case evm.chainRules.IsPrague:
// TODO replace with prooper instruction set when fork is specified
table = &shanghaiInstructionSet
table = &pragueInstructionSet
case evm.chainRules.IsCancun:
table = &cancunInstructionSet
case evm.chainRules.IsShanghai:
Expand Down
7 changes: 7 additions & 0 deletions core/vm/jump_table.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ var (
mergeInstructionSet = newMergeInstructionSet()
shanghaiInstructionSet = newShanghaiInstructionSet()
cancunInstructionSet = newCancunInstructionSet()
pragueInstructionSet = newPragueInstructionSet()
)

// JumpTable contains the EVM opcodes supported at a given fork.
Expand All @@ -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)
Expand Down

0 comments on commit f83a94d

Please sign in to comment.