-
Notifications
You must be signed in to change notification settings - Fork 228
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
Bootstrap process not compatible with rust libp2p-kad #966
Comments
Right I overlooked the situation where you creating a new DHT from thin air. I wanted to use the DHT Ping RPC query (for performance reasons), but it is deprecated and we didn't went that route, that could solve issues like this. I also still think this kind of hardening and edge cases should be written down in a spec but there were no interest last time I had discussions about this. |
As I understand it, this is a general problem, even if rust-libp2p is bootstrapped. The issue is just that rust-libp2p never returns itself and hence the validation never passes. As I see it, the peer itself is the only entry in its highest bucket, so it makes sense to return itself if asked for peers in that highest bucket. Therefore, I think, the better solution would be that rust-libp2p just returned itself. |
The specs specify that When requested for self's key:
Implicitly, a node wouldn't have to return itself (because the requester is already aware), but it should return a list of its closest peers. @xinaxu is right, it is an issue that go-libp2p-kad-dht nodes don't accept rust-libp2p nodes in their buckets. A quick fix could be to modify the lookupCheck to request What really matters is that the remote node is able to provide at least 1 peer in response to |
Just suggested a change in rust-libp2p to address the issue |
libp2p/rust-libp2p#5270 has been merged. It makes sure that rust-libp2p returns multiple peers when being requested for its own peer id. It used to return 0 peers in the past, which is why the rust-libp2p nodes were never added to go-libp2p-kad-dht buckets. Also see: #968 |
In Pull Request #820, additional validation is added to check if the bootstrap node should be put into the routing table - if it fails to return itself for finding itself, then it won't be put into the routing table
go-libp2p-kad-dht/dht.go
Line 383 in 1b5d0b6
The logic indicates, when querying
FIND_NODE
for the destination peer, it is expecting the destination node to return at least themselves.However, the logic in rust libp2p-kad does not include themselves in the response. The result will be, a golang DHT client cannot use a rust DHT client for bootstrapping.
https://github.com/libp2p/rust-libp2p/blob/a579e691c46a8efd2e38ebafca1c59a9b58fc56c/protocols/kad/src/behaviour.rs#L1184
The error shown is
The text was updated successfully, but these errors were encountered: