Commit 013a8b0c authored by Matthew Slipper's avatar Matthew Slipper

op-chain-ops: Remove starting-l1-block-number field

parent de172b11
...@@ -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
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment