Skip to content

net: Update litep2p to v0.14.0#12049

Merged
lexnv merged 17 commits into
masterfrom
lenxv/update-lp2p
May 22, 2026
Merged

net: Update litep2p to v0.14.0#12049
lexnv merged 17 commits into
masterfrom
lenxv/update-lp2p

Conversation

@lexnv

@lexnv lexnv commented May 11, 2026

Copy link
Copy Markdown
Contributor

This PR updates litep2p to the latest release.

  • multihash needs a new const generic
  • multihash erorr is opaque without public variants
  • litep2p re exports no longer have the Identity variant, which is handled via a local constant

Litep2pProtocol and Libp2pProtocol now are deduced to the same type, therefore the LiteP2pProtocol to/from Protocol is no longer needed. Small other changes revolve around the fact that Protocol::p2p now contains a peerID rather than a multihash.

Next Steps

  • local node testing

[0.14.0] - 2026-05-11

This release updates several core dependencies, aligns clippy rules with the latest Rust version, and enhances observability for notification protocols.

Notably, this version introduces a breaking change to error handling: the PeerId::from_bytes method now returns a specialized ParseError instead of a multihash::Error.

Changed

  • deps: upgrade multiaddr 0.18, multihash 0.19, libp2p 0.56 (#564)

Fixed

  • fix clippy errors and warnings (#565)

Added

  • notification: Expose protocol name through trace logs (#563)

lexnv added 6 commits May 11, 2026 14:30
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
same type

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
@lexnv lexnv self-assigned this May 11, 2026
@lexnv lexnv added the T0-node This PR/Issue is related to the topic “node”. label May 11, 2026
@socket-security

socket-security Bot commented May 11, 2026

Copy link
Copy Markdown

lexnv added 2 commits May 11, 2026 16:38
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
Comment thread substrate/client/network/src/bitswap/mod.rs Outdated
Comment thread substrate/client/network/types/src/multihash.rs Outdated
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
@lexnv

lexnv commented May 15, 2026

Copy link
Copy Markdown
Contributor Author

/cmd prdoc --audience node_dev --bump minor

Comment thread prdoc/pr_12049.prdoc Outdated
@paritytech-workflow-stopper

Copy link
Copy Markdown

All GitHub workflows were cancelled due to failure one of the required jobs.
Failed workflow url: https://github.com/paritytech/polkadot-sdk/actions/runs/25961865931
Failed job name: fmt

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

@sandreim sandreim left a comment

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.

Let's also do Kusama/Polkadot RC/system parachain burn-in and check metrics for sanity

Comment thread prdoc/pr_12049.prdoc Outdated
Comment thread prdoc/pr_12049.prdoc Outdated
Co-authored-by: Alexandru Vasile <60601340+lexnv@users.noreply.github.com>
@lexnv

lexnv commented May 22, 2026

Copy link
Copy Markdown
Contributor Author

The PR has been deployed on:

Kusama validators

1. Same block request banning

2026-05-22 11:26:27.000warn2026-05-22 08:26:26.979  WARN tokio-runtime-worker sub-libp2p::peerstore: Report 12D3KooWRssGJbgNCBk8zKF9ukbruXkQ3SNP9o9zws4CgiGvBkeV: -2147483648 to -2147483648. Reason: Same block request multiple times. Banned, disconnecting
  • This has been transiently observed from the sync engine for as long as I can remember
  • 40 incidents

2. Websocket failed to decode a smaller payload

2026-05-22 05:45:48.951error2026-05-22 02:45:48.950 ERROR tokio-runtime-worker litep2p::crypto::noise: failed to decrypt message ty=WebSocket peer=PeerId("12D3KooWRcuS3SXDGXkp2ywmxYGtc3ukpUqYtcXZCXwBfNJnd7pG") buf_len=12 frame_size=28 error=Decrypt
  • 9 occurrences, 5 different peers
  • Most likely, smoldot has abruptly terminated the connection or not flushed all data before closing (needs further investigation)
  • Unrelated to the changes

3. Seconding aborted due to duplicate collation

2026-05-22 06:01:07.737warn2026-05-22 03:01:07.697  WARN tokio-runtime-worker parachain::collator-protocol: Seconding aborted due to an error relay_parent=0xa6419034925f58de45926114d4c639dac2e868b3bcc0aa598dfb8e92511909a1 para_id=1005 peer_id=PeerId("12D3KooWHeWztAknbbXq9YQ6fdg8GrS77cqSJPwYuPA6kiPfLxu8") error=Received duplicate collation from the peer
  • 6 occurrences happening for para ID 1002 (1 time), 1005 (4 times), 1004 (1 time)

4. Force closing connections

2026-05-22 11:27:19.209warn2026-05-22 08:27:19.205  WARN tokio-runtime-worker litep2p::notification::handle: [Relaychain] notification channel clogged, force close connection peer=PeerId("12D3KooWJ9gppNAFSnGNUHWWrBqjMCnqKgLGm8yTDc1zv7Fqcu3j") protocol_name=Allocated("/91b171bb158e2d3848fa23a9f1c25182fb8e20313b2c1eb49219da7a70ce90c3/grandpa/1")
  • 12.4k times where peers are disconnected due to a bug in grandpa

5. Failed to get unfulfilled claim queue entries

2026-05-22 08:42:42.774error2026-05-22 05:42:42.774 ERROR tokio-runtime-worker parachain::collator-protocol: Failed to get unfulfilled claim queue entries relay_parent=0x784be636944a66507a8b0c483e9e8211b817a33494f6d7ab4e103056531adeb9 err=RelayParentStateNotFound
  • 1 time caused by missing parent state

6. IPFS inbound substream opened for peer that doesnt exist

2026-05-22 05:48:01.963warn2026-05-22 02:48:01.934  WARN tokio-runtime-worker litep2p::ipfs::identify: inbound identify substream opened for peer who doesn't exist peer=PeerId("12D3KooWMTmxBAibJXEny1gwa8vgrPkNsUyd12QzFaNnXjhgAxVZ") protocol=/ipfs/id/1.0.0
  • 1 time, most probably a race condition where the peer has disconnected from the networking layer before receiving an ACK for opening the substream
  • this is harmless from the networking perspective, connections are reported as closed above

7. Fetch POV timeout

2026-05-21 19:37:00.509warn2026-05-21 16:37:00.506  WARN tokio-runtime-worker parachain::availability-distribution: fetch_pov_job err=FetchPoV(NetworkError(Network(Timeout))) para_id=2090 pov_hash=0x22cf2608e897b03ec3a54157dfae9eb56139ce0ef25d8fd7f98fbd22d624b835 authority_id=Public(0051209e8bb529d72c8c0fc122f20dc063516b530656c533428ff183c612e233 (Cajcn56L...))
  • pov fetching timeoued

Polkadot YAP 3428

1. Called on_validated_block_announce on bad peer ID:

2026-05-22 07:54:06.667error2026-05-22 04:54:06.667 ERROR tokio-runtime-worker sync: [Relaychain] 💔 Called `on_validated_block_announce` with a bad peer ID 12D3KooWAdyiVAaeGdtBt6vn5zVetwA4z4qfm9Fi2QCSykN1wTBJ
  • This has been transiently observed from the sync engine for as long as I can remember
  • 1 incident over 24h

2. Same block request banning

2026-05-22 07:53:18.301warn2026-05-22 04:53:18.280  WARN tokio-runtime-worker sub-libp2p::peerstore: [Relaychain] Report 12D3KooWFSaJx3nk5Lyk9jTG73g4zqadcMhV24ZqkYJRpmfGUoLD: -2147483648 to -2147483648. Reason: Same block request multiple times. Banned, disconnecting. 
  • 8 incidents over 24 leading to decreased connection stability
  • This usually happens when: remote peer has submited a sync request that we couldn't fulfil, the peer tried again 2 more times. The downstream effect is that we are banning and disconnecting the peer.

3. Force closing connections

2026-05-22 11:27:19.209warn2026-05-22 08:27:19.205  WARN tokio-runtime-worker litep2p::notification::handle: [Relaychain] notification channel clogged, force close connection peer=PeerId("12D3KooWJ9gppNAFSnGNUHWWrBqjMCnqKgLGm8yTDc1zv7Fqcu3j") protocol_name=Allocated("/91b171bb158e2d3848fa23a9f1c25182fb8e20313b2c1eb49219da7a70ce90c3/grandpa/1")
  • This happend 2.76k times over 24h
  • Similar to above, we disconnect and ban peers for 5s 2.76k times, degrading low-latency expectations of protocols
  • The issue originates from Grandpa

Polkadot

  • spawned a fullnode in polkadot with warp sync
  • The node is producing blocks and is healthy
  • 3-4 entries per minute for the grandpa channel clogged

Summary

Connection instabilities are currently being triggered by force disconnects when Grandpa sends out more than 2k notifications. Effectivley, this cloggs the notifiaction channel and to prevent flooding peers that can't keep up, litep2p forces a disconnect.

This is quite significant, since we see 12.4k occurrences in kusama alone and 2.76k in polkadot-yap. These force disconnects can abruptly terminate connections between backing group and relay chain side parachain peers.

The PR only surfaces the issue that was silent before:

The issue is further tracked in:

@lexnv lexnv added this pull request to the merge queue May 22, 2026
Merged via the queue into master with commit 4efb368 May 22, 2026
304 of 306 checks passed
@lexnv lexnv deleted the lenxv/update-lp2p branch May 22, 2026 11:27
kayabaNerve added a commit to serai-dex/patch-polkadot-sdk that referenced this pull request May 23, 2026
This is a cherry-pick of 4efb36878825839d3a4da381ac95073d6f6300d8. It was
merged with paritytech/polkadot-sdk#12049, which did
note concerns as part of testing, yet most were marked unrelated. As we do not
currently use the `litep2p` backend, the main point is simply the upstream
adoption of the latest `multihash`, `multiaddr` (a patch I did not want to
write myself) and the deduplication accordingly.

`Code::digest` panics if the input doesn't fit within the resulting
`Multihash`. I'm not convinced that's sound but I defer to the upstream about
it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

T0-node This PR/Issue is related to the topic “node”.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants