Conversation
…20886) there's lots of code that is never used in ecc/group module, especially in WNAF implementation. This PR removes most of the unused code. We also: - add documentation for WNAF - add edge case testing for WNAF --------- Co-authored-by: sergei iakovenko <105737703+iakovenkos@users.noreply.github.com> Co-authored-by: ledwards2225 <98505400+ledwards2225@users.noreply.github.com> Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com> Co-authored-by: AztecBot <tech@aztecprotocol.com>
Adds Chonk proof compression logic that utilizes two things: 1. Suyash's proposed EC point compression: store (x, sign_bit) instead of (x, y); leverage curve equation to reconstruct y-coord 2. Store all fields as u256 / 32 bytes. (Similar effect to Snappy compression but seems to do slightly better) Overall effect is that each single "component" of the proof is represented as 32 bytes. E.g. an Fq (naively 2 Frs) becomes one u256. A bn254 commitment (naively 2 Fqs = 4 Frs) becomes one u256 representing the x-coord. High level stats: | Metric | Value | |-------------------|------------------------------------------| | Original size | 1,935 Fr elements = ~60 KB| | Snappy compressed size | ~47 KB | | Compressed size | ~35 KB | | Compression ratio | 1.72x | | Compress time | 0.64 ms | | Decompress time | 3.5 ms | --------- Co-authored-by: Jonathan Hao <jonathan@aztec-labs.com>
## Summary - Size the CRS at `max_end_index` (actual data extent) rather than `dyadic_size` for non-ZK proofs - Make Shplonk quotient polynomial `round_up_power_2` conditional on having non-dyadic claims (Libra/sumcheck), which only exist in the ZK path - Size PolynomialBatcher's temporary polynomials (`batched_unshifted`, `batched_to_be_shifted`, `A_0_pos`, `A_0_neg`) at `actual_data_size` rather than `full_batched_size` ## Benchmark results Chonk AMM flow (`ecdsar1+amm_add_liquidity_1_recursions+sponsored_fpc`), `max_end_index=278,429` vs `dyadic_size=524,288`: ``` bb prove --scheme chonk --ivc_inputs_path .../ecdsar1+amm_add_liquidity_1_recursions+sponsored_fpc/ivc-inputs.msgpack -o /tmp/out ``` | | Run 1 (KB) | Run 2 (KB) | Run 3 (KB) | Avg (MiB) | |---|---|---|---|---| | Before | 702,660 | 704,044 | 691,328 | 682.7 | | After | 657,096 | 672,916 | 677,508 | 654.8 | | **Savings** | **45,564** | **31,128** | **13,820** | **~28 MiB (~4.1%)** | ## Test plan - [x] `ultra_honk_bench` at 2^20 passes (no crash) - [x] `ultra_honk_tests`: 260 passed, 5 skipped - [x] `commitment_schemes_tests`: 82 passed, 2 skipped - [ ] CI passes
Collaborator
Author
|
🤖 Auto-merge enabled after 4 hours of inactivity. This PR will be merged automatically once all checks pass. |
This file contains hidden or 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
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.
BEGIN_COMMIT_OVERRIDE
chore: ecc group audit 1- remove dead code, documentation and test (#20886)
chore: chonk proof compression poc (#20645)
feat: reduce CRS and polynomial memory for non-ZK proofs (#20731)
END_COMMIT_OVERRIDE