Open altonen opened 6 months ago
Isn't https://github.com/altonen/litep2p/blob/master/src/protocol/libp2p/kademlia/bucket.rs#L90-L97 responsible for replacing disconnected peers?
You're right, I had forgotten that check and only looked at routing_table.rs
. But as discussed in Element, I believe the eviction is smarter in rust-libp2p and we should have something similar in litep2p as well.
Currently the routing table doesn't evict any peers if a bucket is full. Meaning if Kademlia tries to add a peer with an active connection to the routing table and it's full of disconnected peers, the new connected peer is rejected. Analyze how
rust-libp2p
deals with evictions and see if it can be applied to litep2p.