From 80dfa41e32d463e26696f33d17d91352b81e8769 Mon Sep 17 00:00:00 2001 From: Mark Spanbroek Date: Tue, 30 Jan 2024 09:09:59 +0100 Subject: [PATCH] Remove calls to invalid() Gas estimation seems to work just fine without them? --- contracts/Groth16Verifier.sol | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/contracts/Groth16Verifier.sol b/contracts/Groth16Verifier.sol index 54565c3..cb84825 100644 --- a/contracts/Groth16Verifier.sol +++ b/contracts/Groth16Verifier.sol @@ -45,11 +45,6 @@ library Pairing { // solhint-disable-next-line no-inline-assembly assembly { success := staticcall(sub(gas(), 2000), 6, input, 0xc0, r, 0x60) - // Use "invalid" to make gas estimation work - switch success - case 0 { - invalid() - } } require(success, "pairing-add-failed"); } @@ -68,11 +63,6 @@ library Pairing { // solhint-disable-next-line no-inline-assembly assembly { success := staticcall(sub(gas(), 2000), 7, input, 0x80, r, 0x60) - // Use "invalid" to make gas estimation work - switch success - case 0 { - invalid() - } } require(success, "pairing-mul-failed"); } @@ -109,11 +99,6 @@ library Pairing { out, 0x20 ) - // Use "invalid" to make gas estimation work - switch success - case 0 { - invalid() - } } require(success, "pairing-opcode-failed"); return out[0] != 0;