From edb982b72a97a77a33d543309efe5ea6936d7f71 Mon Sep 17 00:00:00 2001 From: Lucca Dukic <109136188+LuccaBitfly@users.noreply.github.com> Date: Thu, 31 Oct 2024 09:49:39 +0100 Subject: [PATCH] feat: add validator count field to group summary See: BEDS-626 --- backend/pkg/api/types/validator_dashboard.go | 16 +++++++++------- frontend/types/api/validator_dashboard.ts | 6 ++++-- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/backend/pkg/api/types/validator_dashboard.go b/backend/pkg/api/types/validator_dashboard.go index d8de98b71..0b74eb8fd 100644 --- a/backend/pkg/api/types/validator_dashboard.go +++ b/backend/pkg/api/types/validator_dashboard.go @@ -65,8 +65,9 @@ type VDBSummaryTableRow struct { type GetValidatorDashboardSummaryResponse ApiPagingResponse[VDBSummaryTableRow] type VDBGroupSummaryColumnItem struct { - StatusCount StatusCount `json:"status_count"` - Validators []uint64 `json:"validators,omitempty"` + StatusCount StatusCount `json:"status_count"` + Validators []uint64 `json:"validators,omitempty"` // fill with up to 3 validator indexes + ValidatorCount uint64 `json:"validator_count"` // number of distinct validators } type VDBGroupSummarySyncCount struct { @@ -87,11 +88,12 @@ type VDBGroupSummaryData struct { AttestationEfficiency float64 `json:"attestation_efficiency"` AttestationAvgInclDist float64 `json:"attestation_avg_incl_dist"` - SyncCommittee VDBGroupSummaryColumnItem `json:"sync"` - SyncCommitteeCount VDBGroupSummarySyncCount `json:"sync_count"` - Slashings VDBGroupSummaryColumnItem `json:"slashings"` // Failed slashings are count of validators in the group that were slashed - ProposalValidators []uint64 `json:"proposal_validators"` - MissedRewards VDBGroupSummaryMissedRewards `json:"missed_rewards"` + SyncCommittee VDBGroupSummaryColumnItem `json:"sync"` + SyncCommitteeCount VDBGroupSummarySyncCount `json:"sync_count"` + Slashings VDBGroupSummaryColumnItem `json:"slashings"` // Failed slashings are count of validators in the group that were slashed + ProposalValidators []uint64 `json:"proposal_validators"` // fill with up to 3 validator indexes + ProposalValidatorCount uint64 `json:"proposal_validator_count"` // number of distinct validators + MissedRewards VDBGroupSummaryMissedRewards `json:"missed_rewards"` Apr ClElValue[float64] `json:"apr"` diff --git a/frontend/types/api/validator_dashboard.ts b/frontend/types/api/validator_dashboard.ts index 43eed6497..c426f0aea 100644 --- a/frontend/types/api/validator_dashboard.ts +++ b/frontend/types/api/validator_dashboard.ts @@ -54,7 +54,8 @@ export interface VDBSummaryTableRow { export type GetValidatorDashboardSummaryResponse = ApiPagingResponse; export interface VDBGroupSummaryColumnItem { status_count: StatusCount; - validators?: number /* uint64 */[]; + validators?: number /* uint64 */[]; // fill with up to 3 validator indexes + validator_count: number /* uint64 */; // number of distinct validators } export interface VDBGroupSummarySyncCount { current_validators: number /* uint64 */; @@ -75,7 +76,8 @@ export interface VDBGroupSummaryData { sync: VDBGroupSummaryColumnItem; sync_count: VDBGroupSummarySyncCount; slashings: VDBGroupSummaryColumnItem; // Failed slashings are count of validators in the group that were slashed - proposal_validators: number /* uint64 */[]; + proposal_validators: number /* uint64 */[]; // fill with up to 3 validator indexes + proposal_validator_count: number /* uint64 */; // number of distinct validators missed_rewards: VDBGroupSummaryMissedRewards; apr: ClElValue; luck: Luck;