diff --git a/web3_proxy/src/bin/web3_proxy_cli/popularity_contest.rs b/web3_proxy/src/bin/web3_proxy_cli/popularity_contest.rs index e05da609..8950c788 100644 --- a/web3_proxy/src/bin/web3_proxy_cli/popularity_contest.rs +++ b/web3_proxy/src/bin/web3_proxy_cli/popularity_contest.rs @@ -50,6 +50,7 @@ impl PopularityContestSubCommand { let mut by_tier = BTreeMap::>::new(); let mut tier_requests = BTreeMap::::new(); let mut total_requests = 0; + let mut highest_block = 0; for conn in conns { let conn = conn.as_object().unwrap(); @@ -80,6 +81,8 @@ impl PopularityContestSubCommand { .map(|x| x.as_u64()) .unwrap_or_default(); + highest_block = highest_block.max(head_block); + let head_latency = conn.get("head_latency").unwrap().as_f64().unwrap(); let request_latency = conn @@ -117,7 +120,7 @@ impl PopularityContestSubCommand { "rpc_requests", "tier_request_pct", "total_pct", - "head_block", + "head_lag", "head_latency", "request_latency", ]); @@ -148,7 +151,7 @@ impl PopularityContestSubCommand { rpc.requests, tier_request_pct, total_request_pct, - rpc.head_block, + highest_block - rpc.head_block, format!("{:.3}", rpc.head_latency), format!("{:.3}", rpc.request_latency), ]);