Skip to content

Commit

Permalink
Merge pull request #13 from elenaf9/gossipsub/backpressure/readd-logs
Browse files Browse the repository at this point in the history
fix(gossipsub): readd lines accidently removed with #12
  • Loading branch information
jxs authored Nov 22, 2024
2 parents c812627 + b295f56 commit 1789386
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion protocols/gossipsub/src/behaviour.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1030,6 +1030,10 @@ where

for peer_id in added_peers {
// Send a GRAFT control message
tracing::debug!(peer=%peer_id, "JOIN: Sending Graft message to peer");
if let Some((peer_score, ..)) = &mut self.peer_score {
peer_score.graft(&peer_id, topic_hash.clone());
}
self.send_message(
peer_id,
RpcOut::Graft(Graft {
Expand Down Expand Up @@ -1127,7 +1131,11 @@ where
}
for peer_id in peers {
// Send a PRUNE control message
let prune = self.make_prune(topic_hash, &peer_id, self.config.do_px(), true);
tracing::debug!(%peer_id, "LEAVE: Sending PRUNE to peer");

let on_unsubscribe = true;
let prune =
self.make_prune(topic_hash, &peer_id, self.config.do_px(), on_unsubscribe);
self.send_message(peer_id, RpcOut::Prune(prune));

// If the peer did not previously exist in any mesh, inform the handler
Expand Down Expand Up @@ -1283,6 +1291,12 @@ where
Instant::now() + self.config.iwant_followup_time(),
);
}
tracing::trace!(
peer=%peer_id,
"IHAVE: Asking for the following messages from peer: {:?}",
iwant_ids_vec
);

self.send_message(
*peer_id,
RpcOut::IWant(IWant {
Expand Down

0 comments on commit 1789386

Please sign in to comment.