Repository navigation
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 wevm#5623 Co-Authored-By: Claude Opus 5.5 <[email protected]>
🦋 Changeset detectedLatest commit: 29922ed 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 |
|
@sbvegan is attempting to deploy a commit to the Wevm Team on Vercel. A member of the Team first needs to authorize it. |
Member
|
Thanks a lot for the clear write-up and the fix, @sbvegan! I verified it against OptimismPortal2 and the superchain-registry, and it's right. Your commit is kept as is in #5625, which adds a regression test for the stale-factory case and fixes the getWithdrawalStatus read-rounds test the new portal read broke. Closing this in favor of #5625. |
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. Fixes the two breaking items there and types the new receipt field. The
0x7Dpost-execution transaction type is left for a follow-up, since it adds a new transaction type to the OP Stack API.Changes
1. Read the
DisputeGameFactoryfrom the portal (getGames).getGamesused the chain definition'scontracts.disputeGameFactoryfirst. It only readOptimismPortal2.disputeGameFactory()when the definition had none.Before OP Stack Upgrade 22 (Lagoon),
OPContractsManagerV2.migratemoves OP Mainnet and Unichain, and their Sepolia chains, onto a new shared factory. After that the portal only accepts games from the shared factory. The old per-chain addresses inoptimism,unichain,optimismSepoliaandunichainSepoliathen point at a factory that gets no new games. SowaitToProvenever resolves, and proofs built from old games are rejected.getGamesnow reads the factory from the portal, cached as before, unlessdisputeGameFactoryAddressis passed. This coversgetGame,getL2Output,getTimeToProve,waitToProve,getWithdrawalStatus,getTimeToNextGameandwaitForNextGame. The portal is already read in the same call (respectedGameType), so this works for every chain wheregetGamesalready worked.Trade-off: one extra
eth_callpercacheTimewindow for chains that had a static factory. The alternative is updating the four chain definitions once the migration executes, which still breaks every client pinned to an older viem.2. Treat
ZK_DISPUTE_GAME(game type10) as a super-root game.GameTypes.isSuperGameincontracts-bedrock/src/dispute/lib/Types.solincludesZK_DISPUTE_GAME, andOptimismPortal2readsrootClaimByChainIdfor it. OP Mainnet and Unichain plan to make it their respected game type after Lagoon activates. Without this,getGamessetsusesSuperRoots: falsefor type10and reads the game's L2 timestamp as a block number.3. Format the
opGasRefundreceipt field.Lagoon receipts gain
opGasRefund, aQuantityornull(spec). It is now typed and formatted asbigint | null, and left out when the RPC omits it.Docs: the
disputeGameFactoryAddressdefault ongetGame,getGames,getTimeToNextGameandwaitForNextGamenow says it comes from the portal.Testing
pnpm check:typespasses.10andopGasRefund(refund,null, absent). They pass alongside the existing formatter and game-type unit tests.getGamesand withdrawal action tests locally (no fork RPC configured), so those rely on CI.biome checkis clean, and there's a changeset.🤖 Generated with Claude Code