core/vm: define cancun + enable 1153 (tstore/tload) in cancun (#27663)

This commit is contained in:
Daniel Liu 2025-02-05 15:48:57 +08:00
parent 07fd1c64cf
commit 240de84287
2 changed files with 7 additions and 3 deletions

View file

@ -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

View file

@ -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: