From c6927151efb27bb4042286bc1c4d579dd72c8633 Mon Sep 17 00:00:00 2001 From: Michael Vines Date: Fri, 18 Nov 2022 15:26:21 -0800 Subject: [PATCH] Sort offline/wrong-shred nodes by stake weight while waiting for supermajority (#28872) --- core/src/validator.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/core/src/validator.rs b/core/src/validator.rs index 4f92f51fb..554c15f4b 100644 --- a/core/src/validator.rs +++ b/core/src/validator.rs @@ -1997,6 +1997,7 @@ fn get_stake_percent_in_gossip(bank: &Bank, cluster_info: &ClusterInfo, log: boo "{:.3}% of active stake has the wrong shred version in gossip", (wrong_shred_stake as f64 / total_activated_stake as f64) * 100., ); + wrong_shred_nodes.sort_by(|b, a| a.0.cmp(&b.0)); // sort by reverse stake weight for (stake, identity) in wrong_shred_nodes { info!( " {:.3}% - {}", @@ -2011,6 +2012,7 @@ fn get_stake_percent_in_gossip(bank: &Bank, cluster_info: &ClusterInfo, log: boo "{:.3}% of active stake is not visible in gossip", (offline_stake as f64 / total_activated_stake as f64) * 100. ); + offline_nodes.sort_by(|b, a| a.0.cmp(&b.0)); // sort by reverse stake weight for (stake, identity) in offline_nodes { info!( " {:.3}% - {}",