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

@@ -251,6 +251,7 @@ impl From<ContributionError> for Error {
#[derivative(Clone(bound = "T: BeaconChainTypes"))]
pub struct VerifiedSyncContribution<T: BeaconChainTypes> {
signed_aggregate: SignedContributionAndProof<T::EthSpec>,
participant_pubkeys: Vec<PublicKeyBytes>,
}
/// Wraps a `SyncCommitteeMessage` that has been verified for propagation on the gossip network.
@@ -385,7 +386,10 @@ impl<T: BeaconChainTypes> VerifiedSyncContribution<T> {
slot: contribution.slot,
});
}
Ok(VerifiedSyncContribution { signed_aggregate })
Ok(VerifiedSyncContribution {
signed_aggregate,
participant_pubkeys,
})
}
/// A helper function to add this aggregate to `beacon_chain.op_pool`.
@@ -402,6 +406,11 @@ impl<T: BeaconChainTypes> VerifiedSyncContribution<T> {
pub fn aggregate(&self) -> &SignedContributionAndProof<T::EthSpec> {
&self.signed_aggregate
}
/// Returns the pubkeys of all validators that are included in the aggregate.
pub fn participant_pubkeys(&self) -> &[PublicKeyBytes] {
&self.participant_pubkeys
}
}
impl VerifiedSyncCommitteeMessage {