Repository navigation
fix: count validating attesters from each rollup's own active set - #129
Merged
Merged
Conversation
After #128 went to prod the summary reported 2,541 validating attesters on the canonical rollup while getActiveAttesterCount said 3,157, and 0 on v5 where the chain has 50. Active stake read 507M against the ~630M the GSE holds, and that is the dashboard's headline number. The reader only asked about attesters in the indexer's deposit table, and that table is missing about 670 attesters that are validating on chain (all 50 on v5, which deposited between blocks 26,229,331 and 26,253,638, and ~616 on v6). Why the indexer lacks them is a separate question; the summary should not depend on it for the active set, which the rollup can list itself. Each rollup's active set is now read with getActiveAttesterCount and getAttesterAtIndex and merged into the attesters asked about, so validating counts and stake are complete whatever the indexer holds. Exiting and zombie attesters have left the active set, so for those the indexer's list is still the only source. The two calls live in a separate ABI rather than ROLLUP_ABI: ponder.config.ts gives ROLLUP_ABI to the Rollup contract, so extending it changes Ponder's build fingerprint and would force another schema rebuild on deploy for a function no handler uses.
aminsammara
added a commit
that referenced
this pull request
Nov 5, 2026
… down (#130) The #129 deploy went out as an in-place image swap on atp-indexer-si-v2. Ponder fingerprints the whole src/ tree, not just ponder.config.ts, so the new image refused to start on a schema an older build created. box-deploy.sh then exited without restoring the previous image, which left the prod API returning 502. Redeploying with a fresh schema could not fix it either. The si-v3 rebuild completed, but the script finds the old schema by asking the serving container, and that container was crash-looping. CURRENT came back empty, psql ran against "".atp_position, the failing command substitution tripped set -e, and the script died before the flip. Three changes: - current_schema falls back to docker-compose.override.yml, which this script writes and which records what the box was serving, whenever the container can't answer. - A failed /ready after an image swap restores the previous image instead of leaving the box down. - psql_count tolerates a schema that doesn't exist. The parity check then compares against 0 rather than killing the script.
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.
Follow-up to #128, which is now in prod. The staking summary undercounts active attesters, and the dashboard headline currently reads 507M instead of about 630M.
What's wrong
getActiveAttesterCount)activeValueLockedThe reader only asks about attesters in the indexer's
deposittable, and that table is missing about 670 attesters that are validating on chain:Why the indexer lacks those deposits is a separate investigation. The old event-count summary was already off by about 99 stakes and 113 exits, which points the same way.
Fix
getActiveAttesterCount+getAttesterAtIndexand merged into the attesters the reader checks.Deploy
ROLLUP_ACTIVE_SET_ABI, notROLLUP_ABI. That keeps Ponder's build fingerprint identical to what's deployed.ponder.config.ts,ponder.schema.tsandsrc/eventsare unchanged fromorigin/main.atp-indexer-si-v2, with nonew_schemaand no rebuild.Checks
yarn jest: 40 tests pass, including a new case for validating attesters the indexer never saw.yarn typecheck: clean.