Skip to content

Conversation

AmadiMichael
Copy link
Member

design doc for the ocpm superchain upgrade fix

@AmadiMichael AmadiMichael requested review from mds1 and maurelian July 29, 2025 12:52
}
```

## Requirements and Expected behaviour
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should remove this section since we added a similar one above.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done


## Proposed Solution

A proposed solution for this is to change the check to version comparisons. We can hardcode an expected version for the SuperchainConfig and compare it to the actual version. If the actual version is equal to the expected version, we can upgrade the SuperchainConfig. Otherwise we continue the execution.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To clarify, which of the following will be the upgrade condition

  1. The current superchainConfig.version() value is equal to the previous OR
  2. The current superchainConfig.version() value is not equal to the current

?

}
}
```
- It is also important to note that for any superchain asides the one with its superchainConfig hardcoded in the OPCM, in order to upgrade the superchainConfig, one of it's L1 chains which has the same ProxyAdmin as the SuperchainConfig's ProxyAdmin will need to be upgraded in the same transaction i.e the `OpChainConfig` should not be empty. This is because if the `OpChainConfig` is empty, the function defaults to using a hardcoded superchainConfig and superchainProxyAdmin.
Copy link
Contributor

@maurelian maurelian Aug 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that this is very important. It means that:

  1. we do not support a SuperchainConfig having a ProxyAdmin which is not also the owner of an OP Chain
  2. it is not possible to upgrade a SuperchainConfig without upgrading at least one OP Chain.

<!-- An overview of what could go wrong.
Also any open questions that need more work to resolve. -->
- **A chain might be upgraded when it's superchainConfig is not upgraded:**
- Mitigation: We can implement a simple loop to assert that all chains in the array are of the same superchain and have tests for this.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Above it says:

Note this means that it is possible for OPChains of different superchains to be upgraded in one call to OPCM.upgrade() as long as they share the same proxyAdminOwner. This means that we must check that each OPChain's superchainConfig is at the correct version before proceeding to upgrade it, otherwise we revert the transaction.

Which way should we go, allow this situation or not?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we want to allow.

Note this means that it is possible for OPChains of different superchains to be upgraded in one call to OPCM.upgrade() as long as they share the same proxyAdminOwner. This means that we must check that each OPChain's superchainConfig is at the correct version before proceeding to upgrade it, otherwise we revert the transaction.

I have fixed the FMA

@AmadiMichael AmadiMichael merged commit ae1b94a into main Sep 2, 2025
4 checks passed
@AmadiMichael AmadiMichael deleted the opcm/opcm-superchain-upgrade-fix branch September 2, 2025 21:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants