Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OPCM Fix: Failure when addGameType due to common saltMixer (OPCM - Upgrade 13) #14142

Open
Tracked by #13069
maurelian opened this issue Feb 4, 2025 · 0 comments
Open
Tracked by #13069
Labels

Comments

@maurelian
Copy link
Contributor

Context: OPContractsManager.sol#L634

Description:

The function addGameType allows for multiple game types to be simultaneously deployed/upgraded. Additionally, the function allows for the delayedWETH address to be set to address(0), meaning the game type needs a new deployment of the DelayedWETH rather than an upgrade.

However, if two game types (for the same chain id) have their delayedWETH address set to zero, then a collision in the create2 address will prevent the second one from being deployed, reverting the entire transaction -- if the saltMixer parameter is the same, which is likely to happen, as these values are usually version tags.

Furthermore, the same saltMixer is used to deploy the game implementations, which breaks the invariant that the implementation version is typically used as entropy.

As seen in OPContractsManager.sol#L1125, the version is explicitly included in the salt calculation:

computeSalt(_l2ChainId, "v2.0.0", "PermissionedDisputeGame"),

Using the same saltMixer across different deployments violates this pattern and may lead to inconsistencies in contract versioning and deployment tracking.

Recommendation:

A different salt should be used for the delayedWETH for each game type -- or the deployment of a new proxy should be skipped if the create2 address already has code deployed to it.
Furthermore, a different salt variable should be used for deploying the game type implementation, rather than reusing the DelayedWETH salt.

Optimism:

Spearbit:

@maurelian maurelian added T-evm-safety Team: EVM Safety T-upgrades labels Feb 4, 2025
@maurelian maurelian changed the title OPCM Fix: Failure when addGameType due to common saltMixer (Upgrade 13) OPCM Fix: Failure when addGameType due to common saltMixer (OPCM - Upgrade 13) Feb 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: No status
Status: No status
Development

No branches or pull requests

1 participant