libp2p / js-libp2p-floodsub

Also known as pubsub-flood or just dumbsub, this implementation of pubsub focused on delivering an API for Publish/Subscribe, but with no CastTree Forming (it just floods the network).
https://libp2p.io
Other
47 stars 16 forks source link

Pubsub has no peers in latest version #168

Closed sethhrbek closed 2 years ago

sethhrbek commented 2 years ago

When creating a node with the following configuration:

    transports: [
      new TCP(),
      new WebSockets(),
      new WebRTCStar({wrtc}),
    ],
    connectionEncryption: [
      new Noise()
    ],
    streamMuxers: [
      new Mplex()
    ],
    pubsub: new FloodSub({
      enabled: true,
      canRelayMessage: true,
      emitSelf: false
    }),
    dht: new KadDHT({
      protocolPrefix: PROTOCOL_PREFIX,
      clientMode: false
    }),
    peerDiscovery: [
      webRtcStar.discovery
    ]

The newer versions of floodSub (>=2.0.0) don't work (messages don't get transferred between nodes). The farthest I've diagnosed this issue is the pubsub peer list is returning an empty array, despite the node having peers (this.node.getPeers() returns a populated array, this.node.pubsub.peers returns empty).

This issue does not exist when using floodsub < 2.0.0 (pubsub peer list is populated and pubsub messaging works).

Tested the issue on libp2p 0.37.2 and 0.37.3

BigLep commented 2 years ago

@sethhrbek: this is surprising because we test message delivery in our test suite. Can you please put together a reproduction case that maintainers can easily run?

Also, is there any reason you're not using gossipsub?

github-actions[bot] commented 2 years ago

Oops, seems like we needed more information for this issue, please comment with more details or this issue will be closed in 7 days.

github-actions[bot] commented 2 years ago

This issue was closed because it is missing author input.