Commit 45eeef38 authored by mergify[bot]'s avatar mergify[bot] Committed by GitHub

Merge pull request #4915 from ethereum-optimism/sc/ctb-l2oo-init-early

fix(ctb): initialize L2OO in dictator step 1
parents b3ec2877 830163ef
...@@ -205,6 +205,19 @@ contract SystemDictator is OwnableUpgradeable { ...@@ -205,6 +205,19 @@ contract SystemDictator is OwnableUpgradeable {
) )
) )
); );
// Upgrade and initialize the L2OutputOracle so the Proposer can start up.
config.globalConfig.proxyAdmin.upgradeAndCall(
payable(config.proxyAddressConfig.l2OutputOracleProxy),
address(config.implementationAddressConfig.l2OutputOracleImpl),
abi.encodeCall(
L2OutputOracle.initialize,
(
l2OutputOracleDynamicConfig.l2OutputOracleStartingBlockNumber,
l2OutputOracleDynamicConfig.l2OutputOracleStartingTimestamp
)
)
);
} }
/** /**
...@@ -290,19 +303,6 @@ contract SystemDictator is OwnableUpgradeable { ...@@ -290,19 +303,6 @@ contract SystemDictator is OwnableUpgradeable {
// Dynamic config must be set before we can initialize the L2OutputOracle. // Dynamic config must be set before we can initialize the L2OutputOracle.
require(dynamicConfigSet, "SystemDictator: dynamic oracle config is not yet initialized"); require(dynamicConfigSet, "SystemDictator: dynamic oracle config is not yet initialized");
// Upgrade and initialize the L2OutputOracle.
config.globalConfig.proxyAdmin.upgradeAndCall(
payable(config.proxyAddressConfig.l2OutputOracleProxy),
address(config.implementationAddressConfig.l2OutputOracleImpl),
abi.encodeCall(
L2OutputOracle.initialize,
(
l2OutputOracleDynamicConfig.l2OutputOracleStartingBlockNumber,
l2OutputOracleDynamicConfig.l2OutputOracleStartingTimestamp
)
)
);
// Upgrade and initialize the OptimismPortal. // Upgrade and initialize the OptimismPortal.
config.globalConfig.proxyAdmin.upgradeAndCall( config.globalConfig.proxyAdmin.upgradeAndCall(
payable(config.proxyAddressConfig.optimismPortalProxy), payable(config.proxyAddressConfig.optimismPortalProxy),
......
...@@ -29,6 +29,7 @@ const deployFn: DeployFunction = async (hre) => { ...@@ -29,6 +29,7 @@ const deployFn: DeployFunction = async (hre) => {
L1ERC721BridgeProxy, L1ERC721BridgeProxy,
L1ERC721BridgeProxyWithSigner, L1ERC721BridgeProxyWithSigner,
SystemConfigProxy, SystemConfigProxy,
L2OutputOracleProxy,
] = await getContractsFromArtifacts(hre, [ ] = await getContractsFromArtifacts(hre, [
{ {
name: 'SystemDictatorProxy', name: 'SystemDictatorProxy',
...@@ -67,6 +68,11 @@ const deployFn: DeployFunction = async (hre) => { ...@@ -67,6 +68,11 @@ const deployFn: DeployFunction = async (hre) => {
iface: 'SystemConfig', iface: 'SystemConfig',
signerOrProvider: deployer, signerOrProvider: deployer,
}, },
{
name: 'L2OutputOracleProxy',
iface: 'L2OutputOracle',
signerOrProvider: deployer,
},
]) ])
// If we have the key for the controller then we don't need to wait for external txns. // If we have the key for the controller then we don't need to wait for external txns.
...@@ -287,6 +293,13 @@ const deployFn: DeployFunction = async (hre) => { ...@@ -287,6 +293,13 @@ const deployFn: DeployFunction = async (hre) => {
'gasLimit', 'gasLimit',
hre.deployConfig.l2GenesisBlockGasLimit hre.deployConfig.l2GenesisBlockGasLimit
) )
// Check L2OutputOracle was initialized properly.
await assertContractVariable(
L2OutputOracleProxy,
'latestBlockNumber',
hre.deployConfig.l2OutputOracleStartingBlockNumber
)
}, },
}) })
......
...@@ -26,7 +26,6 @@ const deployFn: DeployFunction = async (hre) => { ...@@ -26,7 +26,6 @@ const deployFn: DeployFunction = async (hre) => {
L1CrossDomainMessenger, L1CrossDomainMessenger,
L1StandardBridgeProxy, L1StandardBridgeProxy,
L1StandardBridge, L1StandardBridge,
L2OutputOracle,
OptimismPortal, OptimismPortal,
OptimismMintableERC20Factory, OptimismMintableERC20Factory,
L1ERC721Bridge, L1ERC721Bridge,
...@@ -57,11 +56,6 @@ const deployFn: DeployFunction = async (hre) => { ...@@ -57,11 +56,6 @@ const deployFn: DeployFunction = async (hre) => {
iface: 'L1StandardBridge', iface: 'L1StandardBridge',
signerOrProvider: deployer, signerOrProvider: deployer,
}, },
{
name: 'L2OutputOracleProxy',
iface: 'L2OutputOracle',
signerOrProvider: deployer,
},
{ {
name: 'OptimismPortalProxy', name: 'OptimismPortalProxy',
iface: 'OptimismPortal', iface: 'OptimismPortal',
...@@ -213,13 +207,6 @@ const deployFn: DeployFunction = async (hre) => { ...@@ -213,13 +207,6 @@ const deployFn: DeployFunction = async (hre) => {
submit L2 outputs to the L2OutputOracle. submit L2 outputs to the L2OutputOracle.
`, `,
checks: async () => { checks: async () => {
// Check L2OutputOracle was initialized properly.
await assertContractVariable(
L2OutputOracle,
'latestBlockNumber',
hre.deployConfig.l2OutputOracleStartingBlockNumber
)
// Check OptimismPortal was initialized properly. // Check OptimismPortal was initialized properly.
await assertContractVariable( await assertContractVariable(
OptimismPortal, OptimismPortal,
......
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