Skip to content

Commit

Permalink
Merge branch 'master' into dependabot/go_modules/wasm-tests/webtransp…
Browse files Browse the repository at this point in the history
…ort-tests/echo-server/github.com/quic-go/quic-go-0.48.2
  • Loading branch information
jxs authored Dec 11, 2024
2 parents 6027340 + 276ce84 commit b581fca
Show file tree
Hide file tree
Showing 24 changed files with 131 additions and 40 deletions.
8 changes: 4 additions & 4 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ rust-version = "1.75.0"
[workspace.dependencies]
libp2p = { version = "0.54.2", path = "libp2p" }
libp2p-allow-block-list = { version = "0.4.2", path = "misc/allow-block-list" }
libp2p-autonat = { version = "0.13.1", path = "protocols/autonat" }
libp2p-autonat = { version = "0.13.2", path = "protocols/autonat" }
libp2p-connection-limits = { version = "0.4.1", path = "misc/connection-limits" }
libp2p-core = { version = "0.42.1", path = "core" }
libp2p-dcutr = { version = "0.12.1", path = "protocols/dcutr" }
Expand All @@ -83,7 +83,7 @@ libp2p-floodsub = { version = "0.45.0", path = "protocols/floodsub" }
libp2p-gossipsub = { version = "0.48.0", path = "protocols/gossipsub" }
libp2p-identify = { version = "0.46.0", path = "protocols/identify" }
libp2p-identity = { version = "0.2.10" }
libp2p-kad = { version = "0.47.0", path = "protocols/kad" }
libp2p-kad = { version = "0.47.1", path = "protocols/kad" }
libp2p-mdns = { version = "0.46.0", path = "protocols/mdns" }
libp2p-memory-connection-limits = { version = "0.3.1", path = "misc/memory-connection-limits" }
libp2p-metrics = { version = "0.15.0", path = "misc/metrics" }
Expand All @@ -95,8 +95,8 @@ libp2p-plaintext = { version = "0.42.0", path = "transports/plaintext" }
libp2p-pnet = { version = "0.25.0", path = "transports/pnet" }
libp2p-quic = { version = "0.11.2", path = "transports/quic" }
libp2p-relay = { version = "0.18.1", path = "protocols/relay" }
libp2p-rendezvous = { version = "0.15.0", path = "protocols/rendezvous" }
libp2p-request-response = { version = "0.27.1", path = "protocols/request-response" }
libp2p-rendezvous = { version = "0.15.1", path = "protocols/rendezvous" }
libp2p-request-response = { version = "0.28.0", path = "protocols/request-response" }
libp2p-server = { version = "0.12.8", path = "misc/server" }
libp2p-stream = { version = "0.2.0-alpha.1", path = "protocols/stream" }
libp2p-swarm = { version = "0.45.2", path = "swarm" }
Expand Down
3 changes: 3 additions & 0 deletions libp2p/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
- Deprecate `void` crate.
See [PR 5676](https://github.com/libp2p/rust-libp2p/pull/5676).

- Expose swarm builder phase errors.
See [PR 5726](https://github.com/libp2p/rust-libp2p/pull/5726).

## 0.54.1

- Update individual crates.
Expand Down
4 changes: 4 additions & 0 deletions libp2p/src/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ mod phase;
mod select_muxer;
mod select_security;

#[cfg(all(not(target_arch = "wasm32"), feature = "websocket"))]
pub use phase::WebsocketError;
pub use phase::{BehaviourError, TransportError};

/// Build a [`Swarm`](libp2p_swarm::Swarm) by combining an identity, a set of
/// [`Transport`](libp2p_core::Transport)s and a
/// [`NetworkBehaviour`](libp2p_swarm::NetworkBehaviour).
Expand Down
5 changes: 5 additions & 0 deletions libp2p/src/builder/phase.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@ use swarm::*;
use tcp::*;
use websocket::*;

pub use behaviour::BehaviourError;
pub use other_transport::TransportError;
#[cfg(all(not(target_arch = "wasm32"), feature = "websocket"))]
pub use websocket::WebsocketError;

use super::{
select_muxer::SelectMuxerUpgrade, select_security::SelectSecurityUpgrade, SwarmBuilder,
};
Expand Down
7 changes: 6 additions & 1 deletion libp2p/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -148,12 +148,17 @@ pub mod bandwidth;
#[cfg(doc)]
pub mod tutorials;

#[cfg(all(not(target_arch = "wasm32"), feature = "websocket"))]
pub use builder::WebsocketError as WebsocketBuilderError;
pub use libp2p_identity as identity;
pub use libp2p_identity::PeerId;
pub use libp2p_swarm::{Stream, StreamProtocol};

pub use self::{
builder::SwarmBuilder,
builder::{
BehaviourError as BehaviourBuilderError, SwarmBuilder,
TransportError as TransportBuilderError,
},
core::{
transport::TransportError,
upgrade::{InboundUpgrade, OutboundUpgrade},
Expand Down
4 changes: 4 additions & 0 deletions protocols/autonat/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 0.13.2

- Update to `libp2p-request-response` `v0.28.0`.

## 0.13.1

- Verify that an incoming AutoNAT dial comes from a connected peer. See [PR 5597](https://github.com/libp2p/rust-libp2p/pull/5597).
Expand Down
2 changes: 1 addition & 1 deletion protocols/autonat/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name = "libp2p-autonat"
edition = "2021"
rust-version = { workspace = true }
description = "NAT and firewall detection for libp2p"
version = "0.13.1"
version = "0.13.2"
authors = [
"David Craven <[email protected]>",
"Elena Frank <[email protected]>",
Expand Down
2 changes: 2 additions & 0 deletions protocols/autonat/src/v1/behaviour/as_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ impl HandleInnerEvent for AsClient<'_> {
request_id,
response,
},
..
} => {
tracing::debug!(?response, "Outbound dial-back request returned response");

Expand Down Expand Up @@ -154,6 +155,7 @@ impl HandleInnerEvent for AsClient<'_> {
peer,
error,
request_id,
..
} => {
tracing::debug!(
%peer,
Expand Down
2 changes: 2 additions & 0 deletions protocols/autonat/src/v1/behaviour/as_server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ impl HandleInnerEvent for AsServer<'_> {
request,
channel,
},
..
} => {
let probe_id = self.probe_id.next();
if !self.connected.contains_key(&peer) {
Expand Down Expand Up @@ -183,6 +184,7 @@ impl HandleInnerEvent for AsServer<'_> {
peer,
error,
request_id,
..
} => {
tracing::debug!(
%peer,
Expand Down
2 changes: 1 addition & 1 deletion protocols/gossipsub/src/behaviour.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2761,7 +2761,7 @@ where
| RpcOut::Prune(_)
| RpcOut::Subscribe(_)
| RpcOut::Unsubscribe(_) => {
unreachable!("Channel for highpriority contorl messages is unbounded and should always be open.")
unreachable!("Channel for highpriority control messages is unbounded and should always be open.")
}
}

Expand Down
5 changes: 5 additions & 0 deletions protocols/kad/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## 0.47.1

- Expose Distance private field U256 to public.
See [PR 5705](https://github.com/libp2p/rust-libp2p/pull/5705).

## 0.47.0

- Expose a kad query facility allowing specify num_results dynamicaly.
Expand Down
2 changes: 1 addition & 1 deletion protocols/kad/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name = "libp2p-kad"
edition = "2021"
rust-version = { workspace = true }
description = "Kademlia protocol for libp2p"
version = "0.47.0"
version = "0.47.1"
authors = ["Parity Technologies <[email protected]>"]
license = "MIT"
repository = "https://github.com/libp2p/rust-libp2p"
Expand Down
4 changes: 2 additions & 2 deletions protocols/kad/src/kbucket/key.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ use crate::record;

construct_uint! {
/// 256-bit unsigned integer.
pub(super) struct U256(4);
pub struct U256(4);
}

/// A `Key` in the DHT keyspace with preserved preimage.
Expand Down Expand Up @@ -193,7 +193,7 @@ impl AsRef<KeyBytes> for KeyBytes {

/// A distance between two keys in the DHT keyspace.
#[derive(Copy, Clone, PartialEq, Eq, Default, PartialOrd, Ord, Debug)]
pub struct Distance(pub(super) U256);
pub struct Distance(pub U256);

impl Distance {
/// Returns the integer part of the base 2 logarithm of the [`Distance`].
Expand Down
2 changes: 1 addition & 1 deletion protocols/kad/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ pub use behaviour::{
QueryResult, QueryStats, Quorum, RoutingUpdate, StoreInserts,
};
pub use kbucket::{
Distance as KBucketDistance, EntryView, KBucketRef, Key as KBucketKey, NodeStatus,
Distance as KBucketDistance, EntryView, KBucketRef, Key as KBucketKey, NodeStatus, U256,
};
use libp2p_swarm::StreamProtocol;
pub use protocol::{ConnectionType, KadPeer};
Expand Down
4 changes: 4 additions & 0 deletions protocols/rendezvous/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 0.15.1

- Update to `libp2p-request-response` `v0.28.0`.

## 0.15.0

<!-- Update to libp2p-swarm v0.45.0 -->
Expand Down
2 changes: 1 addition & 1 deletion protocols/rendezvous/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name = "libp2p-rendezvous"
edition = "2021"
rust-version = { workspace = true }
description = "Rendezvous protocol for libp2p"
version = "0.15.0"
version = "0.15.1"
authors = ["The COMIT guys <[email protected]>"]
license = "MIT"
repository = "https://github.com/libp2p/rust-libp2p"
Expand Down
3 changes: 3 additions & 0 deletions protocols/rendezvous/src/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@ impl NetworkBehaviour for Behaviour {
libp2p_request_response::Message::Request {
request, channel, ..
},
..
}) => {
if let Some((event, response)) =
handle_request(peer_id, request, &mut self.registrations)
Expand All @@ -202,6 +203,7 @@ impl NetworkBehaviour for Behaviour {
peer,
request_id,
error,
..
}) => {
tracing::warn!(
%peer,
Expand All @@ -217,6 +219,7 @@ impl NetworkBehaviour for Behaviour {
| ToSwarm::GenerateEvent(libp2p_request_response::Event::Message {
peer: _,
message: libp2p_request_response::Message::Response { .. },
..
})
| ToSwarm::GenerateEvent(libp2p_request_response::Event::OutboundFailure {
..
Expand Down
5 changes: 5 additions & 0 deletions protocols/request-response/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## 0.28.0

- Add connection id to the events emitted by a request-response `Behaviour`.
See [PR 5719](https://github.com/libp2p/rust-libp2p/pull/5719).

## 0.27.1

- Deprecate `void` crate.
Expand Down
2 changes: 1 addition & 1 deletion protocols/request-response/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name = "libp2p-request-response"
edition = "2021"
rust-version = { workspace = true }
description = "Generic Request/Response Protocols"
version = "0.27.1"
version = "0.28.0"
authors = ["Parity Technologies <[email protected]>"]
license = "MIT"
repository = "https://github.com/libp2p/rust-libp2p"
Expand Down
Loading

0 comments on commit b581fca

Please sign in to comment.