From 74134e9b63b31b0de9cea31b763249d6053052f2 Mon Sep 17 00:00:00 2001 From: sukhman Date: Thu, 26 Jun 2025 15:31:16 +0530 Subject: [PATCH] Remove piggyback TODO from gossipsub Signed-off-by: sukhman --- libp2p/pubsub/gossipsub.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/libp2p/pubsub/gossipsub.py b/libp2p/pubsub/gossipsub.py index ccfeb941..3ab41afe 100644 --- a/libp2p/pubsub/gossipsub.py +++ b/libp2p/pubsub/gossipsub.py @@ -251,7 +251,6 @@ class GossipSub(IPubsubRouter, Service): stream = self.pubsub.peers[peer_id] # FIXME: We should add a `WriteMsg` similar to write delimited messages. # Ref: https://github.com/libp2p/go-libp2p-pubsub/blob/master/comm.go#L107 - # TODO: Go use `sendRPC`, which possibly piggybacks gossip/control messages. try: await stream.write(encode_varint_prefixed(rpc_msg.SerializeToString())) except StreamClosed: @@ -459,8 +458,8 @@ class GossipSub(IPubsubRouter, Service): self.fanout_heartbeat() # Get the peers to send IHAVE to peers_to_gossip = self.gossip_heartbeat() - # Pack GRAFT, PRUNE and IHAVE for the same peer into one control message and - # send it + # Pack(piggyback) GRAFT, PRUNE and IHAVE for the same peer into + # one control message and send it await self._emit_control_msgs( peers_to_graft, peers_to_prune, peers_to_gossip )