Skip to content

Commit b2ab358

Browse files
authored
fix: filter offline validators by missed_count > 0 at API level (#313)
Add missed_count_gt filter to attestation liveness API query to only fetch validators with missed attestations. Removes redundant client-side filtering since the API now handles it.
1 parent 9cb9c1a commit b2ab358

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/pages/ethereum/epochs/hooks/useEpochDetailData.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@ export function useEpochDetailData(epoch: number, isLive = false): UseEpochDetai
123123
query: {
124124
slot_gte: firstSlot,
125125
slot_lte: lastSlot,
126+
missed_count_gt: 0,
126127
page_size: 10000,
127128
},
128129
}),
@@ -315,13 +316,12 @@ export function useEpochDetailData(epoch: number, isLive = false): UseEpochDetai
315316
};
316317

317318
// Process missed attestations by entity
318-
const missedAttestationsByEntity: SlotMissedAttestationEntity[] = attestationLivenessData
319-
.filter(record => (record.missed_count ?? 0) > 0)
320-
.map(record => ({
321-
slot: record.slot ?? 0,
322-
entity: record.entity ?? 'unknown',
323-
count: record.missed_count ?? 0,
324-
}));
319+
// Note: API query already filters for missed_count > 0
320+
const missedAttestationsByEntity: SlotMissedAttestationEntity[] = attestationLivenessData.map(record => ({
321+
slot: record.slot ?? 0,
322+
entity: record.entity ?? 'unknown',
323+
count: record.missed_count ?? 0,
324+
}));
325325

326326
// Calculate top 10 entities by total missed attestations
327327
const entityTotals = new Map<string, number>();

0 commit comments

Comments
 (0)