Repository navigation
fix(indexer): find cached logs missing their transaction in sync-repair - #148
Merged
Merged
Conversation
The prod builder crash-loops on ATP:Claimed at block 24439439 because the log for ATP 0xd2d5 is cached with its block but without its transaction, so event.transaction is undefined. diagnose only looked for missing blocks; also report logs with no transaction row so MIN_BAD covers these holes.
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.
Problem
With #147,
statusshows why the prodatp-indexer-si-v7builder crash-loops (5,967 restarts, stuck at 37.1%):The
Claimedlog for ATP0xd2d5…is inponder_sync.logs, and its block is cached, but its transaction row is missing. Ponder builds the event with an emptytransaction, soevent.transaction.hashthrows. This is the same partial-commit damage from the duplicate-pgbug (#140), with the transaction insert lost instead of the block insert.diagnoseonly looked for missing blocks, which is why the earlier repair (MIN_BAD=26074117) did not cover block 24439439.The live v4 schema shows the same ATP with
totalWithdrawn = 0, although it claimed at this block, so this is also one of the missing claims #138 set out to recover.Fix
diagnosealso reports cached logs with no matchingponder_sync.transactionsrow (onchain_id,block_number,transaction_index). Factory-discovery logs are excluded, as in the existing check. The repair is unchanged: runrepairwith the lowestfirst_blockacross all three checks.Testing
The query was run on PGlite against a mock
ponder_sync: it reports only the log whose transaction is missing, and skips factory addresses and logs that have their transaction.