Skip to content

Commit

Permalink
Merge branch 'master' into update-ci-stable
Browse files Browse the repository at this point in the history
  • Loading branch information
mergify[bot] authored Aug 22, 2024
2 parents ffe80f0 + 4dfc45b commit 688f768
Show file tree
Hide file tree
Showing 18 changed files with 176 additions and 138 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
## Main APIs

- [`libp2p-core` CHANGELOG](core/CHANGELOG.md)
- [`libp2p-identity` CHANGELOG](identity/CHANGELOG.md)
- [`libp2p-swarm` CHANGELOG](swarm/CHANGELOG.md)
- [`libp2p-swarm-derive` CHANGELOG](swarm-derive/CHANGELOG.md)

Expand All @@ -13,7 +14,6 @@
- [`libp2p-floodsub` CHANGELOG](protocols/floodsub/CHANGELOG.md)
- [`libp2p-gossipsub` CHANGELOG](protocols/gossipsub/CHANGELOG.md)
- [`libp2p-identify` CHANGELOG](protocols/identify/CHANGELOG.md)
- [`libp2p-identity` CHANGELOG](protocols/identity/CHANGELOG.md)
- [`libp2p-kad` CHANGELOG](protocols/kad/CHANGELOG.md)
- [`libp2p-mdns` CHANGELOG](protocols/mdns/CHANGELOG.md)
- [`libp2p-ping` CHANGELOG](protocols/ping/CHANGELOG.md)
Expand Down
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 @@ -75,7 +75,7 @@ rust-version = "1.75.0"
asynchronous-codec = { version = "0.7.0" }
futures-bounded = { version = "0.2.4" }
futures-rustls = { version = "0.26.0", default-features = false }
libp2p = { version = "0.54.0", path = "libp2p" }
libp2p = { version = "0.54.1", path = "libp2p" }
libp2p-allow-block-list = { version = "0.4.0", path = "misc/allow-block-list" }
libp2p-autonat = { version = "0.13.0", path = "protocols/autonat" }
libp2p-connection-limits = { version = "0.4.0", path = "misc/connection-limits" }
Expand All @@ -86,17 +86,17 @@ libp2p-floodsub = { version = "0.45.0", path = "protocols/floodsub" }
libp2p-gossipsub = { version = "0.47.0", path = "protocols/gossipsub" }
libp2p-identify = { version = "0.45.0", path = "protocols/identify" }
libp2p-identity = { version = "0.2.9" }
libp2p-kad = { version = "0.46.0", path = "protocols/kad" }
libp2p-kad = { version = "0.46.1", path = "protocols/kad" }
libp2p-mdns = { version = "0.46.0", path = "protocols/mdns" }
libp2p-memory-connection-limits = { version = "0.3.0", path = "misc/memory-connection-limits" }
libp2p-metrics = { version = "0.14.2", path = "misc/metrics" }
libp2p-metrics = { version = "0.15.0", path = "misc/metrics" }
libp2p-mplex = { version = "0.42.0", path = "muxers/mplex" }
libp2p-noise = { version = "0.45.0", path = "transports/noise" }
libp2p-perf = { version = "0.4.0", path = "protocols/perf" }
libp2p-ping = { version = "0.45.0", path = "protocols/ping" }
libp2p-plaintext = { version = "0.42.0", path = "transports/plaintext" }
libp2p-pnet = { version = "0.25.0", path = "transports/pnet" }
libp2p-quic = { version = "0.11.0", path = "transports/quic" }
libp2p-quic = { version = "0.11.1", path = "transports/quic" }
libp2p-relay = { version = "0.18.0", path = "protocols/relay" }
libp2p-rendezvous = { version = "0.15.0", path = "protocols/rendezvous" }
libp2p-request-response = { version = "0.27.0", path = "protocols/request-response" }
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,4 +102,4 @@ Conduct](https://github.com/ipfs/community/blob/master/code-of-conduct.md).
- [Substrate](https://github.com/paritytech/substrate) - Framework for blockchain innovation,
used by [Polkadot](https://www.parity.io/technologies/polkadot/).
- [Taple](https://github.com/opencanarias/taple-core) - Sustainable DLT for asset and process traceability by [OpenCanarias](https://www.opencanarias.com/en/).
- [Ceylon](https://github.com/ceylonai/ceylon) - A Multi-Agent System (MAS) Development Framwork.
- [Ceylon](https://github.com/ceylonai/ceylon) - A Multi-Agent System (MAS) Development Framework.
5 changes: 5 additions & 0 deletions funding.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"opRetro": {
"projectId": "0x966804cb492e1a4bde5d781a676a44a23d69aa5dd2562fa7a4f95bb606021c8b"
}
}
5 changes: 5 additions & 0 deletions libp2p/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## 0.54.1

- Update individual crates.
- Update to [`libp2p-metrics` `0.15.0`](misc/metrics/CHANGELOG.md#0150).

## 0.54.0

- Update individual crates.
Expand Down
2 changes: 1 addition & 1 deletion libp2p/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name = "libp2p"
edition = "2021"
rust-version = { workspace = true }
description = "Peer-to-peer networking library"
version = "0.54.0"
version = "0.54.1"
authors = ["Parity Technologies <admin@parity.io>"]
license = "MIT"
repository = "https://github.com/libp2p/rust-libp2p"
Expand Down
131 changes: 71 additions & 60 deletions libp2p/src/tutorials/ping.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
//! 3. Adding `libp2p` as well as `futures` as dependencies in the
//! `Cargo.toml` file. Current crate versions may be found at
//! [crates.io](https://crates.io/).
//! We will also include `async-std` with the
//! We will also include `tokio` with the
//! "attributes" feature to allow for an `async main`.
//! At the time of writing we have:
//!
Expand All @@ -55,9 +55,9 @@
//! edition = "2021"
//!
//! [dependencies]
//! 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"] }
//! libp2p = { version = "0.54", features = ["noise", "ping", "tcp", "tokio", "yamux"] }
//! futures = "0.3.30"
//! tokio = { version = "1.37.0", features = ["full"] }
//! tracing-subscriber = { version = "0.3", features = ["env-filter"] }
//! ```
//!
Expand All @@ -74,9 +74,11 @@
//! use std::error::Error;
//! use tracing_subscriber::EnvFilter;
//!
//! #[async_std::main]
//! #[tokio::main]
//! async fn main() -> Result<(), Box<dyn Error>> {
//! tracing_subscriber::fmt().with_env_filter(EnvFilter::from_default_env()).init();
//! let _ = tracing_subscriber::fmt()
//! .with_env_filter(EnvFilter::from_default_env())
//! .try_init();
//!
//! let mut swarm = libp2p::SwarmBuilder::with_new_identity();
//!
Expand All @@ -89,25 +91,28 @@
//! ## Transport
//!
//! Next up we need to construct a transport. Each transport in libp2p provides encrypted streams.
//! E.g. combining TCP to establish connections, TLS to encrypt these connections and Yamux to run
//! E.g. combining TCP to establish connections, NOISE to encrypt these connections and Yamux to run
//! one or more streams on a connection. Another libp2p transport is QUIC, providing encrypted
//! streams out-of-the-box. We will stick to TCP for now. Each of these implement the [`Transport`]
//! trait.
//!
//! ```rust
//! use std::error::Error;
//! use tracing_subscriber::EnvFilter;
//! use libp2p::{noise, tcp, yamux};
//!
//! #[async_std::main]
//! #[tokio::main]
//! async fn main() -> Result<(), Box<dyn Error>> {
//! tracing_subscriber::fmt().with_env_filter(EnvFilter::from_default_env()).init();
//! let _ = tracing_subscriber::fmt()
//! .with_env_filter(EnvFilter::from_default_env())
//! .try_init();
//!
//! let mut swarm = libp2p::SwarmBuilder::with_new_identity()
//! .with_async_std()
//! .with_tokio()
//! .with_tcp(
//! libp2p::tcp::Config::default(),
//! libp2p::tls::Config::new,
//! libp2p::yamux::Config::default,
//! tcp::Config::default(),
//! noise::Config::new,
//! yamux::Config::default,
//! )?;
//!
//! Ok(())
Expand Down Expand Up @@ -137,20 +142,22 @@
//! With the above in mind, let's extend our example, creating a [`ping::Behaviour`](crate::ping::Behaviour) at the end:
//!
//! ```rust
//! use libp2p::ping;
//! use tracing_subscriber::EnvFilter;
//! use std::error::Error;
//! use tracing_subscriber::EnvFilter;
//! use libp2p::{noise, ping, tcp, yamux};
//!
//! #[async_std::main]
//! #[tokio::main]
//! async fn main() -> Result<(), Box<dyn Error>> {
//! tracing_subscriber::fmt().with_env_filter(EnvFilter::from_default_env()).init();
//! let _ = tracing_subscriber::fmt()
//! .with_env_filter(EnvFilter::from_default_env())
//! .try_init();
//!
//! let mut swarm = libp2p::SwarmBuilder::with_new_identity()
//! .with_async_std()
//! .with_tokio()
//! .with_tcp(
//! libp2p::tcp::Config::default(),
//! libp2p::tls::Config::new,
//! libp2p::yamux::Config::default,
//! tcp::Config::default(),
//! noise::Config::new,
//! yamux::Config::default,
//! )?
//! .with_behaviour(|_| ping::Behaviour::default())?;
//!
Expand All @@ -166,20 +173,22 @@
//! to the [`Transport`] as well as events from the [`Transport`] to the [`NetworkBehaviour`].
//!
//! ```rust
//! use libp2p::ping;
//! use std::error::Error;
//! use tracing_subscriber::EnvFilter;
//! use libp2p::{noise, ping, tcp, yamux};
//!
//! #[async_std::main]
//! #[tokio::main]
//! async fn main() -> Result<(), Box<dyn Error>> {
//! tracing_subscriber::fmt().with_env_filter(EnvFilter::from_default_env()).init();
//! let _ = tracing_subscriber::fmt()
//! .with_env_filter(EnvFilter::from_default_env())
//! .try_init();
//!
//! let mut swarm = libp2p::SwarmBuilder::with_new_identity()
//! .with_async_std()
//! .with_tokio()
//! .with_tcp(
//! libp2p::tcp::Config::default(),
//! libp2p::tls::Config::new,
//! libp2p::yamux::Config::default,
//! tcp::Config::default(),
//! noise::Config::new,
//! yamux::Config::default,
//! )?
//! .with_behaviour(|_| ping::Behaviour::default())?
//! .build();
Expand All @@ -199,24 +208,25 @@
//! Thus, without any other behaviour in place, we would not be able to observe the pings.
//!
//! ```rust
//! use libp2p::ping;
//! use std::error::Error;
//! use std::time::Duration;
//! use std::{error::Error, time::Duration};
//! use tracing_subscriber::EnvFilter;
//! use libp2p::{noise, ping, tcp, yamux};
//!
//! #[async_std::main]
//! #[tokio::main]
//! async fn main() -> Result<(), Box<dyn Error>> {
//! tracing_subscriber::fmt().with_env_filter(EnvFilter::from_default_env()).init();
//! let _ = tracing_subscriber::fmt()
//! .with_env_filter(EnvFilter::from_default_env())
//! .try_init();
//!
//! let mut swarm = libp2p::SwarmBuilder::with_new_identity()
//! .with_async_std()
//! .with_tokio()
//! .with_tcp(
//! libp2p::tcp::Config::default(),
//! libp2p::tls::Config::new,
//! libp2p::yamux::Config::default,
//! tcp::Config::default(),
//! noise::Config::new,
//! yamux::Config::default,
//! )?
//! .with_behaviour(|_| ping::Behaviour::default())?
//! .with_swarm_config(|cfg| cfg.with_idle_connection_timeout(Duration::from_secs(u64::MAX))) // Allows us to observe pings indefinitely.
//! .with_swarm_config(|cfg| cfg.with_idle_connection_timeout(Duration::from_secs(u64::MAX)))
//! .build();
//!
//! Ok(())
Expand Down Expand Up @@ -250,24 +260,25 @@
//! remote peer.
//!
//! ```rust
//! use libp2p::{ping, Multiaddr};
//! use std::error::Error;
//! use std::time::Duration;
//! use std::{error::Error, time::Duration};
//! use tracing_subscriber::EnvFilter;
//! use libp2p::{noise, ping, tcp, yamux, Multiaddr};
//!
//! #[async_std::main]
//! #[tokio::main]
//! async fn main() -> Result<(), Box<dyn Error>> {
//! tracing_subscriber::fmt().with_env_filter(EnvFilter::from_default_env()).init();
//! let _ = tracing_subscriber::fmt()
//! .with_env_filter(EnvFilter::from_default_env())
//! .try_init();
//!
//! let mut swarm = libp2p::SwarmBuilder::with_new_identity()
//! .with_async_std()
//! .with_tokio()
//! .with_tcp(
//! libp2p::tcp::Config::default(),
//! libp2p::tls::Config::new,
//! libp2p::yamux::Config::default,
//! tcp::Config::default(),
//! noise::Config::new,
//! yamux::Config::default,
//! )?
//! .with_behaviour(|_| ping::Behaviour::default())?
//! .with_swarm_config(|cfg| cfg.with_idle_connection_timeout(Duration::from_secs(u64::MAX))) // Allows us to observe pings indefinitely..
//! .with_swarm_config(|cfg| cfg.with_idle_connection_timeout(Duration::from_secs(u64::MAX)))
//! .build();
//!
//! // Tell the swarm to listen on all interfaces and a random, OS-assigned
Expand All @@ -293,26 +304,26 @@
//! outgoing connection in case we specify an address on the CLI.
//!
//! ```no_run
//! use futures::prelude::*;
//! use libp2p::swarm::SwarmEvent;
//! use libp2p::{ping, Multiaddr};
//! use std::error::Error;
//! use std::time::Duration;
//! use std::{error::Error, time::Duration};
//! use tracing_subscriber::EnvFilter;
//! use libp2p::{noise, ping, tcp, yamux, Multiaddr, swarm::SwarmEvent};
//! use futures::prelude::*;
//!
//! #[async_std::main]
//! #[tokio::main]
//! async fn main() -> Result<(), Box<dyn Error>> {
//! tracing_subscriber::fmt().with_env_filter(EnvFilter::from_default_env()).init();
//! let _ = tracing_subscriber::fmt()
//! .with_env_filter(EnvFilter::from_default_env())
//! .try_init();
//!
//! let mut swarm = libp2p::SwarmBuilder::with_new_identity()
//! .with_async_std()
//! .with_tokio()
//! .with_tcp(
//! libp2p::tcp::Config::default(),
//! libp2p::tls::Config::new,
//! libp2p::yamux::Config::default,
//! tcp::Config::default(),
//! noise::Config::new,
//! yamux::Config::default,
//! )?
//! .with_behaviour(|_| ping::Behaviour::default())?
//! .with_swarm_config(|cfg| cfg.with_idle_connection_timeout(Duration::from_secs(u64::MAX))) // Allows us to observe pings indefinitely.
//! .with_swarm_config(|cfg| cfg.with_idle_connection_timeout(Duration::from_secs(u64::MAX)))
//! .build();
//!
//! // Tell the swarm to listen on all interfaces and a random, OS-assigned
Expand Down
2 changes: 1 addition & 1 deletion misc/metrics/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## 0.14.2
## 0.15.0
- Use `web-time` instead of `instant`.
See [PR 5347](https://github.com/libp2p/rust-libp2p/pull/5347).

Expand Down
2 changes: 1 addition & 1 deletion misc/metrics/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name = "libp2p-metrics"
edition = "2021"
rust-version = { workspace = true }
description = "Metrics for libp2p"
version = "0.14.2"
version = "0.15.0"
authors = ["Max Inden <mail@max-inden.de>"]
license = "MIT"
repository = "https://github.com/libp2p/rust-libp2p"
Expand Down
4 changes: 2 additions & 2 deletions protocols/autonat/src/v2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
//!
//! The new version fixes the issues of the first version:
//! - The server now always dials back over a newly allocated port. This greatly reduces the risk of
//! false positives that often occured in the first version, when the clinet-server connection
//! occured over a hole-punched port.
//! false positives that often occurred in the first version, when the clinet-server connection
//! occurred over a hole-punched port.
//! - The server protects against DoS attacks by requiring the client to send more data to the
//! server then the dial back puts on the client, thus making the protocol unatractive for an
//! attacker.
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.46.1

- Use new provider record update strategy to prevent Sybil attack.
See [PR 5536](https://github.com/libp2p/rust-libp2p/pull/5536).

## 0.46.0

- Included multiaddresses of found peers alongside peer IDs in `GetClosestPeers` query results.
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.46.0"
version = "0.46.1"
authors = ["Parity Technologies <admin@parity.io>"]
license = "MIT"
repository = "https://github.com/libp2p/rust-libp2p"
Expand Down
Loading

0 comments on commit 688f768

Please sign in to comment.