Merge branch 'unstable' of https://github.com/sigp/lighthouse into deneb-free-blobs

This commit is contained in:
realbigsean
2023-06-02 11:57:15 -04:00
63 changed files with 1689 additions and 1193 deletions

View File

@@ -289,7 +289,23 @@ pub fn cli_app<'a, 'b>() -> App<'a, 'b> {
for a beacon node being referenced by validator client using the --proposer-node flag. This configuration is for enabling more secure setups.")
.takes_value(false),
)
.arg(
Arg::with_name("inbound-rate-limiter")
.long("inbound-rate-limiter")
.help(
"Configures the inbound rate limiter (requests received 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 inbound rate limiter is enabled and a protocol is not \
present in the configuration, the default quotas will be used. \
\
This is enabled by default, using default quotas. To disable rate limiting pass \
`disabled` to this option instead."
)
.takes_value(true)
.hidden(true)
)
.arg(
Arg::with_name("disable-backfill-rate-limiting")
.long("disable-backfill-rate-limiting")

View File

@@ -1269,6 +1269,7 @@ pub fn set_network_config(
// Light client server config.
config.enable_light_client_server = cli_args.is_present("light-client-server");
// The self limiter is disabled by default.
// 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")?;
@@ -1289,7 +1290,22 @@ pub fn set_network_config(
config.proposer_only = true;
warn!(log, "Proposer-only mode enabled"; "info"=> "Do not connect a validator client to this node unless via the --proposer-nodes flag");
}
// The inbound rate limiter is enabled by default unless `disabled` is passed to the
// `inbound-rate-limiter` flag. Any other value should be parsed as a configuration string.
config.inbound_rate_limiter_config = match cli_args.value_of("inbound-rate-limiter") {
None => {
// Enabled by default, with default values
Some(Default::default())
}
Some("disabled") => {
// Explicitly disabled
None
}
Some(config_str) => {
// Enabled with a custom configuration
Some(config_str.parse()?)
}
};
Ok(())
}