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

feat(kad): add Behavior::find_closest_local_peers() #5645

Merged
merged 2 commits into from
Oct 24, 2024

Conversation

nazar-pc
Copy link
Contributor

Description

Fixes #5626

Notes & open questions

This is the nicest way I came up with, I decided to leave get_closest_local_peers as is since it does return all peers, not just replication_factor peers.

Looking at #2436 it is not clear if @folex really needed all peers returned or it just happened that way. I'm also happy to change proposed API to return all peers if that is preferred by others.

It is very unfortunate that &mut self is needed for this, I created #5644 that if resolved will allow to have &self instead.

Change checklist

  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • A changelog entry has been made in the appropriate crates

Copy link
Contributor

@guillaumemichel guillaumemichel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks @nazar-pc!

Copy link
Member

@jxs jxs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks Nazar!

Copy link
Member

@dariusc93 dariusc93 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@jxs jxs added the send-it label Oct 24, 2024
@mergify mergify bot merged commit 84c617f into libp2p:master Oct 24, 2024
68 of 69 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Ability to query Kademlia peers via behaviour API
4 participants