ipvm-wg/homestar

Networking: Peer connection limits

mriise opened this issue · 1 comments

mriise commented

Summary

Add settings to control the amount of peers we connect to and discover.

Problem

Homestar will attempt to dial every peer that is under our rendezvous namespace, and since we always register with other nodes it leads to an exponential discovery until every node has dialed every other node in the network.

Impact

At the moment it is fine since we dont have any large networks, but this needs to be addressed before then or networking will be over stressed.

Solution

Add limits to the amount of connected peers in settings.

Detail

When below limits ask around for more peers, then when we start running low (maybe a low level parameter as well?) we start discovering peers again.

https://docs.rs/libp2p/latest/libp2p/connection_limits/struct.ConnectionLimits.html

Additional context

#236 (comment)

Solved by internal configuration.