docs: document the block-building benchmark - #594
Conversation
🤖 Kimi Code ReviewReview of PR #594 — Block Building Benchmark Plan Overall Assessment: Well-structured design document with clear milestones. Several implementation details need correction before M2/M3 to avoid performance overhead and consensus risks. Critical Issues1. Incorrect RocksDB constraint (Section: Harness design)
2. Mock crypto safety boundary (Section: Harness design)
Consensus & Security Concerns3. Determinism guarantees (M1 deliverables)
4.
Performance & Correctness5. Histogram sampling thread safety (Phase capture section)
6. Datadir consistency during copy (Replay mode)
Code Quality7. CLI token dispatch fragility (CLI section)
8. XMSS key window validation (Keys section)
Minor Suggestions9. Schema versioning (Report section)
10. Memory backend cleanup (Synthetic corpus)
11. Error handling in synchronous main (CLI section)
SummaryThe plan is architecturally sound but Item 1 (RocksDB read-only) eliminates a major performance bottleneck in replay mode. Item 3 (determinism) is critical for the "identical block-root sequences" verification gate to be meaningful across different machines. Address these before M2 implementation. The Automated review by Kimi (Moonshot AI) · kimi-k2.5 · custom prompt |
🤖 Codex Code ReviewFindings:
No executable code is changed in this PR, so I don’t have code-correctness, security, memory-safety, or consensus-behavior findings beyond the documentation accuracy issues above. Automated review by OpenAI Codex · gpt-5.4 · custom prompt |
🤖 Claude Code ReviewReview:
|
c443f6b to
346832e
Compare
| The README roadmap lists **"Optimize block building" (issue #465)** as the top near-term | ||
| priority, but block building is only observable today through Prometheus histograms on a | ||
| live devnet — there is no reproducible, offline way to measure it or to compare an | ||
| optimization against a baseline. This adds an `ethlambda benchmark` sub-command that |
There was a problem hiding this comment.
This will get stale soon
There was a problem hiding this comment.
That was the right call, and it is why the plan file is deleted rather than edited: nothing in the tree now records how the benchmark was originally designed, only what it currently does. The milestone table went with it — the parts that were still true are in docs/benchmarking.md as current limitations.
There was a problem hiding this comment.
We should rewrite this as benchmark documentation instead of "this is how benchmarks were originally designed". This is useful for reviewing the other PRs, but will end up being misleading when we start modifying the benchmarks.
There was a problem hiding this comment.
Rewritten. docs/plans/block-building-benchmark.md is deleted; docs/benchmarking.md documents the benchmark in the present tense and is listed in SUMMARY.md under Development, so it sits with the other operational pages instead of as a design record.
I also restacked this PR onto #596, so the page describes behaviour that exists rather than behaviour still in review, and squashed it to one commit — otherwise the diff would have read "add plan doc, delete plan doc".
Two things the plan file never said and a reader needs: when two reports may not be compared at all (the resolved leanSig and leanVM revisions, plus the machine fields), and what is not supported yet — real crypto, the seal phase, replay from a datadir — written as current limitations rather than as milestones, so the page does not promise a schedule.
Review feedback on the first version of this PR: a `docs/plans/` file written as "this is how the benchmark was originally designed" goes stale the moment the benchmark changes, and then actively misleads. This documents what the benchmark does instead, in the mdbook alongside the other operational pages. Covers what to run and with which flags, which phases are measured and what is deliberately outside the span, how phase times are derived from the existing histogram, how to read a report, and what the block-root column is for — a root sequence that survives an optimization is the evidence that only speed changed. Two things the plan file never said, both of which a reader needs: when two reports may not be compared at all (the leanSig and leanVM revisions, and the machine fields), and what is not supported yet — real crypto, the seal phase, and replay from a datadir. Those are stated as current limitations rather than as milestones, so the page describes the tool rather than a schedule for it. The module doc in benchmark/mod.rs points at the new page.
346832e to
d3a2ad3
Compare
| Block building is otherwise only observable through the Prometheus histograms a | ||
| live node exports. Those are noisy, depend on whatever the network happened to | ||
| be doing, and cannot be diffed against a baseline — which makes them a poor | ||
| instrument for the work tracked in | ||
| [#465](https://github.com/lambdaclass/ethlambda/issues/465). The benchmark |
There was a problem hiding this comment.
| Block building is otherwise only observable through the Prometheus histograms a | |
| live node exports. Those are noisy, depend on whatever the network happened to | |
| be doing, and cannot be diffed against a baseline — which makes them a poor | |
| instrument for the work tracked in | |
| [#465](https://github.com/lambdaclass/ethlambda/issues/465). The benchmark | |
| Block building is otherwise only observable through the Prometheus histograms a | |
| live node exports. Those are noisy, depend on whatever the network happened to | |
| be doing, and cannot be diffed against a baseline — which makes them a poor | |
| instrument for tracking performance. The benchmark |
🗒️ Description / Motivation
Documents the block-building benchmark: what it measures, how to run it, how to read a
report, and what it cannot do yet.
This replaces the design plan this PR originally carried. Per review, a
docs/plans/file written as "this is how the benchmark was originally designed" goes stale the moment
the benchmark changes and then actively misleads, so the page now describes the tool
rather than a schedule for building it. The plan served its purpose — it was the shared
reference while #595 and #596 were reviewed — and is not something the tree should keep.
What Changed
docs/benchmarking.mddocs/SUMMARY.mddocs/plans/block-building-benchmark.mdbin/ethlambda/src/benchmark/mod.rsCorrectness / Behavior Guarantees
Documentation only — the one code change is a doc-comment path.
Two things the plan file never stated, both of which a reader needs:
leanSig and leanVM revisions plus the machine fields; leanSig tracks a moving branch
and leanVM performs the aggregation, so either one moving changes the measured crypto.
written as current limitations rather than as milestones, so the page does not promise
a schedule it cannot keep.
Tests Added / Run
make docsbuilds the site with the new page in place; no dangling references to theremoved plan file anywhere in the tree.
make fmt,make lint,make test(622 tests) — all clean.Related Issues / PRs
✅ Verification Checklist
make fmt— cleanmake lint(clippy with-D warnings) — cleanmake test(cargo test --workspace --profile release-fast) — all passing