feat: batch verifier service for Chonk proofs#21460
Open
AztecBot wants to merge 1 commit intolw/batch-verifier-cppfrom
Open
feat: batch verifier service for Chonk proofs#21460AztecBot wants to merge 1 commit intolw/batch-verifier-cppfrom
AztecBot wants to merge 1 commit intolw/batch-verifier-cppfrom
Conversation
da347fb to
5533d02
Compare
91a0228 to
a164f96
Compare
6bb0fc6 to
63882d9
Compare
ludamad
added a commit
that referenced
this pull request
Mar 17, 2026
## Summary Review fixes for #21460 (batch chonk verifier service), addressing findings from a 4-agent code review: - **S1 — Shell injection**: Replace `execSync(`mkfifo ...`)` with `execFileSync('mkfifo', [...])` in production code (`batch_chonk_verifier.ts`) and test code (`batch_verifier.test.ts`). The bench and queue test files already used the safe form. - **S2 — Silent truncation**: Add `BB_ASSERT(len <= UINT32_MAX)` in `write_frame` before the `uint32_t` cast to catch >4GiB payloads instead of silently truncating. - **P1 — Bisection optimization**: When bisecting a failed batch, check the left half first. If it passes, all failures must be in the right half — skip the redundant `batch_check` call. This halves bisection cost for the common single-bad-proof case (3 batch_checks instead of 6 for a batch of 8). - **P2 — O(1) queue front-erase**: Change `queue_` from `std::vector` to `std::deque` so front-erasure in `coordinator_loop` is O(1) instead of O(n). - **P4 — Single syscall write**: Combine the 4-byte header and payload into a single buffer in `write_frame` for one `write()` syscall instead of two. - **P5 — Default harmonization**: Change C++ `BatchVerifierConfig::batch_size` default from 4 to 8 to match the TypeScript default. ## Test plan - Existing batch verifier tests (`batch_verifier_queue.test.ts`, `batch_verifier.test.ts`) cover all bisection patterns including random patterns with multiple bad proofs — these validate the P1 bisection optimization. - The `execFileSync` change is a drop-in replacement with identical behavior for valid paths. - The `std::deque` change is API-compatible with `std::vector` for all operations used. --------- Co-authored-by: AztecBot <tech@aztecprotocol.com>
Collaborator
|
/claudebox fix CI denoise/./bootstrap.sh build_gcc_syntax_check_only — failed (138s) |
Collaborator
Author
|
⏳ Run #1 — Session completed (5m) Pushed fix to #21460 — two issues: GCC couldn't prove memcpy bound in |
| transcript_msm_x_inverse_trace = (row_msm_infinity || msm_accumulator_trace.is_point_at_infinity()) | ||
| ? 0 | ||
| : (msm_accumulator_trace.x - offset_generator().x); | ||
| transcript_msm_x_inverse_trace = |
28de31e to
d163b17
Compare
d163b17 to
f581dfb
Compare
44798f2 to
9b0194c
Compare
f581dfb to
510ffbe
Compare
9b0194c to
755aa9c
Compare
510ffbe to
1ee7350
Compare
TypeScript integration for the batch chonk verifier C++ service: - BatchChonkVerifier: TS orchestrator managing bb subprocess, FIFO pipe, and proof lifecycle (peer path with batching) - FifoFrameReader: length-delimited frame reader for named pipes - QueuedIVCVerifier: concurrency limiter + OTel metrics (RPC path) - TestCircuitVerifier: fake verifier for non-real-proofs mode - BBCircuitVerifier used for RPC path (file-based, one proof at a time) - P2P proof validation now optional (undefined = skip) - Config: bbRpcVerifyConcurrency, bbPeerVerifyBatchSize - Integration tests and queue robustness tests via bb.js bindings
1ee7350 to
9ed03ff
Compare
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.
Summary
Asynchronous batch verification service for Chonk IVC proofs. Builds on Luke's primitives from #21083 (
reduce_to_ipa_claim,batch_reduce_verify).Architecture & Design Doc
3-phase pipeline: parallel reduce (work-stealing) → batch IPA check (single MSM) → emit OK or bisect failures. Results stream over a named pipe as size-delimited msgpack.
ChonkBatchVerifier(inchonk/batch_verifier/) — the async pipeline core. Supersedes Luke's simple synchronousChonkBatchVerifierwith parallel reduce, work-stealing, and bisection-based failure isolation.ChonkBatchVerifierService(inbbapi/) — FIFO streaming wrapper + Start/Queue/Stop RPC commands.Test plan
chonk_tests— 4ChonkBatchVerifierTestspass (valid batch, flush-on-stop, bisection, invalid VK)bbapi_tests— builds cleanci-barretenberg