From a4cb1e45ae84368fbf10a4d6a58b6413d06cd2e9 Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Sat, 27 Mar 2021 02:03:10 +0000 Subject: [PATCH] Only print skipped leader slot message when the node is actually leader (#16156) (#16164) Also, check vote signature after the vote is signed (cherry picked from commit 60b4771fc6bb918d4ba373eb04271622e53d5c4e) Co-authored-by: sakridge --- core/src/replay_stage.rs | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/core/src/replay_stage.rs b/core/src/replay_stage.rs index a5793f3401..bf15dd519a 100644 --- a/core/src/replay_stage.rs +++ b/core/src/replay_stage.rs @@ -898,10 +898,6 @@ impl ReplayStage { skipped_slots_info: &mut SkippedSlotsInfo, has_new_vote_been_rooted: bool, ) { - if !has_new_vote_been_rooted { - info!("Haven't landed a vote, so skipping my leader slot"); - return; - } // all the individual calls to poh_recorder.lock() are designed to // increase granularity, decrease contention @@ -937,6 +933,11 @@ impl ReplayStage { ); if let Some(next_leader) = leader_schedule_cache.slot_leader_at(poh_slot, Some(&parent)) { + if !has_new_vote_been_rooted { + info!("Haven't landed a vote, so skipping my leader slot"); + return; + } + trace!( "{} leader {} at poh slot: {}", my_pubkey, @@ -1285,6 +1286,10 @@ impl ReplayStage { let mut vote_tx = Transaction::new_with_payer(&[vote_ix], Some(&node_keypair.pubkey())); + let blockhash = bank.last_blockhash(); + vote_tx.partial_sign(&[node_keypair.as_ref()], blockhash); + vote_tx.partial_sign(&[authorized_voter_keypair.as_ref()], blockhash); + if !has_new_vote_been_rooted { vote_signatures.push(vote_tx.signatures[0]); if vote_signatures.len() > MAX_VOTE_SIGNATURES { @@ -1293,9 +1298,7 @@ impl ReplayStage { } else { vote_signatures.clear(); } - let blockhash = bank.last_blockhash(); - vote_tx.partial_sign(&[node_keypair.as_ref()], blockhash); - vote_tx.partial_sign(&[authorized_voter_keypair.as_ref()], blockhash); + let _ = cluster_info.send_vote(&vote_tx); cluster_info.push_vote(tower, vote_tx); }