Add --disable-attesting flag to validator client (#7046)

Cleaned up and isolated version of the `--disable-attesting` flag for the VC, from the `holesky-rescue` branch:

- https://github.com/sigp/lighthouse/pull/7041

I figured we don't need the `--disable-attesting` flag on the BN for now, and it was a much more invasive impl.
This commit is contained in:
Michael Sproul
2025-02-27 00:07:16 +11:00
committed by GitHub
parent fe0cf9cb67
commit 80cd8bd911
7 changed files with 43 additions and 0 deletions

View File

@@ -97,6 +97,15 @@ pub struct ValidatorClient {
)]
pub disable_auto_discover: bool,
#[clap(
long,
help = "Disable the performance of attestation duties (and sync committee duties). This \
flag should only be used in emergencies to prioritise block proposal duties.",
display_order = 0,
help_heading = FLAG_HEADER
)]
pub disable_attesting: bool,
#[clap(
long,
help = "If present, the validator client will use longer timeouts for requests \

View File

@@ -85,6 +85,7 @@ pub struct Config {
/// Configuration for the initialized validators
#[serde(flatten)]
pub initialized_validators: InitializedValidatorsConfig,
pub disable_attesting: bool,
}
impl Default for Config {
@@ -126,6 +127,7 @@ impl Default for Config {
validator_registration_batch_size: 500,
distributed: false,
initialized_validators: <_>::default(),
disable_attesting: false,
}
}
}
@@ -379,6 +381,8 @@ impl Config {
true
};
config.disable_attesting = validator_client_config.disable_attesting;
Ok(config)
}
}

View File

@@ -478,6 +478,7 @@ impl<E: EthSpec> ProductionValidatorClient<E> {
context: duties_context,
enable_high_validator_count_metrics: config.enable_high_validator_count_metrics,
distributed: config.distributed,
disable_attesting: config.disable_attesting,
});
// Update the metrics server.
@@ -507,6 +508,7 @@ impl<E: EthSpec> ProductionValidatorClient<E> {
.validator_store(validator_store.clone())
.beacon_nodes(beacon_nodes.clone())
.runtime_context(context.service_context("attestation".into()))
.disable(config.disable_attesting)
.build()?;
let preparation_service = PreparationServiceBuilder::new()