mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-15 19:02:42 +00:00
Add CLI flags
This commit is contained in:
@@ -1131,4 +1131,36 @@ pub fn cli_app<'a, 'b>() -> App<'a, 'b> {
|
||||
.takes_value(true)
|
||||
.possible_values(ProgressiveBalancesMode::VARIANTS)
|
||||
)
|
||||
.arg(
|
||||
Arg::with_name("beacon-processor-max-workers")
|
||||
.long("beacon-processor-max-workers")
|
||||
.value_name("INTEGER")
|
||||
.help("Specifies the maximum concurrent tasks for the task scheduler. Increasing \
|
||||
this value may increase resource consumption. Reducing the value \
|
||||
may result in decreased resource usage and diminished performance. The \
|
||||
default value is the number of logical CPU cores on the host.")
|
||||
.takes_value(true)
|
||||
)
|
||||
.arg(
|
||||
Arg::with_name("beacon-processor-work-queue")
|
||||
.long("beacon-processor-work-queue")
|
||||
.value_name("INTEGER")
|
||||
.help("Specifies the length of the inbound event queue. Increasing this value \
|
||||
may prevent messages from being dropped at risk of overwhelming the \
|
||||
host resources. Decreasing this value may cause messages to be dropped but \
|
||||
may help resource-constrained hosts.")
|
||||
.default_value("16384")
|
||||
.takes_value(true)
|
||||
)
|
||||
.arg(
|
||||
Arg::with_name("beacon-processor-reprocess-queue")
|
||||
.long("beacon-processor-reprocess-queue")
|
||||
.value_name("INTEGER")
|
||||
.help("Specifies the length of the queue for messages requiring delayed processing. \
|
||||
Increasing this value may prevent messages from being dropped at risk of \
|
||||
overwhelming the host resources. Decreasing this value may cause messages \
|
||||
to be dropped but may help resource-constrained hosts.")
|
||||
.default_value("12288")
|
||||
.takes_value(true)
|
||||
)
|
||||
}
|
||||
|
||||
@@ -792,7 +792,7 @@ pub fn get_config<E: EthSpec>(
|
||||
}
|
||||
|
||||
// Backfill sync rate-limiting
|
||||
client_config.chain.enable_backfill_rate_limiting =
|
||||
client_config.beacon_processor.enable_backfill_rate_limiting =
|
||||
!cli_args.is_present("disable-backfill-rate-limiting");
|
||||
|
||||
if let Some(path) = clap_utils::parse_optional(cli_args, "invalid-gossip-verified-blocks-path")?
|
||||
@@ -806,6 +806,20 @@ pub fn get_config<E: EthSpec>(
|
||||
client_config.chain.progressive_balances_mode = progressive_balances_mode;
|
||||
}
|
||||
|
||||
if let Some(max_workers) = clap_utils::parse_optional(cli_args, "beacon-processor-max-workers")?
|
||||
{
|
||||
client_config.beacon_processor.max_workers = max_workers;
|
||||
}
|
||||
|
||||
if client_config.beacon_processor.max_workers == 0 {
|
||||
return Err("--beacon-processor-max-workers must be a non-zero value".to_string());
|
||||
}
|
||||
|
||||
client_config.beacon_processor.max_work_event_queue_len =
|
||||
clap_utils::parse_required(cli_args, "beacon-processor-work-queue")?;
|
||||
client_config.beacon_processor.max_scheduled_work_queue_len =
|
||||
clap_utils::parse_required(cli_args, "beacon-processor-reprocess-queue")?;
|
||||
|
||||
Ok(client_config)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user