Repository navigation
fix(indexer): upgrade Ponder so rollups found during live indexing are kept - #132
Open
aminsammara wants to merge 1 commit into
Open
aminsammara wants to merge 1 commit into
aminsammara wants to merge 1 commit into
Conversation
…e kept The indexer has no Rollup events at all from v5 or v6: no Deposit, FailedDeposit, WithdrawInitiated, WithdrawFinalized or Slashed. Checking the prod API against chain shows v4 and v4.x deposits as real deposit rows, including ones synced live after the box launched, while every v5 and v6 deposit is missing. That includes the 50 validators still on v5. The v5/v6 stakes that do show up come from StakingRegistry delegation rows, a different contract. The cause is a bug in Ponder 0.15.7, fixed upstream in 0.17.2 (ponder-sh/ponder#2347). When a factory feeds several handlers, as the Rollup factory feeds five, a child found during live indexing is added to the in-memory set but then dropped from what gets saved to ponder_sync.factory_addresses. The blocks are still marked synced. Events keep indexing until the next restart. After that the rollup is gone, and no rebuild from the cache fetches it again. v5 went canonical on 2026-07-14, the day after the single-instance indexer started, and v6 later, so both were found live. v4 and v4.x were found during the initial historical sync and are unaffected. This also explains the event-derived exit and failed-deposit numbers being off. The ATP factory feeds two handlers, so ATPs created since launch are probably missing their ATP events too. The upgrade alone would not recover anything: the cache still lists only v4 and v4.x as children and treats the whole range as synced. The Rollup contract now starts one block before the Registry's deployment. The Registry has no earlier events, so nothing is lost, but the factory gets a new id and Ponder refetches the Registry and Rollup logs instead of reusing the broken cache. Only those two sources are refetched, not the ATP and Staker data. Ponder 0.17 needs Node 22, viem 2.35 and TypeScript 5.4, so the image, the engines field and the indexer CI jobs move to Node 22. 0.16's 45-character limit on table and schema names doesn't affect us: the longest table name is 33 characters, and the si-vN schema names are shorter still.
This branch has not been deployed
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
The indexer has no Rollup events from v5 or v6: no Deposit, FailedDeposit, WithdrawInitiated, WithdrawFinalized or Slashed.
I checked the prod API against chain:
depositrows at the exact chain block, including those synced live after the single-instance box launched.depositrow. That includes all 50 validators still on v5 and every sampled ERC20 direct deposit.erc20StakedWithProviderrows, which come from a different contract.Cause
A bug in Ponder 0.15.7, fixed in 0.17.2 by ponder-sh/ponder#2347:
ponder_sync.factory_addresses, yet the blocks are marked synced. OurRollupfactory feeds five handlers.ATPfactory feeds two handlers, so ATPs created since launch are likely affected too. I haven't verified this.Change
ponder^0.17.12. This needsviem^2.35,typescript^5.4 and Node 22, so the Dockerfile, theenginesfield and the indexer CI jobs are updated.Rollupcontract now starts one block before the Registry deployment. This changes the factory id, so Ponder refetches the Registry and Rollup logs instead of trusting the incomplete cache. Only those are refetched, not the ATP or Staker data.Deploy
The build fingerprint changes, so this needs a fresh schema:
deploy-indexer.yamlfor prod,new_schema=atp-indexer-si-v5.The rebuild will take longer than the usual ~7 minutes because the Rollup logs come from RPC. The previous schema stays serving until the flip.
Afterwards,
depositshould contain rows for rollups0x91ff…8e34(v5) and0xe37a…402f(v6). The summary's exiting and zombie counts should then include v5/v6 exits.