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

Commit

Permalink
Only print skipped leader slot message when the node is actually lead…
Browse files Browse the repository at this point in the history
…er (#16156) (#16164)

Also, check vote signature after the vote is signed

(cherry picked from commit 60b4771)

Co-authored-by: sakridge <sakridge@gmail.com>
  • Loading branch information
mergify[bot] and sakridge authored Mar 27, 2021
1 parent 8aded27 commit a4cb1e4
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions core/src/replay_stage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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 {
Expand All @@ -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);
}
Expand Down

0 comments on commit a4cb1e4

Please sign in to comment.