Fix sync committee polling for 0 validators (#2999)

## Issue Addressed

#2953

## Proposed Changes

Adds empty local validator check. 

## Additional Info

Two other options: 
- add check inside `local_index` collection. Instead of after collection.
- Move `local_index` collection to the beginning of the `poll_sync_committee_duties` function and combine sync committee with altair fork check.
This commit is contained in:
tim gretler 2022-02-18 02:36:44 +00:00
parent 3ebb8b0244
commit c8019caba6

View File

@ -399,6 +399,16 @@ pub async fn poll_sync_committee_duties_for_period<T: SlotClock + 'static, E: Et
let spec = &duties_service.spec;
let log = duties_service.context.log();
// no local validators don't need to poll for sync committee
if local_indices.is_empty() {
debug!(
duties_service.context.log(),
"No validators, not polling for sync comittee";
"sync_committee_period" => sync_committee_period,
);
return Ok(());
}
debug!(
log,
"Fetching sync committee duties";