Skip to content

Commit

Permalink
feat: add validator count field to group summary
Browse files Browse the repository at this point in the history
See: BEDS-626
  • Loading branch information
LuccaBitfly committed Oct 31, 2024
1 parent 94b38af commit edb982b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
16 changes: 9 additions & 7 deletions backend/pkg/api/types/validator_dashboard.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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"`

Expand Down
6 changes: 4 additions & 2 deletions frontend/types/api/validator_dashboard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ export interface VDBSummaryTableRow {
export type GetValidatorDashboardSummaryResponse = ApiPagingResponse<VDBSummaryTableRow>;
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 */;
Expand All @@ -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<number /* float64 */>;
luck: Luck;
Expand Down

0 comments on commit edb982b

Please sign in to comment.