Skip to content

Commit

Permalink
Fix chain id option to use classic option style instead of nitro
Browse files Browse the repository at this point in the history
  • Loading branch information
joshuacolvin0 authored and hkalodner committed Aug 25, 2022
1 parent 8268d2c commit eeabd89
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 10 deletions.
12 changes: 6 additions & 6 deletions packages/arb-node-core/cmd/arb-relay/arb-relay.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,10 @@ func startup() error {
defer cancelFunc()

config, err := configuration.ParseRelay()
if err != nil || len(config.Feed.Input.URLs) == 0 || config.L2.ChainID == 0 {
if err != nil || len(config.Feed.Input.URLs) == 0 || config.Node.ChainID == 0 {
fmt.Printf("\n")
fmt.Printf("Sample usage: arb-relay --conf=<filename> \n")
fmt.Printf(" or: arb-relay --feed.input.url=<feed websocket> --l2.chain-id=<chain id>\n\n")
fmt.Printf(" or: arb-relay --feed.input.url=<feed websocket> --node.chain-id=<L2 chain id>\n\n")
if err != nil && !strings.Contains(err.Error(), "help requested") {
fmt.Printf("%s\n", err.Error())
}
Expand Down Expand Up @@ -127,17 +127,17 @@ func NewArbRelay(config *configuration.Config) (*ArbRelay, chan error) {
confirmedAccumulatorChan := make(chan common.Hash, 10)
broadcastClientErrChan := make(chan error, 1)
for _, address := range config.Feed.Input.URLs {
client := broadcastclient.NewBroadcastClient(address, config.L2.ChainID, nil, config.Feed.Input.Timeout, broadcastClientErrChan)
client := broadcastclient.NewBroadcastClient(address, config.Node.ChainID, nil, config.Feed.Input.Timeout, broadcastClientErrChan)
client.ConfirmedAccumulatorListener = confirmedAccumulatorChan
broadcastClients = append(broadcastClients, client)
}
arbRelay := &ArbRelay{
broadcaster: broadcaster.NewBroadcaster(&config.Feed.Output, 0),
broadcaster: broadcaster.NewBroadcaster(&config.Feed.Output, config.Node.ChainID),
broadcastClients: broadcastClients,
confirmedAccumulatorChan: confirmedAccumulatorChan,
}
arbRelay.chainIdBig = new(big.Int).SetUint64(config.L2.ChainID)
arbRelay.chainIdHex = hexutil.Uint64(config.L2.ChainID)
arbRelay.chainIdBig = new(big.Int).SetUint64(config.Node.ChainID)
arbRelay.chainIdHex = hexutil.Uint64(config.Node.ChainID)
return arbRelay, broadcastClientErrChan
}

Expand Down
2 changes: 1 addition & 1 deletion packages/arb-rpc-node/rpc/launch.go
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ func SetupBatcher(
if err != nil {
return nil, nil, err
}
feedBroadcaster := broadcaster.NewBroadcaster(&config.Feed.Output, config.L2.ChainID)
feedBroadcaster := broadcaster.NewBroadcaster(&config.Feed.Output, config.Node.ChainID)
seqBatcher, err := batcher.NewSequencerBatcher(
ctx,
batcherMode.Core,
Expand Down
5 changes: 2 additions & 3 deletions packages/arb-util/configuration/configuration.go
Original file line number Diff line number Diff line change
Expand Up @@ -449,8 +449,7 @@ type Config struct {
URL string `koanf:"url"`
} `koanf:"l1"`
L2 struct {
ChainID uint64 `koanf:"chain-id"`
DisableUpstream bool `koanf:"disable-upstream"`
DisableUpstream bool `koanf:"disable-upstream"`
} `koanf:"l2"`
Log Log `koanf:"log"`
Node Node `koanf:"node"`
Expand Down Expand Up @@ -882,6 +881,7 @@ func resolveDirectoryNames(out *Config, wallet *Wallet) error {
func ParseRelay() (*Config, error) {
f := flag.NewFlagSet(os.Args[0], flag.ContinueOnError)

f.Uint64("node.chain-id", 0, "chain id of the arbitrum chain")
AddFeedOutputOptions(f)

k, err := beginCommonParse(f)
Expand Down Expand Up @@ -998,7 +998,6 @@ func beginCommonParse(f *flag.FlagSet) (*koanf.Koanf, error) {
f.String("log.rpc", "info", "log level for rpc")
f.String("log.core", "info", "log level for general arb node logging")

f.Uint64("l2.chain-id", 0, "if set other than 0, will be used to validate L2 feed connection")
f.Bool("l2.disable-upstream", false, "disable feed and transaction forwarding")

f.Bool("pprof-enable", false, "enable profiling server")
Expand Down

0 comments on commit eeabd89

Please sign in to comment.