mirror of
https://github.com/sigp/lighthouse.git
synced 2026-04-30 19:23:50 +00:00
Add payload attestation validator duty (#9178)
Co-Authored-By: Eitan Seri-Levi <eserilev@ucsc.edu> Co-Authored-By: Jimmy Chen <jchen.tc@gmail.com>
This commit is contained in:
@@ -45,6 +45,7 @@ use validator_services::{
|
||||
block_service::{BlockService, BlockServiceBuilder},
|
||||
duties_service::{self, DutiesService, DutiesServiceBuilder},
|
||||
latency_service,
|
||||
payload_attestation_service::PayloadAttestationService,
|
||||
preparation_service::{PreparationService, PreparationServiceBuilder},
|
||||
sync_committee_service::SyncCommitteeService,
|
||||
};
|
||||
@@ -83,6 +84,7 @@ pub struct ProductionValidatorClient<E: EthSpec> {
|
||||
block_service: BlockService<ValidatorStore<E>, SystemTimeSlotClock>,
|
||||
attestation_service: AttestationService<ValidatorStore<E>, SystemTimeSlotClock>,
|
||||
sync_committee_service: SyncCommitteeService<ValidatorStore<E>, SystemTimeSlotClock>,
|
||||
payload_attestation_service: PayloadAttestationService<ValidatorStore<E>, SystemTimeSlotClock>,
|
||||
doppelganger_service: Option<Arc<DoppelgangerService>>,
|
||||
preparation_service: PreparationService<ValidatorStore<E>, SystemTimeSlotClock>,
|
||||
validator_store: Arc<ValidatorStore<E>>,
|
||||
@@ -552,12 +554,22 @@ impl<E: EthSpec> ProductionValidatorClient<E> {
|
||||
context.executor.clone(),
|
||||
);
|
||||
|
||||
let payload_attestation_service = PayloadAttestationService::new(
|
||||
duties_service.clone(),
|
||||
validator_store.clone(),
|
||||
slot_clock.clone(),
|
||||
beacon_nodes.clone(),
|
||||
context.executor.clone(),
|
||||
context.eth2_config.spec.clone(),
|
||||
);
|
||||
|
||||
Ok(Self {
|
||||
context,
|
||||
duties_service,
|
||||
block_service,
|
||||
attestation_service,
|
||||
sync_committee_service,
|
||||
payload_attestation_service,
|
||||
doppelganger_service,
|
||||
preparation_service,
|
||||
validator_store,
|
||||
@@ -629,6 +641,13 @@ impl<E: EthSpec> ProductionValidatorClient<E> {
|
||||
.start_update_service(&self.context.eth2_config.spec)
|
||||
.map_err(|e| format!("Unable to start sync committee service: {}", e))?;
|
||||
|
||||
if self.context.eth2_config.spec.is_gloas_scheduled() {
|
||||
self.payload_attestation_service
|
||||
.clone()
|
||||
.start_update_service()
|
||||
.map_err(|e| format!("Unable to start payload attestation service: {}", e))?;
|
||||
}
|
||||
|
||||
self.preparation_service
|
||||
.clone()
|
||||
.start_update_service(&self.context.eth2_config.spec)
|
||||
|
||||
Reference in New Issue
Block a user