Skip to content

Commit 894ed8c

Browse files
committed
docs: update report data contract to reflect current state
Updates the data contract doc to match the production-ready state: - TL;DR: describes the per-run-directory S3 layout (not the old central metadata/ directory) - Producer responsibilities: reordered to reflect the commit-signal pattern (metrics first, metadata.json last) - Standard testConfig keys: adds TimeBucket as a server-synthesized key (stamped by the report-api on [Compare: Time] clones only), adds Source column to distinguish producer-written vs server-written - Comparison groups: expanded with step-by-step UI instructions (select [Compare: ...] → switch Show Line Per → TimeBucket or ClientVersion), exact bucket boundaries, when each group appears, stable-ID and non-mutation properties - All references to the old metadata/ layout updated
1 parent 80941d1 commit 894ed8c

1 file changed

Lines changed: 78 additions & 57 deletions

File tree

‎docs/report-data-contract.md‎

Lines changed: 78 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,20 @@ shape into the same S3 layout.
1212

1313
## TL;DR
1414

15-
- One S3 bucket. Under it: `metadata/` directory of small JSON files
16-
describing runs, and `<outputDir>/` directories holding per-block
17-
metrics for each run.
18-
- The report-api (`protocols/base-benchmarking/report-api`) merges all
19-
`metadata/*.json` files into a single `GET /output/metadata.json`
20-
response. The UI consumes that one response.
21-
- To add a benchmark run: drop one JSON file into `metadata/` and the
22-
per-block metrics under its `outputDir`. No central file to update.
23-
- To compare across versions, time windows, or any other axis: write
24-
the axis value into `testConfig` and the report-api groups
25-
automatically.
15+
- One S3 bucket. Each run owns one prefix: `<outputDir>/metadata.json`
16+
(run metadata) + `<outputDir>/metrics-<role>.json` (per-block
17+
timeseries). No central file to update.
18+
- The report-api (`protocols/base-benchmarking/report-api`) lists all
19+
top-level prefixes, reads the `metadata.json` under each, and merges
20+
them into a single `GET /output/metadata.json` response. The UI
21+
consumes that one response.
22+
- To add a benchmark run: upload metrics files first, then
23+
`<outputDir>/metadata.json` last. The metadata file is the commit
24+
signal — in-progress runs are invisible until it lands.
25+
- To compare across versions or time windows: write
26+
`testConfig.ClientVersion` per build. The report-api synthesizes
27+
`[Compare: Versions]` and `[Compare: Time]` groups automatically and
28+
injects them into the same dropdown the user already uses.
2629

2730
## S3 layout
2831

@@ -136,15 +139,16 @@ set. The report-api **auto-generates comparison groups** from
136139

137140
#### Standard `testConfig` keys
138141

139-
| Key | Meaning | Notes |
140-
|---|---|---|
141-
| `BenchmarkRun` | Cohort ID | Required. |
142-
| `TransactionPayload` | Payload type | One per execution variant. |
143-
| `GasLimit` | Block gas limit | int. |
144-
| `BlockTimeMilliseconds` | Target block time | int. |
145-
| `NodeType` | EL flavor under test | e.g., `builder`, `reth`, `geth`, `base-reth-node`. |
146-
| `ClientVersion` | EL binary version | Format: `<name>/v<semver>-<7sha>`. The report-api groups by exact-match — pin it to a stable identifier per build. |
147-
| `ValidatorNodeType` | Validator EL flavor | Optional; defaults to `NodeType`. |
142+
| Key | Source | Meaning | Notes |
143+
|---|---|---|---|
144+
| `BenchmarkRun` | Producer | Cohort ID | Required. All inner runs of one execution share this value. |
145+
| `TransactionPayload` | Producer | Payload type | One per execution variant. |
146+
| `GasLimit` | Producer | Block gas limit | int. |
147+
| `BlockTimeMilliseconds` | Producer | Target block time | int. |
148+
| `NodeType` | Producer | EL flavor under test | e.g., `builder`, `reth`, `geth`, `base-reth-node`. |
149+
| `ClientVersion` | Producer | EL binary version | Format: `<name>/v<semver>-<7sha>`. Report-api groups by exact-match — pin to a stable identifier per build. Drives `[Compare: Versions]`. |
150+
| `ValidatorNodeType` | Producer | Validator EL flavor | Optional; defaults to `NodeType`. |
151+
| `TimeBucket` | Report-api (synthetic only) | Which time window a comparison run came from | `1d`, `1w`, or `1m`. Only present on `[Compare: Time]` synthetic clones. Drives "Show Line Per: TimeBucket" in the chart UI. Never write this yourself — the report-api stamps it. |
148152

149153
You can add any other key. The UI handles them generically — no
150154
frontend change required.
@@ -193,51 +197,68 @@ renders, just with raw key names.
193197
## Comparison groups (automatic)
194198

195199
The report-api automatically synthesizes two kinds of comparison
196-
"runs" alongside the natural ones:
197-
198-
- **`[Compare: Time] <network> <testName>`** — picks the latest run
199-
per variant per time bucket (`1d`/`1w`/`1m`).
200-
- **`[Compare: Versions] <network> <testName>`** — picks the latest
201-
run per variant per distinct `ClientVersion`.
202-
203-
These appear in the existing dropdown next to the natural
204-
`BenchmarkRun` IDs. Selecting one loads runs spanning the comparison
205-
dimension; the user picks `Show Line Per: ClientVersion` (or any
206-
other testConfig key) in the existing chart UI to overlay them as
207-
separate chart series.
200+
"runs" alongside the natural ones. No frontend change is needed —
201+
they appear in the existing dropdown, and the existing chart page
202+
renders them.
203+
204+
- **`[Compare: Time] <testName>`** — picks the most recent run
205+
per variant per time window: `1d` (last 24h), `1w` (1–7 days
206+
ago), `1m` (7–30 days ago). The report-api stamps
207+
`testConfig.TimeBucket` (`"1d"` / `"1w"` / `"1m"`) on each clone
208+
so the chart UI can split on it.
209+
- **`[Compare: Versions] <testName>`** — picks the most recent run
210+
per variant per distinct `testConfig.ClientVersion`.
211+
212+
**How to use them in the UI:**
213+
214+
1. Select a `[Compare: …]` entry from the run dropdown.
215+
2. On the chart comparison page, change `Show Line Per` to:
216+
- **`TimeBucket`** for time comparisons (`1d` vs `1w` vs `1m`)
217+
- **`ClientVersion`** for version comparisons
218+
3. The chart overlays one line per bucket/version per role.
219+
220+
**When they appear:**
221+
222+
- **Time comparison**: as soon as ≥2 of the three buckets have data
223+
for a given `(testName, network)`. Any benchmark with a few weeks
224+
of history qualifies immediately.
225+
- **Version comparison**: as soon as ≥2 distinct
226+
`testConfig.ClientVersion` values exist for a given cohort.
227+
Empty/missing versions are silently skipped. Requires the
228+
`base/benchmark` runner change that populates `ClientVersion`.
208229

209-
For these to populate:
230+
A cohort with fewer than 2 distinct buckets is dropped from the
231+
dropdown — a comparison of one thing isn't a comparison.
210232

211-
- **Time comparison** needs runs spanning ≥2 time buckets. Any
212-
reasonable history satisfies this.
213-
- **Version comparison** needs runs with ≥2 distinct
214-
`testConfig.ClientVersion` values. Empty/missing versions are
215-
silently skipped.
233+
**Synthetic IDs are stable**: `compare-time-mainnet-base-mainnet-performance-benchmark-scale-base-over-150m-gas-limit`
234+
is the same `BenchmarkRun` ID across every metadata refresh, so URLs
235+
are bookmarkable.
216236

217-
A cohort with fewer than 2 distinct buckets is dropped from the
218-
dropdown — a "comparison" of one thing isn't a comparison.
237+
**Source runs are not modified**: synthetic entries are deep clones
238+
with rewritten `BenchmarkRun` and a `[Compare: …]` prefix on
239+
`testName`. The originals continue to appear under their natural IDs.
219240

220241
## Producer responsibilities
221242

222243
A new producer (Rust, monorepo, whatever) needs to:
223244

224-
1. **Write one or more `metadata-<unique>.json` files** under
225-
`s3://<bucket>/metadata/`. Filename only matters in that the
226-
report-api lists everything ending in `.json` and processes it in
227-
listing order (later writes deduplicate earlier ones on the
228-
compound key `(id, outputDir)`).
229-
2. **Write per-block metrics** to
230-
`s3://<bucket>/<outputDir>/metrics-<role>.json` for each
231-
`runs[].outputDir`. Use the role names the report knows
232-
(`sequencer`, `validator`) so the frontend's per-role panels
233-
populate, or document the custom role somewhere the user can find
234-
it.
235-
3. **Populate `testConfig.ClientVersion`** with a value distinct per
236-
build. Without this, version-comparison groups can't form.
237-
4. **Populate `createdAt`** as RFC3339. Required for retention and
238-
time-comparison.
239-
5. Optionally populate `thresholds`, `machineInfo`, `testDescription`
240-
— improves the report UI but nothing breaks without them.
245+
1. **Write metrics first**: upload
246+
`s3://<bucket>/<outputDir>/metrics-<role>.json` for each role
247+
(`sequencer`, `validator`). Use the canonical role names so the
248+
frontend's per-role panels populate.
249+
2. **Write `metadata.json` last**: upload
250+
`s3://<bucket>/<outputDir>/metadata.json` as the final step.
251+
This is the **commit signal** — the run becomes visible to the
252+
report-api only after this file lands. A run whose prefix exists
253+
but has no `metadata.json` is silently ignored.
254+
3. **Populate `testConfig.ClientVersion`** with a stable per-build
255+
identifier. Without this, `[Compare: Versions]` groups can't
256+
form. Use `<name>/v<semver>-<7sha>` format.
257+
4. **Populate `createdAt`** as RFC3339. Required for retention,
258+
sort order, and time-bucket comparisons.
259+
5. Optionally populate `thresholds`, `machineInfo`,
260+
`testDescription` — improves the report UI but nothing breaks
261+
without them.
241262

242263
That's the whole contract. No registration, no schema service, no
243264
central file to update.

0 commit comments

Comments
 (0)