-
Notifications
You must be signed in to change notification settings - Fork 11
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: Refactor FindNode query, keep K best results and add tests #114
Merged
Merged
Changes from 1 commit
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
e1b6778
kad/find_node: Extract immutable components to FindNodeConfig
lexnv d850c52
kad/find_node: Refactor register_response
lexnv 0cadf30
kad/find_node: Refactor schedule_next_peer
lexnv 9bc1577
kad/find_node: Refactor next_action
lexnv 9ff2b6b
kad/find_node: Cache kad message
lexnv 70d20f8
find_node/tests: Check query completes on empty candidates
lexnv 4c956aa
find_node/tests: Check the parallelism is fulfilled
lexnv 8d776d9
find_node/tests: Check the query ends on the number of responses
lexnv e0ce49d
find_node/tests: Produce the closest responses without further
lexnv e81a304
find_node/tests: Continue the query on better candidates
lexnv 51ca1aa
find_node/tests: Ensure the query awaits for pending better responses
lexnv 587b92e
kad/find_node: Keep the best 20 responses and don't update last entry
lexnv e946c69
find_node/tests: Check we keep an window of the best peers, not just the
lexnv 19f8c6e
find_node: Replace entry with the new peer
lexnv File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the drawback of overwriting the entry with this distance? I.e., there should be exactly one peer with such distance as it uniquely identifies the hash, so it should be safe to overwrite without checking.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I followed the libp2p here. However, I believe we can overwrite the entries without checking here, and we'll have a "fresher" report in the end. Will do that, thanks!