mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-09 19:51:47 +00:00
merge with upstream
This commit is contained in:
@@ -201,6 +201,21 @@ pub fn cli_app<'a, 'b>() -> App<'a, 'b> {
|
||||
.help("Lighthouse by default does not discover private IP addresses. Set this flag to enable connection attempts to local addresses.")
|
||||
.takes_value(false),
|
||||
)
|
||||
.arg(
|
||||
Arg::with_name("self-limiter")
|
||||
.long("self-limiter")
|
||||
.help(
|
||||
"Enables the outbound rate limiter (requests made by this node).\
|
||||
\
|
||||
Rate limit quotas per protocol can be set in the form of \
|
||||
<protocol_name>:<tokens>/<time_in_seconds>. To set quotas for multiple protocols, \
|
||||
separate them by ';'. If the self rate limiter is enabled and a protocol is not \
|
||||
present in the configuration, the quotas used for the inbound rate limiter will be \
|
||||
used."
|
||||
)
|
||||
.min_values(0)
|
||||
.hidden(true)
|
||||
)
|
||||
/* REST API related arguments */
|
||||
.arg(
|
||||
Arg::with_name("http")
|
||||
|
||||
@@ -1004,6 +1004,13 @@ pub fn set_network_config(
|
||||
// Light client server config.
|
||||
config.enable_light_client_server = cli_args.is_present("light-client-server");
|
||||
|
||||
// This flag can be used both with or without a value. Try to parse it first with a value, if
|
||||
// no value is defined but the flag is present, use the default params.
|
||||
config.outbound_rate_limiter_config = clap_utils::parse_optional(cli_args, "self-limiter")?;
|
||||
if cli_args.is_present("self-limiter") && config.outbound_rate_limiter_config.is_none() {
|
||||
config.outbound_rate_limiter_config = Some(Default::default());
|
||||
}
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user