From 3ccc4642f27e940f05064463fbd3506568336e42 Mon Sep 17 00:00:00 2001 From: jangko Date: Sun, 16 May 2021 19:31:13 +0700 Subject: [PATCH] disable EIP-2315: Simple Subroutines for the EVM reason: not included in berlin hard fork --- nimbus/vm/interpreter_dispatch.nim | 9 ++++++--- nimbus/vm2/interpreter/op_handlers/oph_memory.nim | 6 +++++- tests/test_op_misc.nim | 5 ++++- 3 files changed, 15 insertions(+), 5 deletions(-) diff --git a/nimbus/vm/interpreter_dispatch.nim b/nimbus/vm/interpreter_dispatch.nim index b06adc3ca..ffcb588e9 100644 --- a/nimbus/vm/interpreter_dispatch.nim +++ b/nimbus/vm/interpreter_dispatch.nim @@ -231,9 +231,12 @@ let IstanbulOpDispatch {.compileTime.}: array[Op, NimNode] = genIstanbulJumpTabl proc genBerlinJumpTable(ops: array[Op, NimNode]): array[Op, NimNode] {.compileTime.} = result = ops - result[BeginSub] = newIdentNode "beginSub" - result[ReturnSub] = newIdentNode "returnSub" - result[JumpSub] = newIdentNode "jumpSub" + # EIP-2315: temporary disabled + # Reason : not included in berlin hard fork + + #result[BeginSub] = newIdentNode "beginSub" + #result[ReturnSub] = newIdentNode "returnSub" + #result[JumpSub] = newIdentNode "jumpSub" result[Balance] = newIdentNode "balanceEIP2929" result[ExtCodeHash] = newIdentNode "extCodeHashEIP2929" diff --git a/nimbus/vm2/interpreter/op_handlers/oph_memory.nim b/nimbus/vm2/interpreter/op_handlers/oph_memory.nim index 6dd6f1b79..f12b17a8d 100644 --- a/nimbus/vm2/interpreter/op_handlers/oph_memory.nim +++ b/nimbus/vm2/interpreter/op_handlers/oph_memory.nim @@ -433,8 +433,11 @@ const info: "Mark a valid destination for jumps", exec: (prep: vm2OpIgnore, run: jumpDestOp, - post: vm2OpIgnore)), + post: vm2OpIgnore))] +#[ + EIP-2315: temporary disabled + Reason : not included in berlin hard fork (opCode: BeginSub, ## 0x5c, Begin subroutine forks: Vm2OpBerlinAndLater, name: "beginSub", @@ -458,6 +461,7 @@ const exec: (prep: vm2OpIgnore, run: jumpSubOp, post: vm2OpIgnore))] +]# # ------------------------------------------------------------------------------ # End diff --git a/tests/test_op_misc.nim b/tests/test_op_misc.nim index c098d1687..734545730 100644 --- a/tests/test_op_misc.nim +++ b/tests/test_op_misc.nim @@ -175,7 +175,9 @@ proc opMiscMain*() = memory: "0xA0B0C0D0E0F0A1B1C1D1E1F1A2B2C2D2E2F2A3B3C3D3E3F3A4B4C4D4E4F4A1B1" "0x00" - +#[ + EIP-2315: Simple Subroutines for the EVM + disabled reason: not included in Berlin hard fork assembler: title: "Simple routine" code: @@ -271,6 +273,7 @@ proc opMiscMain*() = fork: berlin stack: "0x06" +]# when isMainModule: opMiscMain()