Skip to content

Commit

Permalink
Merge branch 'master' into close_progress_shall_not_be_decided_by_las…
Browse files Browse the repository at this point in the history
…t_one
  • Loading branch information
mxinden authored Dec 1, 2023
2 parents 06622b4 + c1925e5 commit 9d06173
Show file tree
Hide file tree
Showing 22 changed files with 223 additions and 208 deletions.
9 changes: 9 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,15 @@ jobs:
semver:
runs-on: ubuntu-latest
env:
# Unset the global `RUSTFLAGS` env to allow warnings.
# cargo-semver-checks intentionally re-locks dependency versions
# before checking, and we shouldn't fail here if a dep has a warning.
#
# More context:
# https://github.com/libp2p/rust-libp2p/pull/4932#issuecomment-1829014527
# https://github.com/obi1kenobi/cargo-semver-checks/issues/589
RUSTFLAGS: ''
steps:
- uses: actions/checkout@v4
- run: wget -q -O- https://github.com/obi1kenobi/cargo-semver-checks/releases/download/v0.25.0/cargo-semver-checks-x86_64-unknown-linux-gnu.tar.gz | tar -xz -C ~/.cargo/bin
Expand Down
36 changes: 23 additions & 13 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 @@ -97,7 +97,7 @@ libp2p-pnet = { version = "0.24.0", path = "transports/pnet" }
libp2p-quic = { version = "0.10.1", path = "transports/quic" }
libp2p-relay = { version = "0.17.1", path = "protocols/relay" }
libp2p-rendezvous = { version = "0.14.0", path = "protocols/rendezvous" }
libp2p-request-response = { version = "0.26.0", path = "protocols/request-response" }
libp2p-request-response = { version = "0.26.1", path = "protocols/request-response" }
libp2p-server = { version = "0.12.4", path = "misc/server" }
libp2p-swarm = { version = "0.44.0", path = "swarm" }
libp2p-swarm-derive = { version = "=0.34.0", path = "swarm-derive" } # `libp2p-swarm-derive` may not be compatible with different `libp2p-swarm` non-breaking releases. E.g. `libp2p-swarm` might introduce a new enum variant `FromSwarm` (which is `#[non-exhaustive]`) in a non-breaking release. Older versions of `libp2p-swarm-derive` would not forward this enum variant within the `NetworkBehaviour` hierarchy. Thus the version pinning is required.
Expand All @@ -106,9 +106,9 @@ libp2p-tcp = { version = "0.41.0", path = "transports/tcp" }
libp2p-tls = { version = "0.3.0", path = "transports/tls" }
libp2p-uds = { version = "0.40.0", path = "transports/uds" }
libp2p-upnp = { version = "0.2.0", path = "protocols/upnp" }
libp2p-webrtc = { version = "0.6.1-alpha", path = "transports/webrtc" }
libp2p-webrtc-utils = { version = "0.1.0", path = "misc/webrtc-utils" }
libp2p-webrtc-websys = { version = "0.2.0-alpha", path = "transports/webrtc-websys" }
libp2p-webrtc = { version = "0.7.0-alpha", path = "transports/webrtc" }
libp2p-webrtc-utils = { version = "0.2.0", path = "misc/webrtc-utils" }
libp2p-webrtc-websys = { version = "0.3.0-alpha", path = "transports/webrtc-websys" }
libp2p-websocket = { version = "0.43.0", path = "transports/websocket" }
libp2p-websocket-websys = { version = "0.3.1", path = "transports/websocket-websys" }
libp2p-webtransport-websys = { version = "0.2.0", path = "transports/webtransport-websys" }
Expand Down
4 changes: 2 additions & 2 deletions examples/browser-webrtc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ tracing-subscriber = { version = "0.3", features = ["env-filter"] }

[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
axum = "0.6.19"
libp2p = { path = "../../libp2p", features = [ "ed25519", "macros", "ping", "wasm-bindgen", "tokio"] }
libp2p = { path = "../../libp2p", features = [ "ed25519", "macros", "ping", "tokio"] }
libp2p-webrtc = { workspace = true, features = ["tokio"] }
rust-embed = { version = "8.0.0", features = ["include-exclude", "interpolate-folder-path"] }
tokio = { version = "1.34", features = ["macros", "net", "rt", "signal"] }
Expand All @@ -37,9 +37,9 @@ mime_guess = "2.0.4"
js-sys = "0.3.66"
libp2p = { path = "../../libp2p", features = [ "ed25519", "macros", "ping", "wasm-bindgen"] }
libp2p-webrtc-websys = { workspace = true }
tracing-wasm = "0.2.1"
wasm-bindgen = "0.2.89"
wasm-bindgen-futures = "0.4.38"
wasm-logger = { version = "0.2.0" }
web-sys = { version = "0.3", features = ['Document', 'Element', 'HtmlElement', 'Node', 'Response', 'Window'] }

[lints]
Expand Down
2 changes: 1 addition & 1 deletion examples/browser-webrtc/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use web_sys::{Document, HtmlElement};

#[wasm_bindgen]
pub async fn run(libp2p_endpoint: String) -> Result<(), JsError> {
wasm_logger::init(wasm_logger::Config::default());
tracing_wasm::set_as_global_default();

let body = Body::from_current_window()?;
body.append_p("Let's ping the WebRTC Server!")?;
Expand Down
2 changes: 1 addition & 1 deletion identity/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name = "libp2p-identity"
version = "0.2.8"
edition = "2021"
description = "Data structures and algorithms for identifying peers in libp2p."
rust-version = { workspace = true }
rust-version = "1.73.0" # MUST NOT inherit from workspace because we don't want to publish breaking changes to `libp2p-identity`.
license = "MIT"
repository = "https://github.com/libp2p/rust-libp2p"
keywords = ["peer-to-peer", "libp2p", "networking", "cryptography"]
Expand Down
54 changes: 25 additions & 29 deletions libp2p/src/tutorials/ping.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
//! edition = "2021"
//!
//! [dependencies]
//! libp2p = { version = "0.52", features = ["tcp", "dns", "async-std", "noise", "yamux", "websocket", "ping", "macros"] }
//! libp2p = { version = "0.52", features = ["tcp", "tls", "dns", "async-std", "noise", "yamux", "websocket", "ping", "macros"] }
//! futures = "0.3.21"
//! async-std = { version = "1.12.0", features = ["attributes"] }
//! tracing-subscriber = { version = "0.3", features = ["env-filter"] }
Expand Down Expand Up @@ -95,7 +95,6 @@
//! trait.
//!
//! ```rust
//! use libp2p::{identity, PeerId};
//! use std::error::Error;
//! use tracing_subscriber::EnvFilter;
//!
Expand All @@ -106,9 +105,9 @@
//! let mut swarm = libp2p::SwarmBuilder::with_new_identity()
//! .with_async_std()
//! .with_tcp(
//! libp2p_tcp::Config::default(),
//! libp2p_tls::Config::new,
//! libp2p_yamux::Config::default,
//! libp2p::tcp::Config::default(),
//! libp2p::tls::Config::new,
//! libp2p::yamux::Config::default,
//! )?;
//!
//! Ok(())
Expand Down Expand Up @@ -138,8 +137,7 @@
//! With the above in mind, let's extend our example, creating a [`ping::Behaviour`](crate::ping::Behaviour) at the end:
//!
//! ```rust
//! use libp2p::swarm::NetworkBehaviour;
//! use libp2p::{identity, ping, PeerId};
//! use libp2p::ping;
//! use tracing_subscriber::EnvFilter;
//! use std::error::Error;
//!
Expand All @@ -150,9 +148,9 @@
//! let mut swarm = libp2p::SwarmBuilder::with_new_identity()
//! .with_async_std()
//! .with_tcp(
//! libp2p_tcp::Config::default(),
//! libp2p_tls::Config::new,
//! libp2p_yamux::Config::default,
//! libp2p::tcp::Config::default(),
//! libp2p::tls::Config::new,
//! libp2p::yamux::Config::default,
//! )?
//! .with_behaviour(|_| ping::Behaviour::default())?;
//!
Expand All @@ -168,8 +166,7 @@
//! to the [`Transport`] as well as events from the [`Transport`] to the [`NetworkBehaviour`].
//!
//! ```rust
//! use libp2p::swarm::NetworkBehaviour;
//! use libp2p::{identity, ping, PeerId};
//! use libp2p::ping;
//! use std::error::Error;
//! use tracing_subscriber::EnvFilter;
//!
Expand All @@ -180,9 +177,9 @@
//! let mut swarm = libp2p::SwarmBuilder::with_new_identity()
//! .with_async_std()
//! .with_tcp(
//! libp2p_tcp::Config::default(),
//! libp2p_tls::Config::new,
//! libp2p_yamux::Config::default,
//! libp2p::tcp::Config::default(),
//! libp2p::tls::Config::new,
//! libp2p::yamux::Config::default,
//! )?
//! .with_behaviour(|_| ping::Behaviour::default())?
//! .build();
Expand All @@ -202,8 +199,7 @@
//! Thus, without any other behaviour in place, we would not be able to observe the pings.
//!
//! ```rust
//! use libp2p::swarm::NetworkBehaviour;
//! use libp2p::{identity, ping, PeerId};
//! use libp2p::ping;
//! use std::error::Error;
//! use std::time::Duration;
//! use tracing_subscriber::EnvFilter;
Expand All @@ -215,9 +211,9 @@
//! let mut swarm = libp2p::SwarmBuilder::with_new_identity()
//! .with_async_std()
//! .with_tcp(
//! libp2p_tcp::Config::default(),
//! libp2p_tls::Config::new,
//! libp2p_yamux::Config::default,
//! libp2p::tcp::Config::default(),
//! libp2p::tls::Config::new,
//! libp2p::yamux::Config::default,
//! )?
//! .with_behaviour(|_| ping::Behaviour::default())?
//! .with_swarm_config(|cfg| cfg.with_idle_connection_timeout(Duration::from_secs(30))) // Allows us to observe pings for 30 seconds.
Expand Down Expand Up @@ -254,7 +250,7 @@
//! remote peer.
//!
//! ```rust
//! use libp2p::{identity, ping, Multiaddr, PeerId};
//! use libp2p::{ping, Multiaddr};
//! use std::error::Error;
//! use std::time::Duration;
//! use tracing_subscriber::EnvFilter;
Expand All @@ -266,9 +262,9 @@
//! let mut swarm = libp2p::SwarmBuilder::with_new_identity()
//! .with_async_std()
//! .with_tcp(
//! libp2p_tcp::Config::default(),
//! libp2p_tls::Config::new,
//! libp2p_yamux::Config::default,
//! libp2p::tcp::Config::default(),
//! libp2p::tls::Config::new,
//! libp2p::yamux::Config::default,
//! )?
//! .with_behaviour(|_| ping::Behaviour::default())?
//! .with_swarm_config(|cfg| cfg.with_idle_connection_timeout(Duration::from_secs(30))) // Allows us to observe pings for 30 seconds.
Expand Down Expand Up @@ -298,8 +294,8 @@
//!
//! ```no_run
//! use futures::prelude::*;
//! use libp2p::swarm::{NetworkBehaviour, SwarmEvent};
//! use libp2p::{identity, ping, Multiaddr, PeerId};
//! use libp2p::swarm::SwarmEvent;
//! use libp2p::{ping, Multiaddr};
//! use std::error::Error;
//! use std::time::Duration;
//! use tracing_subscriber::EnvFilter;
Expand All @@ -311,9 +307,9 @@
//! let mut swarm = libp2p::SwarmBuilder::with_new_identity()
//! .with_async_std()
//! .with_tcp(
//! libp2p_tcp::Config::default(),
//! libp2p_tls::Config::new,
//! libp2p_yamux::Config::default,
//! libp2p::tcp::Config::default(),
//! libp2p::tls::Config::new,
//! libp2p::yamux::Config::default,
//! )?
//! .with_behaviour(|_| ping::Behaviour::default())?
//! .with_swarm_config(|cfg| cfg.with_idle_connection_timeout(Duration::from_secs(30))) // Allows us to observe pings for 30 seconds.
Expand Down
Loading

0 comments on commit 9d06173

Please sign in to comment.