You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, connection management is mostly connection limits, which is currently implemented into PeerBook using NetworkBehaviour (based on libp2p/rust-libp2p#3386). This behaviour does support whitelisting peers (which is more of an "allow list") to bypass the limits, but this is basic (and would likely be in a separate behaviour)
Down the road, we would need a realistic connection manager that would close least useful connections upon reaching a specific limit set. This would close connections to peers that are not guarded or protected by a protocol or behaviour such gossipsub, kad, or even in cases like PeerBook, though may need to check to determine the best course on checking the peer in other behaviours outside of what we managed (eg if the peer is actively subscribed to a topic in gossip, or apart of routing in kad, used for a relay, exchanging data via bitswap, etc). A scoring system would likely need to be implemented in some way.
TODO:
Protect peers manually added to PeerBook
This is done already, but the peer should not be counted towards the connection limit, while the current implementation, it does count.
Make sure tagged peers dont count towards the connection limit
Tag peers used in specific protocols
Peers subscribed to the same topic in gossipsub, untagging when unsubscribed
Peers exchanging blocks with bitswap, untagging when exchanging of blocks are done or have timed out.
Peers used as a relay.
Automatically remove tagged peers that disconnected (though protected peers will remain in place)
The text was updated successfully, but these errors were encountered:
Note: Instead of this being maintained in PeerBook, this will be pushed into its own behaviour (which will likely include the connection limits being moved into said behaviour) to keep things more consistent within the scope of the behaviour purpose.
Connection management itself may be pushed to be handled a bit more in libp2p, although there will still be tracking and cleanup of connections later on here if we reach a threshold.
Currently, connection management is mostly connection limits, which is currently implemented into
PeerBook
usingNetworkBehaviour
(based on libp2p/rust-libp2p#3386). This behaviour does support whitelisting peers (which is more of an "allow list") to bypass the limits, but this is basic (and would likely be in a separate behaviour)Down the road, we would need a realistic connection manager that would close least useful connections upon reaching a specific limit set. This would close connections to peers that are not guarded or protected by a protocol or behaviour such gossipsub, kad, or even in cases like
PeerBook
, though may need to check to determine the best course on checking the peer in other behaviours outside of what we managed (eg if the peer is actively subscribed to a topic in gossip, or apart of routing in kad, used for a relay, exchanging data via bitswap, etc). A scoring system would likely need to be implemented in some way.TODO:
The text was updated successfully, but these errors were encountered: