Skip to content

Upgrade litep2p v0.13.0 -> v0.13.2#11204

Merged
dmitry-markin merged 6 commits intomasterfrom
dm-upgrade-litep2p
Mar 2, 2026
Merged

Upgrade litep2p v0.13.0 -> v0.13.2#11204
dmitry-markin merged 6 commits intomasterfrom
dm-upgrade-litep2p

Conversation

@dmitry-markin
Copy link
Contributor

@dmitry-markin dmitry-markin commented Feb 27, 2026

This PR brings litep2p v0.13.1 to polkadot-sdk. The improvements include:

  1. When dialing remote peers, all addresses from the DHT are tried, starting from the public addresses. Before litep2p v0.13.1, only up to 8 addresses were tried, leading to dial failures when due to misconfiguration there was a lot of private addresses in the DHT.
  2. Protocols are now notified about connected peers before the library user, fixing failures in opening substreams when the user command arrived before the connection event.
  3. Ping protocol implementation now conforms to the spec. This improves the connection stability between polkadot-sdk and smoldot dramatically. Before this PR, smoldot always disconnected polkadot-sdk peers every 15 seconds for 5 seconds due to failed pings.

@dmitry-markin dmitry-markin self-assigned this Feb 27, 2026
@dmitry-markin dmitry-markin added the T0-node This PR/Issue is related to the topic “node”. label Feb 27, 2026
@dmitry-markin
Copy link
Contributor Author

/cmd prdoc --audience node_dev --bump patch

@bkchr
Copy link
Member

bkchr commented Feb 27, 2026

@dmitry-markin

2026-02-27T16:55:01.9867706Z     thread 'litep2p::discovery::tests::litep2p_discovery_works' (357577) panicked at /usr/local/cargo/registry/src/index.crates.io-1949cf8c6b5b557f/litep2p-0.13.1/src/protocol/libp2p/ping/mod.rs:164:9:
2026-02-27T16:55:01.9869270Z     assertion failed: _prev.is_none()
2026-02-27T16:55:01.9869822Z     stack backtrace:
2026-02-27T16:55:01.9870294Z        0: __rustc::rust_begin_unwind
2026-02-27T16:55:01.9870840Z        1: core::panicking::panic_fmt
2026-02-27T16:55:01.9871375Z        2: core::panicking::panic
2026-02-27T16:55:01.9872338Z        3: litep2p::protocol::libp2p::ping::Ping::on_outbound_substream
2026-02-27T16:55:01.9872978Z        4: litep2p::Litep2p::new::{{closure}}
2026-02-27T16:55:01.9873858Z        5: tokio::runtime::task::harness::Harness<T,S>::poll
2026-02-27T16:55:01.9874637Z        6: tokio::runtime::scheduler::current_thread::Context::run_task
2026-02-27T16:55:01.9875409Z        7: tokio::runtime::context::scoped::Scoped<T>::set
2026-02-27T16:55:01.9876503Z        8: tokio::runtime::scheduler::current_thread::CurrentThread::block_on
2026-02-27T16:55:01.9877541Z        9: tokio::runtime::runtime::Runtime::block_on
2026-02-27T16:55:01.9878456Z       10: sc_network::litep2p::discovery::tests::litep2p_discovery_works
2026-02-27T16:55:01.9879331Z       11: core::ops::function::FnOnce::call_once
2026-02-27T16:55:01.9880289Z     note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
2026-02-27T16:55:01.9881022Z 
2026-02-27T16:55:01.9882503Z     thread 'litep2p::discovery::tests::litep2p_discovery_works' (357577) panicked at substrate/client/network/src/litep2p/discovery.rs:934:41:
2026-02-27T16:55:01.9885111Z     called `Option::unwrap()` on a `None` value
2026-02-27T16:55:01.9914221Z     stack backtrace:
2026-02-27T16:55:01.9914951Z        0: __rustc::rust_begin_unwind
2026-02-27T16:55:01.9915531Z        1: core::panicking::panic_fmt
2026-02-27T16:55:01.9916118Z        2: core::panicking::panic
2026-02-27T16:55:01.9916715Z        3: core::option::unwrap_failed
2026-02-27T16:55:01.9917411Z        4: futures_util::stream::stream::StreamExt::poll_next_unpin
2026-02-27T16:55:01.9918253Z        5: <tokio::time::timeout::Timeout<T> as core::future::future::Future>::poll
2026-02-27T16:55:01.9919643Z        6: sc_network::litep2p::discovery::tests::litep2p_discovery_works::{{closure}}
2026-02-27T16:55:01.9920578Z        7: tokio::runtime::scheduler::current_thread::Context::enter
2026-02-27T16:55:01.9921369Z        8: tokio::runtime::context::scoped::Scoped<T>::set
2026-02-27T16:55:01.9922200Z        9: tokio::runtime::scheduler::current_thread::CurrentThread::block_on
2026-02-27T16:55:01.9923005Z       10: tokio::runtime::runtime::Runtime::block_on
2026-02-27T16:55:01.9923772Z       11: sc_network::litep2p::discovery::tests::litep2p_discovery_works
2026-02-27T16:55:01.9924536Z       12: core::ops::function::FnOnce::call_once
2026-02-27T16:55:01.9925432Z     note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

@dmitry-markin dmitry-markin changed the title Upgrade litep2p v0.13.0 -> v0.13.1 Upgrade litep2p v0.13.0 -> v0.13.2 Mar 2, 2026
@dmitry-markin dmitry-markin enabled auto-merge March 2, 2026 13:25
@dmitry-markin dmitry-markin added this pull request to the merge queue Mar 2, 2026
@lexnv lexnv added A4-backport-stable2506 Pull request must be backported to the stable2506 release branch A4-backport-stable2509 Pull request must be backported to the stable2509 release branch A4-backport-stable2512 Pull request must be backported to the stable2512 release branch labels Mar 2, 2026
Merged via the queue into master with commit a547337 Mar 2, 2026
230 of 242 checks passed
@dmitry-markin dmitry-markin deleted the dm-upgrade-litep2p branch March 2, 2026 15:00
@github-project-automation github-project-automation bot moved this to Blocked ⛔️ in Networking Mar 2, 2026
@paritytech-release-backport-bot

Created backport PR for stable2506:

Please cherry-pick the changes locally and resolve any conflicts.

git fetch origin backport-11204-to-stable2506
git worktree add --checkout .worktree/backport-11204-to-stable2506 backport-11204-to-stable2506
cd .worktree/backport-11204-to-stable2506
git reset --hard HEAD^
git cherry-pick -x a54733715b76fab04ef87926de4ce8746f63e8ef
git push --force-with-lease

@paritytech-release-backport-bot

Created backport PR for stable2509:

Please cherry-pick the changes locally and resolve any conflicts.

git fetch origin backport-11204-to-stable2509
git worktree add --checkout .worktree/backport-11204-to-stable2509 backport-11204-to-stable2509
cd .worktree/backport-11204-to-stable2509
git reset --hard HEAD^
git cherry-pick -x a54733715b76fab04ef87926de4ce8746f63e8ef
git push --force-with-lease

@paritytech-release-backport-bot

Created backport PR for stable2512:

Please cherry-pick the changes locally and resolve any conflicts.

git fetch origin backport-11204-to-stable2512
git worktree add --checkout .worktree/backport-11204-to-stable2512 backport-11204-to-stable2512
cd .worktree/backport-11204-to-stable2512
git reset --hard HEAD^
git cherry-pick -x a54733715b76fab04ef87926de4ce8746f63e8ef
git push --force-with-lease

dmitry-markin added a commit that referenced this pull request Mar 3, 2026
Backport #11204 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>
@dmitry-markin dmitry-markin added the A4-backport-stable2603 Pull request must be backported to the stable2603 release branch label Mar 4, 2026
@paritytech-release-backport-bot

Created backport PR for stable2506:

Please cherry-pick the changes locally and resolve any conflicts.

git fetch origin backport-11204-to-stable2506
git worktree add --checkout .worktree/backport-11204-to-stable2506 backport-11204-to-stable2506
cd .worktree/backport-11204-to-stable2506
git reset --hard HEAD^
git cherry-pick -x a54733715b76fab04ef87926de4ce8746f63e8ef
git push --force-with-lease

@paritytech-release-backport-bot

Created backport PR for stable2509:

Please cherry-pick the changes locally and resolve any conflicts.

git fetch origin backport-11204-to-stable2509
git worktree add --checkout .worktree/backport-11204-to-stable2509 backport-11204-to-stable2509
cd .worktree/backport-11204-to-stable2509
git reset --hard HEAD^
git cherry-pick -x a54733715b76fab04ef87926de4ce8746f63e8ef
git push --force-with-lease

@paritytech-release-backport-bot

Created backport PR for stable2512:

Please cherry-pick the changes locally and resolve any conflicts.

git fetch origin backport-11204-to-stable2512
git worktree add --checkout .worktree/backport-11204-to-stable2512 backport-11204-to-stable2512
cd .worktree/backport-11204-to-stable2512
git reset --hard HEAD^
git cherry-pick -x a54733715b76fab04ef87926de4ce8746f63e8ef
git push --force-with-lease

@paritytech-release-backport-bot

Created backport PR for stable2603:

Please cherry-pick the changes locally and resolve any conflicts.

git fetch origin backport-11204-to-stable2603
git worktree add --checkout .worktree/backport-11204-to-stable2603 backport-11204-to-stable2603
cd .worktree/backport-11204-to-stable2603
git reset --hard HEAD^
git cherry-pick -x a54733715b76fab04ef87926de4ce8746f63e8ef
git push --force-with-lease

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

Labels

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

Projects

Status: Blocked ⛔️

Development

Successfully merging this pull request may close these issues.

3 participants