@@ -581,14 +581,18 @@ func (d *DataAccessService) GetValidatorDashboardGroupSummary(ctx context.Contex
581581 goqu .L ("attestations_head_executed" ),
582582 goqu .L ("attestations_source_executed" ),
583583 goqu .L ("attestations_target_executed" ),
584+ goqu .L ("attestations_reward_rewards_only" ),
584585 goqu .L ("blocks_scheduled" ),
585586 goqu .L ("blocks_proposed" ),
587+ goqu .L ("blocks_cl_missed_median_reward" ),
586588 goqu .L ("sync_scheduled" ),
587589 goqu .L ("sync_executed" ),
588590 goqu .L ("slashed AS slashed_in_period" ),
589591 goqu .L ("blocks_slashing_count AS slashed_amount" ),
590592 goqu .L ("blocks_expected" ),
591593 goqu .L ("inclusion_delay_sum" ),
594+ goqu .L ("sync_localized_max_reward" ),
595+ goqu .L ("sync_reward_rewards_only" ),
592596 goqu .L ("sync_committees_expected" )).
593597 From (goqu .L (fmt .Sprintf (`%s AS r FINAL` , clickhouseTable )))
594598
@@ -603,16 +607,17 @@ func (d *DataAccessService) GetValidatorDashboardGroupSummary(ctx context.Contex
603607 }
604608
605609 type QueryResult struct {
606- ValidatorIndex uint32 `db:"validator_index"`
607- EpochStart uint64 `db:"epoch_start"`
608- AttestationReward int64 `db:"attestations_reward"`
609- AttestationIdealReward int64 `db:"attestations_ideal_reward"`
610-
611- AttestationsScheduled int64 `db:"attestations_scheduled"`
612- AttestationsObserved int64 `db:"attestations_observed"`
613- AttestationsHeadExecuted int64 `db:"attestations_head_executed"`
614- AttestationsSourceExecuted int64 `db:"attestations_source_executed"`
615- AttestationsTargetExecuted int64 `db:"attestations_target_executed"`
610+ ValidatorIndex uint32 `db:"validator_index"`
611+ EpochStart uint64 `db:"epoch_start"`
612+ AttestationReward int64 `db:"attestations_reward"`
613+ AttestationsIdealReward int64 `db:"attestations_ideal_reward"`
614+
615+ AttestationsScheduled int64 `db:"attestations_scheduled"`
616+ AttestationsObserved int64 `db:"attestations_observed"`
617+ AttestationsHeadExecuted int64 `db:"attestations_head_executed"`
618+ AttestationsSourceExecuted int64 `db:"attestations_source_executed"`
619+ AttestationsTargetExecuted int64 `db:"attestations_target_executed"`
620+ AttestationsRewardRewardsOnly int64 `db:"attestations_reward_rewards_only"`
616621
617622 BlocksScheduled uint32 `db:"blocks_scheduled"`
618623 BlocksProposed uint32 `db:"blocks_proposed"`
@@ -626,6 +631,10 @@ func (d *DataAccessService) GetValidatorDashboardGroupSummary(ctx context.Contex
626631 BlockChance float64 `db:"blocks_expected"`
627632 SyncCommitteesExpected float64 `db:"sync_committees_expected"`
628633
634+ BlocksCLMissedReward int64 `db:"blocks_cl_missed_median_reward"`
635+ SyncLocalizedMaxRewards int64 `db:"sync_localized_max_reward"`
636+ SyncRewardRewardsOnly int64 `db:"sync_reward_rewards_only"`
637+
629638 InclusionDelaySum int64 `db:"inclusion_delay_sum"`
630639 }
631640
@@ -670,11 +679,15 @@ func (d *DataAccessService) GetValidatorDashboardGroupSummary(ctx context.Contex
670679 totalSyncExpected := float64 (0 )
671680 totalProposals := uint32 (0 )
672681
682+ totalMissedRewardsCl := int64 (0 )
683+ totalMissedRewardsAttestations := int64 (0 )
684+ totalMissedRewardsSync := int64 (0 )
685+
673686 validatorArr := make ([]t.VDBValidator , 0 )
674687 for _ , row := range rows {
675688 validatorArr = append (validatorArr , t .VDBValidator (row .ValidatorIndex ))
676689 totalAttestationRewards += row .AttestationReward
677- totalIdealAttestationRewards += row .AttestationIdealReward
690+ totalIdealAttestationRewards += row .AttestationsIdealReward
678691
679692 ret .AttestationsHead .Success += uint64 (row .AttestationsHeadExecuted )
680693 ret .AttestationsHead .Failed += uint64 (row .AttestationsScheduled ) - uint64 (row .AttestationsHeadExecuted )
@@ -685,6 +698,10 @@ func (d *DataAccessService) GetValidatorDashboardGroupSummary(ctx context.Contex
685698 ret .AttestationsTarget .Success += uint64 (row .AttestationsTargetExecuted )
686699 ret .AttestationsTarget .Failed += uint64 (row .AttestationsScheduled ) - uint64 (row .AttestationsTargetExecuted )
687700
701+ totalMissedRewardsCl += row .BlocksCLMissedReward
702+ totalMissedRewardsAttestations += row .AttestationsIdealReward - row .AttestationsRewardRewardsOnly
703+ totalMissedRewardsSync += row .SyncLocalizedMaxRewards - row .SyncRewardRewardsOnly
704+
688705 if row .ValidatorIndex == 0 && row .BlocksProposed > 0 && row .BlocksProposed != row .BlocksScheduled {
689706 row .BlocksProposed -- // subtract the genesis block from validator 0 (TODO: remove when fixed in the dashoard data exporter)
690707 }
@@ -732,6 +749,10 @@ func (d *DataAccessService) GetValidatorDashboardGroupSummary(ctx context.Contex
732749 }
733750 }
734751
752+ ret .MissedRewards .Attestations = utils .GWeiToWei (big .NewInt (totalMissedRewardsAttestations ))
753+ ret .MissedRewards .Sync = utils .GWeiToWei (big .NewInt (totalMissedRewardsSync ))
754+ ret .MissedRewards .ProposerRewards .Cl = utils .GWeiToWei (big .NewInt (totalMissedRewardsCl ))
755+
735756 _ , ret .Apr .El , _ , ret .Apr .Cl , err = d .internal_getElClAPR (ctx , dashboardId , groupId , hours )
736757 if err != nil {
737758 return nil , err
0 commit comments