Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nit: add warning of ping api issues #401

Merged
merged 3 commits into from
Nov 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 17 additions & 1 deletion app/components/LiveTransactionStatsCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,19 @@ export function LiveTransactionStatsCard() {
<div className="card-header">
<h4 className="card-header-title">Live Transaction Stats</h4>
</div>

<TpsCardBody series={series} setSeries={setSeries} />
<div className="alert alert-warning m-2" role="alert">
Note: We are aware of an issue with ping statistic reporting. Ping statistics may not reflect actual
network performance. Please see{' '}
<a
href="https://www.validators.app/ping-thing?locale=en&network=mainnet"
className="text-white text-decoration-underline"
>
validators.app
</a>{' '}
for more information.
</div>
<PingStatsCardBody series={series} setSeries={setSeries} />
</div>
);
Expand Down Expand Up @@ -273,7 +285,11 @@ function PingStatsCardBody({ series, setSeries }: { series: Series; setSeries: S
return <PingStatsNotReady error={pingInfo.status === PingStatus.Error} retry={pingInfo.retry} />;
}

return <PingBarChart pingInfo={pingInfo} series={series} setSeries={setSeries} />;
return (
<>
<PingBarChart pingInfo={pingInfo} series={series} setSeries={setSeries} />
</>
);
}

type StatsNotReadyProps = { error: boolean; retry?: () => void };
Expand Down
5 changes: 4 additions & 1 deletion app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,10 @@ function StakingComponent() {

const activeStake = React.useMemo(() => {
if (voteAccounts && delinquentStake) {
return voteAccounts.current.reduce((prev, current) => prev + current.activatedStake, BigInt(0)) + delinquentStake;
return (
voteAccounts.current.reduce((prev, current) => prev + current.activatedStake, BigInt(0)) +
delinquentStake
);
}
}, [voteAccounts, delinquentStake]);

Expand Down
Loading