Skip to content

fix: detect stale chain_status in indexer status endpoint#5

Merged
muhammetselimfe merged 1 commit into
mainfrom
dev
May 1, 2026
Merged

fix: detect stale chain_status in indexer status endpoint#5
muhammetselimfe merged 1 commit into
mainfrom
dev

Conversation

@muhammetselimfe
Copy link
Copy Markdown
Collaborator

Previously /api/v1/metrics/indexer/status reported healthy=true even when the underlying RPC was bootstrapping and the indexer was hours behind real chain tip. Root cause: latest_block comes from chain_status (set by the indexer from RPC.GetLatestBlock), so when the RPC reports a lagging tip, current_block and latest_block move in lockstep and blocks_behind stays at 0.

Adds a freshness check on chain_status.last_updated. The syncer only rewrites that timestamp after catching up to the RPC tip, so a stale value reliably signals a stuck or backfilling indexer. EVM threshold 5m, P-Chain 15m. P-Chain last_sync now reflects indexer activity (chain_status.last_updated) instead of the latest block timestamp.

Previously /api/v1/metrics/indexer/status reported healthy=true even
when the underlying RPC was bootstrapping and the indexer was hours
behind real chain tip. Root cause: latest_block comes from
chain_status (set by the indexer from RPC.GetLatestBlock), so when the
RPC reports a lagging tip, current_block and latest_block move in
lockstep and blocks_behind stays at 0.

Adds a freshness check on chain_status.last_updated. The syncer only
rewrites that timestamp after catching up to the RPC tip, so a stale
value reliably signals a stuck or backfilling indexer. EVM threshold
5m, P-Chain 15m. P-Chain last_sync now reflects indexer activity
(chain_status.last_updated) instead of the latest block timestamp.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@muhammetselimfe muhammetselimfe self-assigned this May 1, 2026
Copy link
Copy Markdown

@devin-ai-integration devin-ai-integration Bot left a comment

Choose a reason for hiding this comment

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

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 2 additional findings.

Open in Devin Review

@muhammetselimfe muhammetselimfe merged commit 07a465f into main May 1, 2026
3 checks passed
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.

1 participant