Symptom
The Starknet indexer (apps/api, built on @snapshot-labs/checkpoint) periodically halts and falls thousands of blocks behind chain tip (recently observed ~17k blocks behind). When it stalls, downstream data goes stale: voting numbers on the interface stop updating until the indexer is manually recovered.
This has recurred (it has happened before on a network and was flagged to investigate), so it is not a one-off.
Constraint: cannot be naively auto-restarted
We currently restart it manually. It cannot be safely auto-restarted because the indexing path does not run inside DB transactions, so a restart can leave it in an inconsistent state and end up in a deadlock. Quote from the discussion: "we dont have transactions so when we restart there is a chance we end up in deadlock."
Goal
- Investigate the root cause of the stalls (why the indexer head stops advancing).
- Make restart safe and idempotent so recovery (manual or automated) cannot deadlock. Options to consider:
- Transactional checkpointing (wrap block-write + checkpoint cursor in a single DB transaction so a restart resumes cleanly).
- A documented safe-restart procedure / lock handling if full transactions are not feasible short term.
Infra context
DigitalOcean hosts; Cloudflare domains (api-arb1 / api-indexer-2.snapshot.box, some old/killed); Checkpoint console at console.checkpoint.box.
Notes
Filed in sx-monorepo since apps/api is the deployed indexer service that consumes Checkpoint. If the fix turns out to be in the framework itself, the related repo is snapshot-labs/checkpoint.
Related: monitoring/alerting tracked in #2163
To handle next week.
Symptom
The Starknet indexer (
apps/api, built on@snapshot-labs/checkpoint) periodically halts and falls thousands of blocks behind chain tip (recently observed ~17k blocks behind). When it stalls, downstream data goes stale: voting numbers on the interface stop updating until the indexer is manually recovered.This has recurred (it has happened before on a network and was flagged to investigate), so it is not a one-off.
Constraint: cannot be naively auto-restarted
We currently restart it manually. It cannot be safely auto-restarted because the indexing path does not run inside DB transactions, so a restart can leave it in an inconsistent state and end up in a deadlock. Quote from the discussion: "we dont have transactions so when we restart there is a chance we end up in deadlock."
Goal
Infra context
DigitalOcean hosts; Cloudflare domains (api-arb1 / api-indexer-2.snapshot.box, some old/killed); Checkpoint console at console.checkpoint.box.
Notes
Filed in
sx-monoreposinceapps/apiis the deployed indexer service that consumes Checkpoint. If the fix turns out to be in the framework itself, the related repo issnapshot-labs/checkpoint.Related: monitoring/alerting tracked in #2163
To handle next week.