Skip to content

Commit

Permalink
fix minor issues with config
Browse files Browse the repository at this point in the history
  • Loading branch information
ganeshvanahalli committed Dec 27, 2024
1 parent 411b1cd commit 067b687
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion arbnode/blockmetadata.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import (

type BlockMetadataFetcherConfig struct {
Enable bool `koanf:"enable"`
Source rpcclient.ClientConfig `koanf:"source"`
Source rpcclient.ClientConfig `koanf:"source" reload:"hot"`
SyncInterval time.Duration `koanf:"sync-interval"`
APIBlocksLimit uint64 `koanf:"api-blocks-limit"`
}
Expand Down
7 changes: 4 additions & 3 deletions arbnode/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,10 +137,10 @@ func (c *Config) Validate() error {
return err
}
if c.Sequencer && c.TransactionStreamer.TrackBlockMetadataFrom == 0 {
return errors.New("when sequencer is enabled track-missing-block-metadata-from should be set as well")
return errors.New("when sequencer is enabled track-block-metadata-from should be set as well")
}
if c.TransactionStreamer.TrackBlockMetadataFrom != 0 && !c.BlockMetadataFetcher.Enable {
log.Warn("track-missing-block-metadata-from is set but blockMetadata fetcher is not enabled")
log.Warn("track-block-metadata-from is set but blockMetadata fetcher is not enabled")
}
return nil
}
Expand Down Expand Up @@ -172,7 +172,7 @@ func ConfigAddOptions(prefix string, f *flag.FlagSet, feedInputEnable bool, feed
DangerousConfigAddOptions(prefix+".dangerous", f)
TransactionStreamerConfigAddOptions(prefix+".transaction-streamer", f)
MaintenanceConfigAddOptions(prefix+".maintenance", f)
BlockMetadataFetcherConfigAddOptions(prefix+"block-metadata-fetcher", f)
BlockMetadataFetcherConfigAddOptions(prefix+".block-metadata-fetcher", f)
}

var ConfigDefault = Config{
Expand Down Expand Up @@ -204,6 +204,7 @@ func ConfigDefaultL1Test() *Config {
config.SeqCoordinator = TestSeqCoordinatorConfig
config.Sequencer = true
config.Dangerous.NoSequencerCoordinator = true
config.TransactionStreamer.TrackBlockMetadataFrom = 1

return config
}
Expand Down
8 changes: 4 additions & 4 deletions cmd/nitro/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ func TestEmptyCliConfig(t *testing.T) {
}

func TestSeqConfig(t *testing.T) {
args := strings.Split("--persistent.chain /tmp/data --init.dev-init --node.parent-chain-reader.enable=false --parent-chain.id 5 --chain.id 421613 --node.batch-poster.parent-chain-wallet.pathname /l1keystore --node.batch-poster.parent-chain-wallet.password passphrase --http.addr 0.0.0.0 --ws.addr 0.0.0.0 --node.sequencer --execution.sequencer.enable --node.feed.output.enable --node.feed.output.port 9642", " ")
args := strings.Split("--persistent.chain /tmp/data --init.dev-init --node.parent-chain-reader.enable=false --parent-chain.id 5 --chain.id 421613 --node.batch-poster.parent-chain-wallet.pathname /l1keystore --node.batch-poster.parent-chain-wallet.password passphrase --http.addr 0.0.0.0 --ws.addr 0.0.0.0 --node.sequencer --execution.sequencer.enable --node.feed.output.enable --node.feed.output.port 9642 --node.transaction-streamer.track-block-metadata-from=10", " ")
_, _, err := ParseNode(context.Background(), args)
Require(t, err)
}
Expand Down Expand Up @@ -79,7 +79,7 @@ func TestInvalidArchiveConfig(t *testing.T) {
}

func TestAggregatorConfig(t *testing.T) {
args := strings.Split("--persistent.chain /tmp/data --init.dev-init --node.parent-chain-reader.enable=false --parent-chain.id 5 --chain.id 421613 --node.batch-poster.parent-chain-wallet.pathname /l1keystore --node.batch-poster.parent-chain-wallet.password passphrase --http.addr 0.0.0.0 --ws.addr 0.0.0.0 --node.sequencer --execution.sequencer.enable --node.feed.output.enable --node.feed.output.port 9642 --node.data-availability.enable --node.data-availability.rpc-aggregator.backends [{\"url\":\"http://localhost:8547\",\"pubkey\":\"abc==\"}]", " ")
args := strings.Split("--persistent.chain /tmp/data --init.dev-init --node.parent-chain-reader.enable=false --parent-chain.id 5 --chain.id 421613 --node.batch-poster.parent-chain-wallet.pathname /l1keystore --node.batch-poster.parent-chain-wallet.password passphrase --http.addr 0.0.0.0 --ws.addr 0.0.0.0 --node.sequencer --execution.sequencer.enable --node.feed.output.enable --node.feed.output.port 9642 --node.data-availability.enable --node.data-availability.rpc-aggregator.backends [{\"url\":\"http://localhost:8547\",\"pubkey\":\"abc==\"}] --node.transaction-streamer.track-block-metadata-from=10", " ")
_, _, err := ParseNode(context.Background(), args)
Require(t, err)
}
Expand Down Expand Up @@ -142,7 +142,7 @@ func TestLiveNodeConfig(t *testing.T) {
jsonConfig := "{\"chain\":{\"id\":421613}}"
Require(t, WriteToConfigFile(configFile, jsonConfig))

args := strings.Split("--file-logging.enable=false --persistent.chain /tmp/data --init.dev-init --node.parent-chain-reader.enable=false --parent-chain.id 5 --node.batch-poster.parent-chain-wallet.pathname /l1keystore --node.batch-poster.parent-chain-wallet.password passphrase --http.addr 0.0.0.0 --ws.addr 0.0.0.0 --node.sequencer --execution.sequencer.enable --node.feed.output.enable --node.feed.output.port 9642", " ")
args := strings.Split("--file-logging.enable=false --persistent.chain /tmp/data --init.dev-init --node.parent-chain-reader.enable=false --parent-chain.id 5 --node.batch-poster.parent-chain-wallet.pathname /l1keystore --node.batch-poster.parent-chain-wallet.password passphrase --http.addr 0.0.0.0 --ws.addr 0.0.0.0 --node.sequencer --execution.sequencer.enable --node.feed.output.enable --node.feed.output.port 9642 --node.transaction-streamer.track-block-metadata-from=10", " ")
args = append(args, []string{"--conf.file", configFile}...)
config, _, err := ParseNode(context.Background(), args)
Require(t, err)
Expand Down Expand Up @@ -223,7 +223,7 @@ func TestPeriodicReloadOfLiveNodeConfig(t *testing.T) {
jsonConfig := "{\"conf\":{\"reload-interval\":\"20ms\"}}"
Require(t, WriteToConfigFile(configFile, jsonConfig))

args := strings.Split("--persistent.chain /tmp/data --init.dev-init --node.parent-chain-reader.enable=false --parent-chain.id 5 --chain.id 421613 --node.batch-poster.parent-chain-wallet.pathname /l1keystore --node.batch-poster.parent-chain-wallet.password passphrase --http.addr 0.0.0.0 --ws.addr 0.0.0.0 --node.sequencer --execution.sequencer.enable --node.feed.output.enable --node.feed.output.port 9642", " ")
args := strings.Split("--persistent.chain /tmp/data --init.dev-init --node.parent-chain-reader.enable=false --parent-chain.id 5 --chain.id 421613 --node.batch-poster.parent-chain-wallet.pathname /l1keystore --node.batch-poster.parent-chain-wallet.password passphrase --http.addr 0.0.0.0 --ws.addr 0.0.0.0 --node.sequencer --execution.sequencer.enable --node.feed.output.enable --node.feed.output.port 9642 --node.transaction-streamer.track-block-metadata-from=10", " ")
args = append(args, []string{"--conf.file", configFile}...)
config, _, err := ParseNode(context.Background(), args)
Require(t, err)
Expand Down

0 comments on commit 067b687

Please sign in to comment.