This tool measures network latency to all Solana validators on mainnet-beta using ICMP pings and prints a table of the top validators by stake.
It also saves full results to out.json and computes a stake-weighted latency metric — a practical measure of how well-connected your node is to the validators that matter most.
The stake-weighted latency gives a single number summarizing how “close” your node is, in network terms, to the validators that control the most stake
-
The script queries the Solana mainnet RPC for:
- The current validator set and their activated stake
(viasolana_cli::process_show_validators) - The cluster gossip table for each validator’s IP address
(viasolana_cli::process_show_gossip)
- The current validator set and their activated stake
-
It then uses
ping_asyncto send ICMP echo requests (3 per validator) to each validator’s gossip IP. -
Latency is measured as the average round-trip time (RTT) of those 3 pings.
-
The full data is written to
out.jsonas JSON:{ "validators": { "<validator_pubkey>": { "stake": 13255586830000000000, "ping_ms": { "Success": { "time_ms": 159 } } } } } -
A formatted table is printed to the console showing:
- Rank by stake
- Validator identity
- IP address
- Stake (in SOL, formatted with commas)
- Average latency (in milliseconds)
- The script also prints a stake-weighted latency summary — this gives more importance to high-stake validators, which tend to produce more blocks.
cargo build --release
cargo run --release
cargo run --release -- -n 50
Summary:
Successful entries: 968/991
Stake-weighted latency: 302.52 ms
Top 20 validators by stake (change with -n):
| # | Validator | IP | Stake (SOL) | Latency (ms) |
|----|----------------------------------------------|-----------------|-------------|--------------|
| 1 | HEL1USMZKAL2odpNBj2oCjffnFGaYwmbGmyewGv1e2TU | 64.130.57.131 | 13,255,586 | 150 |
| 2 | DRpbCBMxVnDK7maPM5tGv6MvB3v1sRMC86PZ8okm21hy | 67.202.63.79 | 11,695,946 | 1003 |
| 3 | JupmVLmA8RoyTUbTMMuTtoPWHEiNQobxgTeGTrPNkzT | 67.213.121.209 | 11,420,330 | 180 |
| 4 | Fd7btgySsrjuo25CJCj7oE7VPMyezDhnx7pZkj2v69Nk | 67.213.121.169 | 10,647,284 | 199 |
| 5 | DtdSSG8ZJRZVv5Jx7K1MeWp7Zxcu19GD5wQRGRpQ9uMF | 86.54.152.245 | 8,531,286 | 169 |