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
6e5f04d1
Commit
6e5f04d1
authored
Sep 28, 2023
by
Mark Tyneway
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
op-upgrade: cleanup
parent
5b37d241
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
11 deletions
+29
-11
main.go
op-chain-ops/cmd/op-upgrade/main.go
+14
-3
l1.go
op-chain-ops/upgrades/l1.go
+15
-8
No files found.
op-chain-ops/cmd/op-upgrade/main.go
View file @
6e5f04d1
...
@@ -105,18 +105,25 @@ func entrypoint(ctx *cli.Context) error {
...
@@ -105,18 +105,25 @@ func entrypoint(ctx *cli.Context) error {
log
.
Warn
(
"Cannot find deploy config for network"
,
"name"
,
chainConfig
.
Name
,
"deploy-config-name"
,
name
,
"path"
,
deployConfig
)
log
.
Warn
(
"Cannot find deploy config for network"
,
"name"
,
chainConfig
.
Name
,
"deploy-config-name"
,
name
,
"path"
,
deployConfig
)
}
}
if
config
!=
nil
{
log
.
Info
(
"Checking deploy config validity"
,
"name"
,
chainConfig
.
Name
)
if
err
:=
config
.
Check
();
err
!=
nil
{
return
fmt
.
Errorf
(
"error checking deploy config: %w"
,
err
)
}
}
clients
,
err
:=
clients
.
NewClients
(
ctx
.
String
(
"l1-rpc-url"
),
chainConfig
.
PublicRPC
)
clients
,
err
:=
clients
.
NewClients
(
ctx
.
String
(
"l1-rpc-url"
),
chainConfig
.
PublicRPC
)
if
err
!=
nil
{
if
err
!=
nil
{
return
err
return
fmt
.
Errorf
(
"cannot create RPC clients: %w"
,
err
)
}
}
l1ChainID
,
err
:=
clients
.
L1Client
.
ChainID
(
ctx
.
Context
)
l1ChainID
,
err
:=
clients
.
L1Client
.
ChainID
(
ctx
.
Context
)
if
err
!=
nil
{
if
err
!=
nil
{
return
err
return
fmt
.
Errorf
(
"cannot fetch L1 chain ID: %w"
,
err
)
}
}
l2ChainID
,
err
:=
clients
.
L2Client
.
ChainID
(
ctx
.
Context
)
l2ChainID
,
err
:=
clients
.
L2Client
.
ChainID
(
ctx
.
Context
)
if
err
!=
nil
{
if
err
!=
nil
{
return
err
return
fmt
.
Errorf
(
"cannot fetch L2 chain ID: %w"
,
err
)
}
}
log
.
Info
(
chainConfig
.
Name
,
"l1-chain-id"
,
l1ChainID
,
"l2-chain-id"
,
l2ChainID
)
log
.
Info
(
chainConfig
.
Name
,
"l1-chain-id"
,
l1ChainID
,
"l2-chain-id"
,
l2ChainID
)
...
@@ -159,15 +166,19 @@ func entrypoint(ctx *cli.Context) error {
...
@@ -159,15 +166,19 @@ func entrypoint(ctx *cli.Context) error {
log
.
Info
(
"OptimismPortal"
,
"version"
,
list
.
OptimismPortal
.
Version
,
"address"
,
list
.
OptimismPortal
.
Address
)
log
.
Info
(
"OptimismPortal"
,
"version"
,
list
.
OptimismPortal
.
Version
,
"address"
,
list
.
OptimismPortal
.
Address
)
log
.
Info
(
"SystemConfig"
,
"version"
,
list
.
SystemConfig
.
Version
,
"address"
,
list
.
SystemConfig
.
Address
)
log
.
Info
(
"SystemConfig"
,
"version"
,
list
.
SystemConfig
.
Version
,
"address"
,
list
.
SystemConfig
.
Address
)
// Ensure that the superchain registry information is correct by checking the
// actual versions based on what the registry says is true.
if
err
:=
upgrades
.
CheckL1
(
ctx
.
Context
,
&
list
,
clients
.
L1Client
);
err
!=
nil
{
if
err
:=
upgrades
.
CheckL1
(
ctx
.
Context
,
&
list
,
clients
.
L1Client
);
err
!=
nil
{
return
fmt
.
Errorf
(
"error checking L1: %w"
,
err
)
return
fmt
.
Errorf
(
"error checking L1: %w"
,
err
)
}
}
// Build the batch
if
err
:=
upgrades
.
L1
(
&
batch
,
list
,
*
addresses
,
config
,
chainConfig
,
clients
.
L1Client
);
err
!=
nil
{
if
err
:=
upgrades
.
L1
(
&
batch
,
list
,
*
addresses
,
config
,
chainConfig
,
clients
.
L1Client
);
err
!=
nil
{
return
err
return
err
}
}
}
}
// Write the batch to disk or stdout
if
outfile
:=
ctx
.
Path
(
"outfile"
);
outfile
!=
""
{
if
outfile
:=
ctx
.
Path
(
"outfile"
);
outfile
!=
""
{
if
err
:=
writeJSON
(
outfile
,
batch
);
err
!=
nil
{
if
err
:=
writeJSON
(
outfile
,
batch
);
err
!=
nil
{
return
err
return
err
...
...
op-chain-ops/upgrades/l1.go
View file @
6e5f04d1
...
@@ -348,9 +348,16 @@ func SystemConfig(batch *safe.Batch, implementations superchain.ImplementationLi
...
@@ -348,9 +348,16 @@ func SystemConfig(batch *safe.Batch, implementations superchain.ImplementationLi
return
fmt
.
Errorf
(
"no initialize method"
)
return
fmt
.
Errorf
(
"no initialize method"
)
}
}
var
gasPriceOracleOverhead
,
gasPriceOracleScalar
,
startBlock
*
big
.
Int
// If we want to be able to override these based on the values in the config,
// the logic below will need to be updated. Right now the logic prefers the
// on chain values over the offchain values. This to maintain backwards compatibilty
// in the short term.
startBlock
:=
big
.
NewInt
(
0
)
batchInboxAddress
:=
common
.
HexToAddress
(
chainConfig
.
BatchInboxAddr
.
String
())
var
gasPriceOracleOverhead
,
gasPriceOracleScalar
*
big
.
Int
var
batcherHash
common
.
Hash
var
batcherHash
common
.
Hash
var
batchInboxAddress
,
p2pSequencerAddress
,
finalSystemOwner
common
.
Address
var
p2pSequencerAddress
,
finalSystemOwner
common
.
Address
var
l2GenesisBlockGasLimit
uint64
var
l2GenesisBlockGasLimit
uint64
if
config
!=
nil
{
if
config
!=
nil
{
...
@@ -384,14 +391,14 @@ func SystemConfig(batch *safe.Batch, implementations superchain.ImplementationLi
...
@@ -384,14 +391,14 @@ func SystemConfig(batch *safe.Batch, implementations superchain.ImplementationLi
return
err
return
err
}
}
// StartBlock is a new property, we want to explicitly set it to 0 if there is an error fetching it
// StartBlock is a new property, we want to explicitly set it to 0 if there is an error fetching it
s
tartBlock
,
err
=
systemConfig
.
StartBlock
(
&
bind
.
CallOpts
{})
s
ystemConfigStartBlock
,
err
:
=
systemConfig
.
StartBlock
(
&
bind
.
CallOpts
{})
if
err
!=
nil
{
if
err
!=
nil
&&
systemConfigStartBlock
!=
nil
{
startBlock
=
big
.
NewInt
(
0
)
startBlock
=
systemConfigStartBlock
}
}
// BatchInboxAddress is a new property, we want to set it to the offchain value if there is an error fetching it
// BatchInboxAddress is a new property, we want to set it to the offchain value if there is an error fetching it
batchInboxAddress
,
err
=
systemConfig
.
BatchInbox
(
&
bind
.
CallOpts
{})
systemConfigBatchInboxAddress
,
err
:
=
systemConfig
.
BatchInbox
(
&
bind
.
CallOpts
{})
if
err
!=
nil
{
if
err
!=
nil
&&
systemConfigBatchInboxAddress
!=
(
common
.
Address
{})
{
batchInboxAddress
=
common
.
HexToAddress
(
chainConfig
.
BatchInboxAddr
.
String
())
batchInboxAddress
=
systemConfigBatchInboxAddress
}
}
p2pSequencerAddress
,
err
=
systemConfig
.
UnsafeBlockSigner
(
&
bind
.
CallOpts
{})
p2pSequencerAddress
,
err
=
systemConfig
.
UnsafeBlockSigner
(
&
bind
.
CallOpts
{})
if
err
!=
nil
{
if
err
!=
nil
{
...
...
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