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
ac289888
Commit
ac289888
authored
Oct 26, 2022
by
Mark Tyneway
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert "op-chain-ops: read l2 addrs from json file"
This reverts commit 899c4a8871d6e74a336e512e4b3614427d25169f.
parent
bc1cad20
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
39 deletions
+12
-39
main.go
op-chain-ops/cmd/migrate/main.go
+8
-16
layer_two.go
op-chain-ops/genesis/layer_two.go
+4
-23
No files found.
op-chain-ops/cmd/migrate/main.go
View file @
ac289888
...
@@ -2,7 +2,6 @@ package main
...
@@ -2,7 +2,6 @@ package main
import
(
import
(
"context"
"context"
"errors"
"math/big"
"math/big"
"os"
"os"
"path/filepath"
"path/filepath"
...
@@ -13,6 +12,7 @@ import (
...
@@ -13,6 +12,7 @@ import (
"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"
...
@@ -55,10 +55,6 @@ func main() {
...
@@ -55,10 +55,6 @@ func main() {
Name
:
"evm-messages"
,
Name
:
"evm-messages"
,
Usage
:
"Path to evm-messages.json"
,
Usage
:
"Path to evm-messages.json"
,
},
},
&
cli
.
StringFlag
{
Name
:
"l2-addresses"
,
Usage
:
"Path to l2-addresses.json"
,
},
&
cli
.
StringFlag
{
&
cli
.
StringFlag
{
Name
:
"db-path"
,
Name
:
"db-path"
,
Usage
:
"Path to database"
,
Usage
:
"Path to database"
,
...
@@ -108,11 +104,6 @@ func main() {
...
@@ -108,11 +104,6 @@ func main() {
EvmMessages
:
evmMessages
,
EvmMessages
:
evmMessages
,
}
}
l2Addrs
,
err
:=
genesis
.
NewL2Addresses
(
ctx
.
String
(
"l2-addresses"
))
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
{
...
@@ -151,14 +142,15 @@ func main() {
...
@@ -151,14 +142,15 @@ func main() {
return
err
return
err
}
}
// TODO: think about optimal config, there are a lot of deps
l2Addrs
:=
genesis
.
L2Addresses
{
// regarding changing this
ProxyAdminOwner
:
config
.
ProxyAdminOwner
,
if
config
.
ProxyAdminOwner
!=
l2Addrs
.
ProxyAdminOwner
{
// TODO: these values are not in the config
return
errors
.
New
(
"mismatched ProxyAdminOwner config"
)
L1StandardBridgeProxy
:
common
.
Address
{},
L1CrossDomainMessengerProxy
:
common
.
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
{
return
err
return
err
}
}
...
...
op-chain-ops/genesis/layer_two.go
View file @
ac289888
package
genesis
package
genesis
import
(
import
(
"encoding/json"
"fmt"
"os"
"github.com/ethereum-optimism/optimism/op-bindings/predeploys"
"github.com/ethereum-optimism/optimism/op-bindings/predeploys"
"github.com/ethereum-optimism/optimism/op-chain-ops/state"
"github.com/ethereum-optimism/optimism/op-chain-ops/state"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common"
...
@@ -16,25 +12,10 @@ import (
...
@@ -16,25 +12,10 @@ import (
// L2Addresses represents L1 contract addresses
// L2Addresses represents L1 contract addresses
// that are required for the construction of an L2 state
// that are required for the construction of an L2 state
type
L2Addresses
struct
{
type
L2Addresses
struct
{
ProxyAdminOwner
common
.
Address
`json:"proxyAdminOwner"`
ProxyAdminOwner
common
.
Address
L1StandardBridgeProxy
common
.
Address
`json:"l1StandardBridgeProxy"`
L1StandardBridgeProxy
common
.
Address
L1CrossDomainMessengerProxy
common
.
Address
`json:"l1CrossDomainMessengerProxy"`
L1CrossDomainMessengerProxy
common
.
Address
L1ERC721BridgeProxy
common
.
Address
`json:"l1ERC721BridgeProxy"`
L1ERC721BridgeProxy
common
.
Address
}
// NewL2Addresses will read the L2Addresses from a json file on disk
func
NewL2Addresses
(
path
string
)
(
*
L2Addresses
,
error
)
{
file
,
err
:=
os
.
ReadFile
(
path
)
if
err
!=
nil
{
return
nil
,
fmt
.
Errorf
(
"cannot find L2Addresses json at %s: %w"
,
path
,
err
)
}
var
addrs
L2Addresses
if
err
:=
json
.
Unmarshal
(
file
,
&
addrs
);
err
!=
nil
{
return
nil
,
err
}
return
&
addrs
,
nil
}
}
// BuildL2DeveloperGenesis will build the developer Optimism Genesis
// BuildL2DeveloperGenesis will build the developer Optimism Genesis
...
...
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