waku-org / nwaku

Waku node and protocol.
Other
201 stars 53 forks source link

bug: Peer manager does not return random peers #3120

Closed SionoiS closed 1 month ago

SionoiS commented 1 month ago

Problem

When asking the peer manager for a peer, the first peer for a given protocol is return, which means that at startup in the fleet all nodes dial the same peer.

Impact

The chosen one receives a lot of connections.

Expected behavior

The peer manager NEVER return the same peers if it can be avoided.

see https://github.com/waku-org/nwaku/blob/18c375a5deea569e4bbef09d1f9376ad92190bc5/waku/node/peer_manager/peer_manager.nim#L250C5-L250C26