Validator monitor support for sync committees (#2476)

## Issue Addressed

N/A

## Proposed Changes

Add functionality in the validator monitor to provide sync committee related metrics for monitored validators.


Co-authored-by: Michael Sproul <michael@sigmaprime.io>
This commit is contained in:
Pawan Dhananjay
2021-08-31 23:31:36 +00:00
parent 44fa54004c
commit 5a3bcd2904
14 changed files with 564 additions and 71 deletions

View File

@@ -22,7 +22,7 @@ pub mod sync_committee_updates;
pub fn process_epoch<T: EthSpec>(
state: &mut BeaconState<T>,
spec: &ChainSpec,
) -> Result<EpochProcessingSummary, Error> {
) -> Result<EpochProcessingSummary<T>, Error> {
// Ensure the committee caches are built.
state.build_committee_cache(RelativeEpoch::Previous, spec)?;
state.build_committee_cache(RelativeEpoch::Current, spec)?;
@@ -30,6 +30,7 @@ pub fn process_epoch<T: EthSpec>(
// Pre-compute participating indices and total balances.
let participation_cache = ParticipationCache::new(state, spec)?;
let sync_committee = state.current_sync_committee()?.clone();
// Justification and finalization.
process_justification_and_finalization(state, &participation_cache)?;
@@ -75,5 +76,6 @@ pub fn process_epoch<T: EthSpec>(
Ok(EpochProcessingSummary::Altair {
participation_cache,
sync_committee,
})
}