validator: Consider the activated stake of this node to be online again (#9573)
automerge
This commit is contained in:
parent
729cb5eec6
commit
a7aa7e172b
@ -809,7 +809,8 @@ fn get_stake_percent_in_gossip(
|
|||||||
|
|
||||||
let mut total_activated_stake = 0;
|
let mut total_activated_stake = 0;
|
||||||
let all_tvu_peers = cluster_info.read().unwrap().all_tvu_peers();
|
let all_tvu_peers = cluster_info.read().unwrap().all_tvu_peers();
|
||||||
let me = cluster_info.read().unwrap().my_data();
|
let my_shred_version = cluster_info.read().unwrap().my_data().shred_version;
|
||||||
|
let my_id = cluster_info.read().unwrap().id();
|
||||||
|
|
||||||
for (activated_stake, vote_account) in bank.vote_accounts().values() {
|
for (activated_stake, vote_account) in bank.vote_accounts().values() {
|
||||||
let vote_state =
|
let vote_state =
|
||||||
@ -824,7 +825,7 @@ fn get_stake_percent_in_gossip(
|
|||||||
.iter()
|
.iter()
|
||||||
.find(|peer| peer.id == vote_state.node_pubkey)
|
.find(|peer| peer.id == vote_state.node_pubkey)
|
||||||
{
|
{
|
||||||
if peer.shred_version == me.shred_version {
|
if peer.shred_version == my_shred_version {
|
||||||
trace!(
|
trace!(
|
||||||
"observed {} in gossip, (activated_stake={})",
|
"observed {} in gossip, (activated_stake={})",
|
||||||
vote_state.node_pubkey,
|
vote_state.node_pubkey,
|
||||||
@ -835,6 +836,8 @@ fn get_stake_percent_in_gossip(
|
|||||||
wrong_shred_stake += activated_stake;
|
wrong_shred_stake += activated_stake;
|
||||||
wrong_shred_nodes.push((*activated_stake, vote_state.node_pubkey));
|
wrong_shred_nodes.push((*activated_stake, vote_state.node_pubkey));
|
||||||
}
|
}
|
||||||
|
} else if vote_state.node_pubkey == my_id {
|
||||||
|
online_stake += activated_stake; // This node is online
|
||||||
} else {
|
} else {
|
||||||
offline_stake += activated_stake;
|
offline_stake += activated_stake;
|
||||||
offline_nodes.push((*activated_stake, vote_state.node_pubkey));
|
offline_nodes.push((*activated_stake, vote_state.node_pubkey));
|
||||||
|
@ -161,6 +161,7 @@ fn test_validator_exit_2() {
|
|||||||
let num_nodes = 2;
|
let num_nodes = 2;
|
||||||
let mut validator_config = ValidatorConfig::default();
|
let mut validator_config = ValidatorConfig::default();
|
||||||
validator_config.rpc_config.enable_validator_exit = true;
|
validator_config.rpc_config.enable_validator_exit = true;
|
||||||
|
validator_config.wait_for_supermajority = Some(0);
|
||||||
|
|
||||||
let config = ClusterConfig {
|
let config = ClusterConfig {
|
||||||
cluster_lamports: 10_000,
|
cluster_lamports: 10_000,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user