rust-libp2p: FloodSub is not working as of b8a312f7d512c25f86bc16989cb588900483946d

At present master (commit b8a312f7d512c25f86bc16989cb588900483946d) FloodSub doesn’t seem to work properly.

When I run provided chat example, I don’t see messages being delivered between nodes. Running example with debug enabled, I see, that dialed TCP connection is dropped immediately after successful negotiation.

Changing FloodsubHandler::connection_keep_alive() to always return true resolves this issue.

My guess is that this happens because:

  1. libp2p closes idle (useless?) TCP connections
  2. floodsub closes the substream after successful send.

So, we end up with no TCP connection between nodes.

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 18 (12 by maintainers)

Most upvoted comments

I see. In that case, I’d suggest to add something like keep_alive flag to the FloodsubHandler, which is initialized to true on start, and can be turned off by NetworkBehaviour with SendEvent action