Skip to content

Commit 43e4d82

Browse files
lexnvactions-user
authored andcommitted
chore: Update litep2p to v0.8.2 (paritytech#6677)
This includes a critical fix for debug release versions of litep2p (which are running in Kusama as validators). While at it, have stopped the oncall pain of alerts around `incoming_connections_total`. We can rethink the metric expose of litep2p in Q1. ## [0.8.2] - 2024-11-27 This release ensures that the provided peer identity is verified at the crypto/noise protocol level, enhancing security and preventing potential misuses. The release also includes a fix that caused `TransportService` component to panic on debug builds. ### Fixed - req-resp: Fix panic on connection closed for substream open failure ([paritytech#291](paritytech/litep2p#291)) - crypto/noise: Verify crypto/noise signature payload ([paritytech#278](paritytech/litep2p#278)) ### Changed - transport_service/logs: Provide less details for trace logs ([paritytech#292](paritytech/litep2p#292)) ## Testing Done This has been extensively tested in Kusama on all validators, that are now running litep2p. Deployed PR: paritytech#6638 ### Litep2p Dashboards ![Screenshot 2024-11-26 at 19 19 41](https://github.com/user-attachments/assets/e00b2b2b-7e64-4d96-ab26-165e2b8d0dc9) ### Libp2p vs Litep2p CPU usage After deploying litep2p we have reduced CPU usage from around 300-400% to 200%, this is a significant boost in performance, freeing resources for other subcomponents to function more optimally. ![image(1)](https://github.com/user-attachments/assets/fa793df5-4d58-4601-963d-246e56dd2a26) cc @paritytech/sdk-node --------- Signed-off-by: Alexandru Vasile <[email protected]> Co-authored-by: GitHub Action <[email protected]>
1 parent 45dadbc commit 43e4d82

File tree

4 files changed

+24
-4
lines changed

4 files changed

+24
-4
lines changed

Cargo.lock

Lines changed: 2 additions & 2 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
@@ -848,7 +848,7 @@ linked-hash-map = { version = "0.5.4" }
848848
linked_hash_set = { version = "0.1.4" }
849849
linregress = { version = "0.5.1" }
850850
lite-json = { version = "0.2.0", default-features = false }
851-
litep2p = { version = "0.8.1", features = ["websocket"] }
851+
litep2p = { version = "0.8.2", features = ["websocket"] }
852852
log = { version = "0.4.22", default-features = false }
853853
macro_magic = { version = "0.5.1" }
854854
maplit = { version = "1.0.2" }

prdoc/pr_6677.prdoc

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
title: 'chore: Update litep2p to v0.8.2'
2+
doc:
3+
- audience: Node Dev
4+
description: |-
5+
This includes a critical fix for debug release versions of litep2p (which are running in Kusama as validators).
6+
7+
While at it, have stopped the oncall pain of alerts around `incoming_connections_total`. We can rethink the metric expose of litep2p in Q1.
8+
9+
crates:
10+
- name: sc-network
11+
bump: minor

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

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -986,7 +986,15 @@ impl<B: BlockT + 'static, H: ExHashT> NetworkBackend<B, H> for Litep2pNetworkBac
986986

987987
let direction = match endpoint {
988988
Endpoint::Dialer { .. } => "out",
989-
Endpoint::Listener { .. } => "in",
989+
Endpoint::Listener { .. } => {
990+
// Increment incoming connections counter.
991+
//
992+
// Note: For litep2p these are represented by established negotiated connections,
993+
// while for libp2p (legacy) these represent not-yet-negotiated connections.
994+
metrics.incoming_connections_total.inc();
995+
996+
"in"
997+
},
990998
};
991999
metrics.connections_opened_total.with_label_values(&[direction]).inc();
9921000

@@ -1058,6 +1066,7 @@ impl<B: BlockT + 'static, H: ExHashT> NetworkBackend<B, H> for Litep2pNetworkBac
10581066
NegotiationError::ParseError(_) => "parse-error",
10591067
NegotiationError::IoError(_) => "io-error",
10601068
NegotiationError::WebSocket(_) => "webscoket-error",
1069+
NegotiationError::BadSignature => "bad-signature",
10611070
}
10621071
};
10631072

0 commit comments

Comments
 (0)