-
Notifications
You must be signed in to change notification settings - Fork 548
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
Merged
Merged
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 |
1 similar comment
!ci-build-me |
Can you redirect this PR against compatible? I think these changes shouldn't change our existing circuits, so these can go in the next soft-fork upgrade (and can thus also be included in an upcoming o1js release). |
querolita
force-pushed
the
chunking/zkrows_fix
branch
from
September 23, 2024 15:24
b6bdcb1
to
3319804
Compare
!ci-build-me |
1 similar comment
!ci-build-me |
!ci-build-me |
1 similar comment
!ci-build-me |
7 tasks
mrmr1993
force-pushed
the
compatible
branch
from
September 25, 2024 07:54
4c54643
to
7a73517
Compare
querolita
force-pushed
the
chunking/zkrows_fix
branch
from
September 26, 2024 09:47
ccb7710
to
36f921c
Compare
!ci-build-me |
!ci-build-me |
!ci-build-me |
dannywillems
approved these changes
Oct 8, 2024
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.num_chunks
andzk_rows
with a constant default value for ease of debug (merged from this PR)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: