-
Notifications
You must be signed in to change notification settings - Fork 26
kademlia: Workaround for dealing with not implemented PUT_VALUE ACKs
#430
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
Merged
Conversation
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
PUT_VALUE ACKs implementationPUT_VALUE ACKs
This was referenced Sep 5, 2025
lexnv
reviewed
Sep 17, 2025
src/protocol/libp2p/kademlia/mod.rs
Outdated
| let query_id = match action { | ||
| // `SendFindNode` includes `FIND_NODE`, `GET_VALUE` and `GET_PROVIDERS` | ||
| // queries. | ||
| PeerAction::SendFindNode(query_id) |
Collaborator
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.
nit: Maybe we could add the fn query_id() in the PeerAction?
lexnv
reviewed
Sep 17, 2025
lexnv
reviewed
Sep 17, 2025
lexnv
approved these changes
Sep 22, 2025
Collaborator
lexnv
left a comment
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.
LGTM!
dmitry-markin
added a commit
that referenced
this pull request
Nov 11, 2025
Track success of `ADD_PROVIDER` queries and emit `AddProviderSuccess` & `QueryFailed` events. This PR adds tracking of the last stage of `ADD_PROVIDER` query: putting provider records to the target peers. Because libp2p spec doesn't have `ADD_PROVIDER` ACK messages, we track only that the requests were sent out to the target peers without errors. `Quorum` is respected when determining whether the query was successful or not. Builds upon #430.
dmitry-markin
added a commit
that referenced
this pull request
Nov 11, 2025
## [0.12.0] - 2025-11-11 This release adds `KademliaEvent::PutRecordSuccess` & `KademliaEvent::AddProviderSuccess` events to Kademlia, allowing to track whether publishing a record or a provider was successfull. While `PutRecordSuccess` was present in the previous versions of litep2p, it was actually never emitted. Note that `AddProviderSuccess` and `QueryFailed` are also generated during automatic provider refresh, so those may be emitted for `QueryId`s not known to the client code. ### Added - kademlia: Track success of `ADD_PROVIDER` queries ([#432](#432)) - kademlia: Workaround for dealing with not implemented `PUT_VALUE` ACKs ([#430](#430)) - kademlia: Track success of `PUT_VALUE` queries ([#427](#427)) ### Fixed - Identify: gracefully close substream after sending payload ([#466](#466)) - fix: transport context polling order ([#456](#456)) ### Changed - refactor: implement builder pattern for TransportManager ([#453](#453))
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Because previously litep2p didn't send/receive
PUT_VALUEACKs, we can't just enable this mechanism — this would lead to failures when older remote peers don't behave up to spec. This PR deals with this situation by implementing a workaround to handle such peers:PUT_VALUEsend successes instead of ACK responses to determine the query success.PUT_VALUEACK message.This should be seen as a temporary measure until most of the networks updates to litep2p with
PUT_VALUEACK support (this PR or newer). Suggested timing is in a year after releasing the version with this PR. This is tracked by issue #429.Builds upon #427.