You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As part of the release process, the associated implementation contracts and a new OPCM, will be deployed.
The Upgrade Controller (which MUST be a Safe), will DELEGATECALL the OPCM.upgrade() function,
providing the address of the SuperchainProxyAdmin and a list of the SystemConfig contracts for the
OP Chains to be upgraded.
Thus the high level logic for upgrading a contract should be roughly as follows:
// Some upgrades will not require any new valuesstruct NewChainConfig {
address newValues;
address disputeGameBlueprint;
}
Addresses immutable implementations;
constructor(Addresses _implementations) {
implementations = _implementations;
}
/// @notice This function is intended to be DELEGATECALLed by the chain's Upgrade Controller, therefore it/// must not read or write from storage, and should receive all required data as calldata.function upgrade(SuperchainProxyAdmin _admin, ISystemConfig[] _systemConfigs, NewChainConfig[] _newConfigs) public {
for(uint i=0; i< systemConfigs.length; i++) {
// Read the `Addresses` struct from each `SystemConfig` in the `systemConfigs` mapping.// For each entry in the `Addresses` struct:// 1. Call the appropriate `SuperchainProxyAdmin.upgradeAndCall()` function to reset the initialized slot.// 2. Call the appropriate `SuperchainProxyAdmin.upgradeAndCall()` function to update the// implementation and call `upgrade()` on the contract.// 3. For non-MCP compliant dispute game contracts, call `setImplementation()` and update the `AnchorStateRegistry`.
}
// run safety assertions to validate the upgrade
}
To enumerate the full flow:
Deploy new OPCM contract, which contains:
deploy() and upgrade() methods to deploy new chains and ugprade existing chains
immutables pointing to all new implementation contracts and shared config (e.g. a new contract).
For each new implementation an upgrade call will be executed via the SuperchainProxyAdmin
A Safe will DELEGATECALL to the OPCM.upgrade() method, which MUST be pure for safety purposes.
A two step upgrade is used where the first upgrade is to an InitializerResetter which resets
the initialized value, then the implementation is updated to the final address and upgrade()
is called.
Notes:
We should identify measures for ensuring the OPCM is nearly stateless, and the upgrade() function
should not read or write from its own storage.
The text was updated successfully, but these errors were encountered:
As part of the release process, the associated implementation contracts and a new OPCM, will be deployed.
The Upgrade Controller (which MUST be a Safe), will
DELEGATECALL
theOPCM.upgrade()
function,providing the address of the
SuperchainProxyAdmin
and a list of theSystemConfig
contracts for theOP Chains to be upgraded.
Thus the high level logic for upgrading a contract should be roughly as follows:
To enumerate the full flow:
deploy()
andupgrade()
methods to deploy new chains and ugprade existing chainsSuperchainProxyAdmin
DELEGATECALL
to theOPCM.upgrade()
method, which MUST bepure
for safety purposes.InitializerResetter
which resetsthe
initialized
value, then the implementation is updated to the final address andupgrade()
is called.
Notes:
upgrade()
functionshould not read or write from its own storage.
The text was updated successfully, but these errors were encountered: