Summary
I'm currently extending Nebula to also track the GossipSub topics that the remote peer is subscribed to. To do that I'm waiting for the remote peer to open a GossipSub stream and send the hello RPC which contains the list of subscribed topics.
I noticed that for Lighthouse peers the list only contained a single entry. Turns out that each topic subscription is sent as an individual messaage:
|
for topic_hash in self.mesh.clone().into_keys() { |
|
self.send_message(peer_id, RpcOut::Subscribe(topic_hash)); |
|
} |
This is, I guess, not a big issue when it comes to interoperability but it's not spec compliant:
Whenever a new peer is connected, the gossipsub implementation checks to see if the peer implements floodsub and/or gossipsub, and if so, it sends it a hello packet that announces the topics that it is currently subscribing to.
Expected behavior
I would expect that the initial RPC packet contains all topics that a peer is subscribed to.
Actual behavior
The topics that a peer is subscribed to are split across multiple RPCs.
Relevant log output
Possible Solution
No response
Version
No response
Would you like to work on fixing this bug?
Maybe
cc @cortze
Summary
I'm currently extending Nebula to also track the GossipSub topics that the remote peer is subscribed to. To do that I'm waiting for the remote peer to open a GossipSub stream and send the hello RPC which contains the list of subscribed topics.
I noticed that for Lighthouse peers the list only contained a single entry. Turns out that each topic subscription is sent as an individual messaage:
rust-libp2p/protocols/gossipsub/src/behaviour.rs
Lines 2955 to 2957 in 21d2c46
This is, I guess, not a big issue when it comes to interoperability but it's not spec compliant:
Expected behavior
I would expect that the initial RPC packet contains all topics that a peer is subscribed to.
Actual behavior
The topics that a peer is subscribed to are split across multiple RPCs.
Relevant log output
Possible Solution
No response
Version
No response
Would you like to work on fixing this bug?
Maybe
cc @cortze