From 14cbbfc77aeccd782419852c2947cb950acc8f46 Mon Sep 17 00:00:00 2001 From: Marius van der Wijden Date: Fri, 22 Sep 2023 13:44:38 +0200 Subject: [PATCH] core: split 4844 and 7516 --- core/vm/eips.go | 7 +++++-- core/vm/jump_table.go | 3 ++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/core/vm/eips.go b/core/vm/eips.go index 147883dd72..35f0a3f7c2 100644 --- a/core/vm/eips.go +++ b/core/vm/eips.go @@ -289,15 +289,18 @@ func opBlobBaseFee(pc *uint64, interpreter *EVMInterpreter, scope *ScopeContext) return nil, nil } -// enable4844 applies EIP-4844 (DATAHASH opcode) +// enable4844 applies EIP-4844 (BLOBHASH opcode) func enable4844(jt *JumpTable) { - // New opcode jt[BLOBHASH] = &operation{ execute: opBlobHash, constantGas: GasFastestStep, minStack: minStack(1, 1), maxStack: maxStack(1, 1), } +} + +// enable7516 applies EIP-7516 (BLOBBASEFEE opcode) +func enable7516(jt *JumpTable) { jt[BLOBBASEFEE] = &operation{ execute: opBlobBaseFee, constantGas: GasQuickStep, diff --git a/core/vm/jump_table.go b/core/vm/jump_table.go index 702b186615..fb87258326 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) // EIP-4844 (DATAHASH opcode) + enable4844(&instructionSet) // EIP-4844 (BLOBHASH opcode) + enable7516(&instructionSet) // EIP-7516 (BLOBBASEFEE opcode) enable1153(&instructionSet) // EIP-1153 "Transient Storage" enable5656(&instructionSet) // EIP-5656 (MCOPY opcode) enable6780(&instructionSet) // EIP-6780 SELFDESTRUCT only in same transaction