Commit a6db381a authored by Maurelian's avatar Maurelian Committed by GitHub

Merge pull request #4068 from ethereum-optimism/sc/ctb-fix-deploy-bug

parents 0ac339ea ae37ff0d
...@@ -20,12 +20,12 @@ contract MigrationSystemDictator is BaseSystemDictator { ...@@ -20,12 +20,12 @@ contract MigrationSystemDictator is BaseSystemDictator {
/** /**
* @notice Step after which exit 1 can no longer be used. * @notice Step after which exit 1 can no longer be used.
*/ */
uint8 constant EXIT_1_NO_RETURN_STEP = 3; uint8 public constant EXIT_1_NO_RETURN_STEP = 3;
/** /**
* @notice Step where proxy ownership is transferred. * @notice Step where proxy ownership is transferred.
*/ */
uint8 constant PROXY_TRANSFER_STEP = 4; uint8 public constant PROXY_TRANSFER_STEP = 4;
/** /**
* @notice Whether or not the deployment is finalized. * @notice Whether or not the deployment is finalized.
......
...@@ -362,7 +362,42 @@ const deployFn: DeployFunction = async (hre) => { ...@@ -362,7 +362,42 @@ const deployFn: DeployFunction = async (hre) => {
} }
for (let i = 1; i <= 6; i++) { for (let i = 1; i <= 6; i++) {
if ((await MigrationSystemDictator.currentStep()) === i) { const currentStep = await MigrationSystemDictator.currentStep()
if (currentStep === i) {
if (
currentStep > (await MigrationSystemDictator.PROXY_TRANSFER_STEP()) &&
!(await MigrationSystemDictator.dynamicConfigSet())
) {
if (isLiveDeployer) {
console.log(`Updating dynamic oracle config...`)
// Use default starting time if not provided
let deployL2StartingTimestamp =
hre.deployConfig.l2OutputOracleStartingTimestamp
if (deployL2StartingTimestamp < 0) {
const l1StartingBlock = await hre.ethers.provider.getBlock(
hre.deployConfig.l1StartingBlockTag
)
if (l1StartingBlock === null) {
throw new Error(
`Cannot fetch block tag ${hre.deployConfig.l1StartingBlockTag}`
)
}
deployL2StartingTimestamp = l1StartingBlock.timestamp
}
await MigrationSystemDictator.updateL2OutputOracleDynamicConfig({
l2OutputOracleStartingL2Output:
hre.deployConfig.l2OutputOracleGenesisL2Output,
l2OutputOracleStartingBlockNumber:
hre.deployConfig.l2OutputOracleStartingBlockNumber,
l2OutputOracleStartingTimestamp: deployL2StartingTimestamp,
})
} else {
console.log(`Please update dynamic oracle config...`)
}
}
if (isLiveDeployer) { if (isLiveDeployer) {
console.log(`Executing step ${i}...`) console.log(`Executing step ${i}...`)
await MigrationSystemDictator[`step${i}`]() await MigrationSystemDictator[`step${i}`]()
......
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