Skip to content

Commit 804c910

Browse files
lexnvdudo50
authored andcommitted
network/litep2p: Update litep2p network backend to version 0.8.1 (paritytech#6484)
This PR updates the litep2p backend to version 0.8.1 from 0.8.0. - Check the [litep2p updates forum post](https://forum.polkadot.network/t/litep2p-network-backend-updates/9973/3) for performance dashboards. - Check [litep2p release notes](paritytech/litep2p#288) The v0.8.1 release includes key fixes that enhance the stability and performance of the litep2p library. The focus is on long-running stability and improvements to polling mechanisms. ### Long Running Stability Improvements This issue caused long-running nodes to reject all incoming connections, impacting overall stability. Addressed a bug in the connection limits functionality that incorrectly tracked connections due for rejection. This issue caused an artificial increase in inbound peers, which were not being properly removed from the connection limit count. This fix ensures more accurate tracking and management of peer connections [paritytech#286](paritytech/litep2p#286). ### Polling implementation fixes This release provides multiple fixes to the polling mechanism, improving how connections and events are processed: - Resolved an overflow issue in TransportContext’s polling index for streams, preventing potential crashes ([paritytech#283](paritytech/litep2p#283)). - Fixed a delay in the manager’s poll_next function that prevented immediate polling of newly added futures ([paritytech#287](paritytech/litep2p#287)). - Corrected an issue where the listener did not return Poll::Ready(None) when it was closed, ensuring proper signal handling ([paritytech#285](paritytech/litep2p#285)). ### Fixed - manager: Fix connection limits tracking of rejected connections ([paritytech#286](paritytech/litep2p#286)) - transport: Fix waking up on filtered events from `poll_next` ([paritytech#287](paritytech/litep2p#287)) - transports: Fix missing Poll::Ready(None) event from listener ([paritytech#285](paritytech/litep2p#285)) - manager: Avoid overflow on stream implementation for `TransportContext` ([paritytech#283](paritytech/litep2p#283)) - manager: Log when polling returns Ready(None) ([paritytech#284](paritytech/litep2p#284)) ### Testing Done Started kusama nodes running side by side with a higher number of inbound and outbound connections (500). We previously tested with peers bounded at 50. This testing filtered out the fixes included in the latest release. With this high connection testing setup, litep2p outperforms libp2p in almost every domain, from performance to the warnings / errors encountered while operating the nodes. TLDR: this is the version we need to test on kusama validators next - Litep2p Repo | Count | Level | Triage report -|-|-|- polkadot-sdk | 409 | warn | Report .*: .* to .*. Reason: .*. Banned, disconnecting. ( Peer disconnected with inflight after backoffs. Banned, disconnecting. ) litep2p | 128 | warn | Refusing to add known address that corresponds to a different peer ID litep2p | 54 | warn | inbound identify substream opened for peer who doesn't exist polkadot-sdk | 7 | error | 💔 Called `on_validated_block_announce` with a bad peer ID .* polkadot-sdk | 1 | warn | ❌ Error while dialing .*: .* polkadot-sdk | 1 | warn | Report .*: .* to .*. Reason: .*. Banned, disconnecting. ( Invalid justification. Banned, disconnecting. ) - Libp2p Repo | Count | Level | Triage report -|-|-|- polkadot-sdk | 1023 | warn | 💔 Ignored block \(#.* -- .*\) announcement from .* because all validation slots are occupied. polkadot-sdk | 472 | warn | Report .*: .* to .*. Reason: .*. Banned, disconnecting. ( Unsupported protocol. Banned, disconnecting. ) polkadot-sdk | 379 | error | 💔 Called `on_validated_block_announce` with a bad peer ID .* polkadot-sdk | 163 | warn | Report .*: .* to .*. Reason: .*. Banned, disconnecting. ( Invalid justification. Banned, disconnecting. ) polkadot-sdk | 116 | warn | Report .*: .* to .*. Reason: .*. Banned, disconnecting. ( Peer disconnected with inflight after backoffs. Banned, disconnecting. ) polkadot-sdk | 83 | warn | Report .*: .* to .*. Reason: .*. Banned, disconnecting. ( Same block request multiple times. Banned, disconnecting. ) polkadot-sdk | 4 | warn | Re-finalized block #.* \(.*\) in the canonical chain, current best finalized is #.* polkadot-sdk | 2 | warn | Report .*: .* to .*. Reason: .*. Banned, disconnecting. ( Genesis mismatch. Banned, disconnecting. ) polkadot-sdk | 2 | warn | Report .*: .* to .*. Reason: .*. Banned, disconnecting. ( Not requested block data. Banned, disconnecting. ) polkadot-sdk | 2 | warn | Can't listen on .* because: .* polkadot-sdk | 1 | warn | ❌ Error while dialing .*: .* --------- Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
1 parent 1445bd5 commit 804c910

4 files changed

Lines changed: 22 additions & 6 deletions

File tree

Cargo.lock

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -855,7 +855,7 @@ linked-hash-map = { version = "0.5.4" }
855855
linked_hash_set = { version = "0.1.4" }
856856
linregress = { version = "0.5.1" }
857857
lite-json = { version = "0.2.0", default-features = false }
858-
litep2p = { version = "0.8.0", features = ["websocket"] }
858+
litep2p = { version = "0.8.1", features = ["websocket"] }
859859
log = { version = "0.4.22", default-features = false }
860860
macro_magic = { version = "0.5.1" }
861861
maplit = { version = "1.0.2" }

prdoc/pr_6484.prdoc

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
title: Update litep2p network backend to version 0.8.1
2+
3+
doc:
4+
- audience: [ Node Dev, Node Operator ]
5+
description: |
6+
Release 0.8.1 of litep2p includes critical fixes to further enhance the stability and performance of the litep2p network backend.
7+
8+
crates:
9+
- name: sc-network
10+
bump: patch

substrate/client/network/src/litep2p/mod.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1074,7 +1074,13 @@ impl<B: BlockT + 'static, H: ExHashT> NetworkBackend<B, H> for Litep2pNetworkBac
10741074
metrics.pending_connections_errors_total.with_label_values(&["transport-errors"]).inc();
10751075
}
10761076
}
1077-
_ => {}
1077+
None => {
1078+
log::error!(
1079+
target: LOG_TARGET,
1080+
"Litep2p backend terminated"
1081+
);
1082+
return
1083+
}
10781084
},
10791085
}
10801086
}

0 commit comments

Comments
 (0)