Commit 8e76fac4 authored by Maurelian's avatar Maurelian

feat(ctb): Combine MSD step1 and step2 into phase1

parent 642e1dab
...@@ -215,7 +215,7 @@ contract SystemDictator is OwnableUpgradeable { ...@@ -215,7 +215,7 @@ contract SystemDictator is OwnableUpgradeable {
/** /**
* @notice Configures the ProxyAdmin contract. * @notice Configures the ProxyAdmin contract.
*/ */
function step1() external onlyOwner step(1) { function step1() public onlyOwner step(1) {
// Set the AddressManager in the ProxyAdmin. // Set the AddressManager in the ProxyAdmin.
config.globalConfig.proxyAdmin.setAddressManager(config.globalConfig.addressManager); config.globalConfig.proxyAdmin.setAddressManager(config.globalConfig.addressManager);
...@@ -260,7 +260,7 @@ contract SystemDictator is OwnableUpgradeable { ...@@ -260,7 +260,7 @@ contract SystemDictator is OwnableUpgradeable {
* @notice Pauses the system by shutting down the L1CrossDomainMessenger and setting the * @notice Pauses the system by shutting down the L1CrossDomainMessenger and setting the
* deposit halt flag to tell the Sequencer's DTL to stop accepting deposits. * deposit halt flag to tell the Sequencer's DTL to stop accepting deposits.
*/ */
function step2() external onlyOwner step(2) { function step2() public onlyOwner step(2) {
// Store the address of the old L1CrossDomainMessenger implementation. We will need this // Store the address of the old L1CrossDomainMessenger implementation. We will need this
// address in the case that we have to exit early. // address in the case that we have to exit early.
oldL1CrossDomainMessenger = config.globalConfig.addressManager.getAddress( oldL1CrossDomainMessenger = config.globalConfig.addressManager.getAddress(
...@@ -410,6 +410,14 @@ contract SystemDictator is OwnableUpgradeable { ...@@ -410,6 +410,14 @@ contract SystemDictator is OwnableUpgradeable {
); );
} }
/**
* @notice Calls the first 2 steps of the migration process.
*/
function phase1() external onlyOwner {
step1();
step2();
}
/** /**
* @notice Tranfers admin ownership to the final owner. * @notice Tranfers admin ownership to the final owner.
*/ */
......
...@@ -11,7 +11,7 @@ import { ...@@ -11,7 +11,7 @@ import {
assertContractVariable, assertContractVariable,
getContractsFromArtifacts, getContractsFromArtifacts,
getDeploymentAddress, getDeploymentAddress,
doStep, doPhase,
jsonifyTransaction, jsonifyTransaction,
getTenderlySimulationLink, getTenderlySimulationLink,
getCastCommand, getCastCommand,
...@@ -196,16 +196,23 @@ const deployFn: DeployFunction = async (hre) => { ...@@ -196,16 +196,23 @@ const deployFn: DeployFunction = async (hre) => {
console.log(`L1ERC721Bridge already owned by MSD`) console.log(`L1ERC721Bridge already owned by MSD`)
} }
// Step 1 is a freebie, it doesn't impact the system. await doPhase({
await doStep({
isLiveDeployer, isLiveDeployer,
SystemDictator, SystemDictator,
step: 1, phase: 1,
message: ` message: `
Phase 1 includes the following steps:
Step 1 will configure the ProxyAdmin contract, you can safely execute this step at any time Step 1 will configure the ProxyAdmin contract, you can safely execute this step at any time
without impacting the functionality of the rest of the system. without impacting the functionality of the rest of the system.
Step 2 will stop deposits and withdrawals via the L1CrossDomainMessenger and will stop the
DTL from syncing new deposits via the CTC, effectively shutting down the legacy system. Once
this step has been executed, you should immediately begin the L2 migration process. If you
need to restart the system, run exit1() followed by finalize().
`, `,
checks: async () => { checks: async () => {
// Step 1 checks
await assertContractVariable( await assertContractVariable(
ProxyAdmin, ProxyAdmin,
'addressManager', 'addressManager',
...@@ -264,21 +271,8 @@ const deployFn: DeployFunction = async (hre) => { ...@@ -264,21 +271,8 @@ const deployFn: DeployFunction = async (hre) => {
assert(config.systemTxMaxGas === 1_000_000) assert(config.systemTxMaxGas === 1_000_000)
assert(ethers.utils.parseUnits('1', 'gwei').eq(config.minimumBaseFee)) assert(ethers.utils.parseUnits('1', 'gwei').eq(config.minimumBaseFee))
assert(config.maximumBaseFee.eq(uint128Max)) assert(config.maximumBaseFee.eq(uint128Max))
},
})
// Step 2 shuts down the system. // Step 2 checks
await doStep({
isLiveDeployer,
SystemDictator,
step: 2,
message: `
Step 2 will stop deposits and withdrawals via the L1CrossDomainMessenger and will stop the
DTL from syncing new deposits via the CTC, effectively shutting down the legacy system. Once
this step has been executed, you should immediately begin the L2 migration process. If you
need to restart the system, run exit1() followed by finalize().
`,
checks: async () => {
const messenger = await AddressManager.getAddress( const messenger = await AddressManager.getAddress(
'OVM_L1CrossDomainMessenger' 'OVM_L1CrossDomainMessenger'
) )
......
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