feat: add prover and miner count time-series graphs - #44
Conversation
- 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
Preview deployment
The branch alias URL always points to the latest commit on this PR. |
mintybasil
left a comment
There was a problem hiding this comment.
Miner data looks good, everything is working. For the "prover count" I think we have two related issues.
- There is no graph shown
- 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.
- 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
|
Thanks for the review! I've addressed both issues: 1. Fixed data fetching to use historical data
2. Combined into ONE graph
Changes pushed to this branch. The prover count graph should now show historical data for all epochs. |
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-historyexplorer.boundless.network/api/base/provers/summary/1dFrontend:
PovwCycles.tsxEpochPointinterface withminerCount(from epoch data) andactiveProvers(from prover-history API)ProversHistoryBucketinterface anduseEffectto fetch from/api/provers-historymergeEpochData()to accept and merge prover history data#3b82f6) — showsnum_participantsper epoch over time#22c55e) — shows averaged daily prover count per epochCloses #42