Skip to content

Upgrade litep2p to v0.12.0 and handle Kademlia publish success events#9685

Merged
dmitry-markin merged 17 commits into
masterfrom
dm-upgrade-litep2p
Nov 19, 2025
Merged

Upgrade litep2p to v0.12.0 and handle Kademlia publish success events#9685
dmitry-markin merged 17 commits into
masterfrom
dm-upgrade-litep2p

Conversation

@dmitry-markin
Copy link
Copy Markdown
Contributor

@dmitry-markin dmitry-markin commented Sep 9, 2025

litep2p v0.12.0 adds ability to track whether publishing a DHT record or provider was successful. This PR brings this functionality to substrate. Particularly, this fixes authority-discovery unnecessarily republishing DHT records due to litep2p not emitting KademliaEvent::PutRecordSuccess before v0.12.0.

@dmitry-markin dmitry-markin added the T0-node This PR/Issue is related to the topic “node”. label Sep 9, 2025
@dmitry-markin dmitry-markin marked this pull request as ready for review September 17, 2025 13:36
@dmitry-markin dmitry-markin deleted the dm-upgrade-litep2p branch October 20, 2025 12:21
@dmitry-markin dmitry-markin restored the dm-upgrade-litep2p branch October 20, 2025 12:25
@dmitry-markin dmitry-markin reopened this Oct 23, 2025
@dmitry-markin dmitry-markin changed the title [DNM] Upgrade litep2p Upgrade litep2p to v0.12.0 Nov 11, 2025
@dmitry-markin
Copy link
Copy Markdown
Contributor Author

/cmd prdoc --bump major --audience node_dev

@dmitry-markin dmitry-markin requested review from a team and lexnv November 11, 2025 14:11
Copy link
Copy Markdown
Contributor

@lexnv lexnv left a comment

Choose a reason for hiding this comment

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

LGTM!

@dmitry-markin dmitry-markin requested a review from a team November 18, 2025 15:06
Copy link
Copy Markdown
Contributor

@lrubasze lrubasze left a comment

Choose a reason for hiding this comment

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

Change looks good with some minor comment.
Also not sure about PR title - the change is not about bumping the version only.

/// Start providing `key`.
pub async fn start_providing(&mut self, key: KademliaKey) {
self.kademlia_handle.start_providing(key.into()).await;
pub async fn start_providing(&mut self, key: KademliaKey) -> QueryId {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

We add here the return value.
Are there other places in the codebase which could be impacted with this?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Nope, the only place this is called is in litep2p/mod.rs where we store the return value.

@lrubasze Thanks for the review!

@dmitry-markin dmitry-markin changed the title Upgrade litep2p to v0.12.0 Upgrade litep2p to v0.12.0 and handle Kademlia publish success events Nov 18, 2025
@dmitry-markin dmitry-markin added this pull request to the merge queue Nov 19, 2025
Merged via the queue into master with commit d38ac65 Nov 19, 2025
268 of 272 checks passed
@dmitry-markin dmitry-markin deleted the dm-upgrade-litep2p branch November 19, 2025 14:41
@bkontur bkontur added the A4-backport-stable2512 Pull request must be backported to the stable2512 release branch label Nov 20, 2025
paritytech-release-backport-bot Bot pushed a commit that referenced this pull request Nov 20, 2025
…#9685)

litep2p v0.12.0 adds ability to track whether publishing a DHT record or
provider was successful. This PR brings this functionality to substrate.
Particularly, this fixes authority-discovery unnecessarily republishing
DHT records due to litep2p not emitting
`KademliaEvent::PutRecordSuccess` before v0.12.0.

---------

Co-authored-by: cmd[bot] <41898282+github-actions[bot]@users.noreply.github.com>
(cherry picked from commit d38ac65)
@paritytech-release-backport-bot
Copy link
Copy Markdown

Successfully created backport PR for stable2512:

EgorPopelyaev added a commit that referenced this pull request Nov 20, 2025
Backport #9685 into `stable2512` from dmitry-markin.

See the
[documentation](https://github.com/paritytech/polkadot-sdk/blob/master/docs/BACKPORT.md)
on how to use this bot.

<!--
  # To be used by other automation, do not modify:
  original-pr-number: #${pull_number}
-->

---------

Co-authored-by: Dmitry Markin <dmitry@markin.tech>
Co-authored-by: cmd[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: EgorPopelyaev <egor@parity.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A4-backport-stable2512 Pull request must be backported to the stable2512 release branch T0-node This PR/Issue is related to the topic “node”.

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

5 participants