feat: reconcile indexed chain state#93
Open
barry01-hash wants to merge 1 commit into
Open
Conversation
barry01-hash
marked this pull request as ready for review
July 18, 2026 11:23
Author
|
Please merge |
EmeditWeb
reviewed
Jul 21, 2026
EmeditWeb
left a comment
Member
There was a problem hiding this comment.
Review verdict: ✅ APPROVE with notes
Solid reconciliation job. @Cron('0 */15 * * * *') (not BullMQ), overlap guard, no any, tests included (+132). Verified the write paths: reconciliation is chain → DB only and iterates over the authoritative on-chain set, so a failed/empty read is a no-op loop — it never zeroes or corrupts existing rows (safe failure direction). Errors throw rather than silently continue. Transaction status resolution (missing/orphaned/pending) and liquidity/reputation correction all look reasonable.
Notes before merge:
- The financial DB writes (
liquidity_positions.deposited_amount,reputation_cache.score) are only as correct assrc/indexer/authoritative-state.reader.ts. That 114-line reader now drives money/credit-state writes — please give it a focused review (it's the single point of truth for these overwrites). - Reconciliation only writes rows present on-chain; DB rows with no on-chain counterpart are left as-is (conservative — fine, just note it).
- The 30-minute cutoff that marks a pending transaction
orphaned/failed— confirm a slow-but-valid submission can't be prematurely orphaned under network latency.
No blockers; approve once the reader has had a look.
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 #80
What changed
Architecture note
The issue requested BullMQ, but this repository's required architecture explicitly prohibits reintroducing BullMQ after its Redis polling exhausted the Upstash quota. This implementation uses NestJS @Cron with an overlap guard and caught errors, matching the current background-job standard.
The reconciliation path performs no on-chain writes.
Validation
Closes #80