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";
import { IPreimageOracle } from "src/cannon/interfaces/IPreimageOracle.sol";
import { MIPS } from "src/cannon/MIPS.sol";
import { DisputeGameFactory } from "src/dispute/DisputeGameFactory.sol";
import { AnchorStateRegistry } from "src/dispute/AnchorStateRegistry.sol";
import { SuperchainConfig } from "src/L1/SuperchainConfig.sol";
import { ProtocolVersions } from "src/L1/ProtocolVersions.sol";
......@@ -360,6 +361,7 @@ contract DeployImplementations is Script {
blueprints.proxyAdmin = deployBytecode(Blueprint.blueprintDeployerBytecode(type(ProxyAdmin).creationCode), salt);
blueprints.l1ChugSplashProxy = deployBytecode(Blueprint.blueprintDeployerBytecode(type(L1ChugSplashProxy).creationCode), salt);
blueprints.resolvedDelegateProxy = deployBytecode(Blueprint.blueprintDeployerBytecode(type(ResolvedDelegateProxy).creationCode), salt);
blueprints.anchorStateRegistry = deployBytecode(Blueprint.blueprintDeployerBytecode(type(AnchorStateRegistry).creationCode), salt);
vm.stopBroadcast();
// forgefmt: disable-end
......
......@@ -32,8 +32,8 @@
"sourceCodeHash": "0xde4df0f9633dc0cdb1c9f634003ea5b0f7c5c1aebc407bc1b2f44c0ecf938649"
},
"src/L1/OPStackManager.sol": {
"initCodeHash": "0xfcb568c59e2b4fd927b27b3434db657b53571bf64f70bc8453aaf696eda9c3f9",
"sourceCodeHash": "0xfc9069d6967b9b90413fe391805509b178dd134b008a582e4dc64afe14cc1b2a"
"initCodeHash": "0x022b3f6a80eb637972dd0d9ce8666a037c4b916889f44f86771d8c3add9d615d",
"sourceCodeHash": "0xb085725e18c1a0cc1826b770e403ecad765fce686bb80555bf0f6c3c67b21cba"
},
"src/L1/OptimismPortal.sol": {
"initCodeHash": "0xb7a7a28d5b3b88334e7cb4bc1c5fbbf9f691d934e907a2fed6a30e461eb1c0f6",
......
......@@ -45,6 +45,11 @@
"internalType": "address",
"name": "resolvedDelegateProxy",
"type": "address"
},
{
"internalType": "address",
"name": "anchorStateRegistry",
"type": "address"
}
],
"internalType": "struct OPStackManager.Blueprints",
......@@ -283,6 +288,11 @@
"internalType": "address",
"name": "resolvedDelegateProxy",
"type": "address"
},
{
"internalType": "address",
"name": "anchorStateRegistry",
"type": "address"
}
],
"internalType": "struct OPStackManager.Blueprints",
......
......@@ -45,6 +45,11 @@
"internalType": "address",
"name": "resolvedDelegateProxy",
"type": "address"
},
{
"internalType": "address",
"name": "anchorStateRegistry",
"type": "address"
}
],
"internalType": "struct OPStackManager.Blueprints",
......@@ -283,6 +288,11 @@
"internalType": "address",
"name": "resolvedDelegateProxy",
"type": "address"
},
{
"internalType": "address",
"name": "anchorStateRegistry",
"type": "address"
}
],
"internalType": "struct OPStackManager.Blueprints",
......
......@@ -14,7 +14,7 @@
"type": "bool"
},
{
"bytes": "160",
"bytes": "192",
"label": "blueprint",
"offset": 0,
"slot": "1",
......@@ -24,21 +24,21 @@
"bytes": "32",
"label": "latestRelease",
"offset": 0,
"slot": "6",
"slot": "7",
"type": "string"
},
{
"bytes": "32",
"label": "implementations",
"offset": 0,
"slot": "7",
"slot": "8",
"type": "mapping(string => mapping(string => struct OPStackManager.Implementation))"
},
{
"bytes": "32",
"label": "systemConfigs",
"offset": 0,
"slot": "8",
"slot": "9",
"type": "mapping(uint256 => contract SystemConfig)"
}
]
\ No newline at end of file
......@@ -14,7 +14,7 @@
"type": "bool"
},
{
"bytes": "160",
"bytes": "192",
"label": "blueprint",
"offset": 0,
"slot": "1",
......@@ -24,21 +24,21 @@
"bytes": "32",
"label": "latestRelease",
"offset": 0,
"slot": "6",
"slot": "7",
"type": "string"
},
{
"bytes": "32",
"label": "implementations",
"offset": 0,
"slot": "7",
"slot": "8",
"type": "mapping(string => mapping(string => struct OPStackManager.Implementation))"
},
{
"bytes": "32",
"label": "systemConfigs",
"offset": 0,
"slot": "8",
"slot": "9",
"type": "mapping(uint256 => contract SystemConfig)"
}
]
\ No newline at end of file
......@@ -101,6 +101,7 @@ contract OPStackManager is ISemver, Initializable {
address proxyAdmin;
address l1ChugSplashProxy;
address resolvedDelegateProxy;
address anchorStateRegistry;
}
/// @notice Inputs required when initializing the OPStackManager. To avoid 'StackTooDeep' errors,
......@@ -237,6 +238,8 @@ contract OPStackManager is ISemver, Initializable {
);
output.disputeGameFactoryProxy =
DisputeGameFactory(deployProxy(l2ChainId, output.opChainProxyAdmin, "DisputeGameFactory"));
output.anchorStateRegistryProxy =
AnchorStateRegistry(deployProxy(l2ChainId, output.opChainProxyAdmin, "AnchorStateRegistry"));
// Deploy legacy proxied contracts.
output.l1StandardBridgeProxy = L1StandardBridge(
......@@ -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.
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 --------
Implementation storage impl;
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