Repository navigation
fix(op-stack): read dispute game factory from portal when missing - #5548
Merged
jxom merged 3 commits intoNov 16, 2026
Merged
Conversation
getGames read targetChain.contracts.disputeGameFactory[chain.id] with no fallback. getWithdrawalStatus, waitToProve and getTimeToProve accept a target chain with only l2OutputOracle + portal, so on a chain whose portal moved to fault proofs they threw a TypeError. Fall back to portal.disputeGameFactory() when the chain config has no factory. Co-Authored-By: Claude Opus 5.5 <[email protected]>
waitForNextGame polls getGame, so cache the fallback read the same way getPortalVersion caches the portal version. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Use the real L2 block for the timestamp, keep the status tests in order, and name every action the fix covers in the changeset. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
@gomesalexandre is attempting to deploy a commit to the Wevm Team on Vercel. A member of the Team first needs to authorize it. |
🦋 Changeset detectedLatest commit: f698d65 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 |
This was referenced Nov 16, 2026
Merged
Closed
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.
Every fault-proof action ends up in
getGames, which readstargetChain.contracts.disputeGameFactory[chain.id]with no fallback.getWithdrawalStatus,waitToProveandgetTimeToProvealso accept a target chain with onlyl2OutputOracle+portal. So when a chain like that has a portal on v3+, those actions type-check but take the fault-proof path and throwTypeError: Cannot read properties of undefined (reading '1').This PR reads the factory from the portal (
disputeGameFactory(), already inportal2Abi) when neitherdisputeGameFactoryAddressnor the chain config gives one.getWithdrawalStatusalready readsanchorStateRegistry()off the portal the same way. Chains that do configure a factory work as before and make no extra call. The fallback read goes throughwithCachewith the same key shape and 300 ms window asgetPortalVersion, becausewaitForNextGamecallsgetGameon every poll. Types are unchanged.#5547 is the data fix for the 10 bundled chains in this state (BOB, Zircuit, Shape, Ancient8, Metal L2 and testnets). This PR covers the same class for custom
defineChainconfigs and for any chain that moves to fault proofs before its definition is updated. It does not fix a factory that is configured but stale, like Superseed's in #5547, since the configured address still wins.Real calls against publicnode L1 with the bundled chains as they are on main (no factory configured):
These are the same statuses #5547 gets with the factories configured.
The tests add a target chain without
disputeGameFactorytogetGames.test.tsandgetWithdrawalStatus.test.ts, on a mainnet fork at block 26430000. They fail on main with theTypeErrorand pass here.src/op-stack/**is excluded from thecoreproject, so I ran these files locally with a config that includes it. The only results that differ between main and this branch are the two new tests.🤖 Generated with Claude Code