Skip to content

Commit 3aaa4ea

Browse files
committed
fix(dash-exporter)!: dont write ideal if no att duty assigned
1 parent 1635a45 commit 3aaa4ea

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

backend/pkg/exporter/modules/dashboard_data_process.go

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -691,6 +691,13 @@ func (d *dashboardData) processAttestationRewards(data *MultiEpochData, tar *[]t
691691
d.log.Tracef("skipping reward for validator %d in epoch %d", ar.ValidatorIndex, epoch)
692692
continue
693693
}
694+
attData := validatorSlotMap[ar.ValidatorIndex]
695+
if attData == nil {
696+
// happens when the validator has been added to state but doesnt have a duty yet or has been slashed
697+
// fine to ignore
698+
d.log.Tracef("skipping reward for validator %d in epoch %d because it has no attestation duty", ar.ValidatorIndex, epoch)
699+
continue
700+
}
694701
valiIndextO := uint64(tO) + ar.ValidatorIndex
695702
// ideal rewards
696703
// we need to use the effective balance of epoch n+1 because the attestation processing for epoch n happens in the transition from n+1 => n+2
@@ -720,12 +727,6 @@ func (d *dashboardData) processAttestationRewards(data *MultiEpochData, tar *[]t
720727
total += r
721728
}
722729
// generate hyper localized max
723-
attData := validatorSlotMap[ar.ValidatorIndex]
724-
if attData == nil {
725-
// happens when the validator has been added to state but doesnt have a duty yet or has been slashed
726-
// fine to ignore
727-
continue
728-
}
729730
if hyperlocalizedMax[attData.Slot][attData.Committee] < total {
730731
hyperlocalizedMax[attData.Slot][attData.Committee] = total
731732
}

0 commit comments

Comments
 (0)