Repository navigation
fix(op-stack): read the dispute game factory from the portal for OP Stack Upgrade 22 - #5625
Merged
Merged
Conversation
…me actions Read the DisputeGameFactory from the portal instead of the chain definition, treat ZK_DISPUTE_GAME (10) as a super-root game, and format the opGasRefund receipt field. Refs #5623 Co-Authored-By: Claude Opus 5.5 <[email protected]>
…chain definition Adds a getGames regression test where the chain definition holds a different factory than the portal, updates the getWithdrawalStatus read rounds for the portal's disputeGameFactory read, folds the opGasRefund tests into one inline snapshot, and rewords the changeset in past tense. Refs #5623 Amp-Thread-ID: https://ampcode.com/threads/T-01a1fb1a-603b-73f0-9c51-9607e94ee4af Co-authored-by: jxom <[email protected]>
🦋 Changeset detectedLatest commit: 6ea69eb The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Contributor
|
Published pnpm add viem@pr-5625
pnpm add [email protected] |
Merged
This branch had an error being 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.
Refs #5623. Supersedes #5624 by @sbvegan, whose commit is kept as is; this branch adds tests on top.
Root cause
getGames(and every action built on it:getGame,getL2Output,getTimeToProve,waitToProve,getWithdrawalStatus,getTimeToNextGame,waitForNextGame) used the chain definition'scontracts.disputeGameFactorybefore the portal's. OP Stack Upgrade 22 (Lagoon) runsOptimismPortal2.migrateToSharedDisputeGameon OP Mainnet and Unichain (and OP Sepolia and Unichain Sepolia), which points the portal at a new sharedAnchorStateRegistry.OptimismPortal2.disputeGameFactory()returnsanchorStateRegistry.disputeGameFactory(), andproveWithdrawalTransactiononly accepts games from that factory, so the hardcoded per-chain factories go stale:waitToProvenever resolves and proofs built from old-factory games are rejected.The superchain-registry confirms the scope: OP Mainnet and Unichain (and their Sepolia chains) share an
[interop]dependency set; Ink and Soneium getlagoon_timebut no shared contracts. Activation:1796918401(Sepolia),1799683201(mainnet).Changes
From #5624:
getGamesreads the factory from the portal (cached for 300s per client and portal) unlessdisputeGameFactoryAddressis passed. This works before and after the migration, and on every chain.ZK_DISPUTE_GAME(type10) is a super-root game, matchingGameTypes.isSuperGame. Itsl2SequenceNumber()is the super root timestamp, and the portal readsrootClaimByChainIdfor it, so the existing super-root proof path applies unchanged.opGasRefundreceipt field is typed and formatted asbigint | null(SDM spec).Added here:
getGamesregression test where the chain definition holds a different factory (Unichain's) than the portal. It fails onmain(game index17677vs21374) and passes here.getWithdrawalStatusread-rounds test now answersdisputeGameFactory; it timed out on fix(op-stack): read the dispute game factory from the portal, treat ZK games as super-root, format opGasRefund #5624 because its fake RPC had no reply for the new read. The snapshot shows the one extra read round on a cache miss.opGasRefundtests folded into one inline snapshot, and the changeset reworded as one past-tense sentence.Follow-ups (not in this PR)
0x7Dpost-exec transaction type is not modeled yet.ready-to-proveafterwards (the newAnchorStateRegistrydoes not treat old games as proper), so users re-prove. That is existing behavior, not a change here.Testing
src/op-stack/**is excluded from the Vitest projects, so I ran these with a temporary config that includes it:gameTypes,formatters(unit), the newgetGamestest, and thegetWithdrawalStatusrounds test pass.getGames,getGame,getWithdrawalStatus,getTimeToProve,waitToProve,getL2Output,getTimeToNextGameandformatters, the remaining 19 failures are the same set onmain(stale fork blocks and live-RPC snapshot drift).tsc -bforsrcandtest, and Biome on the touched files, pass.