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
2aee16b3
Commit
2aee16b3
authored
Oct 03, 2023
by
Mark Tyneway
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
op-upgrade: cleanup implementation
parent
c85df36f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
8 deletions
+6
-8
main.go
op-chain-ops/cmd/op-upgrade/main.go
+6
-8
No files found.
op-chain-ops/cmd/op-upgrade/main.go
View file @
2aee16b3
...
...
@@ -136,27 +136,25 @@ func entrypoint(ctx *cli.Context) error {
return
fmt
.
Errorf
(
"cannot fetch L1 chain ID: %w"
,
err
)
}
l2ChainID
:=
chainConfig
.
ChainID
// The L2Client is not required, but double check the chain id matches if possible
if
clients
.
L2Client
!=
nil
{
remoteL
2ChainID
,
err
:=
clients
.
L2Client
.
ChainID
(
ctx
.
Context
)
l
2ChainID
,
err
:=
clients
.
L2Client
.
ChainID
(
ctx
.
Context
)
if
err
!=
nil
{
return
fmt
.
Errorf
(
"cannot fetch L2 chain ID: %w"
,
err
)
}
if
remoteL2ChainID
.
Uint64
()
!=
l2ChainID
{
return
fmt
.
Errorf
(
"Mismatched chain IDs: %d != %d"
,
remoteL2ChainID
.
Uint64
()
,
l2ChainID
)
if
chainConfig
.
ChainID
!=
l2ChainID
.
Uint64
()
{
return
fmt
.
Errorf
(
"Mismatched chain IDs: %d != %d"
,
chainConfig
.
ChainID
,
l2ChainID
)
}
}
log
.
Info
(
chainConfig
.
Name
,
"l1-chain-id"
,
l1ChainID
,
"l2-chain-id"
,
l2
ChainID
)
log
.
Info
(
chainConfig
.
Name
,
"l1-chain-id"
,
l1ChainID
,
"l2-chain-id"
,
chainConfig
.
ChainID
)
log
.
Info
(
"Detecting on chain contracts"
)
// Tracking the individual addresses can be deprecated once the system is upgraded
// to the new contracts where the system config has a reference to each address.
addresses
,
ok
:=
superchain
.
Addresses
[
chainConfig
.
ChainID
]
if
!
ok
{
return
fmt
.
Errorf
(
"no addresses for chain ID %d"
,
l2
ChainID
)
return
fmt
.
Errorf
(
"no addresses for chain ID %d"
,
chainConfig
.
ChainID
)
}
versions
,
err
:=
upgrades
.
GetContractVersions
(
ctx
.
Context
,
addresses
,
chainConfig
,
clients
.
L1Client
)
if
err
!=
nil
{
...
...
@@ -259,7 +257,7 @@ func toSuperchainName(chainID uint64) (string, error) {
}
func
writeJSON
(
outfile
string
,
input
interface
{})
error
{
f
,
err
:=
os
.
OpenFile
(
outfile
,
os
.
O_WRONLY
|
os
.
O_CREATE
|
os
.
O_TRUNC
,
0
o
755
)
f
,
err
:=
os
.
OpenFile
(
outfile
,
os
.
O_WRONLY
|
os
.
O_CREATE
|
os
.
O_TRUNC
,
0
o
666
)
if
err
!=
nil
{
return
err
}
...
...
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