From d2dbbe48c42fa124b05413548fef0d2c879cd8c5 Mon Sep 17 00:00:00 2001 From: felix Date: Tue, 20 Jan 2026 11:38:36 +0100 Subject: [PATCH] core/vm: add amsterdam instruction set etc. (#33643) had to make these changes to successfully test eip-7843 via `consume engine`. could be useful to u. edit: maybe the type change from `uint64` can be removed, i can fix that on our end --- core/vm/evm.go | 2 ++ core/vm/jump_table.go | 7 +++++++ 2 files changed, 9 insertions(+) diff --git a/core/vm/evm.go b/core/vm/evm.go index 428781713b..412cb28793 100644 --- a/core/vm/evm.go +++ b/core/vm/evm.go @@ -150,6 +150,8 @@ func NewEVM(blockCtx BlockContext, statedb StateDB, chainConfig *params.ChainCon evm.precompiles = activePrecompiledContracts(evm.chainRules) switch { + case evm.chainRules.IsAmsterdam: + evm.table = &amsterdamInstructionSet case evm.chainRules.IsOsaka: evm.table = &osakaInstructionSet case evm.chainRules.IsVerkle: diff --git a/core/vm/jump_table.go b/core/vm/jump_table.go index d7a4d9da1d..d8ec2b75fe 100644 --- a/core/vm/jump_table.go +++ b/core/vm/jump_table.go @@ -63,6 +63,7 @@ var ( verkleInstructionSet = newVerkleInstructionSet() pragueInstructionSet = newPragueInstructionSet() osakaInstructionSet = newOsakaInstructionSet() + amsterdamInstructionSet = newAmsterdamInstructionSet() ) // JumpTable contains the EVM opcodes supported at a given fork. @@ -92,6 +93,12 @@ func newVerkleInstructionSet() JumpTable { return validate(instructionSet) } +func newAmsterdamInstructionSet() JumpTable { + instructionSet := newOsakaInstructionSet() + enable7843(&instructionSet) // EIP-7843 (SLOTNUM opcode) + return validate(instructionSet) +} + func newOsakaInstructionSet() JumpTable { instructionSet := newPragueInstructionSet() enable7939(&instructionSet) // EIP-7939 (CLZ opcode)