Comments (9)
Sorry - I missed this. It copies the go-libp2p-kad-dht behaviour as that was what was understood to be correct at the time.
This issue has an analogue here: libp2p/js-libp2p#2450 - the fix is here: libp2p/js-libp2p#2499
from rust-libp2p.
It would be silly, because the requester already know the peer it is sending the request to.
As mentioned above, I think there could be a valid reason why you would want the latest peer record
from rust-libp2p.
I don't unfortunately @guillaumemichel.
from rust-libp2p.
This was discussed here and here. I think if the latter was discussed more that could provide more clarification not just to rust-libp2p
but other implementations as well but in my opinion, I dont believe it really make much sense to be able to find one self when calling FIND_NODE
. I havent tested it recently but i know in go-libp2p i was not able to do the same when I tried it so did something change in the go implementation for this?
from rust-libp2p.
IMO it can make sense that the peer returns itself. The response could include additional multiaddresses that the requestor isn't aware of yet. For example, the peer record could include a multiaddress that allows a direct connection while the requestor and requestee are connected through a relay.
You could argue that this is already covered by the identify protocol though 🤷♂️ personally I don't find this implicit dependency on another protocol a super compelling argument to not do the suggested change.
from rust-libp2p.
Currently go-libp2p-kad-dht is returning only itself when its own key is requested through FIND_NODE
, which isn't either conform to the libp2p kad specs.
The question isn't: should the node return itself to such queries. It would be silly, because the requester already know the peer it is sending the request to.
My main concern here is that nodes should return the closest nodes to the requested key (excluding themselves, and the requester). FIND_NODE
should never return an empty response, unless the routing table of the node is empty.
So both rust-libp2p and go-libp2p-kad-dht should should return the list of their closest peers, when receiving a FIND_NODE
request for their own id.
from rust-libp2p.
@mxinden do you know why the empty response was introduced in ef9cb05?
from rust-libp2p.
The spec says:
The libp2p Kademlia DHT offers the following types of operations:
- Peer routing
- Finding the closest nodes to a given key via FIND_NODE.
- Upon a response:
- If successful the response will contain the k closest nodes the peer knows to the key Key. Add them to the candidate list Pn, except for those that have already been queried.
So the response should contain k
peers (including/excluding self). An empty response isn't conform to specs
from rust-libp2p.
@achingbrain did you check the js-libp2p behavior to see how it behaves?
from rust-libp2p.
Related Issues (20)
- Refactor file-sharing example to use tokio instead of async-std
- `Gossipsub`'s substreams keep all connections alive after `idle_connection_timeout`
- mergify continously approving approved pull requests HOT 6
- WebRTC connection doesn't close after timeout HOT 2
- Promote common dependencies to workspace level
- file-sharing works only on local interface HOT 1
- Improve request/response documentation HOT 4
- Compilation on docs.rs is failing
- mdns tokio timer panics HOT 2
- Signature verification fails on handshake if 1024 bit RSA key is used HOT 2
- relay: panics due to unimplemented time in wasm HOT 2
- kad: consume `FromSwarm::NewExternalAddrOfPeer` HOT 14
- Reduce `NewExternalAddrCandidate` reports from `identify`
- kad: make `automatic_bootstrap_interval` publicly configurable
- request-response: Inconsistent documentation.
- request-response: Document request/response max sizes HOT 4
- Active streams affect `yamux::connection::rtt` HOT 10
- rendezvous: Example "discovering with identify" doesn't work HOT 4
- kad: make bucket size configurable HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rust-libp2p.