Skip to content
Merged
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
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