Skip to content

feat: batched chonk verification#21083

Merged
ledwards2225 merged 14 commits intomerge-train/barretenbergfrom
lde/batch-chonk-verification
Mar 5, 2026
Merged

feat: batched chonk verification#21083
ledwards2225 merged 14 commits intomerge-train/barretenbergfrom
lde/batch-chonk-verification

Conversation

@ledwards2225
Copy link
Contributor

@ledwards2225 ledwards2225 commented Mar 3, 2026

Implements ChonkBatchVerifier for batch verifying Chonk proofs.

  • Only batches IPA MSM (via newly added IPA::batch_reduce_verify()) (Note IPA is ~90% of verification time)
  • Adds bbapi::ChonkBatchVerify - ready to be integrated into the TS

Batching is done by replacing $N$ single IPA verifier checks of the form:
$$C_0 = \langle a_0 \vec{s}, \vec{G} \rangle + a_0 b_0 u \cdot G$$
with a batched check of the form (with $\alpha$ chosen randomly by the verifier):
$$\sum_i \alpha^i C_{0,i} = \langle \sum_i \alpha^i a_{0,i} \vec{s_i}, \vec{G} \rangle + \left(\sum_i \alpha^i a_{0,i} b_{0,i} u_i\right) \cdot G$$

See below for relevant benchmarks

@ledwards2225
Copy link
Contributor Author

ledwards2225 commented Mar 3, 2026

All benchmarks run single-threaded

Full Chonk Verification

N proofs Individual Batch Speedup
1 182 ms 182 ms 1.0x
2 364 ms 207 ms 1.8x
4 730 ms 257 ms 2.8x
8 1483 ms 354 ms 4.2x

IPA Verification Only (size 2^15)

N proofs Individual Batch Speedup
1 160 ms 161 ms 1.0x
2 322 ms 167 ms 1.9x
4 640 ms 175 ms 3.7x
8 1315 ms 191 ms 6.9x

Cost Breakdown (single proof, single-threaded)

Component Time % of total
IPA MSM ~160 ms 88%
Non-IPA (ECCVM, Translator, MegaZK, Merge, pairing) ~22 ms 12%
Total 182 ms 100%

@ledwards2225 ledwards2225 marked this pull request as ready for review March 4, 2026 20:42
@ledwards2225 ledwards2225 added the ci-full Run all master checks. label Mar 4, 2026
@notnotraju notnotraju self-requested a review March 5, 2026 11:36
@@ -115,6 +115,36 @@ bool ChonkAPI::verify([[maybe_unused]] const Flags& flags,
return response.valid;
}

Copy link
Contributor

Choose a reason for hiding this comment

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

For the use-case, I guess it is better that the batch size is not one of the arguments?

if (!result.all_checks_passed) {
return false;
}
ipa_claims.push_back(std::move(result.ipa_claim));
Copy link
Contributor

Choose a reason for hiding this comment

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

My clang-tidy claims Std::move of the expression of the trivially-copyable type 'OpeningClaimcurve::Grumpkin' has no effect

Copy link
Contributor Author

Choose a reason for hiding this comment

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

removed, thx

@notnotraju notnotraju self-requested a review March 5, 2026 15:34
Copy link
Contributor

@notnotraju notnotraju left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

@ledwards2225 ledwards2225 enabled auto-merge (squash) March 5, 2026 18:42
@ledwards2225 ledwards2225 merged commit 4594e87 into merge-train/barretenberg Mar 5, 2026
10 checks passed
@ledwards2225 ledwards2225 deleted the lde/batch-chonk-verification branch March 5, 2026 19:20
github-merge-queue bot pushed a commit that referenced this pull request Mar 6, 2026
BEGIN_COMMIT_OVERRIDE
fix: add -g0 to zig presets to eliminate 11GB debug info bloat (#21071)
fix: resolve flaky p2p_client test race condition on ARM64 (#21088)
chore: remove domain iteration macros and address backing memory race
(#20988)
fix: [ECCVM] added domain separation for the multiset equality check.
(#20352)
feat: hybrid CRS hash verification — 8MB chunks, parallel, span-based
(#21113)
chore: unify splitting scalars interface (#20805)
chore: add a unique id to each origin tag (#20924)
chore: Native curve audit (#20936)
chore: Update bootstrap in test vk haven't changed script (#21153)
fix: use reduced form in WASM FromMontgomeryForm test (#21164)
chore: erase ephemeral secrets from memory in schnorr and aes (#21106)
chore: suppress clangd target triple version diagnostic (#21180)
feat: Optimise new claim calculation (#21179)
docs: add Quick Start build instructions to barretenberg README (#20951)
feat: batched chonk verification (#21083)
fix: link libc++ instead of libstdc++ for Rust FFI on Linux (#21203)
fix: [ECCVM] in the transcript table, no-ops force the next accumulator
to be 0. (#20849)
fix: resolve merge-train conflict with next (zig wrapper scripts + -g0)
(#21201)
fix: [ECCVM] rare edge case completeness issue when `z1 == 0` but `z2 !=
0` (#20858)
fix: use actual data extent for CommitmentKey in HypernovaDeciderProver
(#21206)
END_COMMIT_OVERRIDE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci-full Run all master checks.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants