feat: batch chonk verifier TS integration#21460
Conversation
da347fb to
5533d02
Compare
91a0228 to
a164f96
Compare
6bb0fc6 to
63882d9
Compare
## 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>
|
/claudebox fix CI denoise/./bootstrap.sh build_gcc_syntax_check_only — failed (138s) |
|
⏳ Run #1 — Session completed (5m) Pushed fix to #21460 — two issues: GCC couldn't prove memcpy bound in |
28de31e to
d163b17
Compare
d163b17 to
f581dfb
Compare
44798f2 to
9b0194c
Compare
f581dfb to
510ffbe
Compare
9b0194c to
755aa9c
Compare
1ee7350 to
9ed03ff
Compare
490e3dc to
cc236e2
Compare
34d507b to
c5fa5d2
Compare
c5fa5d2 to
0f4ab30
Compare
dc59992 to
1b6da82
Compare
Adds 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 - TestCircuitVerifier used for both peer and RPC in fake-proof mode - BBCircuitVerifier + QueuedIVCVerifier for RPC path (real proofs) - Server splits proofVerifier into peerProofVerifier + rpcProofVerifier Config changes: - numConcurrentIVCVerifiers -> bbRpcVerifyConcurrency + bbPeerVerifyBatchSize - bbIVCConcurrency -> bbBatchVerifyThreads - QueuedIVCVerifier takes (verifier, concurrency) instead of (config, verifier) Integration tests and queue robustness tests via bb.js bindings.
1b6da82 to
7c72073
Compare
| @@ -199,6 +199,7 @@ describe('aztec node', () => { | |||
| epochCache, | |||
| getPackageVersion() ?? '', | |||
| new TestCircuitVerifier(), | |||
There was a problem hiding this comment.
We now have two verifier types
Adds
BatchChonkVerifier, the TS integration for the C++ batch chonk verifier service. Proofs arriving over P2P are batched so a single IPA SRS MSM covers the entire batch, with bisection to isolate bad proofs on failure.The node now runs two separate verification paths:
BatchChonkVerifier— persistent bb subprocess, FIFO pipe, batched IPABBCircuitVerifierwrapped inQueuedIVCVerifier— file-based, concurrency-limited, with OTel metricsTestCircuitVerifierfor both (always valid)New files:
BatchChonkVerifier,FifoFrameReader, integration tests, queue robustness tests, bench (wired intobootstrap.sh).QueuedIVCVerifierconstructor simplified from(config, verifier)to(verifier, concurrency).