Consensys / linea-arithmetization

17 stars 18 forks source link

ECPAIRING has 1 missing limit #817

Open OlivierBBB opened 4 days ago

OlivierBBB commented 4 days ago

Main point

We have two missing limits related to the ECPAIRING precompile:

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 computation

How 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.