Commit 9179225d authored by Maurelian's avatar Maurelian Committed by GitHub

feat: Add ASR proxy to OPStackManager (#11952)

* feat: Add ASR proxy to OPStackManager

* feat: Add AnchorStateRegistry blueprint
parent 668c3fba
...@@ -16,6 +16,7 @@ import { PreimageOracle } from "src/cannon/PreimageOracle.sol"; ...@@ -16,6 +16,7 @@ import { PreimageOracle } from "src/cannon/PreimageOracle.sol";
import { IPreimageOracle } from "src/cannon/interfaces/IPreimageOracle.sol"; import { IPreimageOracle } from "src/cannon/interfaces/IPreimageOracle.sol";
import { MIPS } from "src/cannon/MIPS.sol"; import { MIPS } from "src/cannon/MIPS.sol";
import { DisputeGameFactory } from "src/dispute/DisputeGameFactory.sol"; import { DisputeGameFactory } from "src/dispute/DisputeGameFactory.sol";
import { AnchorStateRegistry } from "src/dispute/AnchorStateRegistry.sol";
import { SuperchainConfig } from "src/L1/SuperchainConfig.sol"; import { SuperchainConfig } from "src/L1/SuperchainConfig.sol";
import { ProtocolVersions } from "src/L1/ProtocolVersions.sol"; import { ProtocolVersions } from "src/L1/ProtocolVersions.sol";
...@@ -360,6 +361,7 @@ contract DeployImplementations is Script { ...@@ -360,6 +361,7 @@ contract DeployImplementations is Script {
blueprints.proxyAdmin = deployBytecode(Blueprint.blueprintDeployerBytecode(type(ProxyAdmin).creationCode), salt); blueprints.proxyAdmin = deployBytecode(Blueprint.blueprintDeployerBytecode(type(ProxyAdmin).creationCode), salt);
blueprints.l1ChugSplashProxy = deployBytecode(Blueprint.blueprintDeployerBytecode(type(L1ChugSplashProxy).creationCode), salt); blueprints.l1ChugSplashProxy = deployBytecode(Blueprint.blueprintDeployerBytecode(type(L1ChugSplashProxy).creationCode), salt);
blueprints.resolvedDelegateProxy = deployBytecode(Blueprint.blueprintDeployerBytecode(type(ResolvedDelegateProxy).creationCode), salt); blueprints.resolvedDelegateProxy = deployBytecode(Blueprint.blueprintDeployerBytecode(type(ResolvedDelegateProxy).creationCode), salt);
blueprints.anchorStateRegistry = deployBytecode(Blueprint.blueprintDeployerBytecode(type(AnchorStateRegistry).creationCode), salt);
vm.stopBroadcast(); vm.stopBroadcast();
// forgefmt: disable-end // forgefmt: disable-end
......
...@@ -32,8 +32,8 @@ ...@@ -32,8 +32,8 @@
"sourceCodeHash": "0xde4df0f9633dc0cdb1c9f634003ea5b0f7c5c1aebc407bc1b2f44c0ecf938649" "sourceCodeHash": "0xde4df0f9633dc0cdb1c9f634003ea5b0f7c5c1aebc407bc1b2f44c0ecf938649"
}, },
"src/L1/OPStackManager.sol": { "src/L1/OPStackManager.sol": {
"initCodeHash": "0xfcb568c59e2b4fd927b27b3434db657b53571bf64f70bc8453aaf696eda9c3f9", "initCodeHash": "0x022b3f6a80eb637972dd0d9ce8666a037c4b916889f44f86771d8c3add9d615d",
"sourceCodeHash": "0xfc9069d6967b9b90413fe391805509b178dd134b008a582e4dc64afe14cc1b2a" "sourceCodeHash": "0xb085725e18c1a0cc1826b770e403ecad765fce686bb80555bf0f6c3c67b21cba"
}, },
"src/L1/OptimismPortal.sol": { "src/L1/OptimismPortal.sol": {
"initCodeHash": "0xb7a7a28d5b3b88334e7cb4bc1c5fbbf9f691d934e907a2fed6a30e461eb1c0f6", "initCodeHash": "0xb7a7a28d5b3b88334e7cb4bc1c5fbbf9f691d934e907a2fed6a30e461eb1c0f6",
......
...@@ -45,6 +45,11 @@ ...@@ -45,6 +45,11 @@
"internalType": "address", "internalType": "address",
"name": "resolvedDelegateProxy", "name": "resolvedDelegateProxy",
"type": "address" "type": "address"
},
{
"internalType": "address",
"name": "anchorStateRegistry",
"type": "address"
} }
], ],
"internalType": "struct OPStackManager.Blueprints", "internalType": "struct OPStackManager.Blueprints",
...@@ -283,6 +288,11 @@ ...@@ -283,6 +288,11 @@
"internalType": "address", "internalType": "address",
"name": "resolvedDelegateProxy", "name": "resolvedDelegateProxy",
"type": "address" "type": "address"
},
{
"internalType": "address",
"name": "anchorStateRegistry",
"type": "address"
} }
], ],
"internalType": "struct OPStackManager.Blueprints", "internalType": "struct OPStackManager.Blueprints",
......
...@@ -45,6 +45,11 @@ ...@@ -45,6 +45,11 @@
"internalType": "address", "internalType": "address",
"name": "resolvedDelegateProxy", "name": "resolvedDelegateProxy",
"type": "address" "type": "address"
},
{
"internalType": "address",
"name": "anchorStateRegistry",
"type": "address"
} }
], ],
"internalType": "struct OPStackManager.Blueprints", "internalType": "struct OPStackManager.Blueprints",
...@@ -283,6 +288,11 @@ ...@@ -283,6 +288,11 @@
"internalType": "address", "internalType": "address",
"name": "resolvedDelegateProxy", "name": "resolvedDelegateProxy",
"type": "address" "type": "address"
},
{
"internalType": "address",
"name": "anchorStateRegistry",
"type": "address"
} }
], ],
"internalType": "struct OPStackManager.Blueprints", "internalType": "struct OPStackManager.Blueprints",
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
"type": "bool" "type": "bool"
}, },
{ {
"bytes": "160", "bytes": "192",
"label": "blueprint", "label": "blueprint",
"offset": 0, "offset": 0,
"slot": "1", "slot": "1",
...@@ -24,21 +24,21 @@ ...@@ -24,21 +24,21 @@
"bytes": "32", "bytes": "32",
"label": "latestRelease", "label": "latestRelease",
"offset": 0, "offset": 0,
"slot": "6", "slot": "7",
"type": "string" "type": "string"
}, },
{ {
"bytes": "32", "bytes": "32",
"label": "implementations", "label": "implementations",
"offset": 0, "offset": 0,
"slot": "7", "slot": "8",
"type": "mapping(string => mapping(string => struct OPStackManager.Implementation))" "type": "mapping(string => mapping(string => struct OPStackManager.Implementation))"
}, },
{ {
"bytes": "32", "bytes": "32",
"label": "systemConfigs", "label": "systemConfigs",
"offset": 0, "offset": 0,
"slot": "8", "slot": "9",
"type": "mapping(uint256 => contract SystemConfig)" "type": "mapping(uint256 => contract SystemConfig)"
} }
] ]
\ No newline at end of file
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
"type": "bool" "type": "bool"
}, },
{ {
"bytes": "160", "bytes": "192",
"label": "blueprint", "label": "blueprint",
"offset": 0, "offset": 0,
"slot": "1", "slot": "1",
...@@ -24,21 +24,21 @@ ...@@ -24,21 +24,21 @@
"bytes": "32", "bytes": "32",
"label": "latestRelease", "label": "latestRelease",
"offset": 0, "offset": 0,
"slot": "6", "slot": "7",
"type": "string" "type": "string"
}, },
{ {
"bytes": "32", "bytes": "32",
"label": "implementations", "label": "implementations",
"offset": 0, "offset": 0,
"slot": "7", "slot": "8",
"type": "mapping(string => mapping(string => struct OPStackManager.Implementation))" "type": "mapping(string => mapping(string => struct OPStackManager.Implementation))"
}, },
{ {
"bytes": "32", "bytes": "32",
"label": "systemConfigs", "label": "systemConfigs",
"offset": 0, "offset": 0,
"slot": "8", "slot": "9",
"type": "mapping(uint256 => contract SystemConfig)" "type": "mapping(uint256 => contract SystemConfig)"
} }
] ]
\ No newline at end of file
...@@ -101,6 +101,7 @@ contract OPStackManager is ISemver, Initializable { ...@@ -101,6 +101,7 @@ contract OPStackManager is ISemver, Initializable {
address proxyAdmin; address proxyAdmin;
address l1ChugSplashProxy; address l1ChugSplashProxy;
address resolvedDelegateProxy; address resolvedDelegateProxy;
address anchorStateRegistry;
} }
/// @notice Inputs required when initializing the OPStackManager. To avoid 'StackTooDeep' errors, /// @notice Inputs required when initializing the OPStackManager. To avoid 'StackTooDeep' errors,
...@@ -237,6 +238,8 @@ contract OPStackManager is ISemver, Initializable { ...@@ -237,6 +238,8 @@ contract OPStackManager is ISemver, Initializable {
); );
output.disputeGameFactoryProxy = output.disputeGameFactoryProxy =
DisputeGameFactory(deployProxy(l2ChainId, output.opChainProxyAdmin, "DisputeGameFactory")); DisputeGameFactory(deployProxy(l2ChainId, output.opChainProxyAdmin, "DisputeGameFactory"));
output.anchorStateRegistryProxy =
AnchorStateRegistry(deployProxy(l2ChainId, output.opChainProxyAdmin, "AnchorStateRegistry"));
// Deploy legacy proxied contracts. // Deploy legacy proxied contracts.
output.l1StandardBridgeProxy = L1StandardBridge( output.l1StandardBridgeProxy = L1StandardBridge(
...@@ -256,6 +259,12 @@ contract OPStackManager is ISemver, Initializable { ...@@ -256,6 +259,12 @@ contract OPStackManager is ISemver, Initializable {
// Now that all proxies are deployed, we can transfer ownership of the AddressManager to the ProxyAdmin. // Now that all proxies are deployed, we can transfer ownership of the AddressManager to the ProxyAdmin.
output.addressManager.transferOwnership(address(output.opChainProxyAdmin)); output.addressManager.transferOwnership(address(output.opChainProxyAdmin));
// The AnchorStateRegistry Implementation is not MCP Ready, and therefore requires an implementation per chain.
// It must be deployed after the DisputeGameFactoryProxy so that it can be provided as a constructor argument.
output.anchorStateRegistryImpl = AnchorStateRegistry(
Blueprint.deployFrom(blueprint.anchorStateRegistry, salt, abi.encode(output.disputeGameFactoryProxy))
);
// -------- Set and Initialize Proxy Implementations -------- // -------- Set and Initialize Proxy Implementations --------
Implementation storage impl; Implementation storage impl;
bytes memory data; bytes memory data;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment