Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add distributed flag to VC to enable support for DVT #4867

Merged
merged 10 commits into from
Feb 15, 2024
6 changes: 6 additions & 0 deletions validator_client/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,12 @@ pub fn cli_app<'a, 'b>() -> App<'a, 'b> {
.value_name("FEE-RECIPIENT")
.takes_value(true)
)
.arg(
Arg::with_name("distributed")
.long("distributed")
.help("Enables functionality required for running the validator in a distributed network.")
.takes_value(false)
)
/* REST API related arguments */
.arg(
Arg::with_name("http")
Expand Down
7 changes: 7 additions & 0 deletions validator_client/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,8 @@ pub struct Config {
pub enable_latency_measurement_service: bool,
/// Defines the number of validators per `validator/register_validator` request sent to the BN.
pub validator_registration_batch_size: usize,
/// Whether we are running with distributed network support.
pub distributed: bool,
}

impl Default for Config {
Expand Down Expand Up @@ -120,6 +122,7 @@ impl Default for Config {
disable_run_on_all: false,
enable_latency_measurement_service: true,
validator_registration_batch_size: 500,
distributed: false,
}
}
}
Expand Down Expand Up @@ -258,6 +261,10 @@ impl Config {
config.beacon_nodes_tls_certs = Some(tls_certs.split(',').map(PathBuf::from).collect());
}

if cli_args.is_present("distributed") {
config.distributed = true;
}

/*
* Http API server
*/
Expand Down
7 changes: 6 additions & 1 deletion validator_client/src/duties_service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -218,9 +218,14 @@ pub struct DutiesService<T, E: EthSpec> {
pub slot_clock: T,
/// Provides HTTP access to remote beacon nodes.
pub beacon_nodes: Arc<BeaconNodeFallback<T, E>>,
pub enable_high_validator_count_metrics: bool,
/// The runtime for spawning tasks.
pub context: RuntimeContext<E>,
/// The current chain spec.
pub spec: ChainSpec,
//// Whether we permit large validator counts in the metrics.
pub enable_high_validator_count_metrics: bool,
/// If this validator is running in distributed mode.
pub distributed: bool,
}

impl<T: SlotClock + 'static, E: EthSpec> DutiesService<T, E> {
Expand Down
2 changes: 2 additions & 0 deletions validator_client/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -457,6 +457,8 @@ impl<T: EthSpec> ProductionValidatorClient<T> {
spec: context.eth2_config.spec.clone(),
context: duties_context,
enable_high_validator_count_metrics: config.enable_high_validator_count_metrics,
distributed: config.distributed,

});

// Update the metrics server.
Expand Down