Repository navigation
Conversation
…amples, fan out receipt RPCs
…block receipt collection
There was a problem hiding this comment.
An organization admin can view or raise the monthly spending cap at claude.ai/admin-settings/usage, on the Claude Code Review row under Services. The cap resets at the start of the next billing period.
Once the cap resets or is raised, someone with write access to this repository can comment @claude review on this pull request to trigger a review.
…, and stream ClickHouse receipt batches
There was a problem hiding this comment.
The latest push brings back an issue flagged in an earlier review; replied in that comment's thread.
Still open from earlier reviews (1):
- 🔴
crates/bench-cli/src/send.rs:81—Multi-validator bench send runs can now fail at the end with "failed to collect block receipts" when any validator lags…
If you have decided not to act on one of these findings, resolve its thread (a reply alone leaves it open) and the next review stops counting it. To review this commit again now, use Re-run on its "Claude Code Review" check.
There was a problem hiding this comment.
I re-reviewed the latest push and found no new bugs. The PR hand-rolls a deflate/gzip writer with a CRC-32 combine port and adds concurrent RPC and ClickHouse paths, so a human look is still worthwhile.
What was reviewed:
- Receipt fan-out: when a secondary provider returns null or errors, the block is now fetched from providers[0], and a secondary that errors stops taking blocks. A lagging validator no longer fails the run.
- ParallelGzipWriter: it now writes a single gzip member (sync-flushed raw deflate chunks, then an empty final block and the combined CRC/ISIZE trailer), and an empty input still produces a valid gzip file.
- ClickHouse: receipt rows are built lazily inside the bounded
buffer_unorderedstream, and only bodies of 4 KiB or more get gzip withContent-Encoding.
Extended reasoning...
The change touches five files in bench-core and bench-cli: receipt collection across RPC providers, a custom parallel gzip encoder for the samples sidecar, and concurrent gzipped ClickHouse inserts. No auth, crypto or permission surface is involved. The ClickHouse credential headers are passed through unchanged. Later commits appear to address the earlier inline findings (lagging providers, multi-member and empty gzip, eager receipt row building). I deferred because the change is about 700 lines and includes a hand-written deflate framing and CRC-32 combine whose correctness rests on a few unit tests.
Summary
Speeds up post-run benchmark processing in
bench-coreandbench-cli:crates/bench-core/src/reporter.rs): Replaces single-threadedGzEncoderwithParallelGzipWriter(up to 16 threads, 4 MiB chunks, level-6Compression::default(), valid RFC 1952 multi-member gzip). Cuts.samples.ndjson.gzwriting from ~31s to ~6.4s on multi-region runs while preserving ~146 MiB output size.crates/bench-core/src/receipt_metrics.rs,crates/bench-cli/src/send.rs):BlockReceiptCollector::finish_with_providersto fan outeth_getBlockReceiptsacross all configured RPC endpoints using a dynamicAtomicU64work queue (so low-RTT validators absorb most blocks instead of stalling behind high-RTT regions).MinimalBlockReceipt(skippinglogs,logsBloom, and extra network fields).HashMap/HashSetfor tracked-tx deduplication and avoids cloning label maps per record during aggregation.crates/bench-core/src/clickhouse.rs,crates/bench-core/src/receipt_clickhouse.rs,crates/bench-core/src/reporter.rs):JSONEachRowpayloads >= 4 KiB withContent-Encoding: gzip.sample_batch_sizechunks and sends up to 6 batches concurrently for both metric samples andtxgen_receipt_gasinserts.Verification
cargo test -p bench-core --lib(174 passed, includingminimal_block_receipt_ignores_logs_and_extra_fields,gzips_large_clickhouse_payloads, andparallel_gzip_writer_produces_valid_multi_member_gzip)cargo test -p bench-cli --bins(48 passed)cargo test -p bench-core --test sender_auth -- --test-threads=2(29 passed)public-mix, 90s).