Skip to content

Commit f592a86

Browse files
committed
Merge branch 'sigp-gossipsub' of github.com:jxs/rust-libp2p into report-lowscore-peers
2 parents b8dd93b + ca16d77 commit f592a86

File tree

15 files changed

+101
-41
lines changed

15 files changed

+101
-41
lines changed

.github/mergify.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
merge_queue:
2+
max_parallel_checks: 1
3+
14
pull_request_rules:
25
- name: Ask to resolve conflict
36
conditions:

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: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ libp2p-floodsub = { version = "0.47.0", path = "protocols/floodsub" }
8585
libp2p-gossipsub = { version = "0.50.0", path = "protocols/gossipsub" }
8686
libp2p-identify = { version = "0.47.0", path = "protocols/identify" }
8787
libp2p-identity = { version = "0.2.12" }
88-
libp2p-kad = { version = "0.48.1", path = "protocols/kad" }
88+
libp2p-kad = { version = "0.49.0", path = "protocols/kad" }
8989
libp2p-mdns = { version = "0.48.0", path = "protocols/mdns" }
9090
libp2p-memory-connection-limits = { version = "0.5.0", path = "misc/memory-connection-limits" }
9191
libp2p-metrics = { version = "0.17.0", path = "misc/metrics" }
@@ -112,7 +112,7 @@ libp2p-upnp = { version = "0.5.0", path = "protocols/upnp" }
112112
libp2p-webrtc = { version = "0.9.0-alpha.1", path = "transports/webrtc" }
113113
libp2p-webrtc-utils = { version = "0.4.0", path = "misc/webrtc-utils" }
114114
libp2p-webrtc-websys = { version = "0.4.0", path = "transports/webrtc-websys" }
115-
libp2p-websocket = { version = "0.45.1", path = "transports/websocket" }
115+
libp2p-websocket = { version = "0.45.2", path = "transports/websocket" }
116116
libp2p-websocket-websys = { version = "0.5.0", path = "transports/websocket-websys" }
117117
libp2p-webtransport-websys = { version = "0.5.1", path = "transports/webtransport-websys" }
118118
libp2p-yamux = { version = "0.47.0", path = "muxers/yamux" }

examples/chat/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ release = false
1111
[dependencies]
1212
tokio = { workspace = true, features = ["full"] }
1313
futures = { workspace = true }
14-
libp2p = { path = "../../libp2p", features = [ "tokio", "gossipsub", "mdns", "noise", "macros", "tcp", "yamux", "quic"] }
14+
libp2p = { version = "0.56", features = ["tokio", "gossipsub", "mdns", "noise", "macros", "tcp", "yamux", "quic"] }
1515
tracing-subscriber = { workspace = true, features = ["env-filter"] }
1616

1717
[lints]

examples/ipfs-private/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ release = false
1212
tokio = { workspace = true, features = ["rt-multi-thread", "macros", "io-std"] }
1313
either = "1.12"
1414
futures = { workspace = true }
15-
libp2p = { path = "../../libp2p", features = [ "tokio", "gossipsub", "dns", "identify", "kad", "macros", "noise", "ping", "pnet", "tcp", "websocket", "yamux"] }
15+
libp2p = { version = "0.56", features = ["tokio", "gossipsub", "dns", "identify", "kad", "macros", "noise", "ping", "pnet", "tcp", "websocket", "yamux"] }
1616
tracing-subscriber = { workspace = true, features = ["env-filter"] }
1717

1818
[lints]

misc/metrics/src/kad.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,6 @@ struct GetRecordResult {
318318
#[derive(EncodeLabelValue, Hash, Clone, Eq, PartialEq, Debug)]
319319
enum GetRecordError {
320320
NotFound,
321-
QuorumFailed,
322321
Timeout,
323322
}
324323

@@ -328,9 +327,6 @@ impl From<&libp2p_kad::GetRecordError> for GetRecordResult {
328327
libp2p_kad::GetRecordError::NotFound { .. } => GetRecordResult {
329328
error: GetRecordError::NotFound,
330329
},
331-
libp2p_kad::GetRecordError::QuorumFailed { .. } => GetRecordResult {
332-
error: GetRecordError::QuorumFailed,
333-
},
334330
libp2p_kad::GetRecordError::Timeout { .. } => GetRecordResult {
335331
error: GetRecordError::Timeout,
336332
},

protocols/gossipsub/CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
## 0.50.0
22

3+
- Relax `Behaviour::with_metrics` requirements, do not require DataTransform and TopicSubscriptionFilter to also impl Default
4+
See [PR XXXX](https://github.com/libp2p/rust-libp2p/pull/6097)
5+
36
- Remove `Rpc` from the public API.
47
See [PR 6091](https://github.com/libp2p/rust-libp2p/pull/6091)
58

protocols/gossipsub/Cargo.toml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,23 +28,23 @@ getrandom = { workspace = true }
2828
hashlink = { workspace = true }
2929
hex_fmt = "0.3.0"
3030
web-time = { workspace = true }
31-
libp2p-core = { workspace = true }
32-
libp2p-identity = { workspace = true, features = ["rand"] }
33-
libp2p-swarm = { workspace = true }
31+
# Libp2p crates, updated to use crates.io versions so that we can use this gossipsub fork with
32+
# crates.io libp2p
33+
libp2p-core = "0.43"
34+
libp2p-identity = { version = "0.2", features = ["rand"] }
35+
libp2p-swarm = "0.47"
3436
quick-protobuf = "0.8"
35-
quick-protobuf-codec = { workspace = true }
37+
quick-protobuf-codec = "0.3.1"
3638
rand = "0.8"
3739
regex = "1.10.5"
3840
serde = { version = "1", optional = true, features = ["derive"] }
3941
sha2 = "0.10.8"
4042
tracing = { workspace = true }
4143

42-
# Metrics dependencies
43-
prometheus-client = { workspace = true, optional = true }
44+
prometheus-client = { version = "0.23", optional = true }
4445

4546
[dev-dependencies]
46-
libp2p-core = { workspace = true }
47-
libp2p-swarm-test = { path = "../../swarm-test" }
47+
libp2p-swarm-test = { version = "0.6.0", features = ["tokio"] }
4848
quickcheck = { workspace = true }
4949
tracing-subscriber = { workspace = true, features = ["env-filter"] }
5050
tokio = { workspace = true, features = ["rt", "rt-multi-thread", "time", "macros"] }

protocols/gossipsub/src/behaviour.rs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -362,18 +362,6 @@ where
362362
D::default(),
363363
)
364364
}
365-
366-
/// Allow the [`Behaviour`] to also record metrics.
367-
/// Metrics can be evaluated by passing a reference to a [`Registry`].
368-
#[cfg(feature = "metrics")]
369-
pub fn with_metrics(
370-
mut self,
371-
metrics_registry: &mut Registry,
372-
metrics_config: MetricsConfig,
373-
) -> Self {
374-
self.metrics = Some(Metrics::new(metrics_registry, metrics_config));
375-
self
376-
}
377365
}
378366

379367
impl<D, F> Behaviour<D, F>
@@ -471,6 +459,18 @@ where
471459
gossip_promises: Default::default(),
472460
})
473461
}
462+
463+
/// Allow the [`Behaviour`] to also record metrics.
464+
/// Metrics can be evaluated by passing a reference to a [`Registry`].
465+
#[cfg(feature = "metrics")]
466+
pub fn with_metrics(
467+
mut self,
468+
metrics_registry: &mut Registry,
469+
metrics_config: MetricsConfig,
470+
) -> Self {
471+
self.metrics = Some(Metrics::new(metrics_registry, metrics_config));
472+
self
473+
}
474474
}
475475

476476
impl<D, F> Behaviour<D, F>

protocols/kad/CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
## 0.49.0
2+
3+
- Remove no longer constructed GetRecordError::QuorumFailed.
4+
See [PR 6106](https://github.com/libp2p/rust-libp2p/pull/6106)
5+
16
## 0.48.1
27

38
- Implement `Copy` for `QueryStats` and `ProgressStep`

0 commit comments

Comments
 (0)