-
Notifications
You must be signed in to change notification settings - Fork 38
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
Circuit constraint refinements to reduce proof size #169
Conversation
This ensures the "LSB check" gate only queries `cur` and `next` rows.
This ensures the Commit^ivk gate only queries `cur` and `next` rows.
Codecov Report
@@ Coverage Diff @@
## main #169 +/- ##
==========================================
+ Coverage 86.65% 86.92% +0.26%
==========================================
Files 64 65 +1
Lines 7811 8965 +1154
==========================================
+ Hits 6769 7793 +1024
- Misses 1042 1172 +130
Continue to review full report at Codecov.
|
The new regions take up more cells overall, but across fewer columns, and the gates now only query `cur` and `next` rows.
Helps to see why we can't optimise it to remove the `prev` query.
Current
This PR:
So we add two fixed column evaluations (64 bytes) to the base proof size (due to the many extra selectors from splitting up NoteCommit), in exchange for removing five advice column evaluations (160 bytes) from the marginal proof size. |
Reminder that this needs three reviews, because it's not going to be covered by the QEDIT audit as an effective third reviewer. (I'll review it today.) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
utACK on everything except note_commit.rs
.
We should ensure that the book has up-to-date layout diagrams for the canonicity checks; then I'll review note_commit.rs
against those.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
utACK
Co-authored-by: ying tong <[email protected]>
Co-authored-by: ying tong <[email protected]>
|
||
// value = d_2 + (2^8)d_3 + (2^58)e_0 | ||
let value_check = { | ||
let two_pow_8 = pallas::Base::from_u64(1 << 8); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let two_pow_8 = pallas::Base::from_u64(1 << 8); |
This is already defined above.
|
||
// g1_g2_prime = g_1 + (2^9)g_2 + 2^130 - t_P | ||
let g1_g2_prime_check = { | ||
let two_pow_9 = two_pow_4 * two_pow_5; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let two_pow_9 = two_pow_4 * two_pow_5; |
This is already defined above.
let canonicity_checks = std::iter::empty() | ||
.chain(Some(("h_1 = 1 => h_0", h_0))) | ||
.chain(Some(("h_1 = 1 => z13_g", z13_g))) | ||
.chain(Some(("h_1 = 1 => z13_g1_g2_prime", z13_g1_g2_prime))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The book was incorrect for this constraint (using g0 in place of the correct h1, which appears to be a cut-and-paste error from the previous section). Fixed in 4c25e3c .
Signed-off-by: Daira Hopwood <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
utACK. Note that I applied my own suggested changes, so my review doesn't count for the last 4 commits. Checked for consistency with #182.
| ak | a | b | b_0 | b_1 | b_2 | z13_a | a_prime | z13_a_prime | 1 | | ||
| nk | c | d | d_0 | d_1 | | z13_c | b2_c_prime| z14_b2_c_prime | 0 | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note to self: update the region layout in the book with this change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Matches the change made in #169.
Per #169 (comment):
Part of #125.
Part of #168.