-
Notifications
You must be signed in to change notification settings - Fork 527
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
Small fix of zk rows for chunking #16057
Open
querolita
wants to merge
14
commits into
develop
Choose a base branch
from
chunking/zkrows_fix
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
!ci-build-me |
1 similar comment
!ci-build-me |
!ci-build-me |
!ci-build-me |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is part of the investigation of the chunking bug in Pickles and o1js (RFCs here and here).
This branch is based on this branch by @Trivo25.
Explain your changes:
kimchi_bindings/wasm/src/plonk_verifier_index.rs
there were two places where a hardcoded 3 was still being used to initializew
and the permutation polynomial. Instead, the updatedzk_rows
should be used:res.set(zk_w(domain, index.zk_rows)).unwrap();
res.set(permutation_vanishing_polynomial(domain, index.zk_rows)).unwrap();
src/lib/pickles/compile.ml
andsrc/lib/pickles/step_branch_data.ml
, the number of rows was not computed correctly.((2 * (permuts + 1) * num_chunks) - 2 + permuts) / permuts
instead.Explain how you tested your changes:
chunk4.ml
used to fail with the error(Pickles.verify dlog_check)
.there are not enough random rows to achieve zero-knowledge (expected: 4, got: 3)
. This suggests some miscalculation in the bindings that I still haven't found.num_chunks = 11
, but this si not a power of 2. Another one is whennum_chunks = 4
(basically anytime(16*c+6)/7
gives an integer number). There, the old computation gives 10 rows whereas this one gives 9. Having more rows is not a problem for zero knowledge-ness itself (it would be the other way round though). But this mismatch between the Kimchi side and the Pickles side can be a source of problems. Thus, it is better if we use the same formula on both sides. This, prevents us from getting another(Pickles.verify dlog_check)
error.TODO:
3
might be used to instantiate variables instead of a proper variabledefault_zk_rows
or similar.o1js-bindings
and learn about the dependencies between libraries across our stack.Partially addresses o1-labs/o1js#1806
Checklist: