diff --git a/nimbus/vm/computation.nim b/nimbus/vm/computation.nim index 9186aac4c..ba680ea6f 100644 --- a/nimbus/vm/computation.nim +++ b/nimbus/vm/computation.nim @@ -243,7 +243,7 @@ proc execCall*(c: Computation) = ## https://github.com/ethereum/EIPs/blob/master/EIPS/eip-161.md ## also see: https://github.com/ethereum/EIPs/issues/716 - if c.isError or c.fork == FKIstanbul: + if c.isError or c.fork >= FKIstanbul: if c.msg.contractAddress == ripemdAddr: # Special case to account for geth+parity bug c.vmState.touchedAccounts.incl c.msg.contractAddress diff --git a/nimbus/vm/interpreter/opcodes_impl.nim b/nimbus/vm/interpreter/opcodes_impl.nim index b07eb749c..14dcbba5d 100644 --- a/nimbus/vm/interpreter/opcodes_impl.nim +++ b/nimbus/vm/interpreter/opcodes_impl.nim @@ -777,9 +777,9 @@ template genCall(callName: untyped, opCode: Op): untyped = # EIP 2046 # reduce gas fee for precompiles # from 700 to 40 - when opCode == StaticCall: - if c.fork >= FkBerlin and destination.toInt <= MaxPrecompilesAddr: - childGasFee = childGasFee - 660.GasInt + #when opCode == StaticCall: + # if c.fork >= FkBerlin and destination.toInt <= MaxPrecompilesAddr: + # childGasFee = childGasFee - 660.GasInt if childGasFee >= 0: c.gasMeter.consumeGas(childGasFee, reason = $opCode) diff --git a/nimbus/vm/precompiles.nim b/nimbus/vm/precompiles.nim index 93c5f0d39..9db0377e4 100644 --- a/nimbus/vm/precompiles.nim +++ b/nimbus/vm/precompiles.nim @@ -222,15 +222,17 @@ proc modExpFee(c: Computation, baseLen, expLen, modLen: Uint256, fork: Fork): Ga max(adjExpLen, 1.u256) ) div divisor - let gasFee = if fork >= FkBerlin: gasCalc(mulComplexityEIP2565, GasQuadDivisorEIP2565) - else: gasCalc(mulComplexity, GasQuadDivisor) + #let gasFee = if fork >= FkBerlin: gasCalc(mulComplexityEIP2565, GasQuadDivisorEIP2565) + #else: gasCalc(mulComplexity, GasQuadDivisor) + + let gasFee = gasCalc(mulComplexity, GasQuadDivisor) if gasFee > high(GasInt).u256: raise newException(OutOfGas, "modExp gas overflow") result = gasFee.truncate(GasInt) - if fork >= FkBerlin and result < 200.GasInt: - result = 200.GasInt + #if fork >= FkBerlin and result < 200.GasInt: + # result = 200.GasInt proc modExp*(c: Computation, fork: Fork = FkByzantium) = ## Modular exponentiation precompiled contract