mirror of
https://github.com/sigp/lighthouse.git
synced 2026-04-19 13:58:28 +00:00
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:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user