Problem
lib/stellar/indexer.ts can advance to a later cursor after an earlier event in the page fails, permanently skipping financial data.
Scope
- Persist raw envelopes first, keyed by network, stream, ledger, transaction, and event index.
- Advance only through the highest contiguous successful sequence.
- Add per-stream leases with fencing for multiple replicas.
- Quarantine poison events with original payload and replay metadata.
- Add bounded replay, backfill, and rebuild commands.
- Detect missing ranges, wrong network/contract, stalls, and projection lag.
- Use a transaction or recoverable inbox for event/checkpoint writes.
Acceptance criteria
- Failure at N prevents checkpoint movement past N.
- Restart at any boundary produces the same result.
- Concurrent workers have single-writer semantics.
- Replay never duplicates financial effects.
- Health reports source, raw and projection checkpoints, lag, and oldest failure.
Required tests
Middle-page poison event, crash around every persistence step, lease race, full pagination, provider retry, and clean-rebuild equivalence.
Non-goals
Guarantee lossless ingestion; do not classify every Stellar operation.
Problem
lib/stellar/indexer.tscan advance to a later cursor after an earlier event in the page fails, permanently skipping financial data.Scope
Acceptance criteria
Required tests
Middle-page poison event, crash around every persistence step, lease race, full pagination, provider retry, and clean-rebuild equivalence.
Non-goals
Guarantee lossless ingestion; do not classify every Stellar operation.