Add --long-timeouts-multiplier CLI flag (#7047)

Adds the `--long-timeouts-multiplier` flag.
Allows granular control for VC timeouts which has proved useful in Holesky.
This commit is contained in:
Mac L
2025-03-05 05:52:57 +04:00
committed by GitHub
parent 80cd8bd911
commit 29a295a134
5 changed files with 42 additions and 1 deletions

View File

@@ -116,6 +116,20 @@ pub struct ValidatorClient {
)]
pub use_long_timeouts: bool,
#[clap(
long,
requires = "use_long_timeouts",
default_value_t = 1,
help = "If present, the validator client will use a multiplier for the timeout \
when making requests to the beacon node. This only takes effect when \
the `--use-long-timeouts` flag is present. The timeouts will be the slot \
duration multiplied by this value. This flag is generally not recommended, \
longer timeouts can cause missed duties when fallbacks are used.",
display_order = 0,
help_heading = FLAG_HEADER,
)]
pub long_timeouts_multiplier: u32,
#[clap(
long,
value_name = "CERTIFICATE-FILES",

View File

@@ -49,6 +49,8 @@ pub struct Config {
pub init_slashing_protection: bool,
/// If true, use longer timeouts for requests made to the beacon node.
pub use_long_timeouts: bool,
/// Multiplier to use for long timeouts.
pub long_timeouts_multiplier: u32,
/// Graffiti to be inserted everytime we create a block.
pub graffiti: Option<Graffiti>,
/// Graffiti file to load per validator graffitis.
@@ -112,6 +114,7 @@ impl Default for Config {
disable_auto_discover: false,
init_slashing_protection: false,
use_long_timeouts: false,
long_timeouts_multiplier: 1,
graffiti: None,
graffiti_file: None,
http_api: <_>::default(),
@@ -196,6 +199,7 @@ impl Config {
config.disable_auto_discover = validator_client_config.disable_auto_discover;
config.init_slashing_protection = validator_client_config.init_slashing_protection;
config.use_long_timeouts = validator_client_config.use_long_timeouts;
config.long_timeouts_multiplier = validator_client_config.long_timeouts_multiplier;
if let Some(graffiti_file_path) = validator_client_config.graffiti_file.as_ref() {
let mut graffiti_file = GraffitiFile::new(graffiti_file_path.into());

View File

@@ -325,7 +325,7 @@ impl<E: EthSpec> ProductionValidatorClient<E> {
get_validator_block: slot_duration / HTTP_GET_VALIDATOR_BLOCK_TIMEOUT_QUOTIENT,
}
} else {
Timeouts::set_all(slot_duration)
Timeouts::set_all(slot_duration.saturating_mul(config.long_timeouts_multiplier))
};
Ok(BeaconNodeHttpClient::from_components(