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

Commit

Permalink
adds logs when push-vote panics with invalid vote-index (#19485) (#19521
Browse files Browse the repository at this point in the history
)

In order to debug this panic on the clusters:

  panicked at 'assertion failed: (vote_index as usize) <
  MAX_LOCKOUT_HISTORY', core/src/cluster_info.rs:1012:9

(cherry picked from commit d7051b0)

Co-authored-by: behzad nouri <[email protected]>
  • Loading branch information
mergify[bot] and behzadnouri authored Aug 31, 2021
1 parent 6f86abf commit 5fbcb10
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion gossip/src/cluster_info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,9 @@ use {
socket::SocketAddrSpace,
streamer::{PacketReceiver, PacketSender},
},
solana_vote_program::vote_state::MAX_LOCKOUT_HISTORY,
solana_vote_program::{
vote_state::MAX_LOCKOUT_HISTORY, vote_transaction::parse_vote_transaction,
},
std::{
borrow::Cow,
collections::{hash_map::Entry, HashMap, HashSet, VecDeque},
Expand Down Expand Up @@ -1005,6 +1007,16 @@ impl ClusterInfo {
.map(|(_ /*wallclock*/, ix)| ix)
};
let vote_index = vote_index.unwrap_or(num_crds_votes);
if (vote_index as usize) >= MAX_LOCKOUT_HISTORY {
let (_, vote, hash) = parse_vote_transaction(&vote).unwrap();
panic!(
"invalid vote index: {}, switch: {}, vote slots: {:?}, tower: {:?}",
vote_index,
hash.is_some(),
vote.slots,
tower
);
}
self.push_vote_at_index(vote, vote_index);
}

Expand Down

0 comments on commit 5fbcb10

Please sign in to comment.