mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-05-13 19:46:39 +00:00
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:
parent
9f758e8251
commit
d2dbbe48c4
2 changed files with 9 additions and 0 deletions
|
|
@ -150,6 +150,8 @@ func NewEVM(blockCtx BlockContext, statedb StateDB, chainConfig *params.ChainCon
|
||||||
evm.precompiles = activePrecompiledContracts(evm.chainRules)
|
evm.precompiles = activePrecompiledContracts(evm.chainRules)
|
||||||
|
|
||||||
switch {
|
switch {
|
||||||
|
case evm.chainRules.IsAmsterdam:
|
||||||
|
evm.table = &amsterdamInstructionSet
|
||||||
case evm.chainRules.IsOsaka:
|
case evm.chainRules.IsOsaka:
|
||||||
evm.table = &osakaInstructionSet
|
evm.table = &osakaInstructionSet
|
||||||
case evm.chainRules.IsVerkle:
|
case evm.chainRules.IsVerkle:
|
||||||
|
|
|
||||||
|
|
@ -63,6 +63,7 @@ var (
|
||||||
verkleInstructionSet = newVerkleInstructionSet()
|
verkleInstructionSet = newVerkleInstructionSet()
|
||||||
pragueInstructionSet = newPragueInstructionSet()
|
pragueInstructionSet = newPragueInstructionSet()
|
||||||
osakaInstructionSet = newOsakaInstructionSet()
|
osakaInstructionSet = newOsakaInstructionSet()
|
||||||
|
amsterdamInstructionSet = newAmsterdamInstructionSet()
|
||||||
)
|
)
|
||||||
|
|
||||||
// JumpTable contains the EVM opcodes supported at a given fork.
|
// JumpTable contains the EVM opcodes supported at a given fork.
|
||||||
|
|
@ -92,6 +93,12 @@ func newVerkleInstructionSet() JumpTable {
|
||||||
return validate(instructionSet)
|
return validate(instructionSet)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func newAmsterdamInstructionSet() JumpTable {
|
||||||
|
instructionSet := newOsakaInstructionSet()
|
||||||
|
enable7843(&instructionSet) // EIP-7843 (SLOTNUM opcode)
|
||||||
|
return validate(instructionSet)
|
||||||
|
}
|
||||||
|
|
||||||
func newOsakaInstructionSet() JumpTable {
|
func newOsakaInstructionSet() JumpTable {
|
||||||
instructionSet := newPragueInstructionSet()
|
instructionSet := newPragueInstructionSet()
|
||||||
enable7939(&instructionSet) // EIP-7939 (CLZ opcode)
|
enable7939(&instructionSet) // EIP-7939 (CLZ opcode)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue