Skip to content

Commit

Permalink
add flag for firehose --node.firehose (bool)
Browse files Browse the repository at this point in the history
  • Loading branch information
sduchesneau committed Aug 7, 2023
1 parent bc29985 commit f48e183
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
7 changes: 5 additions & 2 deletions arbnode/execution/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,17 @@ func CreateExecutionNode(
recordingDbConfig *arbitrum.RecordingDatabaseConfig,
seqConfigFetcher SequencerConfigFetcher,
precheckConfigFetcher TxPreCheckerConfigFetcher,
withFirehose bool,
) (*ExecutionNode, error) {
execEngine, err := NewExecutionEngine(l2BlockChain)
if err != nil {
return nil, err
}

fh := tracers.NewFirehoseLogger()
execEngine.SetLogger(fh)
if withFirehose {
fh := tracers.NewFirehoseLogger()
execEngine.SetLogger(fh)
}

recorder := NewBlockRecorder(recordingDbConfig, execEngine, chainDB)
var txPublisher TransactionPublisher
Expand Down
5 changes: 4 additions & 1 deletion arbnode/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,7 @@ type Config struct {
SyncMonitor SyncMonitorConfig `koanf:"sync-monitor"`
Dangerous DangerousConfig `koanf:"dangerous"`
Caching execution.CachingConfig `koanf:"caching"`
Firehose bool `koanf:"firehose"`
Archive bool `koanf:"archive"`
TxLookupLimit uint64 `koanf:"tx-lookup-limit"`
TransactionStreamer TransactionStreamerConfig `koanf:"transaction-streamer" reload:"hot"`
Expand Down Expand Up @@ -409,6 +410,7 @@ func ConfigAddOptions(prefix string, f *flag.FlagSet, feedInputEnable bool, feed

archiveMsg := fmt.Sprintf("retain past block state (deprecated, please use %v.caching.archive)", prefix)
f.Bool(prefix+".archive", ConfigDefault.Archive, archiveMsg)
f.Bool(prefix+".firehose", ConfigDefault.Firehose, "output firehose blocks on STDOUT")
}

var ConfigDefault = Config{
Expand All @@ -430,6 +432,7 @@ var ConfigDefault = Config{
SyncMonitor: DefaultSyncMonitorConfig,
Dangerous: DefaultDangerousConfig,
Archive: false,
Firehose: false,
TxLookupLimit: 126_230_400, // 1 year at 4 blocks per second
Caching: execution.DefaultCachingConfig,
TransactionStreamer: DefaultTransactionStreamerConfig,
Expand Down Expand Up @@ -612,7 +615,7 @@ func createNodeImpl(
txprecheckConfigFetcher := func() *execution.TxPreCheckerConfig { return &configFetcher.Get().TxPreChecker }
exec, err := execution.CreateExecutionNode(stack, chainDb, l2BlockChain, l1Reader, syncMonitor,
config.ForwardingTarget(), &config.Forwarder, config.RPC, &config.RecordingDB,
sequencerConfigFetcher, txprecheckConfigFetcher)
sequencerConfigFetcher, txprecheckConfigFetcher, config.Firehose)
if err != nil {
return nil, err
}
Expand Down

0 comments on commit f48e183

Please sign in to comment.