ipvm-wg / homestar

Homestar is the individual node that makes up the Everywhere Computer network (similar to how IPFS Kubo, Iroh, Nabu, or other implementation nodes make up the IPFS network). It's written in Rust and is designed for performance and composability.
https://docs.everywhere.computer/homestar/what-is-homestar/
Apache License 2.0
212 stars 23 forks source link

Networking: Peer connection limits #258

Closed mriise closed 9 months ago

mriise commented 1 year ago

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

https://github.com/ipvm-wg/homestar/pull/236#discussion_r1302093005

zeeshanlakhani commented 9 months ago

Solved by internal configuration.