diff --git a/nimbus/evm/computation.nim b/nimbus/evm/computation.nim index 242147331..bba589e98 100644 --- a/nimbus/evm/computation.nim +++ b/nimbus/evm/computation.nim @@ -246,10 +246,6 @@ template gasCosts*(c: Computation): untyped = template fork*(c: Computation): untyped = c.vmState.fork -proc isOriginComputation*(c: Computation): bool = - # Is this computation the computation initiated by a transaction - c.msg.sender == c.vmState.txOrigin - template isSuccess*(c: Computation): bool = c.error.isNil diff --git a/nimbus/evm/interpreter/op_handlers/oph_memory.nim b/nimbus/evm/interpreter/op_handlers/oph_memory.nim index ef42d6a37..8630d09b7 100644 --- a/nimbus/evm/interpreter/op_handlers/oph_memory.nim +++ b/nimbus/evm/interpreter/op_handlers/oph_memory.nim @@ -89,6 +89,12 @@ else: c.vmState.mutateStateDB: db.setStorage(c.msg.contractAddress, slot, newValue) +template sstoreEvmcOrSstore(cpt, slot, newValue: untyped) = + when evmc_enabled: + sstoreEvmc(cpt, slot, newValue, 0.GasInt) + else: + sstoreImpl(cpt, slot, newValue) + template sstoreEvmcOrNetGasMetering(cpt, slot, newValue: untyped, coldAccess = 0.GasInt) = when evmc_enabled: sstoreEvmc(cpt, slot, newValue, coldAccess) @@ -191,7 +197,7 @@ const checkInStaticContext(cpt) cpt.asyncChainTo(ifNecessaryGetSlot(cpt.vmState, cpt.msg.contractAddress, slot)): - sstoreEvmcOrNetGasMetering(cpt, slot, newValue) + sstoreEvmcOrSstore(cpt, slot, newValue) sstoreEIP1283Op: Vm2OpFn = proc (k: var Vm2Ctx) = diff --git a/nimbus/vm_computation.nim b/nimbus/vm_computation.nim index 67667fc53..c8bc3dd64 100644 --- a/nimbus/vm_computation.nim +++ b/nimbus/vm_computation.nim @@ -39,7 +39,6 @@ export vmc.getStorage, vmc.getTimestamp, vmc.isError, - vmc.isOriginComputation, vmc.isSuccess, vmc.merge, vmc.newComputation, diff --git a/nimbus/vm_internals.nim b/nimbus/vm_internals.nim index 2e3191d15..7295a565e 100644 --- a/nimbus/vm_internals.nim +++ b/nimbus/vm_internals.nim @@ -92,7 +92,6 @@ export bChp.getStorage, bChp.getTimestamp, bChp.isError, - bChp.isOriginComputation, bChp.isSuccess, bChp.merge, bChp.newComputation,