Route unstake to the rollup where the stake actually lives#73
Merged
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.
Users with stakes deposited before a canonical rollup upgrade couldn't initiate or finalize unstake, the dashboard sent the write to the deposit-time rollup, but the protocol had auto-migrated their stake to the new canonical (
moveWithRollup = true). Concrete example: tx0xcd6074ec….Three coordinated layers fix this:
Dashboard probe,
useAttesterViewBestEffortprobes canonical + legacy (+ optional indexer hint) rollups in parallel and writes go to whichever holds the live record (effectiveRollup), not the indexer-supplied deposit rollup. Chain is always authoritative.Indexer hint,
moveWithRollupdecoded from originating tx calldata via selector-keyed dispatch (atp-indexer/src/utils/move-with-rollup.ts).effectiveRollupbulk-updated onRegistry:CanonicalRollupUpdatedfor rows that auto-migrate AND aren't mid-exit (the exit pins to whereinitiateWithdrawwas called, verified vialatest_initiate_ts > latest_finalize_tsSQL aggregation).Version resolution,
useRollupVersionFor(effectiveRollup)resolves the per-stake on-chain version.WithdrawalActionsdisables buttons while resolving so a cart entry can't be built against the canonical version when the stake lives on legacy.Schema additions (
moveWithRollup boolean,effectiveRollup hex notNull+ index) ondeposit/staked/stakedWithProvider/erc20StakedWithProvider. Schema versions bumped (testnetv03→v04,prodv21→v22) — full reindex on next deploy, blue-green handles the cutover.