Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[easy] Fix lower bound of zk rows for chunking #2590

Merged
merged 4 commits into from
Sep 30, 2024
Merged

Conversation

querolita
Copy link
Member

@querolita querolita commented Sep 23, 2024

When chunking is in place, the number of rows reserved for zero knowledge must be augmented accordingly. In particular,

zk_rows > (2 * permuts * chunks - 2) / 7

that means that zk_rows must at least be (2 * permuts * chunks - 2) / 7 + 1 or what's equivalent, (2 * permuts * chunks - 5) / 7. Examples of this are here.

Nonetheless, on the Kimchi side, the strict lower bound (2 * permuts * chunks - 2) / 7 is created here and is used incorrectly when triggering the error message ProverError::NotZeroKnowledge. Meaning, it is raised whenever the number of rows is smaller than that value, when it should be raised anytime it is smaller or equal (because by definition, the number of rows must be larger than that value).

This PR fixes that mismatch and adapts the error message accordingly.

Example:

With 2 chunks, the message used to read there are not enough random rows to achieve zero-knowledge (expected: 4, got: 3) whereas with 2 chunks you need at least 5 rows for zero knowledge.

Partially addresses o1-labs/o1js#1806

Copy link

codecov bot commented Sep 23, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 69.54%. Comparing base (0583e99) to head (14c7e1f).
Report is 63 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2590      +/-   ##
==========================================
- Coverage   70.95%   69.54%   -1.42%     
==========================================
  Files         240      244       +4     
  Lines       57669    57644      -25     
==========================================
- Hits        40919    40088     -831     
- Misses      16750    17556     +806     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@querolita querolita merged commit 4f8682d into master Sep 30, 2024
6 of 7 checks passed
@querolita querolita deleted the chunking/zkrows_error branch September 30, 2024 15:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants