Skip to content

Feat/soroban reconciliation gap backfill#1012

Merged
Olowodarey merged 7 commits into
Arena1X:mainfrom
strngecloud:feat/soroban-reconciliation-gap-backfill
Jun 22, 2026
Merged

Feat/soroban reconciliation gap backfill#1012
Olowodarey merged 7 commits into
Arena1X:mainfrom
strngecloud:feat/soroban-reconciliation-gap-backfill

Conversation

@strngecloud

Copy link
Copy Markdown
Contributor

Soroban on-chain event reconciliation & gap-backfill job

Adds a self-healing reconciliation layer to the indexer that detects and backfills gaps between the last indexed ledger and chain head when the process goes down, RPC drops, or events are missed.

Changes

  • ChainSyncCheckpoint entity — per-contract sync state tracking last indexed ledger, chain head, and reconciliation metadata
  • ReconciliationService@Cron job that detects ledger gaps and backfills missing events as PENDING for the existing retry pipeline
  • Ingest path updatesIndexerService and SorobanListener advance the checkpoint; checkpoint never advances past events that failed to persist
  • Health endpointGET /api/indexer/health/reconciliation reports reconciliation status and non-negative lag
  • Env configRECONCILE_ENABLED, RECONCILE_INTERVAL_MS, RECONCILE_WINDOW with sensible defaults
  • Migration for chain_sync_checkpoints table
  • Unit tests for ReconciliationService and updated specs for existing services

Test plan

  • Lint passes (0 errors)
  • All 487 unit tests pass
  • Build succeeds
  • Verify gap backfill: kill indexer, advance chain, restart — gap is filled
  • Verify idempotency: re-running reconciliation over indexed ledgers inserts zero duplicates
  • Verify checkpoint safety: checkpoint never advances past failed persists
  • Verify health endpoint reports non-negative lag

Closes #1004

strngecloud and others added 7 commits June 22, 2026 00:31
Per-contract sync checkpoint to track last indexed ledger, chain head,
and reconciliation metadata for gap detection and self-healing indexing.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Periodic reconciliation job that detects gaps between the last indexed
ledger and chain head, then backfills missing events as PENDING for the
existing indexer retry pipeline to process.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Both IndexerService.pollContractEvents and SorobanListener.pollEvents now
call ReconciliationService.advanceCheckpoint after persisting events so
the checkpoint never advances past events that failed to persist.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
GET /api/indexer/health/reconciliation exposes reconciliation status,
whether it is running, last backfill count, and the lag in ledgers
(always >= 0) between chain head and last indexed ledger.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…erModule

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…env vars

Optional configuration for the reconciliation job with sensible defaults.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@vercel

vercel Bot commented Jun 21, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
insight-arena-4rll Ready Ready Preview, Comment Jun 21, 2026 11:37pm

@Olowodarey Olowodarey merged commit 718cd20 into Arena1X:main Jun 22, 2026
5 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.

[Backend] — Soroban on-chain event reconciliation & gap-backfill job

2 participants