Commit dbb76ac2 authored by Matthew Slipper's avatar Matthew Slipper

Merge branch 'develop' into sc/ctb-msd-del-addrs

parents da791d56 05e86e85
......@@ -49,15 +49,24 @@ contract MigrationSystemDictator is BaseSystemDictator {
}
/**
* @notice Pauses the system by shutting down the L1CrossDomainMessenger and clearing many
* addresses inside the AddressManager.
* @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.
*/
function step2() external onlyOwner step(2) {
// Pause the L1CrossDomainMessenger
L1CrossDomainMessenger(config.proxyAddressConfig.l1CrossDomainMessengerProxy).pause();
// Temporarily brick the L1CrossDomainMessenger by setting its implementation address to
// address(0) which will cause the ResolvedDelegateProxy to revert. Better than pausing
// the L1CrossDomainMessenger via pause() because it can be easily reverted.
config.globalConfig.addressManager.setAddress("OVM_L1CrossDomainMessenger", address(0));
// TODO: Set the deposit halt flag.
}
// Remove all dead addresses from the AddressManager
string[17] memory deads = [
/**
* @notice Removes deprecated addresses from the AddressManager.
*/
function step3() external onlyOwner step(3) {
// Remove all deprecated addresses from the AddressManager
string[17] memory deprecated = [
"OVM_CanonicalTransactionChain",
"OVM_L2CrossDomainMessenger",
"OVM_DecompressionPrecompileAddress",
......@@ -77,15 +86,15 @@ contract MigrationSystemDictator is BaseSystemDictator {
"BondManager"
];
for (uint256 i = 0; i < deads.length; i++) {
config.globalConfig.addressManager.setAddress(deads[i], address(0));
for (uint256 i = 0; i < deprecated.length; i++) {
config.globalConfig.addressManager.setAddress(deprecated[i], address(0));
}
}
/**
* @notice Transfers system ownership to the ProxyAdmin.
*/
function step3() external onlyOwner step(3) {
function step4() external onlyOwner step(4) {
// Transfer ownership of the AddressManager to the ProxyAdmin.
config.globalConfig.addressManager.transferOwnership(
address(config.globalConfig.proxyAdmin)
......@@ -100,7 +109,11 @@ contract MigrationSystemDictator is BaseSystemDictator {
/**
* @notice Upgrades and initializes proxy contracts.
*/
function step4() external onlyOwner step(4) {
function step5() external onlyOwner step(5) {
// Pause the L1CrossDomainMessenger. Now we use the real pause() function because by the
// time we're done here we'll have access to the unpause() function.
L1CrossDomainMessenger(config.proxyAddressConfig.l1CrossDomainMessengerProxy).pause();
// Upgrade and initialize the L2OutputOracle.
config.globalConfig.proxyAdmin.upgradeAndCall(
payable(config.proxyAddressConfig.l2OutputOracleProxy),
......@@ -174,7 +187,7 @@ contract MigrationSystemDictator is BaseSystemDictator {
/**
* @notice Unpauses the system at which point the system should be fully operational.
*/
function step5() external onlyOwner step(5) {
function step6() external onlyOwner step(6) {
// Unpause the L1CrossDomainMessenger.
L1CrossDomainMessenger(config.proxyAddressConfig.l1CrossDomainMessengerProxy).unpause();
}
......@@ -182,7 +195,7 @@ contract MigrationSystemDictator is BaseSystemDictator {
/**
* @notice Tranfers admin ownership to the final owner.
*/
function step6() external onlyOwner step(6) {
function step7() external onlyOwner step(7) {
// Transfer ownership of the L1CrossDomainMessenger to the final owner.
L1CrossDomainMessenger(config.proxyAddressConfig.l1CrossDomainMessengerProxy)
.transferOwnership(config.globalConfig.finalOwner);
......
......@@ -188,7 +188,12 @@ const deployFn: DeployFunction = async (hre) => {
)
},
2: async () => {
await assertContractVariable(L1CrossDomainMessenger, 'paused', true)
assert(
(await AddressManager.getAddress('OVM_L1CrossDomainMessenger')) ===
ethers.constants.AddressZero
)
},
3: async () => {
const deads = [
'OVM_CanonicalTransactionChain',
'OVM_L2CrossDomainMessenger',
......@@ -215,7 +220,7 @@ const deployFn: DeployFunction = async (hre) => {
)
}
},
3: async () => {
4: async () => {
await assertContractVariable(AddressManager, 'owner', ProxyAdmin.address)
assert(
(await L1StandardBridgeProxy.callStatic.getOwner({
......@@ -223,7 +228,7 @@ const deployFn: DeployFunction = async (hre) => {
})) === ProxyAdmin.address
)
},
4: async () => {
5: async () => {
// Check L2OutputOracle was initialized properly.
await assertContractVariable(
L2OutputOracle,
......@@ -278,6 +283,7 @@ const deployFn: DeployFunction = async (hre) => {
)
// Check L1CrossDomainMessenger was initialized properly.
await assertContractVariable(L1CrossDomainMessenger, 'paused', true)
try {
await L1CrossDomainMessenger.xDomainMessageSender()
assert(false, `L1CrossDomainMessenger was not initialized properly`)
......@@ -317,10 +323,10 @@ const deployFn: DeployFunction = async (hre) => {
L1CrossDomainMessenger.address
)
},
5: async () => {
6: async () => {
await assertContractVariable(L1CrossDomainMessenger, 'paused', false)
},
6: async () => {
7: async () => {
await assertContractVariable(
L1CrossDomainMessenger,
'owner',
......@@ -334,7 +340,7 @@ const deployFn: DeployFunction = async (hre) => {
},
}
for (let i = 1; i <= 6; i++) {
for (let i = 1; i <= 7; i++) {
if ((await MigrationSystemDictator.currentStep()) === i) {
if (isLiveDeployer) {
console.log(`Executing step ${i}...`)
......
......@@ -37,7 +37,10 @@ program
}
}
fs.writeFileSync('./data/evm-addresses.json', JSON.stringify(addrs, null, 2))
fs.writeFileSync(
'./data/evm-addresses.json',
JSON.stringify(addrs, null, 2)
)
fs.writeFileSync('./data/evm-messages.json', JSON.stringify(msgs, null, 2))
})
......
......@@ -135,8 +135,9 @@ Optimism's block derivation function is designed such that it:
#### Epochs and the Sequencing Window
The rollup chain is subdivided into epochs. There is a 1:1 correspondence between L1 block numbers and epoch numbers.
For L1 block number `n`, there is a corresponding rollup epoch `n` which can only be derived a "sequencing windows" has
passed, i.e. after L1 block number `n + SEQUENCING_WINDOW_SIZE` is added to the L1 chain.
For L1 block number `n`, there is a corresponding rollup epoch `n` which can only be derived after a _sequencing window_
worth of blocks haspassed, i.e. after L1 block number `n + SEQUENCING_WINDOW_SIZE` is added to the L1 chain.
Each epoch contains at least one block. Every block in the epoch contains an L1 info transaction which contains
contextual information about L1 such as the block hash and timestamp. The first block in the epoch also contains all
......
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