Skip to content

Commit a4cac59

Browse files
authored
Merge pull request #2855 from gobitfly/NOBIDS/improve-validator-page
(NOBIDS) improve validator-page sync-committee-stats-gathering
2 parents 1e6a709 + af23caf commit a4cac59

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

handlers/validator.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -731,16 +731,15 @@ func Validator(w http.ResponseWriter, r *http.Request) {
731731
if len(actualSyncPeriods) > 0 {
732732
// get sync stats from validator_stats
733733
syncStats := types.SyncCommitteesStats{}
734-
// check if validator has been active in the last exported stats day
735-
if lastStatsDay > 0 && validatorPageData.ActivationEpoch <= lastStatsDay*utils.EpochsPerDay() {
734+
if lastStatsDay > 0 {
736735
err = db.ReaderDb.Get(&syncStats, `
737736
SELECT
738737
COALESCE(participated_sync_total, 0) AS participated_sync,
739738
COALESCE(missed_sync_total, 0) AS missed_sync,
740739
COALESCE(orphaned_sync_total, 0) AS orphaned_sync
741740
FROM validator_stats
742741
WHERE validatorindex = $1 AND day = $2`, index, lastStatsDay)
743-
if err != nil {
742+
if err != nil && err != sql.ErrNoRows {
744743
return fmt.Errorf("error getting validator syncStats: %w", err)
745744
}
746745
}

0 commit comments

Comments
 (0)