Skip to content

Commit 87a487f

Browse files
authored
fix: correct attestation vote percentage calculation (#297)
Use actual expected validator count from attestationCorrectness instead of summing committee sizes, which was double-counting validators and causing percentages to exceed 100%.
1 parent 1ba996c commit 87a487f

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

src/pages/ethereum/slots/DetailPage.tsx

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -731,10 +731,7 @@ export function DetailPage(): JSX.Element {
731731
attestationData={allAttestationVotes}
732732
currentSlot={slot}
733733
votedForBlocks={data.votedForBlocks}
734-
expectedValidatorCount={data.committees.reduce(
735-
(sum, committee) => sum + (committee.validators?.length ?? 0),
736-
0
737-
)}
734+
expectedValidatorCount={totalExpectedValidators}
738735
isLoading={attestationVotesLoading}
739736
/>
740737
<AttestationArrivalsChart

0 commit comments

Comments
 (0)