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
41accd0b
Commit
41accd0b
authored
Feb 17, 2023
by
Mark Tyneway
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
deployment: optimism portal with pausability
lint: fix
parent
be8d68a3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
60 additions
and
18 deletions
+60
-18
SystemDictator.sol
...contracts-bedrock/contracts/deployment/SystemDictator.sol
+13
-4
021-SystemDictatorSteps-2.ts
...ges/contracts-bedrock/deploy/021-SystemDictatorSteps-2.ts
+47
-14
No files found.
packages/contracts-bedrock/contracts/deployment/SystemDictator.sol
View file @
41accd0b
...
@@ -111,6 +111,12 @@ contract SystemDictator is OwnableUpgradeable {
...
@@ -111,6 +111,12 @@ contract SystemDictator is OwnableUpgradeable {
*/
*/
L2OutputOracleDynamicConfig public l2OutputOracleDynamicConfig;
L2OutputOracleDynamicConfig public l2OutputOracleDynamicConfig;
/**
* @notice Dynamic configuration for the OptimismPortal. Determines
* if the system should be paused when initialized.
*/
bool public optimismPortalDynamicConfig;
/**
/**
* @notice Current step;
* @notice Current step;
*/
*/
...
@@ -160,14 +166,17 @@ contract SystemDictator is OwnableUpgradeable {
...
@@ -160,14 +166,17 @@ contract SystemDictator is OwnableUpgradeable {
}
}
/**
/**
* @notice Allows the owner to update dynamic
L2OutputOracle
config.
* @notice Allows the owner to update dynamic config.
*
*
* @param _l2OutputOracleDynamicConfig Dynamic L2OutputOracle config.
* @param _l2OutputOracleDynamicConfig Dynamic L2OutputOracle config.
* @param _optimismPortalDynamicConfig Dynamic OptimismPortal config.
*/
*/
function updateL2OutputOracleDynamicConfig(
function updateDynamicConfig(
L2OutputOracleDynamicConfig memory _l2OutputOracleDynamicConfig
L2OutputOracleDynamicConfig memory _l2OutputOracleDynamicConfig,
bool _optimismPortalDynamicConfig
) external onlyOwner {
) external onlyOwner {
l2OutputOracleDynamicConfig = _l2OutputOracleDynamicConfig;
l2OutputOracleDynamicConfig = _l2OutputOracleDynamicConfig;
optimismPortalDynamicConfig = _optimismPortalDynamicConfig;
dynamicConfigSet = true;
dynamicConfigSet = true;
}
}
...
@@ -314,7 +323,7 @@ contract SystemDictator is OwnableUpgradeable {
...
@@ -314,7 +323,7 @@ contract SystemDictator is OwnableUpgradeable {
config.globalConfig.proxyAdmin.upgradeAndCall(
config.globalConfig.proxyAdmin.upgradeAndCall(
payable(config.proxyAddressConfig.optimismPortalProxy),
payable(config.proxyAddressConfig.optimismPortalProxy),
address(config.implementationAddressConfig.optimismPortalImpl),
address(config.implementationAddressConfig.optimismPortalImpl),
abi.encodeCall(OptimismPortal.initialize, (
true
))
abi.encodeCall(OptimismPortal.initialize, (
optimismPortalDynamicConfig
))
);
);
// Upgrade the L1CrossDomainMessenger.
// Upgrade the L1CrossDomainMessenger.
...
...
packages/contracts-bedrock/deploy/021-SystemDictatorSteps-2.ts
View file @
41accd0b
...
@@ -171,21 +171,24 @@ const deployFn: DeployFunction = async (hre) => {
...
@@ -171,21 +171,24 @@ const deployFn: DeployFunction = async (hre) => {
deployL2StartingTimestamp
=
l1StartingBlock
.
timestamp
deployL2StartingTimestamp
=
l1StartingBlock
.
timestamp
}
}
await
SystemDictator
.
updateL2OutputOracleDynamicConfig
({
await
SystemDictator
.
updateDynamicConfig
(
l2OutputOracleStartingBlockNumber
:
{
hre
.
deployConfig
.
l2OutputOracleStartingBlockNumber
,
l2OutputOracleStartingBlockNumber
:
l2OutputOracleStartingTimestamp
:
deployL2StartingTimestamp
,
hre
.
deployConfig
.
l2OutputOracleStartingBlockNumber
,
})
l2OutputOracleStartingTimestamp
:
deployL2StartingTimestamp
,
},
false
// do not pause the the OptimismPortal when initializing
)
}
else
{
}
else
{
const
tx
=
const
tx
=
await
SystemDictator
.
populateTransaction
.
updateDynamicConfig
(
await
SystemDictator
.
populateTransaction
.
updateL2OutputOracleDynamicConfig
(
{
{
l2OutputOracleStartingBlockNumber
:
l2OutputOracleStartingBlockNumber
:
hre
.
deployConfig
.
l2OutputOracleStartingBlockNumber
,
hre
.
deployConfig
.
l2OutputOracleStartingBlockNumber
,
l2OutputOracleStartingTimestamp
:
l2OutputOracleStartingTimestamp
:
hre
.
deployConfig
.
l2OutputOracleStartingTimestamp
,
hre
.
deployConfig
.
l2OutputOracleStartingTimestamp
,
}
,
}
true
)
)
console
.
log
(
`Please update dynamic oracle config...`
)
console
.
log
(
`Please update dynamic oracle config...`
)
console
.
log
(
`MSD address:
${
SystemDictator
.
address
}
`
)
console
.
log
(
`MSD address:
${
SystemDictator
.
address
}
`
)
console
.
log
(
`JSON:`
)
console
.
log
(
`JSON:`
)
...
@@ -243,6 +246,12 @@ const deployFn: DeployFunction = async (hre) => {
...
@@ -243,6 +246,12 @@ const deployFn: DeployFunction = async (hre) => {
(
await
hre
.
ethers
.
provider
.
getBalance
(
L1StandardBridge
.
address
)).
eq
(
0
)
(
await
hre
.
ethers
.
provider
.
getBalance
(
L1StandardBridge
.
address
)).
eq
(
0
)
)
)
if
(
isLiveDeployer
)
{
await
assertContractVariable
(
OptimismPortal
,
'
paused
'
,
false
)
}
else
{
await
assertContractVariable
(
OptimismPortal
,
'
paused
'
,
true
)
}
// Check L1CrossDomainMessenger was initialized properly.
// Check L1CrossDomainMessenger was initialized properly.
await
assertContractVariable
(
L1CrossDomainMessenger
,
'
paused
'
,
true
)
await
assertContractVariable
(
L1CrossDomainMessenger
,
'
paused
'
,
true
)
try
{
try
{
...
@@ -283,6 +292,30 @@ const deployFn: DeployFunction = async (hre) => {
...
@@ -283,6 +292,30 @@ const deployFn: DeployFunction = async (hre) => {
},
},
})
})
if
(
await
isStep
(
SystemDictator
,
6
))
{
console
.
log
(
`
Unpause the OptimismPortal
`
)
if
(
isLiveDeployer
)
{
console
.
log
(
'
OptimismPortal already not paused.
'
)
}
else
{
const
tx
=
await
OptimismPortal
.
populateTransaction
.
unpause
()
console
.
log
(
`Please unpause the OptimismPortal...`
)
console
.
log
(
`OptimismPortal address:
${
OptimismPortal
.
address
}
`
)
console
.
log
(
`JSON:`
)
console
.
log
(
jsonifyTransaction
(
tx
))
}
await
awaitCondition
(
async
()
=>
{
return
!
OptimismPortal
.
paused
()
},
30000
,
1000
)
}
// Step 6 unpauses the new L1CrossDomainMessenger.
// Step 6 unpauses the new L1CrossDomainMessenger.
await
doStep
({
await
doStep
({
isLiveDeployer
,
isLiveDeployer
,
...
...
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