Skip to content

Commit

Permalink
remove sendall opcode and use it on selfdestruct only (#1056)
Browse files Browse the repository at this point in the history
  • Loading branch information
V-Staykov authored Aug 28, 2024
1 parent 79f49f3 commit 423754c
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 17 deletions.
1 change: 0 additions & 1 deletion core/vm/eips_zkevm.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ func enable2929_zkevm(jt *JumpTable) {
// factor here
jt[SELFDESTRUCT].constantGas = params.SelfdestructGasEIP150
jt[SELFDESTRUCT].dynamicGas = gasSelfdestructEIP2929_zkevm
jt[SENDALL].dynamicGas = gasSelfdestructEIP2929_zkevm
}

func enable3529_zkevm(jt *JumpTable) {
Expand Down
2 changes: 0 additions & 2 deletions core/vm/interpreter_zkevm.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,6 @@ func shouldExecuteLastOpCode(op OpCode) bool {
fallthrough
case CREATE2:
fallthrough
case SENDALL:
fallthrough
case SLOAD:
fallthrough
case SSTORE:
Expand Down
9 changes: 1 addition & 8 deletions core/vm/jump_table_zkevm.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,8 @@ func newForkID4InstructionSet() JumpTable {

instructionSet[EXTCODEHASH].execute = opExtCodeHash_zkevm

instructionSet[SENDALL] = &operation{
execute: opSendAll_zkevm,
dynamicGas: gasSelfdestruct_zkevm,
numPop: 1,
numPush: 0,
}

// SELFDESTRUCT is replaces by SENDALL
instructionSet[SELFDESTRUCT] = instructionSet[SENDALL]
instructionSet[SELFDESTRUCT].execute = opSendAll_zkevm

validateAndFillMaxStack(&instructionSet)
return instructionSet
Expand Down
7 changes: 2 additions & 5 deletions core/vm/opcodes_zkevm.go
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
package vm

const (
SENDALL OpCode = 0xfb
)
const ()

// adding extra opcodes dynamically to keep separate from the main codebase
// that simplifies rebasing new versions of Erigon
func init() {
opCodeToString[SENDALL] = "SENDALL"
stringToOp["SENDALL"] = SENDALL

}
1 change: 0 additions & 1 deletion core/vm/zk_counters.go
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,6 @@ func SimpleCounterOperations(cc *CounterCollector) *[256]executionFunc {
CREATE2: cc.opCreate2,
RETURN: cc.opReturn,
REVERT: cc.opRevert,
SENDALL: cc.opSendAll,
SELFDESTRUCT: cc.opSendAll,
INVALID: cc.opInvalid,
ADDRESS: cc.opAddress,
Expand Down

0 comments on commit 423754c

Please sign in to comment.