Skip to content
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

kad: FIND_NODE(self) should return multiple peers #2450

Closed
guillaumemichel opened this issue Mar 27, 2024 · 0 comments · Fixed by #2499
Closed

kad: FIND_NODE(self) should return multiple peers #2450

guillaumemichel opened this issue Mar 27, 2024 · 0 comments · Fixed by #2499
Labels
need/triage Needs initial labeling and prioritization

Comments

@guillaumemichel
Copy link

  • Version:
    1.0.0

  • Platform:
    all

  • Subsystem:
    kad-dht

Severity:

Low

Description:

When receiving a kademlia FIND_NODE request for its own peer id, a js-libp2p node will respond with its own peer record only. According to libp2p kademlia spec, it should reply with the k closest nodes.

The libp2p Kademlia DHT offers the following types of operations:

  • Peer routing
    • Finding the closest nodes to a given key via FIND_NODE.
  1. Upon a response:
    1. 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.

Depending on libp2p/specs#609, nodes shouldn't even include their own peer records in the response (already known to the requester).

@guillaumemichel guillaumemichel added the need/triage Needs initial labeling and prioritization label Mar 27, 2024
achingbrain added a commit that referenced this issue Apr 23, 2024
The `FIND_NODE` DHT operation should return the closest peers the
node knows to the value.

It does not need to return itself in the list because the calling
peer already knows about it.

Fixes #2450
achingbrain added a commit that referenced this issue Apr 24, 2024
The `FIND_NODE` DHT operation should return the closest peers the
node knows to the value.

It does not need to return itself in the list because the calling
peer already knows about it.

Fixes #2450

---------

Co-authored-by: Chad Nehemiah <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
need/triage Needs initial labeling and prioritization
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant