Skip to content

Wire /api/v1/validators and add a network validator-dominance bar chart page block #2565

Description

@JSONbored

The backend ships a network-wide validator leaderboard at GET /api/v1/validators (handleGlobalValidators) that no UI fetches (query count = 0). Surfacing it as a new cross-subnet validator-dominance chart is higher-touch: it needs a new query + type + normalizer, a new route/page or a substantial home block, and careful pagination/empty handling — larger than a single reuse-a-chart bounty and better owned by a maintainer to decide placement (new /validators route vs home block).

Deliverables

  • Add a GlobalValidators type + normalizer + globalValidatorsQuery to src/lib/metagraphed/queries.ts calling /api/v1/validators
  • Add a validator-dominance chart (BarMini or the new dominance-treemap) ranking operators by cross-subnet footprint/stake share
  • Decide and implement placement (new route repo-ui/src/routes/validators.tsx or an Explorer/home block) — architectural call
  • Handle cold/empty leaderboard and pagination
  • Full unit coverage of the normalizer and chart mapping including empty branches

References

  • repo/workers/request-handlers/entities.mjs (handleGlobalValidators @236)
  • repo-ui/src/lib/metagraphed/queries.ts
  • assessment/gapMatrix.md (Table A: GET /api/v1/validators, flagged unused leaderboard)

📸 Required: before/after screenshots (this is a UI change)

Non-negotiable. PRs that change UI must include a before/after screenshot table. PRs without it are automatically closed — no exceptions.

Rules:

  • Show every page/feature you changed — before and after, one row each.
  • Use the markdown table below. Screenshots go inside the table only — no large full-size images pasted elsewhere in the PR.
  • Each cell is a clickable thumbnail (a small image linking to the full-size image) with a one-line caption underneath.
  • Upload screenshots to the PR by drag-and-drop (GitHub hosts them on its CDN). Do NOT commit image files to the repo.

Copy this and fill it in (replace FULL_IMAGE_URL with the URL GitHub gives you after you drop the image in):

| Page / Feature | Before | After |
|---|---|---|
| `/your-route` | [<img src="FULL_IMAGE_URL" width="260">](FULL_IMAGE_URL)<br><sub>before: short caption</sub> | [<img src="FULL_IMAGE_URL" width="260">](FULL_IMAGE_URL)<br><sub>after: short caption</sub> |


size: M · maintainer-only (owner)

Metadata

Metadata

Assignees

Labels

frontendFrontend / metagraphed-ui workmaintainer-onlyOwner-only work — yields no Gittensor points.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions