Skip to content

fix(report): render charts for single-role runs and missing validator metrics#204

Draft
meyer9 wants to merge 1 commit into
mainfrom
fix/report-charts-single-role
Draft

fix(report): render charts for single-role runs and missing validator metrics#204
meyer9 wants to merge 1 commit into
mainfrom
fix/report-charts-single-role

Conversation

@meyer9

@meyer9 meyer9 commented Jul 20, 2026

Copy link
Copy Markdown
Collaborator

Summary

The run-comparison charts page assumed every run has both sequencer and validator metrics. For sequencer-only runs (no metrics-validator.json) the charts page broke in two ways. This PR makes it degrade gracefully so you can always compare runs — including grouping by Transaction Payload when only one role is present.

Problems fixed

  1. Missing-validator blanked the whole page. ChartSelector fabricated both a sequencer and a validator series for every run. Fetching the non-existent validator metrics 404'd, and that rejected the entire Promise.all batch in useMultipleDataSeries, so no charts rendered.

    • Now: a role series is only emitted when that role's metrics exist (result.sequencerMetrics / result.validatorMetrics), and an individual failed fetch degrades to an empty series instead of failing the batch. ChartGrid already skips empty series.
  2. Group-by broke with a single role. The default group-by is role, but a dimension with only one value is dropped from the available variables. The default then pointed at an unavailable dimension, and the role memo threw on variables.role[0] (undefined), breaking every non-role group-by.

    • Now: useBenchmarkFilters falls back to the first available variable (e.g. TransactionPayload) when the requested group-by isn't available, and guards the role lookup with a data-derived fallback. So comparing by Transaction Payload works with a single role.

Changed files

  • report/src/components/ChartSelector.tsx — only emit role variants that have metrics; bind UI to the effective group-by.
  • report/src/hooks/useBenchmarkFilters.tseffectiveByMetric fallback + safe role memo.
  • report/src/utils/useDataSeries.ts — per-series graceful failure instead of batch rejection.
  • report/src/pages/RunComparison.tsx — keep completed runs chartable regardless of the success flag.

Testing

  • tsc --noEmit: no new errors in the changed files.
  • eslint: clean on the changed files.
  • Verified against a real sequencer-only 6-run comparison: charts render and "Show Line Per → Transaction Payload" shows one line per run.

Opened as draft for review.

… metrics

The run-comparison charts page assumed every run had both sequencer and
validator metrics. For sequencer-only runs (no metrics-validator.json)
two things broke:

- ChartSelector fabricated a validator series for every run; fetching its
  missing metrics 404'd and rejected the whole Promise.all batch, blanking
  the page. It now emits a role series only when that role's metrics exist,
  and useMultipleDataSeries degrades an individual failed fetch to an empty
  series instead of failing the batch.
- Grouping fell back to the 'role' dimension, which collapses to a single
  value when only one role is present, so it was dropped from the available
  variables. The default then pointed at an unavailable dimension and the
  role memo threw on variables.role[0]. useBenchmarkFilters now falls back
  to the first available variable (e.g. TransactionPayload) and guards the
  role lookup, so you can compare by transaction payload with a single role.
@cb-heimdall

Copy link
Copy Markdown
Collaborator

🟡 Heimdall Review Status

Requirement Status More Info
Reviews 🟡 0/1
Denominator calculation
Show calculation
1 if user is bot 0
1 if user is external 0
2 if repo is sensitive 0
From .codeflow.yml 1
Additional review requirements
Show calculation
Max 0
0
From CODEOWNERS 0
Global minimum 0
Max 1
1
1 if commit is unverified 1
Sum 2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants