Skip to content

Commit 8ea3a30

Browse files
committed
Merge branch 'master' of github.com:libp2p/rust-libp2p into add-rusttoml
2 parents c64cab6 + 930118e commit 8ea3a30

File tree

43 files changed

+196
-141
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+196
-141
lines changed

Cargo.lock

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

Cargo.toml

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,6 @@ resolver = "2"
7272
rust-version = "1.75.0"
7373

7474
[workspace.dependencies]
75-
asynchronous-codec = { version = "0.7.0" }
76-
futures-bounded = { version = "0.2.4" }
77-
futures-rustls = { version = "0.26.0", default-features = false }
7875
libp2p = { version = "0.54.2", path = "libp2p" }
7976
libp2p-allow-block-list = { version = "0.4.2", path = "misc/allow-block-list" }
8077
libp2p-autonat = { version = "0.13.1", path = "protocols/autonat" }
@@ -91,7 +88,7 @@ libp2p-mdns = { version = "0.46.0", path = "protocols/mdns" }
9188
libp2p-memory-connection-limits = { version = "0.3.1", path = "misc/memory-connection-limits" }
9289
libp2p-metrics = { version = "0.15.0", path = "misc/metrics" }
9390
libp2p-mplex = { version = "0.42.0", path = "muxers/mplex" }
94-
libp2p-noise = { version = "0.45.0", path = "transports/noise" }
91+
libp2p-noise = { version = "0.45.1", path = "transports/noise" }
9592
libp2p-perf = { version = "0.4.0", path = "protocols/perf" }
9693
libp2p-ping = { version = "0.45.1", path = "protocols/ping" }
9794
libp2p-plaintext = { version = "0.42.0", path = "transports/plaintext" }
@@ -114,23 +111,29 @@ libp2p-webrtc-utils = { version = "0.3.0", path = "misc/webrtc-utils" }
114111
libp2p-webrtc-websys = { version = "0.4.0-alpha.2", path = "transports/webrtc-websys" }
115112
libp2p-websocket = { version = "0.44.1", path = "transports/websocket" }
116113
libp2p-websocket-websys = { version = "0.4.1", path = "transports/websocket-websys" }
117-
libp2p-webtransport-websys = { version = "0.4.0", path = "transports/webtransport-websys" }
114+
libp2p-webtransport-websys = { version = "0.4.1", path = "transports/webtransport-websys" }
118115
libp2p-yamux = { version = "0.46.0", path = "muxers/yamux" }
116+
117+
# External dependencies
118+
asynchronous-codec = { version = "0.7.0" }
119+
futures = "0.3.30"
120+
futures-bounded = { version = "0.2.4" }
121+
futures-rustls = { version = "0.26.0", default-features = false }
119122
multiaddr = "0.18.1"
120123
multihash = "0.19.1"
121124
multistream-select = { version = "0.13.0", path = "misc/multistream-select" }
122125
prometheus-client = "0.22.2"
123126
quick-protobuf-codec = { version = "0.3.1", path = "misc/quick-protobuf-codec" }
124127
quickcheck = { package = "quickcheck-ext", path = "misc/quickcheck-ext" }
128+
rcgen = "0.11.3"
129+
ring = "0.17.8"
125130
rw-stream-sink = { version = "0.4.0", path = "misc/rw-stream-sink" }
126-
unsigned-varint = { version = "0.8.0" }
131+
thiserror = "2"
127132
tokio = { version = "1.38", default-features = false }
128133
tracing = "0.1.37"
129134
tracing-subscriber = "0.3"
130-
futures = "0.3.30"
135+
unsigned-varint = { version = "0.8.0" }
131136
web-time = "1.1.0"
132-
ring = "0.17.8"
133-
rcgen = "0.11.3"
134137

135138
[patch.crates-io]
136139

core/CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
- Update `Transport::dial` function signature with a `DialOpts` param and remove `Transport::dial_as_listener`:
99
- `DialOpts` struct contains `PortUse` and `Endpoint`,
10-
- `PortUse` allows controling port allocation of new connections (defaults to `PortUse::Reuse`) -
10+
- `PortUse` allows controlling port allocation of new connections (defaults to `PortUse::Reuse`) -
1111
- Add `port_use` field to `ConnectedPoint`
1212
- Set `endpoint` field in `DialOpts` to `Endpoint::Listener` to dial as a listener
1313
- Remove `Transport::address_translation` and relocate functionality to `libp2p_swarm`

core/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ rand = "0.8"
2828
rw-stream-sink = { workspace = true }
2929
serde = { version = "1", optional = true, features = ["derive"] }
3030
smallvec = "1.13.2"
31-
thiserror = "1.0"
31+
thiserror = { workspace = true }
3232
tracing = { workspace = true }
3333
unsigned-varint = { workspace = true }
3434

identity/CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
## 0.2.8
1212

13-
- Bump `ring` to `0.17.5.
13+
- Bump `ring` to `0.17.5`.
1414
See [PR 4779](https://github.com/libp2p/rust-libp2p/pull/4779).
1515

1616
## 0.2.7

identity/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ rand = { version = "0.8", optional = true }
2525
sec1 = { version = "0.7", default-features = false, optional = true }
2626
serde = { version = "1", optional = true, features = ["derive"] }
2727
sha2 = { version = "0.10.8", optional = true }
28-
thiserror = { version = "1.0", optional = true }
28+
thiserror = { workspace = true, optional = true }
2929
zeroize = { version = "1.8", optional = true }
3030

3131
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]

libp2p/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ libp2p-webtransport-websys = { workspace = true, optional = true }
122122
libp2p-yamux = { workspace = true, optional = true }
123123
multiaddr = { workspace = true }
124124
pin-project = "1.0.0"
125-
thiserror = "1.0"
125+
thiserror = { workspace = true }
126126

127127
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
128128
libp2p-dns = { workspace = true, optional = true }

misc/quick-protobuf-codec/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ categories = ["asynchronous"]
1313
[dependencies]
1414
asynchronous-codec = { workspace = true }
1515
bytes = { version = "1" }
16-
thiserror = "1.0"
16+
thiserror = { workspace = true }
1717
unsigned-varint = { workspace = true, features = ["std"] }
1818
quick-protobuf = "0.8"
1919

misc/webrtc-utils/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ quick-protobuf-codec = { workspace = true }
2323
rand = "0.8"
2424
serde = { version = "1.0", features = ["derive"] }
2525
sha2 = "0.10.8"
26-
thiserror = "1"
26+
thiserror = { workspace = true }
2727
tinytemplate = "1.2"
2828
tracing = { workspace = true }
2929

muxers/yamux/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ categories = ["network-programming", "asynchronous"]
1414
either = "1"
1515
futures = { workspace = true }
1616
libp2p-core = { workspace = true }
17-
thiserror = "1.0"
17+
thiserror = { workspace = true }
1818
yamux012 = { version = "0.12.1", package = "yamux" }
1919
yamux013 = { version = "0.13.3", package = "yamux" }
2020
tracing = { workspace = true }

protocols/autonat/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ tracing = { workspace = true }
3333
quick-protobuf-codec = { workspace = true }
3434
rand = "0.8"
3535
rand_core = { version = "0.6", optional = true }
36-
thiserror = { version = "1.0.52", optional = true }
36+
thiserror = { workspace = true, optional = true }
3737

3838
[dev-dependencies]
3939
tokio = { workspace = true, features = ["macros", "rt", "sync"] }

protocols/dcutr/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ libp2p-swarm = { workspace = true }
2121
libp2p-identity = { workspace = true }
2222
quick-protobuf = "0.8"
2323
quick-protobuf-codec = { workspace = true }
24-
thiserror = "1.0"
24+
thiserror = { workspace = true }
2525
tracing = { workspace = true }
2626
lru = "0.12.3"
2727
futures-bounded = { workspace = true }

protocols/floodsub/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ quick-protobuf = "0.8"
2323
quick-protobuf-codec = { workspace = true }
2424
rand = "0.8"
2525
smallvec = "1.13.2"
26-
thiserror = "1.0.61"
26+
thiserror = { workspace = true }
2727
tracing = { workspace = true }
2828

2929
# Passing arguments to the docsrs builder in order to properly document cfg's.

protocols/gossipsub/CHANGELOG.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,31 @@
11
## 0.48.0
22

3+
- Correct state inconsistencies with the mesh and fanout when unsubscribing.
4+
See [PR 5690](https://github.com/libp2p/rust-libp2p/pull/5690)
5+
36
- Deprecate `futures-ticker` and use `futures-timer` instead.
47
See [PR 5674](https://github.com/libp2p/rust-libp2p/pull/5674).
8+
59
- Apply `max_transmit_size` to the inner message instead of the final payload.
610
See [PR 5642](https://github.com/libp2p/rust-libp2p/pull/5642).
711

812
- Deprecate `void` crate.
913
See [PR 5676](https://github.com/libp2p/rust-libp2p/pull/5676).
1014

11-
## 0.47.1
12-
1315
- Attempt to publish to at least mesh_n peers when flood publish is disabled.
1416
See [PR 5578](https://github.com/libp2p/rust-libp2p/pull/5578).
1517

1618
- Introduce back pressure and penalize slow peers. Drop stale messages that timeout before being
1719
delivered.
1820
See [PR 5595](https://github.com/libp2p/rust-libp2p/pull/5595).
21+
1922
- Change `Behaviour::unsubscribe` and `Behaviour::report_message_validation_result`
2023
to `bool` they don't need to be a `Result`.
2124
See [PR 5595](https://github.com/libp2p/rust-libp2p/pull/5595).
2225

26+
- Fix `cargo clippy` warnings in `rustc 1.84.0-beta.1`.
27+
See [PR 5700](https://github.com/libp2p/rust-libp2p/pull/5700).
28+
2329
## 0.47.0
2430

2531
<!-- Update to libp2p-swarm v0.45.0 -->

protocols/gossipsub/src/backoff.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ impl BackoffStorage {
128128
pub(crate) fn is_backoff_with_slack(&self, topic: &TopicHash, peer: &PeerId) -> bool {
129129
self.backoffs
130130
.get(topic)
131-
.map_or(false, |m| m.contains_key(peer))
131+
.is_some_and(|m| m.contains_key(peer))
132132
}
133133

134134
pub(crate) fn get_backoff_time(&self, topic: &TopicHash, peer: &PeerId) -> Option<Instant> {

protocols/gossipsub/src/behaviour.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1682,7 +1682,7 @@ where
16821682
let self_published = !self.config.allow_self_origin()
16831683
&& if let Some(own_id) = self.publish_config.get_own_id() {
16841684
own_id != propagation_source
1685-
&& raw_message.source.as_ref().map_or(false, |s| s == own_id)
1685+
&& raw_message.source.as_ref().is_some_and(|s| s == own_id)
16861686
} else {
16871687
self.published_message_ids.contains(msg_id)
16881688
};
@@ -1955,8 +1955,11 @@ where
19551955
}
19561956
}
19571957

1958-
// remove unsubscribed peers from the mesh if it exists
1958+
// remove unsubscribed peers from the mesh and fanout if they exist there.
19591959
for (peer_id, topic_hash) in unsubscribed_peers {
1960+
self.fanout
1961+
.get_mut(&topic_hash)
1962+
.map(|peers| peers.remove(&peer_id));
19601963
self.remove_peer_from_mesh(&peer_id, &topic_hash, None, false, Churn::Unsub);
19611964
}
19621965

protocols/identify/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ lru = "0.12.3"
2222
quick-protobuf-codec = { workspace = true }
2323
quick-protobuf = "0.8"
2424
smallvec = "1.13.2"
25-
thiserror = "1.0"
25+
thiserror = { workspace = true }
2626
tracing = { workspace = true }
2727
either = "1.12.0"
2828

protocols/kad/CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
See [PR 5573](https://github.com/libp2p/rust-libp2p/pull/5573).
77
- Add `Behavior::find_closest_local_peers()`.
88
See [PR 5645](https://github.com/libp2p/rust-libp2p/pull/5645).
9+
- Fix `cargo clippy` warnings in `rustc 1.84.0-beta.1`.
10+
See [PR 5700](https://github.com/libp2p/rust-libp2p/pull/5700).
911

1012
## 0.46.2
1113

protocols/kad/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ uint = "0.9"
3030
futures-timer = "3.0.3"
3131
web-time = { workspace = true }
3232
serde = { version = "1.0", optional = true, features = ["derive"] }
33-
thiserror = "1"
33+
thiserror = { workspace = true }
3434
tracing = { workspace = true }
3535

3636
[dev-dependencies]

protocols/kad/src/jobs.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ impl PutRecordJob {
205205
T: RecordStore,
206206
{
207207
if self.inner.check_ready(cx, now) {
208-
let publish = self.next_publish.map_or(false, |t_pub| now >= t_pub);
208+
let publish = self.next_publish.is_some_and(|t_pub| now >= t_pub);
209209
let records = store
210210
.records()
211211
.filter_map(|r| {

protocols/kad/src/kbucket.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -527,12 +527,12 @@ where
527527

528528
/// Returns true if the bucket has a pending node.
529529
pub fn has_pending(&self) -> bool {
530-
self.bucket.pending().map_or(false, |n| !n.is_ready())
530+
self.bucket.pending().is_some_and(|n| !n.is_ready())
531531
}
532532

533533
/// Tests whether the given distance falls into this bucket.
534534
pub fn contains(&self, d: &Distance) -> bool {
535-
BucketIndex::new(d).map_or(false, |i| i == self.index)
535+
BucketIndex::new(d).is_some_and(|i| i == self.index)
536536
}
537537

538538
/// Generates a random distance that falls into this bucket.

protocols/kad/src/kbucket/bucket.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,7 @@ where
376376
// Adjust `first_connected_pos` accordingly.
377377
match status {
378378
NodeStatus::Connected => {
379-
if self.first_connected_pos.map_or(false, |p| p == pos.0)
379+
if self.first_connected_pos.is_some_and(|p| p == pos.0)
380380
&& pos.0 == self.nodes.len()
381381
{
382382
// It was the last connected node.
@@ -397,7 +397,7 @@ where
397397

398398
/// Returns the status of the node at the given position.
399399
pub(crate) fn status(&self, pos: Position) -> NodeStatus {
400-
if self.first_connected_pos.map_or(false, |i| pos.0 >= i) {
400+
if self.first_connected_pos.is_some_and(|i| pos.0 >= i) {
401401
NodeStatus::Connected
402402
} else {
403403
NodeStatus::Disconnected

protocols/kad/src/record.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ impl Record {
104104

105105
/// Checks whether the record is expired w.r.t. the given `Instant`.
106106
pub fn is_expired(&self, now: Instant) -> bool {
107-
self.expires.map_or(false, |t| now >= t)
107+
self.expires.is_some_and(|t| now >= t)
108108
}
109109
}
110110

@@ -157,7 +157,7 @@ impl ProviderRecord {
157157

158158
/// Checks whether the provider record is expired w.r.t. the given `Instant`.
159159
pub fn is_expired(&self, now: Instant) -> bool {
160-
self.expires.map_or(false, |t| now >= t)
160+
self.expires.is_some_and(|t| now >= t)
161161
}
162162
}
163163

protocols/perf/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ libp2p-tls = { workspace = true }
2828
libp2p-yamux = { workspace = true }
2929
serde = { version = "1.0", features = ["derive"] }
3030
serde_json = "1.0"
31-
thiserror = "1.0"
31+
thiserror = { workspace = true }
3232
tracing = { workspace = true }
3333
tracing-subscriber = { workspace = true, features = ["env-filter"] }
3434
tokio = { workspace = true, features = ["macros", "rt", "rt-multi-thread"] }

protocols/relay/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ quick-protobuf = "0.8"
2525
quick-protobuf-codec = { workspace = true }
2626
rand = "0.8.4"
2727
static_assertions = "1"
28-
thiserror = "1.0"
28+
thiserror = { workspace = true }
2929
tracing = { workspace = true }
3030

3131
[dev-dependencies]

protocols/rendezvous/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ libp2p-request-response = { workspace = true }
2424
quick-protobuf = "0.8"
2525
quick-protobuf-codec = { workspace = true }
2626
rand = "0.8"
27-
thiserror = "1"
27+
thiserror = { workspace = true }
2828
tracing = { workspace = true }
2929

3030
[dev-dependencies]

swarm/CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55

66
- Deprecate `void` crate.
77
See [PR 5676](https://github.com/libp2p/rust-libp2p/pull/5676).
8+
9+
- Fix `cargo clippy` warnings in `rustc 1.84.0-beta.1`.
10+
See [PR 5700](https://github.com/libp2p/rust-libp2p/pull/5700).
811

912
## 0.45.1
1013

swarm/src/connection/pool.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ struct PendingConnection {
208208

209209
impl PendingConnection {
210210
fn is_for_same_remote_as(&self, other: PeerId) -> bool {
211-
self.peer_id.map_or(false, |peer| peer == other)
211+
self.peer_id == Some(other)
212212
}
213213

214214
/// Aborts the connection attempt, closing the connection.

transports/noise/CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
## 0.45.1
2+
3+
- Fix `cargo clippy` warnings in `rustc 1.84.0-beta.1`.
4+
See [PR 5700](https://github.com/libp2p/rust-libp2p/pull/5700).
5+
16
## 0.45.0
27

38
<!-- Update to libp2p-swarm v0.45.0 -->

transports/noise/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name = "libp2p-noise"
33
edition = "2021"
44
rust-version = { workspace = true }
55
description = "Cryptographic handshake protocol using the noise framework."
6-
version = "0.45.0"
6+
version = "0.45.1"
77
authors = ["Parity Technologies <[email protected]>"]
88
license = "MIT"
99
repository = "https://github.com/libp2p/rust-libp2p"
@@ -22,7 +22,7 @@ quick-protobuf = "0.8"
2222
rand = "0.8.3"
2323
sha2 = "0.10.8"
2424
static_assertions = "1"
25-
thiserror = "1.0.61"
25+
thiserror = { workspace = true }
2626
tracing = { workspace = true }
2727
x25519-dalek = "2"
2828
zeroize = "1"

transports/noise/src/io/handshake.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ where
108108
.id_remote_pubkey
109109
.ok_or_else(|| Error::AuthenticationFailed)?;
110110

111-
let is_valid_signature = self.dh_remote_pubkey_sig.as_ref().map_or(false, |s| {
111+
let is_valid_signature = self.dh_remote_pubkey_sig.as_ref().is_some_and(|s| {
112112
id_pk.verify(&[STATIC_KEY_DOMAIN.as_bytes(), pubkey.as_ref()].concat(), s)
113113
});
114114

transports/quic/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ parking_lot = "0.12.3"
2121
quinn = { version = "0.11.2", default-features = false, features = ["rustls", "futures-io"] }
2222
rand = "0.8.5"
2323
rustls = { version = "0.23.9", default-features = false }
24-
thiserror = "1.0.61"
24+
thiserror = { workspace = true }
2525
tokio = { workspace = true, default-features = false, features = ["net", "rt", "time"], optional = true }
2626
tracing = { workspace = true }
2727
socket2 = "0.5.7"

0 commit comments

Comments
 (0)