From 30195e88eef72dbb5c06f379846228a8dbffe62a Mon Sep 17 00:00:00 2001 From: Daniel Liu Date: Tue, 11 Feb 2025 18:42:24 +0800 Subject: [PATCH] core/vm: enable cancun instruction set --- common/constants.devnet.go | 2 +- core/vm/interpreter.go | 2 ++ core/vm/jump_table.go | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/common/constants.devnet.go b/common/constants.devnet.go index 7733a879a9..c6e919f576 100644 --- a/common/constants.devnet.go +++ b/common/constants.devnet.go @@ -29,7 +29,7 @@ var DevnetConstant = constant{ tipXDCXMinerDisable: big.NewInt(0), tipXDCXReceiverDisable: big.NewInt(0), eip1559Block: big.NewInt(0), - cancunBlock: big.NewInt(9999999999), + cancunBlock: big.NewInt(1702800), trc21IssuerSMCTestNet: HexToAddress("0x0E2C88753131CE01c7551B726b28BFD04e44003F"), trc21IssuerSMC: HexToAddress("0x8c0faeb5C6bEd2129b8674F262Fd45c4e9468bee"), diff --git a/core/vm/interpreter.go b/core/vm/interpreter.go index 4b622f44d9..c60c073aa3 100644 --- a/core/vm/interpreter.go +++ b/core/vm/interpreter.go @@ -56,6 +56,8 @@ func NewEVMInterpreter(evm *EVM) *EVMInterpreter { // If jump table was not initialised we set the default one. var table *JumpTable switch { + case evm.chainRules.IsCancun: + table = &cancunInstructionSet case evm.chainRules.IsEIP1559: table = &eip1559InstructionSet case evm.chainRules.IsShanghai: diff --git a/core/vm/jump_table.go b/core/vm/jump_table.go index 60fe63ef4f..a32a787a4e 100644 --- a/core/vm/jump_table.go +++ b/core/vm/jump_table.go @@ -57,6 +57,7 @@ var ( mergeInstructionSet = newMergeInstructionSet() shanghaiInstructionSet = newShanghaiInstructionSet() eip1559InstructionSet = newEip1559InstructionSet() + cancunInstructionSet = newCancunInstructionSet() ) // JumpTable contains the EVM opcodes supported at a given fork.