From 5c11ad81bc9df1af1eb3a7fab8c701b413740c3c Mon Sep 17 00:00:00 2001 From: DenzelPenzel Date: Fri, 2 Oct 2026 11:42:47 +0100 Subject: [PATCH 1/3] Bump litep2p to 0.16.0 litep2p 0.16.0 adds the client-server mode for Kademlia and fixes the panics around local provider records in the Kademlia memory store. Since 0.16 peers found in query responses arrive as `KademliaEvent::PeersDiscovered`, while `RoutingTableUpdate` only carries the responder. The litep2p backend keeps reporting the discovered peers through `DiscoveryEvent::RoutingTableUpdate`, so the peerstore and the `Event::PeerRoutingTableUpdate` consumers see the same peers as on 0.15.3. --- Cargo.lock | 24 +++++++++---------- Cargo.toml | 2 +- .../client/network/src/litep2p/discovery.rs | 7 ++++++ 3 files changed, 20 insertions(+), 13 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 746a0c817d8d..86e05df5af52 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -6909,7 +6909,7 @@ dependencies = [ "impl-serde", "primitive-types 0.13.1", "scale-info", - "uint 0.10.0", + "uint 0.10.2", ] [[package]] @@ -9322,7 +9322,7 @@ checksum = "803d15461ab0dcc56706adf266158acbc44ccf719bf7d0af30705f58b90a4b8c" dependencies = [ "integer-sqrt", "num-traits", - "uint 0.10.0", + "uint 0.10.2", ] [[package]] @@ -10907,7 +10907,7 @@ dependencies = [ "tokio-tungstenite 0.27.0", "tokio-util", "tracing", - "uint 0.10.0", + "uint 0.10.2", "unsigned-varint 0.8.0", "url", "x25519-dalek", @@ -10919,9 +10919,9 @@ dependencies = [ [[package]] name = "litep2p" -version = "0.15.3" +version = "0.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75a2c94e6b822a70bf38263b39c26ce3bffbdd78795d7da8de134d1f0cb3f7ea" +checksum = "9395e843af557d592cbde1a17f4070b2cbaa2fe4e518cdcb29c3a36dbfb7bd9b" dependencies = [ "async-trait", "bs58", @@ -10961,7 +10961,7 @@ dependencies = [ "tokio-tungstenite 0.27.0", "tokio-util", "tracing", - "uint 0.10.0", + "uint 0.10.2", "unsigned-varint 0.8.0", "url", "x25519-dalek", @@ -19025,7 +19025,7 @@ dependencies = [ "impl-rlp", "impl-serde", "scale-info", - "uint 0.10.0", + "uint 0.10.2", ] [[package]] @@ -22005,7 +22005,7 @@ dependencies = [ "ip_network", "libp2p", "linked_hash_set", - "litep2p 0.15.3", + "litep2p 0.16.0", "log", "mockall", "multistream-select", @@ -22107,7 +22107,7 @@ dependencies = [ "bytes", "cid", "futures", - "litep2p 0.15.3", + "litep2p 0.16.0", "log", "proptest", "rand 0.8.5", @@ -22327,7 +22327,7 @@ dependencies = [ "ed25519-dalek", "libp2p-identity", "libp2p-kad", - "litep2p 0.15.3", + "litep2p 0.16.0", "log", "multiaddr", "multihash", @@ -29298,9 +29298,9 @@ dependencies = [ [[package]] name = "uint" -version = "0.10.0" +version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "909988d098b2f738727b161a106cfc7cab00c539c2687a8836f8e565976fb53e" +checksum = "2833f28e3adbd1b867292ee4053252ea89ab85e44e5e4701ffead8cada0539fa" dependencies = [ "byteorder", "crunchy", diff --git a/Cargo.toml b/Cargo.toml index 7641a539ed2a..df1fac37cae2 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -934,7 +934,7 @@ linked-hash-map = { version = "0.5.4" } linked_hash_set = { version = "0.1.4" } linregress = { version = "0.5.1" } lite-json = { version = "0.2.0", default-features = false } -litep2p = { version = "0.15.3", features = ["rsa", "webrtc", "websocket"] } +litep2p = { version = "0.16.0", features = ["rsa", "webrtc", "websocket"] } log = { version = "0.4.22", default-features = false } macro_magic = { version = "0.5.1" } maplit = { version = "1.0.2" } diff --git a/substrate/client/network/src/litep2p/discovery.rs b/substrate/client/network/src/litep2p/discovery.rs index 7c4f0c957c76..1165cd05c4b3 100644 --- a/substrate/client/network/src/litep2p/discovery.rs +++ b/substrate/client/network/src/litep2p/discovery.rs @@ -650,6 +650,13 @@ impl Stream for Discovery { peers: peers.into_iter().collect(), })); }, + Poll::Ready(Some(KademliaEvent::PeersDiscovered { peers })) => { + log::trace!(target: LOG_TARGET, "discovered {} peers", peers.len()); + + return Poll::Ready(Some(DiscoveryEvent::RoutingTableUpdate { + peers: peers.into_iter().collect(), + })); + }, Poll::Ready(Some(KademliaEvent::GetRecordSuccess { query_id })) => { log::trace!( target: LOG_TARGET, From 64cf4fd3f010c16d25d1f6df3bcfcf77dd77dc76 Mon Sep 17 00:00:00 2001 From: DenzelPenzel Date: Fri, 2 Oct 2026 11:44:03 +0100 Subject: [PATCH 2/3] Add prdoc --- prdoc/pr_13398.prdoc | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 prdoc/pr_13398.prdoc diff --git a/prdoc/pr_13398.prdoc b/prdoc/pr_13398.prdoc new file mode 100644 index 000000000000..f8e233fb4577 --- /dev/null +++ b/prdoc/pr_13398.prdoc @@ -0,0 +1,10 @@ +title: Bump litep2p to 0.16.0 +doc: +- audience: Node Dev + description: |- + Bump litep2p to 0.16.0 (Kademlia client-server mode, local provider record fixes). + The litep2p backend handles the new `KademliaEvent::PeersDiscovered` by reporting + the peers through `Event::PeerRoutingTableUpdate` as before. +crates: +- name: sc-network + bump: patch From 9ab3222a6d1581695cc9c8229c729e0c28dc80f8 Mon Sep 17 00:00:00 2001 From: DenzelPenzel Date: Tue, 6 Oct 2026 12:49:39 +0100 Subject: [PATCH 3/3] Update prdoc: semver bumps and provider record fix --- prdoc/pr_13398.prdoc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/prdoc/pr_13398.prdoc b/prdoc/pr_13398.prdoc index f8e233fb4577..9d4f16017171 100644 --- a/prdoc/pr_13398.prdoc +++ b/prdoc/pr_13398.prdoc @@ -2,9 +2,14 @@ title: Bump litep2p to 0.16.0 doc: - audience: Node Dev description: |- - Bump litep2p to 0.16.0 (Kademlia client-server mode, local provider record fixes). + Bump litep2p to 0.16.0, which adds the Kademlia client-server mode and fixes + the panics around local provider records in the Kademlia memory store. The litep2p backend handles the new `KademliaEvent::PeersDiscovered` by reporting the peers through `Event::PeerRoutingTableUpdate` as before. crates: - name: sc-network + bump: major +- name: sc-network-types + bump: major +- name: sc-network-bitswap bump: patch