Skip to content

Overclock-Validator/validator-pinger

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Solana Validator Latency Scanner

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

  1. The script queries the Solana mainnet RPC for:

    • The current validator set and their activated stake
      (via solana_cli::process_show_validators)
    • The cluster gossip table for each validator’s IP address
      (via solana_cli::process_show_gossip)
  2. It then uses ping_async to send ICMP echo requests (3 per validator) to each validator’s gossip IP.

  3. Latency is measured as the average round-trip time (RTT) of those 3 pings.

  4. The full data is written to out.json as JSON:

    {
      "validators": {
        "<validator_pubkey>": {
          "stake": 13255586830000000000,
          "ping_ms": { "Success": { "time_ms": 159 } }
        }
      }
    }
  5. 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)
  1. The script also prints a stake-weighted latency summary — this gives more importance to high-stake validators, which tend to produce more blocks.

Build / run

cargo build --release
cargo run --release

Optional: Display more rows

cargo run --release -- -n 50

Example output

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          |

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •