-
Notifications
You must be signed in to change notification settings - Fork 296
Kad clarification #692
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
Open
Ben-PH
wants to merge
2
commits into
libp2p:master
Choose a base branch
from
Ben-PH:kad-clarification
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Kad clarification #692
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
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 hidden or 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
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
|
|
@@ -368,10 +368,17 @@ the wire format and keep their routing table up-to-date, especially with peers | |||||||
| closest to themselves. | ||||||||
|
|
||||||||
| The process runs once on startup, then periodically with a configurable | ||||||||
| frequency (default: 10 minutes). On every run, we generate a random peer ID for | ||||||||
| every non-empty routing table's k-bucket and we look it up via the process | ||||||||
| defined in [peer routing](#peer-routing). Peers encountered throughout the | ||||||||
| search are inserted in the routing table, as per usual business. | ||||||||
| frequency (default: 10 minutes): | ||||||||
|
|
||||||||
| ``` | ||||||||
| if routing table is not empty: | ||||||||
| for each k-bucket in the routing table: | ||||||||
| create a $PEER_ID for said k-bucket using an RNG | ||||||||
| do the normal <findNode($PEER_ID)> | ||||||||
| ``` | ||||||||
| The idea here, is that peers encountered throughout the find-node process | ||||||||
| as defined in [peer routing](#peer-routing), are inserted into the routing table, | ||||||||
| as per usual business. | ||||||||
|
|
||||||||
| In addition, to improve awareness of nodes close to oneself, implementations | ||||||||
| should include a lookup for their own peer ID. | ||||||||
|
|
@@ -497,8 +504,7 @@ These are the requirements for each `MessageType`: | |||||||
|
|
||||||||
| * `PUT_VALUE`: In the request `record` is set to the record to be stored and `key` | ||||||||
| on `Message` is set to equal `key` of the `Record`. The target node validates | ||||||||
| `record`, and if it is valid, it stores it in the datastore and as a response | ||||||||
| echoes the request. | ||||||||
| `record`, and if it is [valid, it then selects](#entry-validation) the value to be stored, and stores it in the datastore. As a response, the request is echoed, with the `record` updated if the selection makes a change. | ||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||
|
|
||||||||
| * `GET_PROVIDERS`: In the request `key` is set to a CID. The target node | ||||||||
| returns the closest known `providerPeers` (if any) and the `k` closest known | ||||||||
|
|
||||||||
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.
I find the current text clearer and more concise.