Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions votor/src/certificate_pool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -677,7 +677,7 @@ impl CertificatePool {

pub fn get_certs_for_standstill(&self) -> Vec<Arc<CertificateMessage>> {
let (highest_finalized_with_notarize_slot, has_fast_finalize) =
self.highest_finalized_with_notarize.unwrap_or((0, true));
self.highest_finalized_with_notarize.unwrap_or((0, false));
self.completed_certificates
.iter()
.filter_map(|(cert_id, cert)| {
Expand Down Expand Up @@ -847,7 +847,7 @@ mod tests {

fn add_skip_vote_range(
pool: &mut CertificatePool,
bank: &Bank,
root_bank: &Bank,
start: Slot,
end: Slot,
keypairs: &[ValidatorVoteKeypairs],
Expand All @@ -857,9 +857,9 @@ mod tests {
let vote = Vote::new_skip_vote(slot);
assert!(pool
.add_message(
bank.epoch_schedule(),
bank.epoch_stakes_map(),
bank.slot(),
root_bank.epoch_schedule(),
root_bank.epoch_stakes_map(),
root_bank.slot(),
&Pubkey::new_unique(),
&dummy_transaction(keypairs, &vote, rank),
&mut vec![]
Expand Down
1 change: 1 addition & 0 deletions votor/src/certificate_pool_service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ impl CertificatePoolService {
CertificatePoolServiceStats::incr_u16(&mut stats.new_finalized_slot);
}
cert_pool.prune_old_state(root_bank_cache.root_bank().slot());
CertificatePoolServiceStats::incr_u64(&mut stats.prune_old_state_called);
// Send new certificates to peers
Self::send_certificates(bls_sender, new_certificates_to_send, stats)
}
Expand Down
8 changes: 8 additions & 0 deletions votor/src/certificate_pool_service/stats.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ pub(crate) struct CertificatePoolServiceStats {
pub(crate) received_votes: u32,
pub(crate) received_certificates: u32,
pub(crate) standstill: bool,
pub(crate) prune_old_state_called: u64,
last_request_time: Instant,
}

Expand All @@ -31,6 +32,7 @@ impl CertificatePoolServiceStats {
received_votes: 0,
received_certificates: 0,
standstill: false,
prune_old_state_called: 0,
last_request_time: Instant::now(),
}
}
Expand All @@ -43,6 +45,10 @@ impl CertificatePoolServiceStats {
*value = value.saturating_add(1);
}

pub fn incr_u64(value: &mut u64) {
*value = value.saturating_add(1);
}

fn reset(&mut self) {
self.add_message_failed = 0;
self.certificates_sent = 0;
Expand All @@ -53,6 +59,7 @@ impl CertificatePoolServiceStats {
self.received_votes = 0;
self.received_certificates = 0;
self.standstill = false;
self.prune_old_state_called = 0;
self.last_request_time = Instant::now();
}

Expand All @@ -76,6 +83,7 @@ impl CertificatePoolServiceStats {
("received_votes", self.received_votes, i64),
("received_certificates", self.received_certificates, i64),
("standstill", self.standstill, i64),
("prune_old_state_called", self.prune_old_state_called, i64),
);
}

Expand Down
Loading