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
013a8b0c
Commit
013a8b0c
authored
Dec 03, 2022
by
Matthew Slipper
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
op-chain-ops: Remove starting-l1-block-number field
parent
de172b11
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
10 deletions
+12
-10
main.go
op-chain-ops/cmd/op-migrate/main.go
+12
-10
No files found.
op-chain-ops/cmd/op-migrate/main.go
View file @
013a8b0c
...
@@ -3,11 +3,14 @@ package main
...
@@ -3,11 +3,14 @@ package main
import
(
import
(
"context"
"context"
"encoding/json"
"encoding/json"
"fmt"
"math/big"
"math/big"
"os"
"os"
"path/filepath"
"path/filepath"
"strings"
"strings"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/core/rawdb"
"github.com/ethereum/go-ethereum/core/rawdb"
"github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/log"
...
@@ -33,10 +36,6 @@ func main() {
...
@@ -33,10 +36,6 @@ func main() {
Value
:
"http://127.0.0.1:8545"
,
Value
:
"http://127.0.0.1:8545"
,
Usage
:
"RPC URL for an L1 Node"
,
Usage
:
"RPC URL for an L1 Node"
,
},
},
&
cli
.
Uint64Flag
{
Name
:
"starting-l1-block-number"
,
Usage
:
"L1 block number to build the L2 genesis from"
,
},
&
cli
.
StringFlag
{
&
cli
.
StringFlag
{
Name
:
"ovm-addresses"
,
Name
:
"ovm-addresses"
,
Usage
:
"Path to ovm-addresses.json"
,
Usage
:
"Path to ovm-addresses.json"
,
...
@@ -145,13 +144,16 @@ func main() {
...
@@ -145,13 +144,16 @@ func main() {
if
err
!=
nil
{
if
err
!=
nil
{
return
err
return
err
}
}
var
blockNumber
*
big
.
Int
bnum
:=
ctx
.
Uint64
(
"starting-l1-block-number"
)
if
bnum
!=
0
{
blockNumber
=
new
(
big
.
Int
)
.
SetUint64
(
bnum
)
}
block
,
err
:=
l1Client
.
BlockByNumber
(
context
.
Background
(),
blockNumber
)
var
block
*
types
.
Block
tag
:=
config
.
L1StartingBlockTag
if
tag
.
BlockNumber
!=
nil
{
block
,
err
=
l1Client
.
BlockByNumber
(
context
.
Background
(),
big
.
NewInt
(
tag
.
BlockNumber
.
Int64
()))
}
else
if
tag
.
BlockHash
!=
nil
{
block
,
err
=
l1Client
.
BlockByHash
(
context
.
Background
(),
*
tag
.
BlockHash
)
}
else
{
return
fmt
.
Errorf
(
"invalid l1StartingBlockTag in deploy config: %v"
,
tag
)
}
if
err
!=
nil
{
if
err
!=
nil
{
return
err
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