From 240de84287252180866f30ee37aa8ca7d4e28f72 Mon Sep 17 00:00:00 2001 From: Daniel Liu Date: Wed, 5 Feb 2025 15:48:57 +0800 Subject: [PATCH] core/vm: define cancun + enable 1153 (tstore/tload) in cancun (#27663) --- core/vm/jump_table.go | 6 ++++++ core/vm/jump_table_export.go | 4 +--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/core/vm/jump_table.go b/core/vm/jump_table.go index fc4b9b8521..6df1e80e80 100644 --- a/core/vm/jump_table.go +++ b/core/vm/jump_table.go @@ -80,6 +80,12 @@ func validate(jt JumpTable) JumpTable { return jt } +func newCancunInstructionSet() JumpTable { + instructionSet := newEip1559InstructionSet() + enable1153(&instructionSet) // EIP-1153 "Transient Storage" + return validate(instructionSet) +} + func newEip1559InstructionSet() JumpTable { instructionSet := newShanghaiInstructionSet() enable2929(&instructionSet) // Gas cost increases for state access opcodes https://eips.ethereum.org/EIPS/eip-2929 diff --git a/core/vm/jump_table_export.go b/core/vm/jump_table_export.go index 60a1340985..b86c2a0116 100644 --- a/core/vm/jump_table_export.go +++ b/core/vm/jump_table_export.go @@ -17,8 +17,6 @@ package vm import ( - "errors" - "github.com/XinFinOrg/XDPoSChain/params" ) @@ -27,7 +25,7 @@ import ( func LookupInstructionSet(rules params.Rules) (JumpTable, error) { switch { case rules.IsCancun: - return newEip1559InstructionSet(), errors.New("cancun-fork not defined yet") + return newCancunInstructionSet(), nil case rules.IsEIP1559: return newEip1559InstructionSet(), nil case rules.IsShanghai: