Skip to content

Conversation

Ben-PH
Copy link

@Ben-PH Ben-PH commented Aug 15, 2025

There is some ambiguity of exactly what a kademlia PUT_VAL response should be, and when it responds. This PR aims to clarify that (#691 (@guillaumemichel )). I went by the issue comment, as opposed to implementation, as the specification, and thus the conversations that take part there, are the authoritative reference, and implementations that diverge are "out of spec" until their divergence is accepted upstream.

While at it, I thought it might be worthwhile to add some clarity to the suggested bootstrap algorithm.

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.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
`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.
`record`, and if it is valid and newer than any existing record for `key`, it
stores it in the datastore and responds by echoing back the request.

Comment on lines +371 to +381
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.
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Triage

Development

Successfully merging this pull request may close these issues.

2 participants