Skip to content

feat: halt indexer on block failure with retry and partial progress#75

Open
metalboyrick wants to merge 6 commits into
developfrom
feat/halt-indexer-on-block-failure
Open

feat: halt indexer on block failure with retry and partial progress#75
metalboyrick wants to merge 6 commits into
developfrom
feat/halt-indexer-on-block-failure

Conversation

@metalboyrick
Copy link
Copy Markdown
Collaborator

@metalboyrick metalboyrick commented Mar 1, 2026

Summary

  • Halt on failure: When a block fails processing, the indexer halts and stops accepting new blocks
  • Automatic retry: Failed blocks are retried every 10s; on success the indexer resumes automatically
  • Partial progress: processHistoricalBlocks uses per-block transactions so blocks before a failure are committed (cursor updated per block)
  • All existing halt guards preserved (subscribeToNewHeads, processNewHead, processBlockQueue, processHistoricalBlocks loop)

Test plan

  • All 48 existing + new tests pass (npm test in packages/auco-indexer)
  • Verify halt adds failed block to retry queue and starts retry timer
  • Verify no duplicate entries in failed blocks list
  • Verify resume clears halt state after successful retry
  • Verify partial progress: blocks 1-2 committed when block 3 fails, cursor at block 2

metalboyrick and others added 4 commits February 11, 2026 03:50
Replace the failed-block retry mechanism with a halt-on-failure approach.
When a block fails processing, the indexer now halts completely and refuses
to process further blocks, preventing data gaps and database inconsistencies.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@metalboyrick metalboyrick changed the title Feat/halt indexer on block failure feat: halt indexer on block failure Mar 1, 2026
- Add automatic retry of failed blocks on a 10s timer
- Resume indexer automatically when all retries succeed
- Refactor processHistoricalBlocks to per-block transactions for partial
  progress (blocks before failure are committed)
- Update cursor per-block during historical sync for correct restart
- Add tests for retry queue, resume, dedup, and partial progress

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@metalboyrick metalboyrick changed the title feat: halt indexer on block failure feat: halt indexer on block failure with retry and partial progress Mar 4, 2026
Add `retryInterval` option to IndexerConfig (default: 10000ms) instead
of hardcoding the retry interval.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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