Skip to content

Commit 4c72494

Browse files
authored
chore(deps): fallback to git repos due to RUSTSEC-2025-0009 (#42)
* chore(deps): fallback to git repos due to RUSTSEC-2025-0009 Waiting for a new tagged release for both libp2p and libp2p-identity * fix: changes from libp2p git repos
1 parent 2756b57 commit 4c72494

File tree

8 files changed

+655
-418
lines changed

8 files changed

+655
-418
lines changed

Cargo.lock

+637-401
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+2-6
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ bitcoin = { version = "0.32.5", features = [ # keep in sync with secp256k1
1212
] }
1313
futures = "0.3.31"
1414
hex = "0.4.3"
15-
libp2p = { version = "0.54.1", features = [
15+
# FIXME: tag a new release to solve RUSTSEC-2025-0009
16+
libp2p = { git = "https://github.com/libp2p/rust-libp2p.git", rev = "b685b63dc6b98355d75234ff83a935ffa23d8eac", features = [
1617
"noise",
1718
"gossipsub",
1819
"tcp",
@@ -24,11 +25,6 @@ libp2p = { version = "0.54.1", features = [
2425
"yamux",
2526
"identify",
2627
] }
27-
libp2p-identity = { version = "0.2.10", default-features = false, features = [
28-
"secp256k1",
29-
"peerid",
30-
"rand",
31-
] }
3228
musig2 = { version = "0.1.0", features = ["serde"] }
3329
prost = "0.13.4"
3430
secp256k1 = { version = "0.29.0", features = [ # keep in sync with bitcoin

crates/db/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ serde_json = "1.0.135"
2727
threadpool.workspace = true
2828
tokio = { workspace = true, features = ["sync"] }
2929

30-
libp2p-identity = { workspace = true, features = ["serde"] }
30+
libp2p = { workspace = true, features = ["serde"] }
3131

3232
[dev-dependencies]
3333
secp256k1 = { workspace = true, features = ["rand"] }

crates/db/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
use async_trait::async_trait;
66
use bitcoin::{hashes::sha256, Txid, XOnlyPublicKey};
7-
use libp2p_identity::PeerId;
7+
use libp2p::identity::PeerId;
88
use musig2::{PartialSignature, PubNonce};
99
use serde::{de::DeserializeOwned, Deserialize, Serialize};
1010
use strata_p2p_types::{P2POperatorPubKey, Scope, SessionId, StakeChainId, WotsPublicKeys};

crates/p2p/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ rust.unused_must_use = "deny"
1111
rust.rust_2018_idioms = { level = "deny", priority = -1 }
1212

1313
[dependencies]
14-
libp2p = { version = "0.54.1", features = [
14+
libp2p = { workspace = true, features = [
1515
"noise",
1616
"gossipsub",
1717
"tcp",

crates/p2p/src/swarm/mod.rs

+11-6
Original file line numberDiff line numberDiff line change
@@ -329,19 +329,20 @@ impl<DB: RepositoryExt> P2P<DB> {
329329

330330
let event = Event::from(msg);
331331

332-
let _ = self
332+
let propagation_result = self
333333
.swarm
334334
.behaviour_mut()
335335
.gossipsub
336336
.report_message_validation_result(
337337
&message_id,
338338
&propagation_source,
339339
MessageAcceptance::Accept,
340-
)
341-
.inspect_err(
342-
|err| error!(%err, ?event, "failed to propagate accepted message further"),
343340
);
344341

342+
if !propagation_result {
343+
error!(?event, "failed to propagate accepted message further");
344+
}
345+
345346
// Do not broadcast new event to "handles" if it's not new.
346347
if !new_event {
347348
return Ok(());
@@ -531,25 +532,29 @@ impl<DB: RepositoryExt> P2P<DB> {
531532
event: RequestResponseEvent<GetMessageRequest, GetMessageResponse>,
532533
) -> P2PResult<()> {
533534
match event {
534-
RequestResponseEvent::Message { peer, message } => {
535+
RequestResponseEvent::Message { peer, message, .. } => {
535536
debug!(%peer, ?message, "Received message");
536537
self.handle_message_event(peer, message).await?
537538
}
538539
RequestResponseEvent::OutboundFailure {
539540
peer,
540541
request_id,
541542
error,
543+
..
542544
} => {
543545
error!(%peer, %error, %request_id, "Outbound failure")
544546
}
545547
RequestResponseEvent::InboundFailure {
546548
peer,
547549
request_id,
548550
error,
551+
..
549552
} => {
550553
error!(%peer, %error, %request_id, "Inbound failure")
551554
}
552-
RequestResponseEvent::ResponseSent { peer, request_id } => {
555+
RequestResponseEvent::ResponseSent {
556+
peer, request_id, ..
557+
} => {
553558
debug!(%peer, %request_id, "Response sent")
554559
}
555560
}

crates/types/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ rust.rust_2018_idioms = { level = "deny", priority = -1 }
1717
[dependencies]
1818
bitcoin.workspace = true
1919
hex = { workspace = true, features = ["serde"] }
20-
libp2p-identity.workspace = true
20+
libp2p.workspace = true
2121
proptest = { version = "1.6.0", optional = true }
2222
proptest-derive = { version = "0.5.1", optional = true }
2323
serde.workspace = true

crates/types/src/operator.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
use std::fmt;
55

66
use hex::ToHex;
7-
use libp2p_identity::secp256k1::PublicKey;
7+
use libp2p::identity::secp256k1::PublicKey;
88

99
/// P2P [`P2POperatorPubKey`] serves as an identifier of protocol entity.
1010
///

0 commit comments

Comments
 (0)