temporary disable EIP2046 and EIP2565
This commit is contained in:
parent
e2975b613c
commit
ab314c1e04
|
@ -243,7 +243,7 @@ proc execCall*(c: Computation) =
|
||||||
## https://github.com/ethereum/EIPs/blob/master/EIPS/eip-161.md
|
## https://github.com/ethereum/EIPs/blob/master/EIPS/eip-161.md
|
||||||
## also see: https://github.com/ethereum/EIPs/issues/716
|
## 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:
|
if c.msg.contractAddress == ripemdAddr:
|
||||||
# Special case to account for geth+parity bug
|
# Special case to account for geth+parity bug
|
||||||
c.vmState.touchedAccounts.incl c.msg.contractAddress
|
c.vmState.touchedAccounts.incl c.msg.contractAddress
|
||||||
|
|
|
@ -777,9 +777,9 @@ template genCall(callName: untyped, opCode: Op): untyped =
|
||||||
# EIP 2046
|
# EIP 2046
|
||||||
# reduce gas fee for precompiles
|
# reduce gas fee for precompiles
|
||||||
# from 700 to 40
|
# from 700 to 40
|
||||||
when opCode == StaticCall:
|
#when opCode == StaticCall:
|
||||||
if c.fork >= FkBerlin and destination.toInt <= MaxPrecompilesAddr:
|
# if c.fork >= FkBerlin and destination.toInt <= MaxPrecompilesAddr:
|
||||||
childGasFee = childGasFee - 660.GasInt
|
# childGasFee = childGasFee - 660.GasInt
|
||||||
|
|
||||||
if childGasFee >= 0:
|
if childGasFee >= 0:
|
||||||
c.gasMeter.consumeGas(childGasFee, reason = $opCode)
|
c.gasMeter.consumeGas(childGasFee, reason = $opCode)
|
||||||
|
|
|
@ -222,15 +222,17 @@ proc modExpFee(c: Computation, baseLen, expLen, modLen: Uint256, fork: Fork): Ga
|
||||||
max(adjExpLen, 1.u256)
|
max(adjExpLen, 1.u256)
|
||||||
) div divisor
|
) div divisor
|
||||||
|
|
||||||
let gasFee = if fork >= FkBerlin: gasCalc(mulComplexityEIP2565, GasQuadDivisorEIP2565)
|
#let gasFee = if fork >= FkBerlin: gasCalc(mulComplexityEIP2565, GasQuadDivisorEIP2565)
|
||||||
else: gasCalc(mulComplexity, GasQuadDivisor)
|
#else: gasCalc(mulComplexity, GasQuadDivisor)
|
||||||
|
|
||||||
|
let gasFee = gasCalc(mulComplexity, GasQuadDivisor)
|
||||||
|
|
||||||
if gasFee > high(GasInt).u256:
|
if gasFee > high(GasInt).u256:
|
||||||
raise newException(OutOfGas, "modExp gas overflow")
|
raise newException(OutOfGas, "modExp gas overflow")
|
||||||
|
|
||||||
result = gasFee.truncate(GasInt)
|
result = gasFee.truncate(GasInt)
|
||||||
if fork >= FkBerlin and result < 200.GasInt:
|
#if fork >= FkBerlin and result < 200.GasInt:
|
||||||
result = 200.GasInt
|
# result = 200.GasInt
|
||||||
|
|
||||||
proc modExp*(c: Computation, fork: Fork = FkByzantium) =
|
proc modExp*(c: Computation, fork: Fork = FkByzantium) =
|
||||||
## Modular exponentiation precompiled contract
|
## Modular exponentiation precompiled contract
|
||||||
|
|
Loading…
Reference in New Issue