diff --git a/core/vm/jump_table.go b/core/vm/jump_table.go index 41a89ec6b6790..e0f20ca4d6c9d 100644 --- a/core/vm/jump_table.go +++ b/core/vm/jump_table.go @@ -82,7 +82,8 @@ func validate(jt JumpTable) JumpTable { func newCancunInstructionSet() JumpTable { instructionSet := newShanghaiInstructionSet() - enable4844(&instructionSet) // BLOBHASH opcode + enable4844(&instructionSet) // EIP-4844 (DATAHASH opcode) + enable5656(&instructionSet) // EIP-5656 (MCOPY opcode) return validate(instructionSet) } diff --git a/core/vm/jump_table_export.go b/core/vm/jump_table_export.go index 9b160ad18b466..6ea47d63a281e 100644 --- a/core/vm/jump_table_export.go +++ b/core/vm/jump_table_export.go @@ -27,11 +27,11 @@ import ( func LookupInstructionSet(rules params.Rules) (JumpTable, error) { switch { case rules.IsVerkle: - return newShanghaiInstructionSet(), errors.New("verkle-fork not defined yet") + return newCancunInstructionSet(), errors.New("verkle-fork not defined yet") case rules.IsPrague: - return newShanghaiInstructionSet(), errors.New("prague-fork not defined yet") + return newCancunInstructionSet(), errors.New("prague-fork not defined yet") case rules.IsCancun: - return newShanghaiInstructionSet(), errors.New("cancun-fork not defined yet") + return newCancunInstructionSet(), nil case rules.IsShanghai: return newShanghaiInstructionSet(), nil case rules.IsMerge: diff --git a/tests/init.go b/tests/init.go index 869f1bfcdd677..a04e227dc7afe 100644 --- a/tests/init.go +++ b/tests/init.go @@ -299,6 +299,25 @@ var Forks = map[string]*params.ChainConfig{ TerminalTotalDifficulty: big.NewInt(0), ShanghaiTime: u64(15_000), }, + "Cancun": { + ChainID: big.NewInt(1), + HomesteadBlock: big.NewInt(0), + EIP150Block: big.NewInt(0), + EIP155Block: big.NewInt(0), + EIP158Block: big.NewInt(0), + ByzantiumBlock: big.NewInt(0), + ConstantinopleBlock: big.NewInt(0), + PetersburgBlock: big.NewInt(0), + IstanbulBlock: big.NewInt(0), + MuirGlacierBlock: big.NewInt(0), + BerlinBlock: big.NewInt(0), + LondonBlock: big.NewInt(0), + ArrowGlacierBlock: big.NewInt(0), + MergeNetsplitBlock: big.NewInt(0), + TerminalTotalDifficulty: big.NewInt(0), + ShanghaiTime: u64(0), + CancunTime: u64(0), + }, } // AvailableForks returns the set of defined fork names