diff --git a/nimbus/evm/precompiles.nim b/nimbus/evm/precompiles.nim index 07201861c..68e49da97 100644 --- a/nimbus/evm/precompiles.nim +++ b/nimbus/evm/precompiles.nim @@ -343,10 +343,10 @@ func bn256ecPairing(c: Computation, fork: EVMFork = FkByzantium): EvmResultVoid else: GasECPairingBaseIstanbul + numPoints * GasECPairingPerPointIstanbul ? c.gasMeter.consumeGas(gasFee, reason="ecPairing Precompile") - - c.output.setLen(32) + if msglen == 0: # we can discard here because we supply buffer of proper size + c.output.setLen(32) discard BNU256.one().toBytesBE(c.output) else: # Calculate number of pairing pairs @@ -357,12 +357,13 @@ func bn256ecPairing(c: Computation, fork: EVMFork = FkByzantium): EvmResultVoid for i in 0..