Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
nebula
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
exchain
nebula
Commits
05e86e85
Unverified
Commit
05e86e85
authored
Nov 15, 2022
by
mergify[bot]
Committed by
GitHub
Nov 15, 2022
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #3998 from ethereum-optimism/sc/ctb-msd-better-pause
fix(ctb): better XDM pause in MSD
parents
dbb8721b
63d877a0
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
37 additions
and
18 deletions
+37
-18
MigrationSystemDictator.sol
...-bedrock/contracts/deployment/MigrationSystemDictator.sol
+25
-12
019-MigrationSystemDictatorSteps.ts
...tracts-bedrock/deploy/019-MigrationSystemDictatorSteps.ts
+12
-6
No files found.
packages/contracts-bedrock/contracts/deployment/MigrationSystemDictator.sol
View file @
05e86e85
...
@@ -49,15 +49,24 @@ contract MigrationSystemDictator is BaseSystemDictator {
...
@@ -49,15 +49,24 @@ contract MigrationSystemDictator is BaseSystemDictator {
}
}
/**
/**
* @notice Pauses the system by shutting down the L1CrossDomainMessenger and
clearing many
* @notice Pauses the system by shutting down the L1CrossDomainMessenger and
setting the
*
addresses inside the AddressManager
.
*
deposit halt flag to tell the Sequencer's DTL to stop accepting deposits
.
*/
*/
function step2() external onlyOwner step(2) {
function step2() external onlyOwner step(2) {
// Pause the L1CrossDomainMessenger
// Temporarily brick the L1CrossDomainMessenger by setting its implementation address to
L1CrossDomainMessenger(config.proxyAddressConfig.l1CrossDomainMessengerProxy).pause();
// 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[18] memory deads = [
* @notice Removes deprecated addresses from the AddressManager.
*/
function step3() external onlyOwner step(3) {
// Remove all deprecated addresses from the AddressManager
string[18] memory deprecated = [
"Proxy__OVM_L1CrossDomainMessenger",
"Proxy__OVM_L1CrossDomainMessenger",
"Proxy__OVM_L1StandardBridge",
"Proxy__OVM_L1StandardBridge",
"OVM_CanonicalTransactionChain",
"OVM_CanonicalTransactionChain",
...
@@ -78,15 +87,15 @@ contract MigrationSystemDictator is BaseSystemDictator {
...
@@ -78,15 +87,15 @@ contract MigrationSystemDictator is BaseSystemDictator {
"OVM_L1MultiMessageRelayer"
"OVM_L1MultiMessageRelayer"
];
];
for (uint256 i = 0; i < de
ads
.length; i++) {
for (uint256 i = 0; i < de
precated
.length; i++) {
config.globalConfig.addressManager.setAddress(de
ads
[i], address(0));
config.globalConfig.addressManager.setAddress(de
precated
[i], address(0));
}
}
}
}
/**
/**
* @notice Transfers system ownership to the ProxyAdmin.
* @notice Transfers system ownership to the ProxyAdmin.
*/
*/
function step
3() external onlyOwner step(3
) {
function step
4() external onlyOwner step(4
) {
// Transfer ownership of the AddressManager to the ProxyAdmin.
// Transfer ownership of the AddressManager to the ProxyAdmin.
config.globalConfig.addressManager.transferOwnership(
config.globalConfig.addressManager.transferOwnership(
address(config.globalConfig.proxyAdmin)
address(config.globalConfig.proxyAdmin)
...
@@ -101,7 +110,11 @@ contract MigrationSystemDictator is BaseSystemDictator {
...
@@ -101,7 +110,11 @@ contract MigrationSystemDictator is BaseSystemDictator {
/**
/**
* @notice Upgrades and initializes proxy contracts.
* @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.
// Upgrade and initialize the L2OutputOracle.
config.globalConfig.proxyAdmin.upgradeAndCall(
config.globalConfig.proxyAdmin.upgradeAndCall(
payable(config.proxyAddressConfig.l2OutputOracleProxy),
payable(config.proxyAddressConfig.l2OutputOracleProxy),
...
@@ -175,7 +188,7 @@ contract MigrationSystemDictator is BaseSystemDictator {
...
@@ -175,7 +188,7 @@ contract MigrationSystemDictator is BaseSystemDictator {
/**
/**
* @notice Unpauses the system at which point the system should be fully operational.
* @notice Unpauses the system at which point the system should be fully operational.
*/
*/
function step
5() external onlyOwner step(5
) {
function step
6() external onlyOwner step(6
) {
// Unpause the L1CrossDomainMessenger.
// Unpause the L1CrossDomainMessenger.
L1CrossDomainMessenger(config.proxyAddressConfig.l1CrossDomainMessengerProxy).unpause();
L1CrossDomainMessenger(config.proxyAddressConfig.l1CrossDomainMessengerProxy).unpause();
}
}
...
@@ -183,7 +196,7 @@ contract MigrationSystemDictator is BaseSystemDictator {
...
@@ -183,7 +196,7 @@ contract MigrationSystemDictator is BaseSystemDictator {
/**
/**
* @notice Tranfers admin ownership to the final owner.
* @notice Tranfers admin ownership to the final owner.
*/
*/
function step
6() external onlyOwner step(6
) {
function step
7() external onlyOwner step(7
) {
// Transfer ownership of the L1CrossDomainMessenger to the final owner.
// Transfer ownership of the L1CrossDomainMessenger to the final owner.
L1CrossDomainMessenger(config.proxyAddressConfig.l1CrossDomainMessengerProxy)
L1CrossDomainMessenger(config.proxyAddressConfig.l1CrossDomainMessengerProxy)
.transferOwnership(config.globalConfig.finalOwner);
.transferOwnership(config.globalConfig.finalOwner);
...
...
packages/contracts-bedrock/deploy/019-MigrationSystemDictatorSteps.ts
View file @
05e86e85
...
@@ -188,7 +188,12 @@ const deployFn: DeployFunction = async (hre) => {
...
@@ -188,7 +188,12 @@ const deployFn: DeployFunction = async (hre) => {
)
)
},
},
2
:
async
()
=>
{
2
:
async
()
=>
{
await
assertContractVariable
(
L1CrossDomainMessenger
,
'
paused
'
,
true
)
assert
(
(
await
AddressManager
.
getAddress
(
'
OVM_L1CrossDomainMessenger
'
))
===
ethers
.
constants
.
AddressZero
)
},
3
:
async
()
=>
{
const
deads
=
[
const
deads
=
[
'
Proxy__OVM_L1CrossDomainMessenger
'
,
'
Proxy__OVM_L1CrossDomainMessenger
'
,
'
Proxy__OVM_L1StandardBridge
'
,
'
Proxy__OVM_L1StandardBridge
'
,
...
@@ -216,7 +221,7 @@ const deployFn: DeployFunction = async (hre) => {
...
@@ -216,7 +221,7 @@ const deployFn: DeployFunction = async (hre) => {
)
)
}
}
},
},
3
:
async
()
=>
{
4
:
async
()
=>
{
await
assertContractVariable
(
AddressManager
,
'
owner
'
,
ProxyAdmin
.
address
)
await
assertContractVariable
(
AddressManager
,
'
owner
'
,
ProxyAdmin
.
address
)
assert
(
assert
(
(
await
L1StandardBridgeProxy
.
callStatic
.
getOwner
({
(
await
L1StandardBridgeProxy
.
callStatic
.
getOwner
({
...
@@ -224,7 +229,7 @@ const deployFn: DeployFunction = async (hre) => {
...
@@ -224,7 +229,7 @@ const deployFn: DeployFunction = async (hre) => {
}))
===
ProxyAdmin
.
address
}))
===
ProxyAdmin
.
address
)
)
},
},
4
:
async
()
=>
{
5
:
async
()
=>
{
// Check L2OutputOracle was initialized properly.
// Check L2OutputOracle was initialized properly.
await
assertContractVariable
(
await
assertContractVariable
(
L2OutputOracle
,
L2OutputOracle
,
...
@@ -279,6 +284,7 @@ const deployFn: DeployFunction = async (hre) => {
...
@@ -279,6 +284,7 @@ const deployFn: DeployFunction = async (hre) => {
)
)
// Check L1CrossDomainMessenger was initialized properly.
// Check L1CrossDomainMessenger was initialized properly.
await
assertContractVariable
(
L1CrossDomainMessenger
,
'
paused
'
,
true
)
try
{
try
{
await
L1CrossDomainMessenger
.
xDomainMessageSender
()
await
L1CrossDomainMessenger
.
xDomainMessageSender
()
assert
(
false
,
`L1CrossDomainMessenger was not initialized properly`
)
assert
(
false
,
`L1CrossDomainMessenger was not initialized properly`
)
...
@@ -318,10 +324,10 @@ const deployFn: DeployFunction = async (hre) => {
...
@@ -318,10 +324,10 @@ const deployFn: DeployFunction = async (hre) => {
L1CrossDomainMessenger
.
address
L1CrossDomainMessenger
.
address
)
)
},
},
5
:
async
()
=>
{
6
:
async
()
=>
{
await
assertContractVariable
(
L1CrossDomainMessenger
,
'
paused
'
,
false
)
await
assertContractVariable
(
L1CrossDomainMessenger
,
'
paused
'
,
false
)
},
},
6
:
async
()
=>
{
7
:
async
()
=>
{
await
assertContractVariable
(
await
assertContractVariable
(
L1CrossDomainMessenger
,
L1CrossDomainMessenger
,
'
owner
'
,
'
owner
'
,
...
@@ -335,7 +341,7 @@ const deployFn: DeployFunction = async (hre) => {
...
@@ -335,7 +341,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
((
await
MigrationSystemDictator
.
currentStep
())
===
i
)
{
if
(
isLiveDeployer
)
{
if
(
isLiveDeployer
)
{
console
.
log
(
`Executing step
${
i
}
...`
)
console
.
log
(
`Executing step
${
i
}
...`
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment