-
Notifications
You must be signed in to change notification settings - Fork 959
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make it possible to disable automatically inserting nodes we connect to to the DHT #1560
Comments
Summarizing a discussion in Riot there are two simple and one complex paths forward: 1. Disable automatic routing table updatesOffering an option in libp2p Kademlia to disable routing table updates when a new connection is established i.e. a simple condition in rust-libp2p/protocols/kad/src/behaviour.rs Lines 1104 to 1115 in 0443fea
It would remain enabled by default. When disabled, no entry will get into the routing table without an explicit call to 2. Provide a method to remove nodes after-the-factOffering Drawbacks of this approach are related to keeping the Kademlia internal peer blacklist in-sync. E.g. we connect to a node, thus it is added to the Kademlia routing table, but before identifying the node we disconnect. In this scenario the peer would stay in the Kademlia routing table forever. 3. Introduce structured prioritization to Kademlias routing tableSee details in #1352. This would require us to have an authenticated address book, which we currently only have in an eventually consistent form with the authority discovery module. |
Note that |
@mxinden Are you already working on it? If not, I can look into implementing options (1) and (2). |
@romanb in regards to option (1) I created mxinden@ad3d5db which should pave the way for initial testing within Substrate. It is currently blocked due to paritytech/substrate#5938. Once that merged we can properly add peers to the DHT based on the result of the status message. I am not aware of any efforts for (2). |
In libp2p-kad, whenever we successfully connect to a node, we immediately insert its address in the DHT.
Unfortunately, in Substrate (and probably for other users for libp2p) we don't necessarily want that to happen.
In particular, light clients shouldn't be part of the DHT (paritytech/substrate#3303) and, now that we have multiple DHTs, we should only insert nodes in the DHT after having verified that they have the correct chain root (paritytech/substrate#5825).
There should be an option that disables the auto-insertion.
The text was updated successfully, but these errors were encountered: