Use f64 for stake math in get_stake_percent_in_gossip (#19895)
This commit is contained in:
parent
d3c80be7d5
commit
c91519961c
@ -1617,21 +1617,22 @@ fn get_stake_percent_in_gossip(bank: &Bank, cluster_info: &ClusterInfo, log: boo
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let online_stake_percentage = (online_stake as f64 / total_activated_stake as f64) * 100.;
|
||||||
if log {
|
if log {
|
||||||
info!(
|
info!(
|
||||||
"{}% of active stake visible in gossip",
|
"{:.3}% of active stake visible in gossip",
|
||||||
online_stake * 100 / total_activated_stake
|
online_stake_percentage
|
||||||
);
|
);
|
||||||
|
|
||||||
if !wrong_shred_nodes.is_empty() {
|
if !wrong_shred_nodes.is_empty() {
|
||||||
info!(
|
info!(
|
||||||
"{}% of active stake has the wrong shred version in gossip",
|
"{:.3}% of active stake has the wrong shred version in gossip",
|
||||||
wrong_shred_stake * 100 / total_activated_stake,
|
(wrong_shred_stake as f64 / total_activated_stake as f64) * 100.,
|
||||||
);
|
);
|
||||||
for (stake, identity) in wrong_shred_nodes {
|
for (stake, identity) in wrong_shred_nodes {
|
||||||
info!(
|
info!(
|
||||||
" {}% - {}",
|
" {:.3}% - {}",
|
||||||
stake * 100 / total_activated_stake,
|
(stake as f64 / total_activated_stake as f64) * 100.,
|
||||||
identity
|
identity
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -1639,20 +1640,20 @@ fn get_stake_percent_in_gossip(bank: &Bank, cluster_info: &ClusterInfo, log: boo
|
|||||||
|
|
||||||
if !offline_nodes.is_empty() {
|
if !offline_nodes.is_empty() {
|
||||||
info!(
|
info!(
|
||||||
"{}% of active stake is not visible in gossip",
|
"{:.3}% of active stake is not visible in gossip",
|
||||||
offline_stake * 100 / total_activated_stake
|
(offline_stake as f64 / total_activated_stake as f64) * 100.
|
||||||
);
|
);
|
||||||
for (stake, identity) in offline_nodes {
|
for (stake, identity) in offline_nodes {
|
||||||
info!(
|
info!(
|
||||||
" {}% - {}",
|
" {:.3}% - {}",
|
||||||
stake * 100 / total_activated_stake,
|
(stake as f64 / total_activated_stake as f64) * 100.,
|
||||||
identity
|
identity
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
online_stake * 100 / total_activated_stake
|
online_stake_percentage as u64
|
||||||
}
|
}
|
||||||
|
|
||||||
// Cleanup anything that looks like an accounts append-vec
|
// Cleanup anything that looks like an accounts append-vec
|
||||||
|
Loading…
x
Reference in New Issue
Block a user