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

feat: Add ASR proxy to OPStackManager #11952

Merged
merged 2 commits into from
Sep 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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 @@ -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";
Expand Down Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions packages/contracts-bedrock/semver-lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@
"sourceCodeHash": "0xde4df0f9633dc0cdb1c9f634003ea5b0f7c5c1aebc407bc1b2f44c0ecf938649"
},
"src/L1/OPStackManager.sol": {
"initCodeHash": "0xfcb568c59e2b4fd927b27b3434db657b53571bf64f70bc8453aaf696eda9c3f9",
"sourceCodeHash": "0xfc9069d6967b9b90413fe391805509b178dd134b008a582e4dc64afe14cc1b2a"
"initCodeHash": "0x022b3f6a80eb637972dd0d9ce8666a037c4b916889f44f86771d8c3add9d615d",
"sourceCodeHash": "0xb085725e18c1a0cc1826b770e403ecad765fce686bb80555bf0f6c3c67b21cba"
},
"src/L1/OptimismPortal.sol": {
"initCodeHash": "0xb7a7a28d5b3b88334e7cb4bc1c5fbbf9f691d934e907a2fed6a30e461eb1c0f6",
Expand Down
10 changes: 10 additions & 0 deletions packages/contracts-bedrock/snapshots/abi/OPStackManager.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,11 @@
"internalType": "address",
"name": "resolvedDelegateProxy",
"type": "address"
},
{
"internalType": "address",
"name": "anchorStateRegistry",
"type": "address"
}
],
"internalType": "struct OPStackManager.Blueprints",
Expand Down Expand Up @@ -283,6 +288,11 @@
"internalType": "address",
"name": "resolvedDelegateProxy",
"type": "address"
},
{
"internalType": "address",
"name": "anchorStateRegistry",
"type": "address"
}
],
"internalType": "struct OPStackManager.Blueprints",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,11 @@
"internalType": "address",
"name": "resolvedDelegateProxy",
"type": "address"
},
{
"internalType": "address",
"name": "anchorStateRegistry",
"type": "address"
}
],
"internalType": "struct OPStackManager.Blueprints",
Expand Down Expand Up @@ -283,6 +288,11 @@
"internalType": "address",
"name": "resolvedDelegateProxy",
"type": "address"
},
{
"internalType": "address",
"name": "anchorStateRegistry",
"type": "address"
}
],
"internalType": "struct OPStackManager.Blueprints",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"type": "bool"
},
{
"bytes": "160",
mds1 marked this conversation as resolved.
Show resolved Hide resolved
"bytes": "192",
"label": "blueprint",
"offset": 0,
"slot": "1",
Expand All @@ -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)"
}
]
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"type": "bool"
},
{
"bytes": "160",
"bytes": "192",
"label": "blueprint",
"offset": 0,
"slot": "1",
Expand All @@ -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)"
}
]
9 changes: 9 additions & 0 deletions packages/contracts-bedrock/src/L1/OPStackManager.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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(
Expand All @@ -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;
Expand Down
Loading