Skip to content
This repository was archived by the owner on Jan 22, 2025. It is now read-only.

Commit 640d4de

Browse files
committed
Account for stake held by the current node while waiting for the supermajority to join gossip
1 parent 47dd293 commit 640d4de

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

core/src/validator.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,7 @@ impl Validator {
299299

300300
if config.wait_for_supermajority {
301301
info!(
302-
"Waiting more than 66% of activated stake at slot {} to be in gossip...",
302+
"Waiting for more than 66% of activated stake at slot {} to be in gossip...",
303303
bank.slot()
304304
);
305305
loop {
@@ -630,6 +630,8 @@ fn get_stake_percent_in_gossip(
630630
activated_stake
631631
);
632632
gossip_stake += activated_stake;
633+
} else if vote_state.node_pubkey == cluster_info.read().unwrap().id() {
634+
gossip_stake += activated_stake;
633635
}
634636
}
635637

local-cluster/tests/local_cluster.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,8 @@ fn test_validator_exit_2() {
159159
let num_nodes = 2;
160160
let mut validator_config = ValidatorConfig::default();
161161
validator_config.rpc_config.enable_validator_exit = true;
162+
validator_config.wait_for_supermajority = true;
163+
162164
let config = ClusterConfig {
163165
cluster_lamports: 10_000,
164166
node_stakes: vec![100; num_nodes],

0 commit comments

Comments
 (0)