Skip to content

Commit

Permalink
v2.0: removes early return if prune_messages are empty (backport of #…
Browse files Browse the repository at this point in the history
…3006) (#3011)

removes early return if prune_messages are empty (#3006)

Even if there are no outgoing prune messages we still need to generate
outgoing push messages for packets just received, so the code should not
early return here:
https://github.com/anza-xyz/agave/blob/d2cc71f0d/gossip/src/cluster_info.rs#L2400-L2402

(cherry picked from commit ce15821)

Co-authored-by: behzad nouri <[email protected]>
  • Loading branch information
mergify[bot] and behzadnouri authored Sep 30, 2024
1 parent 3aa2c0a commit 246fe45
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions gossip/src/cluster_info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2412,9 +2412,6 @@ impl ClusterInfo {
.collect()
})
};
if prune_messages.is_empty() {
return;
}
let mut packet_batch = PacketBatch::new_unpinned_with_recycler_data_and_dests(
recycler,
"handle_batch_push_messages",
Expand Down Expand Up @@ -2444,7 +2441,9 @@ impl ClusterInfo {
self.stats
.packets_sent_push_messages_count
.add_relaxed((packet_batch.len() - num_prune_packets) as u64);
let _ = response_sender.send(packet_batch);
if !packet_batch.is_empty() {
let _ = response_sender.send(packet_batch);
}
}

fn require_stake_for_gossip(&self, stakes: &HashMap<Pubkey, u64>) -> bool {
Expand Down

0 comments on commit 246fe45

Please sign in to comment.