@@ -861,7 +861,7 @@ func (d *DataAccessService) GetValidatorDashboardSummaryChart(ctx context.Contex
861861 divisorColumn = "efficiency_sync_divisor"
862862 }
863863
864- chartDs := goqu .Dialect ( "postgres" ).
864+ chartDs := goqu .
865865 From (goqu .T (dataTable ).As ("d" )).
866866 Select (
867867 goqu .I (dateColumn ).As ("ts" ),
@@ -931,6 +931,10 @@ func (d *DataAccessService) GetValidatorDashboardSummaryChart(ctx context.Contex
931931 }
932932
933933 if ! dashboardId .AggregateGroups && requestedGroupsMap [row .GroupId ] {
934+ if row .EfficiencyDivisor .IsZero () {
935+ data [row.Timestamp ][row.GroupId ] = 0
936+ continue
937+ }
934938 data [row.Timestamp ][row.GroupId ] = row .EfficiencyDividend .Div (row .EfficiencyDivisor ).InexactFloat64 () * 100
935939 if data [row.Timestamp ][row.GroupId ] > 100 {
936940 log .Error (nil , "efficiency is greater than 100%" , 0 , map [string ]interface {}{"efficiency" : efficiency })
@@ -945,8 +949,8 @@ func (d *DataAccessService) GetValidatorDashboardSummaryChart(ctx context.Contex
945949 Timestamp : row .Timestamp ,
946950 }
947951 }
948- totalEfficiencyMap [row .Timestamp ].EfficiencyDividend .Add (row .EfficiencyDividend )
949- totalEfficiencyMap [row .Timestamp ].EfficiencyDivisor .Add (row .EfficiencyDivisor )
952+ totalEfficiencyMap [row .Timestamp ].EfficiencyDividend = totalEfficiencyMap [ row . Timestamp ]. EfficiencyDividend .Add (row .EfficiencyDividend )
953+ totalEfficiencyMap [row .Timestamp ].EfficiencyDivisor = totalEfficiencyMap [ row . Timestamp ]. EfficiencyDivisor .Add (row .EfficiencyDivisor )
950954 }
951955 }
952956
@@ -973,6 +977,10 @@ func (d *DataAccessService) GetValidatorDashboardSummaryChart(ctx context.Contex
973977 totalLineGroupId = t .DefaultGroupId
974978 }
975979 for _ , row := range totalEfficiencyMap {
980+ if row .EfficiencyDivisor .IsZero () {
981+ data [row.Timestamp ][totalLineGroupId ] = 0
982+ continue
983+ }
976984 data [row.Timestamp ][totalLineGroupId ] = row .EfficiencyDividend .Div (row .EfficiencyDivisor ).InexactFloat64 () * 100
977985 if data [row.Timestamp ][totalLineGroupId ] > 100 {
978986 log .Error (nil , "efficiency is greater than 100%" , 0 , map [string ]interface {}{"efficiency" : efficiency })
0 commit comments