@@ -43,12 +43,11 @@ use validator_http_api::ApiSecret;
4343use validator_services:: {
4444 attestation_service:: { AttestationService , AttestationServiceBuilder } ,
4545 block_service:: { BlockService , BlockServiceBuilder } ,
46- duties_service:: { self , DutiesService } ,
46+ duties_service:: { self , DutiesService , DutiesServiceBuilder } ,
4747 preparation_service:: { PreparationService , PreparationServiceBuilder } ,
48- sync:: SyncDutiesMap ,
4948 sync_committee_service:: SyncCommitteeService ,
5049} ;
51- use validator_store:: ValidatorStore ;
50+ use validator_store:: ValidatorStore as ValidatorStoreTrait ;
5251
5352/// The interval between attempts to contact the beacon node during startup.
5453const RETRY_DELAY : Duration = Duration :: from_secs ( 2 ) ;
@@ -73,20 +72,18 @@ const HTTP_GET_VALIDATOR_BLOCK_TIMEOUT_QUOTIENT: u32 = 4;
7372
7473const DOPPELGANGER_SERVICE_NAME : & str = "doppelganger" ;
7574
75+ type ValidatorStore = LighthouseValidatorStore < SystemTimeSlotClock > ;
76+
7677#[ derive( Clone ) ]
7778pub struct ProductionValidatorClient < E : EthSpec > {
7879 context : RuntimeContext < E > ,
79- duties_service :
80- Arc < DutiesService < LighthouseValidatorStore < SystemTimeSlotClock > , SystemTimeSlotClock , E > > ,
81- block_service : BlockService < LighthouseValidatorStore < SystemTimeSlotClock > , SystemTimeSlotClock > ,
82- attestation_service :
83- AttestationService < LighthouseValidatorStore < SystemTimeSlotClock > , SystemTimeSlotClock , E > ,
84- sync_committee_service :
85- SyncCommitteeService < LighthouseValidatorStore < SystemTimeSlotClock > , SystemTimeSlotClock , E > ,
80+ duties_service : Arc < DutiesService < ValidatorStore , SystemTimeSlotClock , E > > ,
81+ block_service : BlockService < ValidatorStore , SystemTimeSlotClock > ,
82+ attestation_service : AttestationService < ValidatorStore , SystemTimeSlotClock , E > ,
83+ sync_committee_service : SyncCommitteeService < ValidatorStore , SystemTimeSlotClock , E > ,
8684 doppelganger_service : Option < Arc < DoppelgangerService > > ,
87- preparation_service :
88- PreparationService < LighthouseValidatorStore < SystemTimeSlotClock > , SystemTimeSlotClock > ,
89- validator_store : Arc < LighthouseValidatorStore < SystemTimeSlotClock > > ,
85+ preparation_service : PreparationService < ValidatorStore , SystemTimeSlotClock > ,
86+ validator_store : Arc < ValidatorStore > ,
9087 slot_clock : SystemTimeSlotClock ,
9188 http_api_listen_addr : Option < SocketAddr > ,
9289 config : Config ,
@@ -470,19 +467,17 @@ impl<E: EthSpec> ProductionValidatorClient<E> {
470467 validator_store. prune_slashing_protection_db ( slot. epoch ( E :: slots_per_epoch ( ) ) , true ) ;
471468 }
472469
473- let duties_service = Arc :: new ( DutiesService {
474- attesters : <_ >:: default ( ) ,
475- proposers : <_ >:: default ( ) ,
476- sync_duties : SyncDutiesMap :: new ( config. distributed ) ,
477- slot_clock : slot_clock. clone ( ) ,
478- beacon_nodes : beacon_nodes. clone ( ) ,
479- validator_store : validator_store. clone ( ) ,
480- unknown_validator_next_poll_slots : <_ >:: default ( ) ,
481- spec : context. eth2_config . spec . clone ( ) ,
482- executor : context. executor . clone ( ) ,
483- enable_high_validator_count_metrics : config. enable_high_validator_count_metrics ,
484- distributed : config. distributed ,
485- } ) ;
470+ let duties_service = Arc :: new (
471+ DutiesServiceBuilder :: new ( )
472+ . slot_clock ( slot_clock. clone ( ) )
473+ . beacon_nodes ( beacon_nodes. clone ( ) )
474+ . validator_store ( validator_store. clone ( ) )
475+ . spec ( context. eth2_config . spec . clone ( ) )
476+ . executor ( context. executor . clone ( ) )
477+ . enable_high_validator_count_metrics ( config. enable_high_validator_count_metrics )
478+ . distributed ( config. distributed )
479+ . build ( ) ?,
480+ ) ;
486481
487482 // Update the metrics server.
488483 if let Some ( ctx) = & validator_metrics_ctx {
0 commit comments