Skip to content

feat: add prover and miner count time-series graphs - #44

Merged
mintybasil merged 5 commits into
mainfrom
zeroklaw/issue-42-prover-miner-graphs
May 12, 2026
Merged

feat: add prover and miner count time-series graphs#44
mintybasil merged 5 commits into
mainfrom
zeroklaw/issue-42-prover-miner-graphs

Conversation

@zeroklaw

Copy link
Copy Markdown
Member

Summary

Adds time-series graphs for Miner Count and Active Provers to the PoVW & Market Cycles tab, as requested in #42.

Changes

New API endpoint: /api/provers-history

  • Fetches current prover count from explorer.boundless.network/api/base/provers/summary/1d
  • Accumulates daily snapshots in KV (permanent, no TTL — historical data is immutable)
  • Maps daily snapshots to epochs by averaging the prover counts over each 2-day epoch window
  • Gracefully degrades to empty array when upstream is unavailable

Frontend: PovwCycles.tsx

  • Extended EpochPoint interface with minerCount (from epoch data) and activeProvers (from prover-history API)
  • Added ProversHistoryBucket interface and useEffect to fetch from /api/provers-history
  • Updated mergeEpochData() to accept and merge prover history data
  • Added Miner Count per Epoch AreaChart (blue #3b82f6) — shows num_participants per epoch over time
  • Added Active Provers per Epoch AreaChart (green #22c55e) — shows averaged daily prover count per epoch
  • Both charts only render when their respective data is available (> 0 values exist)

Closes #42

- Add /api/provers-history endpoint that accumulates daily prover count
  snapshots in KV and maps them to epochs (2-day averages)
- Add minerCount and activeProvers fields to EpochPoint interface
- Add ProversHistoryBucket type and fetch from new endpoint
- Add Miner Count per Epoch AreaChart (blue #3b82f6)
- Add Active Provers per Epoch AreaChart (green #22c55e)
- Charts conditionally render only when data is available
@github-actions

github-actions Bot commented May 11, 2026

Copy link
Copy Markdown

Preview deployment

URL
Latest commit https://5b7873d8.boundless-profit-explorer.pages.dev
Branch alias https://head.boundless-profit-explorer.pages.dev

The branch alias URL always points to the latest commit on this PR.

@zeroklaw
zeroklaw marked this pull request as ready for review May 11, 2026 18:46

@mintybasil mintybasil left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Miner data looks good, everything is working. For the "prover count" I think we have two related issues.

  1. There is no graph shown
  2. Data fetching seems limited

I'm assuming that issue 1 is caused by issue 2. AFAICT to fetch the prover count we are just loading explorer.boundless.network/api/base/provers/summary/1d. However this only provides a snapshot for a recent day. We need to backfill the data for all available epochs. In the explorer UI they have a stat Daily unique provers, which has exactly the data we need, perhaps you can try to find the API endpoint. This is part of the "stats" data, not a prover-specific endpoint.

Also - one potential miscommunication, we should be adding ONE graph with both counts.

@zerokrab zerokrab deleted a comment from zeroklaw May 12, 2026
- Update /api/provers-history to fetch from /base/stats endpoint
  using unique_provers_locking_requests field instead of
  /api/base/provers/summary/1d which only provides current snapshot
- Group daily stats by epoch_number_start (same approach as market-stats)
- Combine Miner Count and Active Provers into single chart
  as requested in review
@zeroklaw

Copy link
Copy Markdown
Member Author

Thanks for the review! I've addressed both issues:

1. Fixed data fetching to use historical data

  • Changed /api/provers-history to fetch from /base/stats endpoint (same as /api/market-stats)
  • Now uses unique_provers_locking_requests field which provides historical daily unique prover counts
  • Groups by epoch_number_start to map daily data to epochs (same approach as market-stats)
  • This provides backfilled data for all available epochs, not just a single day snapshot

2. Combined into ONE graph

  • Merged the "Miner Count per Epoch" and "Active Provers per Epoch" charts into a single chart titled "Miner & Prover Count per Epoch"
  • Both metrics are now displayed together with a legend (blue for Miner Count, green for Active Provers)
  • Chart only renders when either metric has data

Changes pushed to this branch. The prover count graph should now show historical data for all epochs.

@mintybasil
mintybasil merged commit 14454ea into main May 12, 2026
1 check passed
@mintybasil
mintybasil deleted the zeroklaw/issue-42-prover-miner-graphs branch May 12, 2026 20:38
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.

Add prover and miner count graphs

2 participants