Skip to content

fix(prover-ray): adding limit checks for the lookups and permutations - #3619

Open
bogdanbear wants to merge 12 commits into
mainfrom
prover-ray/add-limits-on-lookups-and-permutations
Open

fix(prover-ray): adding limit checks for the lookups and permutations#3619
bogdanbear wants to merge 12 commits into
mainfrom
prover-ray/add-limits-on-lookups-and-permutations

Conversation

@bogdanbear

@bogdanbear bogdanbear commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

This PR adds per-query row-limit checks to the lookup (lookuptologderivsum) and permutation (grandproduct) compilers, guarding against small-field accumulator overflow: each check runs as both a prover action (panics) and a verifier action (rejects), registered on the witness round so it fires before any rows are walked.

Introduces the budget primitives in wiop: MaxLookupRows (2^30) and MaxPermutationRows (2^58), enforced via TableRelationQuery.CheckRowLimit / ValidateRowLimit, which bound each side of a query independently.
Establishes how the budget is shared: lookups sharing an including (B) table drain one common accumulator, so their limit is divided by the group's lookup count; permutations and message-bus handles use independent per-module accumulators, so their full budget applies per query/handle.

Checklist

  • I wrote new tests for my new core changes.
  • I have successfully ran tests, style checker and build against my new changes locally.
  • I have informed the team of any breaking changes if there are any.

Signed-off-by: Bogdan Ursu <bogdanursuoffice@gmail.com>
Signed-off-by: Bogdan Ursu <bogdanursuoffice@gmail.com>
Signed-off-by: Bogdan Ursu <bogdanursuoffice@gmail.com>
@bogdanbear bogdanbear self-assigned this Jul 23, 2026
@bogdanbear bogdanbear added the Prover-RAY All issues or PR relevant to the establishment of the framework in prover-ray label Jul 23, 2026
@bogdanbear bogdanbear changed the title fix(prover-ray): adding limit checks for the lookups fix(prover-ray): adding limit checks for the lookups and permutations Jul 23, 2026
Signed-off-by: Bogdan Ursu <bogdanursuoffice@gmail.com>
Signed-off-by: Bogdan Ursu <bogdanursuoffice@gmail.com>
Signed-off-by: Bogdan Ursu <bogdanursuoffice@gmail.com>
@bogdanbear
bogdanbear marked this pull request as ready for review July 24, 2026 03:44
Comment thread prover-ray/wiop/query_table_relation.go
Signed-off-by: Bogdan Ursu <bogdanursuoffice@gmail.com>
Signed-off-by: Bogdan Ursu <bogdanursuoffice@gmail.com>
Signed-off-by: Bogdan Ursu <bogdanursuoffice@gmail.com>
Signed-off-by: Bogdan Ursu <bogdanursuoffice@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Prover-RAY All issues or PR relevant to the establishment of the framework in prover-ray

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants