diff --git a/validator_client/src/lib.rs b/validator_client/src/lib.rs index ec7a084f55..5dccda20f0 100644 --- a/validator_client/src/lib.rs +++ b/validator_client/src/lib.rs @@ -60,13 +60,13 @@ const WAITING_FOR_GENESIS_POLL_TIME: Duration = Duration::from_secs(12); const HTTP_ATTESTATION_TIMEOUT_QUOTIENT: u32 = 4; const HTTP_ATTESTER_DUTIES_TIMEOUT_QUOTIENT: u32 = 4; const HTTP_ATTESTATION_SUBSCRIPTIONS_TIMEOUT_QUOTIENT: u32 = 24; -const HTTP_ATTESTATION_AGGREGATOR_TIMEOUT_QUOTIENT: u32 = 24; // For distributed mode only +const HTTP_ATTESTATION_AGGREGATOR_TIMEOUT_QUOTIENT: u32 = 24; // For DVT involving middleware only const HTTP_LIVENESS_TIMEOUT_QUOTIENT: u32 = 4; const HTTP_PROPOSAL_TIMEOUT_QUOTIENT: u32 = 2; const HTTP_PROPOSER_DUTIES_TIMEOUT_QUOTIENT: u32 = 4; const HTTP_SYNC_COMMITTEE_CONTRIBUTION_TIMEOUT_QUOTIENT: u32 = 4; const HTTP_SYNC_DUTIES_TIMEOUT_QUOTIENT: u32 = 4; -const HTTP_SYNC_AGGREGATOR_TIMEOUT_QUOTIENT: u32 = 24; // For distributed mode only +const HTTP_SYNC_AGGREGATOR_TIMEOUT_QUOTIENT: u32 = 24; // For DVT involving middleware only const HTTP_GET_BEACON_BLOCK_SSZ_TIMEOUT_QUOTIENT: u32 = 4; const HTTP_GET_DEBUG_BEACON_STATE_QUOTIENT: u32 = 4; const HTTP_GET_DEPOSIT_SNAPSHOT_QUOTIENT: u32 = 4; @@ -83,12 +83,12 @@ const SELECTION_PROOF_SLOT_LOOKAHEAD: u64 = 8; /// The attestation selection proof lookahead for those running with the --distributed flag. const SELECTION_PROOF_SLOT_LOOKAHEAD_DVT: u64 = 1; -/// Fraction of a slot at which selection proof signing should happen (2 means half way). +/// Fraction of a slot at which attestation selection proof signing should happen (2 means half way). const SELECTION_PROOF_SCHEDULE_DENOM: u32 = 2; -/// Number of epochs in advance to compute selection proofs when not in `distributed` mode. +/// Number of epochs in advance to compute sync selection proofs when not in `distributed` mode. pub const AGGREGATION_PRE_COMPUTE_EPOCHS: u64 = 2; -/// Number of slots in advance to compute selection proofs when in `distributed` mode. +/// Number of slots in advance to compute sync selection proofs when in `distributed` mode. pub const AGGREGATION_PRE_COMPUTE_SLOTS_DISTRIBUTED: u64 = 1; type ValidatorStore = LighthouseValidatorStore; @@ -499,9 +499,7 @@ impl ProductionValidatorClient { } }; - let duties_service: Arc< - DutiesService, SystemTimeSlotClock>, - > = Arc::new( + let duties_service = Arc::new( DutiesServiceBuilder::new() .slot_clock(slot_clock.clone()) .beacon_nodes(beacon_nodes.clone()) diff --git a/validator_client/validator_services/src/duties_service.rs b/validator_client/validator_services/src/duties_service.rs index cff3426cb7..34607eaa13 100644 --- a/validator_client/validator_services/src/duties_service.rs +++ b/validator_client/validator_services/src/duties_service.rs @@ -118,11 +118,12 @@ pub struct SubscriptionSlots { pub struct SelectionProofConfig { pub lookahead_slot: u64, pub computation_offset: Duration, // The seconds to compute the selection proof before a slot - pub selections_endpoint: bool, - pub parallel_sign: bool, + pub selections_endpoint: bool, // whether to call the selections endpoint, true for DVT with middleware + pub parallel_sign: bool, // whether to sign the selection proof in parallel, true in distributed mode } impl SelectionProofConfig { + // Create a default associated function to be passed in DutiesServiceBuilder::new() fn default() -> Self { Self { lookahead_slot: 0, @@ -136,7 +137,7 @@ impl SelectionProofConfig { /// Create a selection proof for `duty`. /// /// Return `Ok(None)` if the attesting validator is not an aggregator. -async fn make_selection_proof( +async fn make_selection_proof( duty: &AttesterData, validator_store: &S, spec: &ChainSpec, @@ -147,7 +148,7 @@ async fn make_selection_proof { spec: Option>, //// Whether we permit large validator counts in the metrics. enable_high_validator_count_metrics: bool, - /// If this validator is running in distributed mode. + /// Create attestation selection proof config attestation_selection_proof_config: SelectionProofConfig, + /// Create sync selection proof config sync_selection_proof_config: SelectionProofConfig, disable_attesting: bool, } diff --git a/validator_client/validator_services/src/sync.rs b/validator_client/validator_services/src/sync.rs index d2a1aabc5b..cdda9a6690 100644 --- a/validator_client/validator_services/src/sync.rs +++ b/validator_client/validator_services/src/sync.rs @@ -487,7 +487,7 @@ pub async fn poll_sync_committee_duties_for_period( +pub async fn make_sync_selection_proof( duties_service: &Arc>, duty: &SyncDuty, proof_slot: Slot, @@ -519,7 +519,7 @@ pub async fn make_sync_selection_proof