feat(factory): use CREATE2 for deterministic game proxy deployment#250
Open
leopoldjoy wants to merge 2 commits intomainfrom
Open
feat(factory): use CREATE2 for deterministic game proxy deployment#250leopoldjoy wants to merge 2 commits intomainfrom
leopoldjoy wants to merge 2 commits intomainfrom
Conversation
Switch DisputeGameFactory from LibClone.clone() to LibClone.cloneDeterministic() using the game UUID as the CREATE2 salt. This makes proxy addresses locally computable from (gameType, rootClaim, extraData), enabling the proposer to batch-verify game existence via concurrent UUID lookups instead of sequential factory scans. Also moves the GameAlreadyExists duplicate check into _createGameImpl so it runs before deployment, giving a clean revert instead of a raw CREATE2 failure on duplicate submissions.
Collaborator
🟡 Heimdall Review Status
|
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.
Summary
DisputeGameFactory._createGameImpl()fromLibClone.clone()(CREATE) toLibClone.cloneDeterministic()(CREATE2), using the game UUID as the saltGameAlreadyExistsduplicate check from_finalizeGameCreationinto_createGameImplso it runs before deployment (cleaner revert vs raw CREATE2 failure)Motivation
With CREATE2, game proxy addresses become deterministic — computable locally from
(gameType, rootClaim, extraData)without any RPC calls. This unblocks the multiproof proposer from doing batch-concurrentgames()lookups to verify the on-chain game chain, instead of the current sequential factory scan + forward walk approach. It also eliminates an edge case where the proposer gets stuck if an invalid game appears before a valid one at the same block number (since the correct game can now be looked up directly by its inputs rather than iterated over).Changes
src/dispute/DisputeGameFactory.sol_createGameImpl: computes UUID, checksGameAlreadyExists, then callscloneDeterministic(data, uuid)instead ofclone(data)— for both the no-args and with-args CWIA paths_finalizeGameCreation: removed the now-redundantGameAlreadyExistscheck (UUID is still computed here for storage)snapshots/semver-lock.jsonjust semver-lockTesting
All 25 existing
DisputeGameFactorytests pass, including thetestFuzz_create_sameUUID_revertstest that exercises the duplicate-rejection path.