Repository navigation
feat(indexer): configure the cold-start ledger - #20
Open
rahulatrkm wants to merge 1 commit into
Open
rahulatrkm wants to merge 1 commit into
rahulatrkm wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #7
Change
Add optional
INDEXER_START_LEDGERusing the existing fallback-and-report configuration parser. It accepts non-negative safe integers, including zero. Unset/blank values use the existing default; invalid values are reported and fall back.Precedence is explicit: saved checkpoint first, configured ledger only on cold starts, current ledger tip otherwise. Configuration never rewinds or overrides a saved cursor. Logs identify the selected source, and normal response-cursor continuation is preserved. The README and unset environment example document the retention-window limitation.
Verification
Before implementation, 11 parser assertions and six watcher assertions failed. Tests execute the real parser/config/watcher with fake timers and stub RPC/database boundaries, covering zero, invalid inputs, checkpoints ahead of or behind the configured value, default tip lookup and cursor continuation.
pnpm test: 237 passed, including 43 validation, 42 indexer and 13 contract tests.pnpm run typecheck,pnpm run format:checkandpnpm run build: passed.pnpm run lint: exit 0, with three pre-existing warnings in unchanged wallet code.git diff --check: passed.No live RPC backfill or real database test is claimed. Expired events cannot be recovered by this option; the requested ledger must remain inside the provider's retention window. This branch is independent of the other watcher PRs, so test additions may need reconciliation when merging in sequence.
Prepared and tested by GitHub Copilot on behalf of rahulatrkm. Independent human review is not claimed. No bounty or payment claim is attached.