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 upgrade: Add MTCannon to OPCM #13979

Merged
merged 23 commits into from
Jan 27, 2025
Merged
Show file tree
Hide file tree
Changes from 12 commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
d70a307
mtcannon upgrade notes
maurelian Jan 22, 2025
f1fe5cd
mtcannon upgrade strawman impl
maurelian Jan 22, 2025
06bf29d
rename mips to mips64
maurelian Jan 25, 2025
8e5cd33
feat: rename _currentGame to _disputeGame
maurelian Jan 25, 2025
dbdcd0e
feat: Move has input into the OpChain struct, and take one per game
maurelian Jan 25, 2025
92dbaa9
bump semvers
maurelian Jan 25, 2025
8bf8df5
feat: rename OpChains to OpChainConfigs and mips to mips64
maurelian Jan 25, 2025
0a1afaf
feat: Add PrestateNotSet error and tests
maurelian Jan 25, 2025
0f4ff6d
test fixes
maurelian Jan 25, 2025
117c18f
fix snapshots and interfaces
maurelian Jan 26, 2025
2e0f9e3
fix empty prestate tests
maurelian Jan 26, 2025
50f3b0b
semver
maurelian Jan 26, 2025
df8bdec
update arg name to _opChainConfig
maurelian Jan 27, 2025
09ccfb2
Deploy Mips64 in test
maurelian Jan 27, 2025
ef9aceb
Address feedback in OPCM.t.sol
maurelian Jan 27, 2025
521b027
refactor: only take one absolute prestate per chain
mds1 Jan 27, 2025
30860f3
feat: Move superchainProxy admin from opcm upgrade() to constructor()
maurelian Jan 26, 2025
231dc10
Make use of named variable in deploy.s.sol
maurelian Jan 27, 2025
a2b8101
feat: Add state var checks to ChainAssertsion.checkOPCM
maurelian Jan 27, 2025
536db56
wip: adding SuperchainProxyAdmin to op-deployer
maurelian Jan 27, 2025
9021c22
fix: Correct check of scc and pv impls in chainAssertions.opcm
maurelian Jan 27, 2025
6e92c58
lint and fix unused import
maurelian Jan 27, 2025
3a6a5be
Merge pull request #13989 from ethereum-optimism/opcm/no-sc-arg
maurelian Jan 27, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -105,13 +105,15 @@ interface IOPContractsManager {
address disputeGameFactoryImpl;
address anchorStateRegistryImpl;
address delayedWETHImpl;
address mipsImpl;
address mips64Impl;
}

/// @notice The input required to identify a chain for upgrading.
struct OpChain {
struct OpChainConfig {
ISystemConfig systemConfigProxy;
IProxyAdmin proxyAdmin;
Claim permissionedDisputeGamePrestateHash;
Claim permissionlessDisputeGamePrestateHash;
maurelian marked this conversation as resolved.
Show resolved Hide resolved
}

struct AddGameInput {
Expand Down Expand Up @@ -206,6 +208,8 @@ interface IOPContractsManager {

error SuperchainProxyAdminMismatch();

error PrestateNotSet(GameType gameType);

// -------- Methods --------

function __constructor__(
Expand All @@ -222,8 +226,8 @@ interface IOPContractsManager {

/// @notice Upgrades the implementation of all proxies in the specified chains
/// @param _superchainProxyAdmin The proxy admin that owns all of the proxies
/// @param _opChains The chains to upgrade
function upgrade(IProxyAdmin _superchainProxyAdmin, OpChain[] memory _opChains) external;
/// @param _opChainConfigs The chains to upgrade
function upgrade(IProxyAdmin _superchainProxyAdmin, OpChainConfig[] memory _opChainConfigs) external;

/// @notice addGameType deploys a new dispute game and links it to the DisputeGameFactory. The inputted _gameConfigs
/// must be added in ascending GameType order.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -501,7 +501,7 @@ library ChainAssertions {
require(impls.l1StandardBridgeImpl == _contracts.L1StandardBridge, "CHECK-OPCM-100");
require(impls.disputeGameFactoryImpl == _contracts.DisputeGameFactory, "CHECK-OPCM-110");
require(impls.delayedWETHImpl == _contracts.DelayedWETH, "CHECK-OPCM-120");
require(impls.mipsImpl == address(_mips), "CHECK-OPCM-130");
require(impls.mips64Impl == address(_mips), "CHECK-OPCM-130");

// Verify that initCode is correctly set into the blueprints
IOPContractsManager.Blueprints memory blueprints = _opcm.blueprints();
Expand Down
maurelian marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -484,7 +484,7 @@ contract DeployImplementations is Script {
disputeGameFactoryImpl: address(_dio.disputeGameFactoryImpl()),
anchorStateRegistryImpl: address(_dio.anchorStateRegistryImpl()),
delayedWETHImpl: address(_dio.delayedWETHImpl()),
mipsImpl: address(_dio.mipsSingleton())
mips64Impl: address(_dio.mipsSingleton())
});

vm.broadcast(msg.sender);
Expand Down Expand Up @@ -866,7 +866,7 @@ contract DeployImplementationsInterop is DeployImplementations {
disputeGameFactoryImpl: address(_dio.disputeGameFactoryImpl()),
anchorStateRegistryImpl: address(_dio.anchorStateRegistryImpl()),
delayedWETHImpl: address(_dio.delayedWETHImpl()),
mipsImpl: address(_dio.mipsSingleton())
mips64Impl: address(_dio.mipsSingleton())
});

vm.broadcast(msg.sender);
Expand Down
14 changes: 7 additions & 7 deletions packages/contracts-bedrock/scripts/deploy/DeployOPCM.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ contract DeployOPCMInput is BaseDeployIO {
address internal _disputeGameFactoryImpl;
address internal _anchorStateRegistryImpl;
address internal _delayedWETHImpl;
address internal _mipsImpl;
address internal _mips64Impl;

// Setter for address type
function set(bytes4 _sel, address _addr) public {
Expand All @@ -64,7 +64,7 @@ contract DeployOPCMInput is BaseDeployIO {
else if (_sel == this.disputeGameFactoryImpl.selector) _disputeGameFactoryImpl = _addr;
else if (_sel == this.anchorStateRegistryImpl.selector) _anchorStateRegistryImpl = _addr;
else if (_sel == this.delayedWETHImpl.selector) _delayedWETHImpl = _addr;
else if (_sel == this.mipsImpl.selector) _mipsImpl = _addr;
else if (_sel == this.mips64Impl.selector) _mips64Impl = _addr;
else revert("DeployOPCMInput: unknown selector");
}

Expand Down Expand Up @@ -186,9 +186,9 @@ contract DeployOPCMInput is BaseDeployIO {
return _delayedWETHImpl;
}

function mipsImpl() public view returns (address) {
require(_mipsImpl != address(0), "DeployOPCMInput: not set");
return _mipsImpl;
function mips64Impl() public view returns (address) {
require(_mips64Impl != address(0), "DeployOPCMInput: not set");
return _mips64Impl;
}
}

Expand Down Expand Up @@ -234,7 +234,7 @@ contract DeployOPCM is Script {
disputeGameFactoryImpl: address(_doi.disputeGameFactoryImpl()),
anchorStateRegistryImpl: address(_doi.anchorStateRegistryImpl()),
delayedWETHImpl: address(_doi.delayedWETHImpl()),
mipsImpl: address(_doi.mipsImpl())
mips64Impl: address(_doi.mips64Impl())
});

IOPContractsManager opcm_ = deployOPCM(
Expand Down Expand Up @@ -313,7 +313,7 @@ contract DeployOPCM is Script {
require(implementations.disputeGameFactoryImpl == _doi.disputeGameFactoryImpl(), "OPCMI-180");
require(implementations.anchorStateRegistryImpl == _doi.anchorStateRegistryImpl(), "OPCMI-190");
require(implementations.delayedWETHImpl == _doi.delayedWETHImpl(), "OPCMI-200");
require(implementations.mipsImpl == _doi.mipsImpl(), "OPCMI-210");
require(implementations.mips64Impl == _doi.mips64Impl(), "OPCMI-210");
}

function etchIOContracts() public returns (DeployOPCMInput doi_, DeployOPCMOutput doo_) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -468,8 +468,8 @@ contract DeployOPChain is Script {
);

IOPContractsManager opcm = _doi.opcm();
address mipsImpl = opcm.implementations().mipsImpl;
require(game.vm() == IBigStepper(mipsImpl), "DPG-30");
address mips64Impl = opcm.implementations().mips64Impl;
require(game.vm() == IBigStepper(mips64Impl), "DPG-30");

require(address(game.weth()) == address(_doo.delayedWETHPermissionedGameProxy()), "DPG-40");
require(address(game.anchorStateRegistry()) == address(_doo.anchorStateRegistryProxy()), "DPG-50");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ contract ReadImplementationAddresses is Script {
vm.prank(address(0));
_rio.set(_rio.l1StandardBridge.selector, l1SBImpl);

address mipsLogic = _rii.opcm().implementations().mipsImpl;
address mipsLogic = _rii.opcm().implementations().mips64Impl;
_rio.set(_rio.mipsSingleton.selector, mipsLogic);

address delayedWETH = _rii.opcm().implementations().delayedWETHImpl;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@
},
{
"internalType": "address",
"name": "mipsImpl",
"name": "mips64Impl",
"type": "address"
}
],
Expand Down Expand Up @@ -574,7 +574,7 @@
},
{
"internalType": "address",
"name": "mipsImpl",
"name": "mips64Impl",
"type": "address"
}
],
Expand Down Expand Up @@ -669,10 +669,20 @@
"internalType": "contract IProxyAdmin",
"name": "proxyAdmin",
"type": "address"
},
{
"internalType": "Claim",
"name": "permissionedDisputeGamePrestateHash",
"type": "bytes32"
},
{
"internalType": "Claim",
"name": "permissionlessDisputeGamePrestateHash",
"type": "bytes32"
}
],
"internalType": "struct OPContractsManager.OpChain[]",
"name": "_opChains",
"internalType": "struct OPContractsManager.OpChainConfig[]",
"name": "_opChainConfigs",
"type": "tuple[]"
}
],
Expand Down Expand Up @@ -850,6 +860,17 @@
"name": "OnlyUpgradeController",
"type": "error"
},
{
"inputs": [
{
"internalType": "GameType",
"name": "gameType",
"type": "uint32"
}
],
"name": "PrestateNotSet",
"type": "error"
},
{
"inputs": [],
"name": "ReservedBitsSet",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@
},
{
"internalType": "address",
"name": "mipsImpl",
"name": "mips64Impl",
"type": "address"
}
],
Expand Down Expand Up @@ -574,7 +574,7 @@
},
{
"internalType": "address",
"name": "mipsImpl",
"name": "mips64Impl",
"type": "address"
}
],
Expand Down Expand Up @@ -669,10 +669,20 @@
"internalType": "contract IProxyAdmin",
"name": "proxyAdmin",
"type": "address"
},
{
"internalType": "Claim",
"name": "permissionedDisputeGamePrestateHash",
"type": "bytes32"
},
{
"internalType": "Claim",
"name": "permissionlessDisputeGamePrestateHash",
"type": "bytes32"
}
],
"internalType": "struct OPContractsManager.OpChain[]",
"name": "_opChains",
"internalType": "struct OPContractsManager.OpChainConfig[]",
"name": "_opChainConfigs",
"type": "tuple[]"
}
],
Expand Down Expand Up @@ -850,6 +860,17 @@
"name": "OnlyUpgradeController",
"type": "error"
},
{
"inputs": [
{
"internalType": "GameType",
"name": "gameType",
"type": "uint32"
}
],
"name": "PrestateNotSet",
"type": "error"
},
{
"inputs": [],
"name": "ReservedBitsSet",
Expand Down
8 changes: 4 additions & 4 deletions packages/contracts-bedrock/snapshots/semver-lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@
"sourceCodeHash": "0x2dd7bf6cbce655b1023a3ad071523bf455aa13fad5d02e1e434af71728cd794c"
},
"src/L1/OPContractsManager.sol": {
"initCodeHash": "0x181f685035a334401db2c145689e6b1bfcee8e9422e5850fc0de7937e009e965",
"sourceCodeHash": "0xd3f173b2dba1f23cbe6510737b583069035a015781ee4735836ef3620a9abd2a"
"initCodeHash": "0xe0324c986d2e8dee0c20d325631ed8fc68cad79a52555790c25cdc13dd8ef5fc",
"sourceCodeHash": "0x811a20610e91be43f8bde8621476803513ed301ebf15df79885930e5ac28c78f"
},
"src/L1/OPContractsManagerInterop.sol": {
"initCodeHash": "0xb9e066b13039ea0b0dfa956991551f1cebc6e2ba6be8d00531c198817ede383f",
"sourceCodeHash": "0x5d69aed02dcb5d87cb12c84139c551acced73363965c4bbfff9413e72aaa1173"
"initCodeHash": "0x52391efa9a5093b253b5a61f8b81f41ae735733a73a2862ff8ed31a450601c1b",
"sourceCodeHash": "0x526ff72544d404377ea58b5ed476f4cdd3d4338acec9909ce12d1778bffb298e"
},
"src/L1/OptimismPortal2.sol": {
"initCodeHash": "0x969e3687d4497cc168af61e610ba0ae187e80f86aaa7b5d5bb598de19f279f08",
Expand Down
Loading