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
1c95fc27
Unverified
Commit
1c95fc27
authored
Oct 27, 2022
by
mergify[bot]
Committed by
GitHub
Oct 27, 2022
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #3792 from ethereum-optimism/fix/read-json-l2addrs
op-chain-ops: read l2 addrs from hh deploy artifacts
parents
41e485ac
c687cb5e
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
6 deletions
+35
-6
main.go
op-chain-ops/cmd/migrate/main.go
+35
-6
No files found.
op-chain-ops/cmd/migrate/main.go
View file @
1c95fc27
...
@@ -5,14 +5,15 @@ import (
...
@@ -5,14 +5,15 @@ import (
"math/big"
"math/big"
"os"
"os"
"path/filepath"
"path/filepath"
"strings"
"github.com/ethereum-optimism/optimism/l2geth/core/rawdb"
"github.com/ethereum-optimism/optimism/l2geth/core/rawdb"
"github.com/ethereum-optimism/optimism/l2geth/core/state"
"github.com/ethereum-optimism/optimism/l2geth/core/state"
"github.com/ethereum-optimism/optimism/l2geth/log"
"github.com/ethereum-optimism/optimism/l2geth/log"
"github.com/ethereum-optimism/optimism/op-bindings/hardhat"
"github.com/ethereum-optimism/optimism/op-chain-ops/genesis"
"github.com/ethereum-optimism/optimism/op-chain-ops/genesis"
op_state
"github.com/ethereum-optimism/optimism/op-chain-ops/state"
op_state
"github.com/ethereum-optimism/optimism/op-chain-ops/state"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/ethclient"
"github.com/ethereum/go-ethereum/ethclient"
"github.com/mattn/go-isatty"
"github.com/mattn/go-isatty"
...
@@ -63,6 +64,14 @@ func main() {
...
@@ -63,6 +64,14 @@ func main() {
Name
:
"deploy-config"
,
Name
:
"deploy-config"
,
Usage
:
"Path to hardhat deploy config file"
,
Usage
:
"Path to hardhat deploy config file"
,
},
},
cli
.
StringFlag
{
Name
:
"network"
,
Usage
:
"Name of hardhat deploy network"
,
},
cli
.
StringFlag
{
Name
:
"hardhat-deployments"
,
Usage
:
"Comma separated list of hardhat deployment directories"
,
},
cli
.
BoolFlag
{
cli
.
BoolFlag
{
Name
:
"dry-run"
,
Name
:
"dry-run"
,
Usage
:
"Dry run the upgrade by not committing the database"
,
Usage
:
"Dry run the upgrade by not committing the database"
,
...
@@ -104,6 +113,13 @@ func main() {
...
@@ -104,6 +113,13 @@ func main() {
EvmMessages
:
evmMessages
,
EvmMessages
:
evmMessages
,
}
}
network
:=
ctx
.
String
(
"network"
)
deployments
:=
strings
.
Split
(
ctx
.
String
(
"hardhat-deployments"
),
","
)
hh
,
err
:=
hardhat
.
New
(
network
,
[]
string
{},
deployments
)
if
err
!=
nil
{
return
err
}
l1RpcURL
:=
ctx
.
String
(
"l1-rpc-url"
)
l1RpcURL
:=
ctx
.
String
(
"l1-rpc-url"
)
l1Client
,
err
:=
ethclient
.
Dial
(
l1RpcURL
)
l1Client
,
err
:=
ethclient
.
Dial
(
l1RpcURL
)
if
err
!=
nil
{
if
err
!=
nil
{
...
@@ -142,12 +158,25 @@ func main() {
...
@@ -142,12 +158,25 @@ func main() {
return
err
return
err
}
}
// Get the addresses from the hardhat deploy artifacts
l1StandardBridgeProxyDeployment
,
err
:=
hh
.
GetDeployment
(
"Proxy__OVM_L1StandardBridge"
)
if
err
!=
nil
{
return
err
}
l1CrossDomainMessengerProxyDeployment
,
err
:=
hh
.
GetDeployment
(
"Proxy__OVM_L1CrossdomainMessenger"
)
if
err
!=
nil
{
return
err
}
l1ERC721BridgeProxyDeployment
,
err
:=
hh
.
GetDeployment
(
"L1ERC721BridgeProxy"
)
if
err
!=
nil
{
return
err
}
l2Addrs
:=
genesis
.
L2Addresses
{
l2Addrs
:=
genesis
.
L2Addresses
{
ProxyAdminOwner
:
config
.
ProxyAdminOwner
,
ProxyAdminOwner
:
config
.
ProxyAdminOwner
,
// TODO: these values are not in the config
L1StandardBridgeProxy
:
l1StandardBridgeProxyDeployment
.
Address
,
L1StandardBridgeProxy
:
common
.
Address
{},
L1CrossDomainMessengerProxy
:
l1CrossDomainMessengerProxyDeployment
.
Address
,
L1CrossDomainMessengerProxy
:
common
.
Address
{},
L1ERC721BridgeProxy
:
l1ERC721BridgeProxyDeployment
.
Address
,
L1ERC721BridgeProxy
:
common
.
Address
{},
}
}
if
err
:=
genesis
.
MigrateDB
(
wrappedDB
,
config
,
block
,
&
l2Addrs
,
&
migrationData
);
err
!=
nil
{
if
err
:=
genesis
.
MigrateDB
(
wrappedDB
,
config
,
block
,
&
l2Addrs
,
&
migrationData
);
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