Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove sendall opcode and use it on selfdestruct only #1056

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading