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
27 changes: 26 additions & 1 deletion core/src/banking_stage/leader_slot_metrics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -468,6 +468,12 @@ pub(crate) struct VotePacketCountMetrics {

// How many votes ingested from tpu were dropped
dropped_tpu_votes: u64,

// How many votes were Alpenglow votes
alpenglow_votes: u64,

// How many Alpenglow votes were successfully sent to the cert pool
alpenglow_votes_sent: u64,
}

impl VotePacketCountMetrics {
Expand All @@ -481,7 +487,9 @@ impl VotePacketCountMetrics {
"id" => id,
("slot", slot, i64),
("dropped_gossip_votes", self.dropped_gossip_votes, i64),
("dropped_tpu_votes", self.dropped_tpu_votes, i64)
("dropped_tpu_votes", self.dropped_tpu_votes, i64),
("alpenglow_all_to_all_votes", self.alpenglow_votes, i64),
("alpenglow_all_to_all_votes_sent", self.alpenglow_votes_sent, i64),
);
}
}
Expand Down Expand Up @@ -908,6 +916,23 @@ impl LeaderSlotMetricsTracker {
);
}
}

pub(crate) fn increment_alpenglow_vote_count(&mut self, count: u64, sent: u64) {
if let Some(leader_slot_metrics) = &mut self.leader_slot_metrics {
saturating_add_assign!(
leader_slot_metrics
.vote_packet_count_metrics
.alpenglow_votes,
count
);
saturating_add_assign!(
leader_slot_metrics
.vote_packet_count_metrics
.alpenglow_votes_sent,
sent
);
}
}
}

#[cfg(test)]
Expand Down
15 changes: 13 additions & 2 deletions core/src/banking_stage/packet_receiver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,11 @@ impl PacketReceiver {
// Consumes results if Ok, otherwise we keep the Err
.map(|receive_packet_results| {
if let Some(sender) = alpenglow_vote_sender {
self.send_alpenglow_votes_to_cert_pool(&receive_packet_results, sender);
self.send_alpenglow_votes_to_cert_pool(
&receive_packet_results,
sender,
slot_metrics_tracker,
);
}
self.buffer_packets(
receive_packet_results,
Expand Down Expand Up @@ -77,14 +81,21 @@ impl PacketReceiver {
packet_stats: _,
}: &ReceivePacketResults,
alpenglow_vote_sender: &AlpenglowVoteSender,
slot_metrics_tracker: &mut LeaderSlotMetricsTracker,
) {
let mut total = 0;
let mut total_sent = 0;
for packet in deserialized_packets.iter() {
if let Some(result) =
parse_alpenglow_vote_transaction_from_sanitized(packet.transaction())
{
let _ = alpenglow_vote_sender.send(result);
total += 1;
if alpenglow_vote_sender.send(result).is_ok() {
total_sent += 1;
}
}
}
slot_metrics_tracker.increment_alpenglow_vote_count(total, total_sent);
}

fn get_receive_timeout(vote_storage: &VoteStorage) -> Duration {
Expand Down