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
This commit is contained in:
felix 2026-01-20 11:38:36 +01:00 committed by Jared Wasinger
parent 9f758e8251
commit d2dbbe48c4
2 changed files with 9 additions and 0 deletions

View file

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

View file

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