Skip to content

Commit

Permalink
Merge branch 'master' of github.com:libp2p/rust-libp2p into rename-relay
Browse files Browse the repository at this point in the history
  • Loading branch information
jxs committed Dec 20, 2022
2 parents 6f63553 + 13a59a3 commit 91241e7
Show file tree
Hide file tree
Showing 77 changed files with 545 additions and 428 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ jobs:

- uses: Swatinem/rust-cache@359a70e43a0bb8a13953b04a90f76428b4959bb6 # v2.2.0
with:
key: ${{ matrix.target }}
save-if: ${{ github.ref == 'refs/heads/master' }}

- run: cargo check --package libp2p --all-features --target=${{ matrix.target }}
Expand Down Expand Up @@ -144,6 +145,7 @@ jobs:

- uses: Swatinem/rust-cache@359a70e43a0bb8a13953b04a90f76428b4959bb6 # v2.2.0
with:
key: ${{ matrix.features }}
save-if: ${{ github.ref == 'refs/heads/master' }}

- run: cargo check --package libp2p --features="${{ matrix.features }}"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
echo "<meta http-equiv=\"refresh\" content=\"0; url=libp2p\">" > target/doc/index.html
cp -r target/doc/* ./host-docs
- name: Upload documentation
uses: actions/upload-pages-artifact@v1.0.6
uses: actions/upload-pages-artifact@v1.0.7
with:
path: "host-docs/"

Expand Down
22 changes: 18 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,11 @@

# 0.51.0 [unreleased]

- Count bandwidth at the application level. Previously `BandwidthLogging` would implement `Transport` and now implements `StreamMuxer` ([PR 3180](https://github.com/libp2p/rust-libp2p/pull/3180)).
- `BandwidthLogging::new` now requires a 2nd argument: `Arc<BandwidthSinks>`
- Remove `BandwidthFuture`
- Rename `BandwidthConnecLogging` to `InstrumentedStream`
- Remove `SimpleProtocol` due to being unused. See [`libp2p::core::upgrade`](https://docs.rs/libp2p/0.50.0/libp2p/core/upgrade/index.html) for alternatives. See [PR 3191].

- Update individual crates.
- Update to [`libp2p-dcutr` `v0.9.0`](protocols/dcutr/CHANGELOG.md#090).

Expand All @@ -71,11 +74,22 @@
- Update to [`libp2p-metrics` `v0.12.0`](misc/metrics/CHANGELOG.md#0120).

- Update to [`libp2p-swarm` `v0.42.0`](swarm/CHANGELOG.md#0420).

- Update to [`libp2p-mdns` `v0.43.0`](protocols/mdns/CHANGELOG.md#0430).

- Update to [`libp2p-gossipsub` `v0.44.0`](protocols/gossipsub/CHANGELOG.md#0440).


- Update to [`libp2p-yamux` `v0.43.0`](muxers/yamux/CHANGELOG.md#0430).

- Update to [`libp2p-mplex` `v0.39.0`](muxers/mplex/CHANGELOG.md#0390).

- Update to [`libp2p-wasm-ext` `v0.39.0`](transports/wasm-ext/CHANGELOG.md#0390).

- Update to [`libp2p-plaintext` `v0.39.0`](transports/plaintext/CHANGELOG.md#0390).

- Update to [`libp2p-noise` `v0.42.0`](transports/noise/CHANGELOG.md#0420).

- Update to [`libp2p-core` `v0.39.0`](core/CHANGELOG.md#0390).

[PR 3191]: https://github.com/libp2p/rust-libp2p/pull/3191

Expand Down
32 changes: 18 additions & 14 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -93,38 +93,38 @@ getrandom = "0.2.3" # Explicit dependency to be used in `wasm-bindgen` feature
instant = "0.1.11" # Explicit dependency to be used in `wasm-bindgen` feature

libp2p-autonat = { version = "0.10.0", path = "protocols/autonat", optional = true }
libp2p-core = { version = "0.38.0", path = "core" }
libp2p-core = { version = "0.39.0", path = "core" }
libp2p-dcutr = { version = "0.9.0", path = "protocols/dcutr", optional = true }
libp2p-floodsub = { version = "0.42.0", path = "protocols/floodsub", optional = true }
libp2p-identify = { version = "0.42.0", path = "protocols/identify", optional = true }
libp2p-kad = { version = "0.43.0", path = "protocols/kad", optional = true }
libp2p-metrics = { version = "0.12.0", path = "misc/metrics", optional = true }
libp2p-mplex = { version = "0.38.0", path = "muxers/mplex", optional = true }
libp2p-noise = { version = "0.41.0", path = "transports/noise", optional = true }
libp2p-mplex = { version = "0.39.0", path = "muxers/mplex", optional = true }
libp2p-noise = { version = "0.42.0", path = "transports/noise", optional = true }
libp2p-ping = { version = "0.42.0", path = "protocols/ping", optional = true }
libp2p-plaintext = { version = "0.38.0", path = "transports/plaintext", optional = true }
libp2p-plaintext = { version = "0.39.0", path = "transports/plaintext", optional = true }
libp2p-pnet = { version = "0.22.2", path = "transports/pnet", optional = true }
libp2p-relay = { version = "0.15.0", path = "protocols/relay", optional = true }
libp2p-rendezvous = { version = "0.12.0", path = "protocols/rendezvous", optional = true }
libp2p-request-response = { version = "0.24.0", path = "protocols/request-response", optional = true }
libp2p-swarm = { version = "0.42.0", path = "swarm" }
libp2p-uds = { version = "0.37.0", path = "transports/uds", optional = true }
libp2p-wasm-ext = { version = "0.38.0", path = "transports/wasm-ext", optional = true }
libp2p-yamux = { version = "0.42.0", path = "muxers/yamux", optional = true }
multiaddr = { version = "0.16.0" }
libp2p-wasm-ext = { version = "0.39.0", path = "transports/wasm-ext", optional = true }
libp2p-yamux = { version = "0.43.0", path = "muxers/yamux", optional = true }
multiaddr = { version = "0.17.0" }
parking_lot = "0.12.0"
pin-project = "1.0.0"
smallvec = "1.6.1"

[target.'cfg(not(any(target_os = "emscripten", target_os = "wasi", target_os = "unknown")))'.dependencies]
libp2p-deflate = { version = "0.38.0", path = "transports/deflate", optional = true }
libp2p-dns = { version = "0.38.0", path = "transports/dns", optional = true }
libp2p-deflate = { version = "0.39.0", path = "transports/deflate", optional = true }
libp2p-dns = { version = "0.39.0", path = "transports/dns", optional = true }
libp2p-mdns = { version = "0.43.0", path = "protocols/mdns", optional = true }
libp2p-quic = { version = "0.7.0-alpha", path = "transports/quic", optional = true }
libp2p-tcp = { version = "0.38.0", path = "transports/tcp", optional = true }
libp2p-tls = { version = "0.1.0-alpha", path = "transports/tls", optional = true }
libp2p-webrtc = { version = "0.4.0-alpha", path = "transports/webrtc", optional = true }
libp2p-websocket = { version = "0.40.0", path = "transports/websocket", optional = true }
libp2p-quic = { version = "0.7.0-alpha.2", path = "transports/quic", optional = true }
libp2p-tcp = { version = "0.39.0", path = "transports/tcp", optional = true }
libp2p-tls = { version = "0.1.0-alpha.2", path = "transports/tls", optional = true }
libp2p-webrtc = { version = "0.4.0-alpha.2", path = "transports/webrtc", optional = true }
libp2p-websocket = { version = "0.41.0", path = "transports/websocket", optional = true }

[target.'cfg(not(target_os = "unknown"))'.dependencies]
libp2p-gossipsub = { version = "0.44.0", path = "protocols/gossipsub", optional = true }
Expand All @@ -136,6 +136,10 @@ env_logger = "0.10.0"
clap = { version = "4.0.13", features = ["derive"] }
tokio = { version = "1.15", features = ["io-util", "io-std", "macros", "rt", "rt-multi-thread"] }

libp2p-mplex = { path = "muxers/mplex" }
libp2p-noise = { path = "transports/noise" }
libp2p-tcp = { path = "transports/tcp", features = ["tokio"] }

[workspace]
members = [
"core",
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
[![dependency status](https://deps.rs/repo/github/libp2p/rust-libp2p/status.svg?style=flat-square)](https://deps.rs/repo/github/libp2p/rust-libp2p)
[![Crates.io](https://img.shields.io/crates/v/libp2p.svg)](https://crates.io/crates/libp2p)
[![docs.rs](https://img.shields.io/badge/api-rustdoc-blue.svg)](https://docs.rs/libp2p)
[![docs.rs master](https://img.shields.io/badge/docs-master-blueviolet)](https://libp2p.github.io/rust-libp2p/libp2p/)

This repository is the central place for Rust development of the [libp2p](https://libp2p.io) spec.

Expand Down
10 changes: 5 additions & 5 deletions core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name = "libp2p-core"
edition = "2021"
rust-version = "1.60.0"
description = "Core traits and structs of libp2p"
version = "0.38.0"
version = "0.39.0"
authors = ["Parity Technologies <admin@parity.io>"]
license = "MIT"
repository = "https://github.com/libp2p/rust-libp2p"
Expand All @@ -21,8 +21,8 @@ futures-timer = "3"
instant = "0.1.11"
libsecp256k1 = { version = "0.7.0", optional = true }
log = "0.4"
multiaddr = { version = "0.16.0" }
multihash = { version = "0.16", default-features = false, features = ["std", "multihash-impl", "identity", "sha2"] }
multiaddr = { version = "0.17.0" }
multihash = { version = "0.17.0", default-features = false, features = ["std", "multihash-impl", "identity", "sha2"] }
multistream-select = { version = "0.12.1", path = "../misc/multistream-select" }
p256 = { version = "0.11.1", default-features = false, features = ["ecdsa", "std"], optional = true }
parking_lot = "0.12.0"
Expand All @@ -49,7 +49,7 @@ base64 = "0.13.0"
criterion = "0.4"
libp2p-mplex = { path = "../muxers/mplex" }
libp2p-noise = { path = "../transports/noise" }
multihash = { version = "0.16", default-features = false, features = ["arb"] }
multihash = { version = "0.17.0", default-features = false, features = ["arb"] }
quickcheck = { package = "quickcheck-ext", path = "../misc/quickcheck-ext" }
rmp-serde = "1.0"
serde_json = "1.0"
Expand All @@ -67,7 +67,7 @@ serde = ["multihash/serde-codec", "dep:serde"]
name = "peer_id"
harness = false

# Passing arguments to the docsrs builder in order to properly document cfg's.
# Passing arguments to the docsrs builder in order to properly document cfg's.
# More information: https://docs.rs/about/builds#cross-compiling
[package.metadata.docs.rs]
all-features = true
Expand Down
2 changes: 1 addition & 1 deletion misc/keygen/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@ clap = { version = "4.0.13", features = ["derive"] }
zeroize = "1"
serde = { version = "1.0.136", features = ["derive"] }
serde_json = "1.0.79"
libp2p-core = { version = "0.38.0", path = "../../core" }
libp2p-core = { version = "0.39.0", path = "../../core" }
base64 = "0.13.0"
2 changes: 2 additions & 0 deletions misc/metrics/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# 0.12.0 [unreleased]

- Update to `libp2p-core` `v0.39.0`.

- Add `connections_establishment_duration` metric. See [PR 3134].

- Update to `libp2p-dcutr` `v0.9.0`.
Expand Down
2 changes: 1 addition & 1 deletion misc/metrics/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ relay = ["libp2p-relay"]
dcutr = ["libp2p-dcutr"]

[dependencies]
libp2p-core = { version = "0.38.0", path = "../../core" }
libp2p-core = { version = "0.39.0", path = "../../core" }
libp2p-dcutr = { version = "0.9.0", path = "../../protocols/dcutr", optional = true }
libp2p-identify = { version = "0.42.0", path = "../../protocols/identify", optional = true }
libp2p-kad = { version = "0.43.0", path = "../../protocols/kad", optional = true }
Expand Down
20 changes: 10 additions & 10 deletions misc/metrics/src/dcutr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,30 +55,30 @@ enum EventType {
DirectConnectionUpgradeFailed,
}

impl From<&libp2p_dcutr::behaviour::Event> for EventType {
fn from(event: &libp2p_dcutr::behaviour::Event) -> Self {
impl From<&libp2p_dcutr::Event> for EventType {
fn from(event: &libp2p_dcutr::Event) -> Self {
match event {
libp2p_dcutr::behaviour::Event::InitiatedDirectConnectionUpgrade {
libp2p_dcutr::Event::InitiatedDirectConnectionUpgrade {
remote_peer_id: _,
local_relayed_addr: _,
} => EventType::InitiateDirectConnectionUpgrade,
libp2p_dcutr::behaviour::Event::RemoteInitiatedDirectConnectionUpgrade {
libp2p_dcutr::Event::RemoteInitiatedDirectConnectionUpgrade {
remote_peer_id: _,
remote_relayed_addr: _,
} => EventType::RemoteInitiatedDirectConnectionUpgrade,
libp2p_dcutr::behaviour::Event::DirectConnectionUpgradeSucceeded {
remote_peer_id: _,
} => EventType::DirectConnectionUpgradeSucceeded,
libp2p_dcutr::behaviour::Event::DirectConnectionUpgradeFailed {
libp2p_dcutr::Event::DirectConnectionUpgradeSucceeded { remote_peer_id: _ } => {
EventType::DirectConnectionUpgradeSucceeded
}
libp2p_dcutr::Event::DirectConnectionUpgradeFailed {
remote_peer_id: _,
error: _,
} => EventType::DirectConnectionUpgradeFailed,
}
}
}

impl super::Recorder<libp2p_dcutr::behaviour::Event> for Metrics {
fn record(&self, event: &libp2p_dcutr::behaviour::Event) {
impl super::Recorder<libp2p_dcutr::Event> for Metrics {
fn record(&self, event: &libp2p_dcutr::Event) {
self.events
.get_or_create(&EventLabels {
event: event.into(),
Expand Down
4 changes: 2 additions & 2 deletions misc/metrics/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,8 @@ pub trait Recorder<Event> {
}

#[cfg(feature = "dcutr")]
impl Recorder<libp2p_dcutr::behaviour::Event> for Metrics {
fn record(&self, event: &libp2p_dcutr::behaviour::Event) {
impl Recorder<libp2p_dcutr::Event> for Metrics {
fn record(&self, event: &libp2p_dcutr::Event) {
self.dcutr.record(event)
}
}
Expand Down
2 changes: 1 addition & 1 deletion misc/metrics/src/swarm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -396,5 +396,5 @@ impl<TTransErr> From<&libp2p_swarm::PendingInboundConnectionError<TTransErr>>
}

fn create_connection_establishment_duration_histogram() -> Histogram {
Histogram::new(exponential_buckets(1e-3, 2., 10))
Histogram::new(exponential_buckets(0.01, 1.5, 20))
}
4 changes: 4 additions & 0 deletions muxers/mplex/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# 0.39.0 [unreleased]

- Update to `libp2p-core` `v0.39.0`.

# 0.38.0

- Update to `libp2p-core` `v0.38.0`.
Expand Down
4 changes: 2 additions & 2 deletions muxers/mplex/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name = "libp2p-mplex"
edition = "2021"
rust-version = "1.60.0"
description = "Mplex multiplexing protocol for libp2p"
version = "0.38.0"
version = "0.39.0"
authors = ["Parity Technologies <admin@parity.io>"]
license = "MIT"
repository = "https://github.com/libp2p/rust-libp2p"
Expand All @@ -14,7 +14,7 @@ categories = ["network-programming", "asynchronous"]
bytes = "1"
futures = "0.3.1"
asynchronous-codec = "0.6"
libp2p-core = { version = "0.38.0", path = "../../core" }
libp2p-core = { version = "0.39.0", path = "../../core" }
log = "0.4"
nohash-hasher = "0.2"
parking_lot = "0.12"
Expand Down
4 changes: 4 additions & 0 deletions muxers/yamux/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# 0.43.0 [unreleased]

- Update to `libp2p-core` `v0.39.0`.

# 0.42.0

- Update to `libp2p-core` `v0.38.0`.
Expand Down
4 changes: 2 additions & 2 deletions muxers/yamux/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name = "libp2p-yamux"
edition = "2021"
rust-version = "1.60.0"
description = "Yamux multiplexing protocol for libp2p"
version = "0.42.0"
version = "0.43.0"
authors = ["Parity Technologies <admin@parity.io>"]
license = "MIT"
repository = "https://github.com/libp2p/rust-libp2p"
Expand All @@ -12,7 +12,7 @@ categories = ["network-programming", "asynchronous"]

[dependencies]
futures = "0.3.1"
libp2p-core = { version = "0.38.0", path = "../../core" }
libp2p-core = { version = "0.39.0", path = "../../core" }
parking_lot = "0.12"
thiserror = "1.0"
yamux = "0.10.0"
Expand Down
2 changes: 2 additions & 0 deletions protocols/autonat/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# 0.10.0 [unreleased]

- Update to `libp2p-core` `v0.39.0`.

- Require the node's local `PeerId` to be passed into the constructor of `libp2p_autonat::Behaviour`. See [PR 3153].

- Update to `libp2p-request-response` `v0.24.0`.
Expand Down
2 changes: 1 addition & 1 deletion protocols/autonat/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ async-trait = "0.1"
futures = "0.3"
futures-timer = "3.0"
instant = "0.1"
libp2p-core = { version = "0.38.0", path = "../../core" }
libp2p-core = { version = "0.39.0", path = "../../core" }
libp2p-swarm = { version = "0.42.0", path = "../../swarm" }
libp2p-request-response = { version = "0.24.0", path = "../request-response" }
log = "0.4"
Expand Down
6 changes: 6 additions & 0 deletions protocols/dcutr/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
# 0.9.0 [unreleased]

- Update to `libp2p-core` `v0.39.0`.

- Update to `libp2p-swarm` `v0.42.0`.

- Declare `InboundUpgradeError` and `OutboundUpgradeError` as type aliases instead of renames.
This is a workaround for a missing feature in `cargo semver-checks`. See [PR 3213].

- Require the node's local `PeerId` to be passed into the constructor of `libp2p_dcutr::Behaviour`. See [PR 3153].

- Rename types in public API to follow naming conventions defined in [issue 2217]. See [PR 3214].

[PR 3213]: https://github.com/libp2p/rust-libp2p/pull/3213
[PR 3153]: https://github.com/libp2p/rust-libp2p/pull/3153
[issue 2217]: https://github.com/libp2p/rust-libp2p/issues/2217
[PR 3214]: https://github.com/libp2p/rust-libp2p/pull/3214

# 0.8.0

Expand Down
2 changes: 1 addition & 1 deletion protocols/dcutr/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ either = "1.6.0"
futures = "0.3.1"
futures-timer = "3.0"
instant = "0.1.11"
libp2p-core = { version = "0.38.0", path = "../../core" }
libp2p-core = { version = "0.39.0", path = "../../core" }
libp2p-swarm = { version = "0.42.0", path = "../../swarm" }
log = "0.4"
prost-codec = { version = "0.3", path = "../../misc/prost-codec" }
Expand Down
10 changes: 5 additions & 5 deletions protocols/dcutr/examples/dcutr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ fn main() -> Result<(), Box<dyn Error>> {
relay_client: client::Behaviour,
ping: ping::Behaviour,
identify: identify::Behaviour,
dcutr: dcutr::behaviour::Behaviour,
dcutr: dcutr::Behaviour,
}

#[derive(Debug)]
Expand All @@ -123,7 +123,7 @@ fn main() -> Result<(), Box<dyn Error>> {
Ping(ping::Event),
Identify(identify::Event),
Relay(client::Event),
Dcutr(dcutr::behaviour::Event),
Dcutr(dcutr::Event),
}

impl From<ping::Event> for Event {
Expand All @@ -144,8 +144,8 @@ fn main() -> Result<(), Box<dyn Error>> {
}
}

impl From<dcutr::behaviour::Event> for Event {
fn from(e: dcutr::behaviour::Event) -> Self {
impl From<dcutr::Event> for Event {
fn from(e: dcutr::Event) -> Self {
Event::Dcutr(e)
}
}
Expand All @@ -157,7 +157,7 @@ fn main() -> Result<(), Box<dyn Error>> {
"/TODO/0.0.1".to_string(),
local_key.public(),
)),
dcutr: dcutr::behaviour::Behaviour::new(local_peer_id),
dcutr: dcutr::Behaviour::new(local_peer_id),
};

let mut swarm = match ThreadPool::new() {
Expand Down
Loading

0 comments on commit 91241e7

Please sign in to comment.