Bug: GET /api/v1/epochs/{N}/participants returns 500 for past epochs (CreatedAtBlockHeight=0) #983
Bug
GET /api/v1/epochs/{N}/participants returns 500 Internal Server Error for past epochs. Current epoch works fine.
Repro
GET http://node1.gonka.ai:8000/api/v1/epochs/215/participants
→ 500 Internal Server Error: height must be greater than 0, but got 0
Epoch 215 consistently reproduces this. Any past epoch where CreatedAtBlockHeight was not yet populated will fail.
Root Cause
In queryActiveParticipants (get_participants_handler.go):
- First query (no height) fetches
activeParticipants blockHeight := activeParticipants.CreatedAtBlockHeight— for old epochs this is 0 (field was not populated at storage time)- Second call
QueryByKeyWithOptions(..., height=0, prove=true)— CometBFT rejectsheight=0with the above error
Fix
Check if blockHeight == 0 before the second query. If so, skip the proof query and return the first result directly, with a Warn log for observability.
Fix is implemented in PR #973.
🔄 Auto-synced from Issue #983 every hour.