Skip to content

feat: merge-train/barretenberg#21063

Merged
AztecBot merged 3 commits intonextfrom
merge-train/barretenberg
Mar 3, 2026
Merged

feat: merge-train/barretenberg#21063
AztecBot merged 3 commits intonextfrom
merge-train/barretenberg

Conversation

@AztecBot
Copy link
Collaborator

@AztecBot AztecBot commented Mar 3, 2026

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

…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>
ledwards2225 and others added 2 commits March 3, 2026 16:06
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
Copy link
Collaborator

@ludamad ludamad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 Auto-approved

@AztecBot AztecBot added this pull request to the merge queue Mar 3, 2026
@AztecBot
Copy link
Collaborator Author

AztecBot commented Mar 3, 2026

🤖 Auto-merge enabled after 4 hours of inactivity. This PR will be merged automatically once all checks pass.

Merged via the queue into next with commit bce3ed9 Mar 3, 2026
22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants