@@ -93,7 +93,7 @@ func (d *DataAccessService) GetValidatorDashboardSummary(ctx context.Context, da
9393 }
9494 var averageNetworkEfficiency float64
9595 if efficiency .TotalEfficiency [period ].Valid {
96- averageNetworkEfficiency = efficiency .TotalEfficiency [period ].Float64 * 100
96+ averageNetworkEfficiency = efficiency .TotalEfficiency [period ].Float64
9797 }
9898
9999 // ------------------------------------------------------------------------------------------------------------------
@@ -738,7 +738,7 @@ func (d *DataAccessService) GetValidatorDashboardGroupSummary(ctx context.Contex
738738 }
739739
740740 if totalBlockChance > 0 {
741- ret .Luck .Proposal .Percent = (float64 (totalBlocksScheduled )) / totalBlockChance * 100
741+ ret .Luck .Proposal .Percent = (float64 (totalBlocksScheduled )) / totalBlockChance
742742
743743 // calculate the average time it takes for the set of validators to propose a single block on average
744744 ret .Luck .Proposal .AverageIntervalSeconds = uint64 (time .Duration ((luckHours / totalBlockChance ) * float64 (time .Hour )).Seconds ())
@@ -754,7 +754,7 @@ func (d *DataAccessService) GetValidatorDashboardGroupSummary(ctx context.Contex
754754 totalSyncSlotDuties := float64 (ret .SyncCommittee .StatusCount .Failed ) + float64 (ret .SyncCommittee .StatusCount .Success )
755755 slotDutiesPerSyncCommittee := float64 (utils .SlotsPerSyncCommittee ())
756756 syncCommittees := math .Ceil (totalSyncSlotDuties / slotDutiesPerSyncCommittee ) // gets the number of sync committees
757- ret .Luck .Sync .Percent = syncCommittees / totalSyncExpected * 100
757+ ret .Luck .Sync .Percent = syncCommittees / totalSyncExpected
758758
759759 // calculate the average time it takes for the set of validators to be elected into a sync committee on average
760760 ret .Luck .Sync .AverageIntervalSeconds = uint64 (time .Duration ((luckHours / totalSyncExpected ) * float64 (time .Hour )).Seconds ())
@@ -817,7 +817,7 @@ func calcEfficiency(dividend, divisor decimal.Decimal) float64 {
817817 if divisor .IsZero () {
818818 return 0
819819 }
820- return dividend .Div (divisor ).InexactFloat64 () * 100
820+ return dividend .Div (divisor ).InexactFloat64 ()
821821}
822822
823823// for summary charts: series id is group id, no stack
@@ -945,9 +945,9 @@ func (d *DataAccessService) GetValidatorDashboardSummaryChart(ctx context.Contex
945945 if data [row.Timestamp ][row.GroupId ] == 0 {
946946 continue
947947 }
948- if data [row.Timestamp ][row.GroupId ] > 100 {
948+ if data [row.Timestamp ][row.GroupId ] > 1 {
949949 log .Error (nil , "efficiency is greater than 100%" , 0 , map [string ]interface {}{"efficiency" : efficiency })
950- data [row.Timestamp ][row.GroupId ] = 100
950+ data [row.Timestamp ][row.GroupId ] = 1
951951 }
952952 groupMap [row .GroupId ] = true
953953 }
@@ -971,7 +971,7 @@ func (d *DataAccessService) GetValidatorDashboardSummaryChart(ctx context.Contex
971971 }
972972 var averageNetworkEfficiency float64
973973 if efficiency .AttestationEfficiency [enums .Last24h ].Valid {
974- averageNetworkEfficiency = efficiency .AttestationEfficiency [enums .Last24h ].Float64 * 100
974+ averageNetworkEfficiency = efficiency .AttestationEfficiency [enums .Last24h ].Float64
975975 }
976976
977977 for ts := range tsMap {
@@ -990,9 +990,9 @@ func (d *DataAccessService) GetValidatorDashboardSummaryChart(ctx context.Contex
990990 if data [row.Timestamp ][totalLineGroupId ] == 0 {
991991 continue
992992 }
993- if data [row.Timestamp ][totalLineGroupId ] > 100 {
993+ if data [row.Timestamp ][totalLineGroupId ] > 1 {
994994 log .Error (nil , "efficiency is greater than 100%" , 0 , map [string ]interface {}{"efficiency" : efficiency })
995- data [row.Timestamp ][totalLineGroupId ] = 100
995+ data [row.Timestamp ][totalLineGroupId ] = 1
996996 }
997997 }
998998 groupMap [totalLineGroupId ] = true
0 commit comments