Open dmytro-his opened 8 months ago
Hi @jxs, could you please provide feedback on this issue? Is it indeed a bug, or is this expected behavior? Also, does the proposed solution work for you?
Hi, and sorry for missing this!
Currently gossipsub
only keeps the substream if it is in the mesh:
https://github.com/libp2p/rust-libp2p/blob/4dfc45bfec008405988edca2432c27ed5b93535f/protocols/gossipsub/src/handler.rs#L426-L428
which seems to be the opposite to what you refer on the issue right?
But I think all connections should be kept alive, as gossipsub
publishes messages for peers not in the mesh.
Summary
It seems
gossipsub
protocol keeps active substreams for connections that exists outside the gossip-mesh. As a result, connections remain alive even afteridle_connection_timeout
.This functionality appears to have changed from version
v0.52.0
, where gossip kept connections alive only within the mesh. Commits with relevant updates: https://github.com/libp2p/rust-libp2p/commit/fafa6bc472f6fe9501c75be6a936df2cb37e053a and https://github.com/libp2p/rust-libp2p/commit/fcd410a56c86de3b34f4896d1447ef1da959947cExpected behavior
Gossipsub
protocol should keep connections alive, but exclusively for peers within the meshActual behavior
Gossipsub
protocol keeps all connections aliveRelevant log output
No response
Possible Solution
Ignore gossip substreams in the
connection-keep-alive algorithm
. Uselibp2p_swarm::stream::Stream::ignore_for_keep_alive
for gossip inbound and outbound substreams.Version
0.53.1
Would you like to work on fixing this bug ?
Maybe