Skip to content

Commit

Permalink
Account for stake held by the current node while waiting for the supe…
Browse files Browse the repository at this point in the history
…rmajority to join gossip
  • Loading branch information
mvines committed Jan 8, 2020
1 parent 4b577aa commit 43897de
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 3 additions & 1 deletion core/src/validator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ impl Validator {

if config.wait_for_supermajority {
info!(
"Waiting more than 66% of activated stake at slot {} to be in gossip...",
"Waiting for more than 66% of activated stake at slot {} to be in gossip...",
bank.slot()
);
loop {
Expand Down Expand Up @@ -630,6 +630,8 @@ fn get_stake_percent_in_gossip(
activated_stake
);
gossip_stake += activated_stake;
} else if vote_state.node_pubkey == cluster_info.read().unwrap().id() {
gossip_stake += activated_stake;
}
}

Expand Down
2 changes: 2 additions & 0 deletions local-cluster/tests/local_cluster.rs
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,8 @@ fn test_validator_exit_2() {
let num_nodes = 2;
let mut validator_config = ValidatorConfig::default();
validator_config.rpc_config.enable_validator_exit = true;
validator_config.wait_for_supermajority = true;

let config = ClusterConfig {
cluster_lamports: 10_000,
node_stakes: vec![100; num_nodes],
Expand Down

0 comments on commit 43897de

Please sign in to comment.