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)

Also, check vote signature after the vote is signed
  • Loading branch information
sakridge authored Mar 27, 2021
1 parent 433f1ea commit 60b4771
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 @@ -1031,10 +1031,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 @@ -1070,6 +1066,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 @@ -1421,6 +1422,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 @@ -1429,9 +1434,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 60b4771

Please sign in to comment.