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
346832e to
d3a2ad3
Compare
d3a2ad3 to
3f34ade
Compare
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.
Co-authored-by: Tomás Grüner <47506558+MegaRedHand@users.noreply.github.com>
d4694dd to
3f9f63e
Compare
…ass#591) ## 🗒️ Description / Motivation The binary has only ever run the node, so an invocation is a bare list of node flags. The offline block-building benchmark adds a second entry point, which means the node first needs a name of its own. `node` is an ordinary clap sub-command on a top-level parser that owns the binary's name, version and about. `NodeOptions` (renamed from `CliOptions`) becomes a plain `clap::Args` group and keeps every field exactly as it is — no `Option<T>`, no `required = true`, no unwrap helper on the node path, which is what the review of lambdaclass#497 objected to. The flat `ethlambda --genesis ...` form keeps working, because that is what the Dockerfile, lean-quickstart, the hive shim and the devnet skills all pass. clap has no `default_subcommand`, so exactly one thing sits in front of the parser: a command line that names no sub-command gets `node` inserted. ## What Changed | File | Change | |------|--------| | `bin/ethlambda/src/command.rs` | New. Top-level `Cli` parser + `Command` sub-command enum, and `default_subcommand`, which inserts `node` unless the first token is a sub-command, `-h/--help/-V/--version`, or clap's generated `help` | | `bin/ethlambda/src/cli.rs` | `clap::Parser` → `clap::Args`, and `CliOptions` renamed to `NodeOptions`; the `#[command(...)]` attribute moves to the top-level parser. No field changes | | `bin/ethlambda/src/main.rs` | Parses through `command::parse()` and matches on `Command` | `command.rs` also carries a test-only `parse_node_options` helper. Merging `main` brought lambdaclass#579's `cli.rs` tests, which called `CliOptions::parse_from` — a `clap::Parser` method the group lost when it became `clap::Args`. Git merged both sides cleanly, so nothing flagged it; the test build was broken until `a3d7e52`, and both test modules now parse a node command line through the real dispatch. ## Correctness / Behavior Guarantees - **Every existing invocation keeps working**, and clap owns everything a reader should not have to trust us for: `--help` lists the sub-commands itself, usage lines name the sub-command, and an unknown sub-command produces clap's error rather than a stray-positional one. - `NodeOptions` declares no positional arguments, so the first token after the program name is either a flag or a sub-command — a flag *value* never lands there and is never mistaken for one. A leading flag therefore means the flat node form. - **`--version` after node flags still works and still prints the same string.** It used to live on the node options, so it was accepted anywhere; `propagate_version` keeps that, and `display_name = "ethlambda"` keeps the output byte-identical rather than `ethlambda-node`. All three forms are asserted equal. - **One deliberate change:** a bare `ethlambda` now prints clap's top-level help, listing the sub-commands, instead of a missing-argument list. It still exits non-zero, and the test asserts both. ## Tests Added / Run Unit tests in `command.rs` pin: the flat parse; the two forms agreeing field for field; a `--node-id` value that is literally `node`; a trailing `node` token still rejected; a second `node` token rejected; missing required flags in both forms; the bare invocation's error kind and non-zero exit; `--help`/`--version` staying top-level; `--version` printing one identical string across all three forms; and `--help` listing the sub-commands. `make fmt`, `make lint`, `make test` (574 tests, 30 suites) — all clean. ## Related Issues / PRs - Replaces the CLI approach reviewed in the now-closed lambdaclass#497 - Design doc in lambdaclass#594; the benchmark stacks on this in lambdaclass#595 → lambdaclass#596 - Related to lambdaclass#465 ## ✅ Verification Checklist - [x] Ran `make fmt` — clean - [x] Ran `make lint` (clippy with `-D warnings`) — clean - [x] Ran `make test` (`cargo test --workspace --profile release-fast`) — all passing --------- Co-authored-by: Tomás Grüner <47506558+MegaRedHand@users.noreply.github.com>
🗒️ 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