We have two missing limits related to the ECPAIRING precompile:
PRECOMPILE_ECPAIRING_G2_MEMBERSHIP_TESTS
count the number of times we have to invoke the G2 membership testing circuit in gnark
will be set to 64
~PRECOMPILE_ECPARING_LINES~
~counts the raw number of lines dedicated to ECPAIRING stuff~
~proposal: set it to e.g. the power of 2 following 16 ( 4 192 + 2) i.e. 16384~
PRECOMPILE_ECPAIRING_G2_MEMBERSHIP_TESTS
Recall that we must test of G2 membership whenever in the following cases:
If INTERNAL_CHECKS_PASSED = 1 and SUCCESS_BIT = 0:
1 time per ECPAIRING call with (it is only required for the first $B_k\notin G_2$)
If INTERNAL_CHECKS_PASSED = 1 and SUCCESS_BIT = 1:
0, 1, 2, ... times (once per pair $(A_k, B_k)$ with $A_k = \infty$ and $B_k \neq \infty$.)
PRECOMPILE_ECPARING_LINES
~Is necessary because we currently don't 'price' ECPAIRING calls that fail INTERNAL_CHECKS 😅 so the sequencer would accept an ECPAIRING call that fails ICP but has arbitrary size (given enough gas of course ... but it could be enormous.)~
Correction. This limit is actually already taken care of (the ECDATA module has a limit of 262144 rows.) Also note that the following computation
which accounts for "full use of the GNARK capabilities" still leaves plenty of room (wrt the 262144 limit) for plenty of horsing around. IRL we will likely only use a few hundred rows in that module in 99.9% of cases.
Main point
We have two missing limits related to the ECPAIRING precompile:
PRECOMPILE_ECPAIRING_G2_MEMBERSHIP_TESTS
PRECOMPILE_ECPARING_LINES
~PRECOMPILE_ECPAIRING_G2_MEMBERSHIP_TESTS
Recall that we must test of G2 membership whenever in the following cases:
PRECOMPILE_ECPARING_LINES
~Is necessary because we currently don't 'price' ECPAIRING calls that fail INTERNAL_CHECKS 😅 so the sequencer would accept an ECPAIRING call that fails ICP but has arbitrary size (given enough gas of course ... but it could be enormous.)~
Correction. This limit is actually already taken care of (the ECDATA module has a limit of
262144
rows.) Also note that the following computationHow large can the ECDATA trace get
which accounts for "full use of the GNARK capabilities" still leaves plenty of room (wrt the
262144
limit) for plenty of horsing around. IRL we will likely only use a few hundred rows in that module in 99.9% of cases.