.github/workflows: Refactor CI jobs (#3090)

We refactor our continuous integration workflow with the following goals in mind:

- Run as few jobs as possible
- Have the jobs finish as fast as possible
- Have the jobs redo as little work as possible

There are only so many jobs that GitHub Actions will run in parallel.
Thus, it makes sense to not create massive matrices but instead group
things together meaningfully.

The new `test` job will:

- Run once for each crate
- Ensure that the crate compiles on its specified MSRV
- Ensure that the tests pass
- Ensure that there are no semver violations

This is an improvement to before because we are running all of these
in parallel which speeds up execution and highlights more errors at
once. Previously, tests run later in the pipeline would not get run
at all until you make sure the "first" one passes.

We also previously did not verify the MSRV of each crate, making the
setting in the `Cargo.toml` rather pointless.

The new `cross` job supersedes the existing `wasm` job.

This is an improvement because we now also compile the crate for
windows and MacOS. Something that wasn't checked before.
We assume that checking MSRV and the tests under Linux is good enough.
Hence, this job only checks for compile-errors.

The new `feature_matrix` ensures we compile correctly with certain feature combinations.

`libp2p` exposes a fair few feature-flags. Some of the combinations
are worth checking independently. For the moment, this concerns only
the executor related transports together with the executor flags but
this list can easily be extended.

The new `clippy` job runs for `stable` and `beta` rust.

Clippy gets continuously extended with new lints. Up until now, we would only
learn about those as soon as a new version of Rust is released and CI would
run the new lints. This leads to unrelated failures in CI. Running clippy on with `beta`
Rust gives us a heads-up of 6 weeks before these lints land on stable.

Fixes #2951.
This commit is contained in:
Thomas Eizinger 2022-11-18 22:04:16 +11:00 committed by GitHub
parent 05c079422e
commit 0c85839dab
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
72 changed files with 363 additions and 208 deletions

View File

@ -11,175 +11,235 @@ concurrency:
cancel-in-progress: true cancel-in-progress: true
jobs: jobs:
test-desktop: test:
name: Build and test name: Test ${{ matrix.crate }}
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: gather_published_crates
strategy: strategy:
fail-fast: false
matrix: matrix:
args: [ crate: ${{ fromJSON(needs.gather_published_crates.outputs.members) }}
"--no-default-features",
"--all-features",
"--benches --all-features",
]
steps: steps:
- name: Install Protoc - name: Install Protoc
uses: arduino/setup-protoc@v1 uses: arduino/setup-protoc@64c0c85d18e984422218383b81c52f8b077404d3 # v1.1.2
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- uses: Swatinem/rust-cache@359a70e43a0bb8a13953b04a90f76428b4959bb6 # v2.2.0 - name: Get MSRV for ${{ matrix.crate }}
with: id: parse-msrv
key: ${{ matrix.args }} run: |
RUST_VERSION=$(cargo metadata --format-version=1 --no-deps | jq -r '.packages[] | select(.name == "${{ matrix.crate }}") | .rust_version')
echo "version=${RUST_VERSION}" >> $GITHUB_OUTPUT
- run: cargo test --workspace ${{ matrix.args }} - name: Install Rust ${{ steps.parse-msrv.outputs.version }} for MSRV check
uses: actions-rs/toolchain@16499b5e05bf2e26879000db0c1d13f7e13fa3af # v1.0.7
with:
profile: minimal
toolchain: ${{ steps.parse-msrv.outputs.version }}
test-wasm: - name: Update to latest stable Rust
name: Build on WASM uses: actions-rs/toolchain@16499b5e05bf2e26879000db0c1d13f7e13fa3af # v1.0.7
runs-on: ubuntu-latest with:
profile: minimal
toolchain: stable
override: true
# By default, this action already includes the active Rust toolchain in the cache key.
# We also install a separate toolchain for the MSRV check so all we need to do is add that to the key to make sure it invalidates when we update the MSRV.
# cargo separates build artifacts by Rust compiler version, meaning we can compile with different versions but cache all artifacts.
- uses: Swatinem/rust-cache@359a70e43a0bb8a13953b04a90f76428b4959bb6 # v2.2.0
with:
key: ${{ matrix.crate }}-msrv-${{ steps.parse-msrv.outputs.version }}
- name: Check if ${{ matrix.crate }} compiles on MSRV (Rust ${{ steps.parse-msrv.outputs.version }})
run: cargo +${{ steps.parse-msrv.outputs.version }} check --package ${{ matrix.crate }} --all-features
- name: Check if we compile without any features activated
run: cargo check --package ${{ matrix.crate }} --no-default-features
- name: Run all tests
run: cargo test --package ${{ matrix.crate }} --all-features
- name: Check if crate has been released
id: check-released
run: |
RESPONSE_CODE=$(curl https://crates.io/api/v1/crates/${{ matrix.crate }} --silent --write-out "%{http_code}" --output /dev/null)
echo "code=${RESPONSE_CODE}"
echo "code=${RESPONSE_CODE}" >> $GITHUB_OUTPUT
- name: Check public API for semver violations
if: steps.check-released.outputs.code == 200 # Workaround until https://github.com/obi1kenobi/cargo-semver-check/issues/146 is shipped.
run: |
cargo install cargo-semver-checks
cargo semver-checks check-release -p ${{ matrix.crate }}
cross:
name: Compile on ${{ matrix.target }}
strategy: strategy:
matrix: matrix:
toolchain: [
wasm32-unknown-emscripten,
wasm32-wasi
]
include: include:
- toolchain: wasm32-unknown-unknown - target: "wasm32-unknown-unknown"
args: "--features wasm-bindgen" os: ubuntu-latest
env: - target: "wasm32-unknown-emscripten"
CC: clang-11 os: ubuntu-latest
defaults: - target: "wasm32-wasi"
run: os: ubuntu-latest
shell: bash - target: "x86_64-apple-darwin"
os: macos-latest
- target: "x86_64-pc-windows-msvc"
os: windows-latest
runs-on: ${{ matrix.os }}
steps: steps:
- name: Install Protoc - name: Install Protoc
uses: arduino/setup-protoc@v1 uses: arduino/setup-protoc@64c0c85d18e984422218383b81c52f8b077404d3 # v1.1.2
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- name: Install Rust ${{ matrix.toolchain }} - uses: actions-rs/toolchain@16499b5e05bf2e26879000db0c1d13f7e13fa3af # v1.0.7
uses: actions-rs/toolchain@16499b5e05bf2e26879000db0c1d13f7e13fa3af # v1.0.7 with:
with: profile: minimal
toolchain: stable toolchain: stable
target: ${{ matrix.toolchain }} override: true
override: true target: ${{ matrix.target }}
- name: Install a recent version of clang - uses: Swatinem/rust-cache@359a70e43a0bb8a13953b04a90f76428b4959bb6 # v2.2.0
run: |
sudo bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)"
- name: Install CMake - run: cargo check --package libp2p --all-features --target=${{ matrix.target }}
run: sudo apt-get install -y cmake
- uses: Swatinem/rust-cache@359a70e43a0bb8a13953b04a90f76428b4959bb6 # v2.2.0 feature_matrix: # Test various feature combinations work correctly
with: name: Compile with select features (${{ matrix.features }})
key: ${{ matrix.toolchain }} runs-on: ubuntu-latest
strategy:
matrix:
include:
- features: "mdns tcp dns tokio"
- features: "mdns tcp dns async-std"
steps:
- name: Install Protoc
uses: arduino/setup-protoc@64c0c85d18e984422218383b81c52f8b077404d3 # v1.1.2
- name: Build on ${{ matrix.toolchain }} - uses: actions/checkout@v3
# TODO: also run `cargo test`
# TODO: ideally we would build `--workspace`, but not all crates compile for WASM - uses: actions-rs/toolchain@16499b5e05bf2e26879000db0c1d13f7e13fa3af # v1.0.7
run: cargo build --target=${{ matrix.toolchain }} ${{ matrix.args }} with:
profile: minimal
toolchain: stable
override: true
- uses: Swatinem/rust-cache@359a70e43a0bb8a13953b04a90f76428b4959bb6 # v2.2.0
with:
key: ${{ matrix.runtime }}
- run: cargo check --package libp2p --features="${{ matrix.features }}"
check-rustdoc-links: check-rustdoc-links:
name: Check rustdoc intra-doc links name: Check rustdoc intra-doc links
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Install Protoc - name: Install Protoc
uses: arduino/setup-protoc@v1 uses: arduino/setup-protoc@64c0c85d18e984422218383b81c52f8b077404d3 # v1.1.2
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- uses: actions-rs/toolchain@16499b5e05bf2e26879000db0c1d13f7e13fa3af # v1.0.7 - uses: actions-rs/toolchain@16499b5e05bf2e26879000db0c1d13f7e13fa3af # v1.0.7
with: with:
profile: minimal profile: minimal
toolchain: stable toolchain: stable
override: true override: true
- uses: Swatinem/rust-cache@359a70e43a0bb8a13953b04a90f76428b4959bb6 # v2.2.0 - uses: Swatinem/rust-cache@359a70e43a0bb8a13953b04a90f76428b4959bb6 # v2.2.0
- name: Check rustdoc links - name: Check rustdoc links
run: RUSTDOCFLAGS="--deny rustdoc::broken_intra_doc_links --deny warnings" cargo doc --verbose --workspace --no-deps --all-features --document-private-items run: RUSTDOCFLAGS="--deny rustdoc::broken_intra_doc_links --deny warnings" cargo doc --verbose --workspace --no-deps --all-features --document-private-items
check-clippy: clippy:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
rust-version: [
stable,
beta
]
steps:
- name: Install Protoc
uses: arduino/setup-protoc@64c0c85d18e984422218383b81c52f8b077404d3 # v1.1.2
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@16499b5e05bf2e26879000db0c1d13f7e13fa3af # v1.0.7
with:
profile: minimal
toolchain: ${{ matrix.rust-version }}
override: true
components: clippy
- uses: Swatinem/rust-cache@359a70e43a0bb8a13953b04a90f76428b4959bb6 # v2.2.0
- name: Run cargo clippy
uses: actions-rs/cargo@844f36862e911db73fe0815f00a4a2602c279505 # v1.0.3
with:
command: custom-clippy # cargo alias to allow reuse of config locally
ipfs-integration-test:
name: IPFS Integration tests
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Install Protoc - name: Install Protoc
uses: arduino/setup-protoc@v1 uses: arduino/setup-protoc@64c0c85d18e984422218383b81c52f8b077404d3 # v1.1.2
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- uses: actions-rs/toolchain@16499b5e05bf2e26879000db0c1d13f7e13fa3af # v1.0.7 - uses: actions-rs/toolchain@16499b5e05bf2e26879000db0c1d13f7e13fa3af # v1.0.7
with: with:
profile: minimal profile: minimal
toolchain: stable toolchain: stable
override: true override: true
components: clippy
- uses: Swatinem/rust-cache@359a70e43a0bb8a13953b04a90f76428b4959bb6 # v2.2.0 - uses: Swatinem/rust-cache@359a70e43a0bb8a13953b04a90f76428b4959bb6 # v2.2.0
- name: Run cargo clippy - name: Run ipfs-kad example
uses: actions-rs/cargo@844f36862e911db73fe0815f00a4a2602c279505 # v1.0.3 run: RUST_LOG=libp2p_swarm=debug,libp2p_kad=trace,libp2p_tcp=debug cargo run --example ipfs-kad --features full
with:
command: custom-clippy # cargo alias to allow reuse of config locally
integration-test:
name: Integration tests
runs-on: ubuntu-latest
steps:
- name: Install Protoc
uses: arduino/setup-protoc@v1
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@16499b5e05bf2e26879000db0c1d13f7e13fa3af # v1.0.7
with:
profile: minimal
toolchain: stable
override: true
- uses: Swatinem/rust-cache@359a70e43a0bb8a13953b04a90f76428b4959bb6 # v2.2.0
- name: Run ipfs-kad example
run: RUST_LOG=libp2p_swarm=debug,libp2p_kad=trace,libp2p_tcp=debug cargo run --example ipfs-kad --features full
rustfmt: rustfmt:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- uses: actions-rs/toolchain@16499b5e05bf2e26879000db0c1d13f7e13fa3af # v1.0.7 - uses: actions-rs/toolchain@16499b5e05bf2e26879000db0c1d13f7e13fa3af # v1.0.7
with: with:
profile: minimal profile: minimal
toolchain: stable toolchain: stable
override: true override: true
components: rustfmt components: rustfmt
- name: Check formatting - name: Check formatting
run: cargo fmt -- --check run: cargo fmt -- --check
manifest_lint: manifest_lint:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- uses: actions-rs/toolchain@16499b5e05bf2e26879000db0c1d13f7e13fa3af # v1.0.7 - uses: actions-rs/toolchain@16499b5e05bf2e26879000db0c1d13f7e13fa3af # v1.0.7
with: with:
profile: minimal profile: minimal
toolchain: stable toolchain: stable
override: true override: true
- name: Ensure `full` feature contains all features - name: Ensure `full` feature contains all features
run: | run: |
ALL_FEATURES=$(cargo metadata --format-version=1 --no-deps | jq -r '.packages[] | select(.name == "libp2p") | .features | keys | map(select(. != "full")) | sort | join(" ")') ALL_FEATURES=$(cargo metadata --format-version=1 --no-deps | jq -r '.packages[] | select(.name == "libp2p") | .features | keys | map(select(. != "full")) | sort | join(" ")')
FULL_FEATURE=$(cargo metadata --format-version=1 --no-deps | jq -r '.packages[] | select(.name == "libp2p") | .features["full"] | sort | join(" ")') FULL_FEATURE=$(cargo metadata --format-version=1 --no-deps | jq -r '.packages[] | select(.name == "libp2p") | .features["full"] | sort | join(" ")')
test "$ALL_FEATURES = $FULL_FEATURE" test "$ALL_FEATURES = $FULL_FEATURE"
echo "$ALL_FEATURES";
echo "$FULL_FEATURE";
test "$ALL_FEATURES" = "$FULL_FEATURE"
echo "$ALL_FEATURES"; gather_published_crates:
echo "$FULL_FEATURE";
test "$ALL_FEATURES" = "$FULL_FEATURE"
gather_crates_for_semver_checks:
runs-on: ubuntu-latest runs-on: ubuntu-latest
outputs: outputs:
members: ${{ steps.cargo-metadata.outputs.members }} members: ${{ steps.cargo-metadata.outputs.members }}
@ -189,35 +249,4 @@ jobs:
- id: cargo-metadata - id: cargo-metadata
run: | run: |
WORKSPACE_MEMBERS=$(cargo metadata --format-version=1 --no-deps | jq -c '.packages | .[] | select(.publish == null) | .name' | jq -s '.' | jq -c '.') WORKSPACE_MEMBERS=$(cargo metadata --format-version=1 --no-deps | jq -c '.packages | .[] | select(.publish == null) | .name' | jq -s '.' | jq -c '.')
echo "::set-output name=members::${WORKSPACE_MEMBERS}" echo "members=${WORKSPACE_MEMBERS}" >> $GITHUB_OUTPUT
semver-check:
runs-on: ubuntu-latest
needs: gather_crates_for_semver_checks
strategy:
fail-fast: false
matrix:
crate: ${{ fromJSON(needs.gather_crates_for_semver_checks.outputs.members) }}
steps:
- name: Cancel Previous Runs
uses: styfle/cancel-workflow-action@bb6001c4ea612bf59c3abfc4756fbceee4f870c7 # 0.10.0
with:
access_token: ${{ github.token }}
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@16499b5e05bf2e26879000db0c1d13f7e13fa3af # v1.0.7
with:
profile: minimal
toolchain: stable
override: true
- name: Install Protoc
uses: arduino/setup-protoc@v1
- uses: Swatinem/rust-cache@359a70e43a0bb8a13953b04a90f76428b4959bb6 # v2.2.0
- run: cargo install cargo-semver-checks
- name: Semver Check
run: cargo semver-checks check-release -p ${{ matrix.crate }}

View File

@ -71,6 +71,7 @@
- Update to [`libp2p-noise` `v0.41.0`](transports/noise/CHANGELOG.md#0410). - Update to [`libp2p-noise` `v0.41.0`](transports/noise/CHANGELOG.md#0410).
- Update to [`libp2p-ping` `v0.41.0`](protocols/ping/CHANGELOG.md#0410). - Update to [`libp2p-ping` `v0.41.0`](protocols/ping/CHANGELOG.md#0410).
- Update to [`libp2p-plaintext` `v0.38.0`](transports/plaintext/CHANGELOG.md#0380). - Update to [`libp2p-plaintext` `v0.38.0`](transports/plaintext/CHANGELOG.md#0380).
- Update to [`libp2p-pnet` `v0.22.2`](transports/pnet/CHANGELOG.md#0222).
- Update to [`libp2p-relay` `v0.14.0`](protocols/relay/CHANGELOG.md#0140). - Update to [`libp2p-relay` `v0.14.0`](protocols/relay/CHANGELOG.md#0140).
- Update to [`libp2p-rendezvous` `v0.11.0`](protocols/rendezovus/CHANGELOG.md#0110). - Update to [`libp2p-rendezvous` `v0.11.0`](protocols/rendezovus/CHANGELOG.md#0110).
- Update to [`libp2p-request-response` `v0.23.0`](protocols/request-response/CHANGELOG.md#0230). - Update to [`libp2p-request-response` `v0.23.0`](protocols/request-response/CHANGELOG.md#0230).

View File

@ -1,7 +1,7 @@
[package] [package]
name = "libp2p" name = "libp2p"
edition = "2021" edition = "2021"
rust-version = "1.60.0" rust-version = "1.62.0"
description = "Peer-to-peer networking library" description = "Peer-to-peer networking library"
version = "0.50.0" version = "0.50.0"
authors = ["Parity Technologies <admin@parity.io>"] authors = ["Parity Technologies <admin@parity.io>"]
@ -103,14 +103,13 @@ libp2p-mplex = { version = "0.38.0", path = "muxers/mplex", optional = true }
libp2p-noise = { version = "0.41.0", path = "transports/noise", optional = true } libp2p-noise = { version = "0.41.0", path = "transports/noise", optional = true }
libp2p-ping = { version = "0.41.0", path = "protocols/ping", optional = true } libp2p-ping = { version = "0.41.0", path = "protocols/ping", optional = true }
libp2p-plaintext = { version = "0.38.0", path = "transports/plaintext", optional = true } libp2p-plaintext = { version = "0.38.0", path = "transports/plaintext", optional = true }
libp2p-pnet = { version = "0.22.1", path = "transports/pnet", optional = true } libp2p-pnet = { version = "0.22.2", path = "transports/pnet", optional = true }
libp2p-relay = { version = "0.14.0", path = "protocols/relay", optional = true } libp2p-relay = { version = "0.14.0", path = "protocols/relay", optional = true }
libp2p-rendezvous = { version = "0.11.0", path = "protocols/rendezvous", optional = true } libp2p-rendezvous = { version = "0.11.0", path = "protocols/rendezvous", optional = true }
libp2p-request-response = { version = "0.23.0", path = "protocols/request-response", optional = true } libp2p-request-response = { version = "0.23.0", path = "protocols/request-response", optional = true }
libp2p-swarm = { version = "0.41.0", path = "swarm" } libp2p-swarm = { version = "0.41.0", path = "swarm" }
libp2p-uds = { version = "0.37.0", path = "transports/uds", optional = true } 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-wasm-ext = { version = "0.38.0", path = "transports/wasm-ext", optional = true }
libp2p-webrtc = { version = "0.1.0-alpha", path = "transports/webrtc", optional = true }
libp2p-yamux = { version = "0.42.0", path = "muxers/yamux", optional = true } libp2p-yamux = { version = "0.42.0", path = "muxers/yamux", optional = true }
multiaddr = { version = "0.16.0" } multiaddr = { version = "0.16.0" }
parking_lot = "0.12.0" parking_lot = "0.12.0"
@ -123,8 +122,9 @@ libp2p-dns = { version = "0.38.0", path = "transports/dns", optional = true }
libp2p-mdns = { version = "0.42.0", path = "protocols/mdns", optional = true } libp2p-mdns = { version = "0.42.0", path = "protocols/mdns", optional = true }
libp2p-quic = { version = "0.7.0-alpha", path = "transports/quic", 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-tcp = { version = "0.38.0", path = "transports/tcp", optional = true }
libp2p-websocket = { version = "0.40.0", path = "transports/websocket", optional = true }
libp2p-tls = { version = "0.1.0-alpha", path = "transports/tls", optional = true } libp2p-tls = { version = "0.1.0-alpha", path = "transports/tls", optional = true }
libp2p-webrtc = { version = "0.1.0-alpha", path = "transports/webrtc", optional = true }
libp2p-websocket = { version = "0.40.0", path = "transports/websocket", optional = true }
[target.'cfg(not(target_os = "unknown"))'.dependencies] [target.'cfg(not(target_os = "unknown"))'.dependencies]
libp2p-gossipsub = { version = "0.43.0", path = "protocols/gossipsub", optional = true } libp2p-gossipsub = { version = "0.43.0", path = "protocols/gossipsub", optional = true }

View File

@ -6,9 +6,14 @@
- Move `Executor` to `libp2p-swarm`. See [PR 3097]. - Move `Executor` to `libp2p-swarm`. See [PR 3097].
- Update `rust-version` to reflect the actual MSRV: 1.60.0. See [PR 3090].
- Update `multistream-select` to `v0.12.1`. See [PR 3090].
[PR 3031]: https://github.com/libp2p/rust-libp2p/pull/3031 [PR 3031]: https://github.com/libp2p/rust-libp2p/pull/3031
[PR 3058]: https://github.com/libp2p/rust-libp2p/pull/3058 [PR 3058]: https://github.com/libp2p/rust-libp2p/pull/3058
[PR 3097]: https://github.com/libp2p/rust-libp2p/pull/3097 [PR 3097]: https://github.com/libp2p/rust-libp2p/pull/3097
[PR 3090]: https://github.com/libp2p/rust-libp2p/pull/3090
# 0.37.0 # 0.37.0

View File

@ -1,7 +1,7 @@
[package] [package]
name = "libp2p-core" name = "libp2p-core"
edition = "2021" edition = "2021"
rust-version = "1.56.1" rust-version = "1.60.0"
description = "Core traits and structs of libp2p" description = "Core traits and structs of libp2p"
version = "0.38.0" version = "0.38.0"
authors = ["Parity Technologies <admin@parity.io>"] authors = ["Parity Technologies <admin@parity.io>"]
@ -23,7 +23,7 @@ libsecp256k1 = { version = "0.7.0", optional = true }
log = "0.4" log = "0.4"
multiaddr = { version = "0.16.0" } multiaddr = { version = "0.16.0" }
multihash = { version = "0.16", default-features = false, features = ["std", "multihash-impl", "identity", "sha2"] } multihash = { version = "0.16", default-features = false, features = ["std", "multihash-impl", "identity", "sha2"] }
multistream-select = { version = "0.12", path = "../misc/multistream-select" } multistream-select = { version = "0.12.1", path = "../misc/multistream-select" }
p256 = { version = "0.11.1", default-features = false, features = ["ecdsa"], optional = true } p256 = { version = "0.11.1", default-features = false, features = ["ecdsa"], optional = true }
parking_lot = "0.12.0" parking_lot = "0.12.0"
pin-project = "1.0.0" pin-project = "1.0.0"

View File

@ -18,7 +18,10 @@
- Add `protocol_stack` metrics. See [PR 2982]. - Add `protocol_stack` metrics. See [PR 2982].
- Update `rust-version` to reflect the actual MSRV: 1.62.0. See [PR 3090].
[PR 2982]: https://github.com/libp2p/rust-libp2p/pull/2982/ [PR 2982]: https://github.com/libp2p/rust-libp2p/pull/2982/
[PR 3090]: https://github.com/libp2p/rust-libp2p/pull/3090
# 0.10.0 # 0.10.0

View File

@ -1,7 +1,7 @@
[package] [package]
name = "libp2p-metrics" name = "libp2p-metrics"
edition = "2021" edition = "2021"
rust-version = "1.56.1" rust-version = "1.62.0"
description = "Metrics for libp2p" description = "Metrics for libp2p"
version = "0.11.0" version = "0.11.0"
authors = ["Max Inden <mail@max-inden.de>"] authors = ["Max Inden <mail@max-inden.de>"]

View File

@ -1,3 +1,9 @@
# 0.12.1 [Unreleased]
- Update `rust-version` to reflect the actual MSRV: 1.60.0. See [PR 3090].
[PR 3090]: https://github.com/libp2p/rust-libp2p/pull/3090
# 0.12.0 # 0.12.0
- Remove parallel dialing optimization, to avoid requiring the use of the `ls` command. See [PR 2934]. - Remove parallel dialing optimization, to avoid requiring the use of the `ls` command. See [PR 2934].

View File

@ -1,9 +1,9 @@
[package] [package]
name = "multistream-select" name = "multistream-select"
edition = "2021" edition = "2021"
rust-version = "1.56.1" rust-version = "1.60.0"
description = "Multistream-select negotiation protocol for libp2p" description = "Multistream-select negotiation protocol for libp2p"
version = "0.12.0" version = "0.12.1"
authors = ["Parity Technologies <admin@parity.io>"] authors = ["Parity Technologies <admin@parity.io>"]
license = "MIT" license = "MIT"
repository = "https://github.com/libp2p/rust-libp2p" repository = "https://github.com/libp2p/rust-libp2p"

View File

@ -4,8 +4,11 @@
- Implement `From` trait for `std::io::Error`. See [PR 2622]. - Implement `From` trait for `std::io::Error`. See [PR 2622].
- Don't leak `prost` dependency in `Error` type. See [PR 3058]. - Don't leak `prost` dependency in `Error` type. See [PR 3058].
- Update `rust-version` to reflect the actual MSRV: 1.60.0. See [PR 3090].
[PR 2622]: https://github.com/libp2p/rust-libp2p/pull/2622/ [PR 2622]: https://github.com/libp2p/rust-libp2p/pull/2622/
[PR 3058]: https://github.com/libp2p/rust-libp2p/pull/3058/ [PR 3058]: https://github.com/libp2p/rust-libp2p/pull/3058/
[PR 3090]: https://github.com/libp2p/rust-libp2p/pull/3090
# 0.2.0 # 0.2.0

View File

@ -1,7 +1,7 @@
[package] [package]
name = "prost-codec" name = "prost-codec"
edition = "2021" edition = "2021"
rust-version = "1.56.1" rust-version = "1.60.0"
description = "Asynchronous de-/encoding of Protobuf structs using asynchronous-codec, unsigned-varint and prost." description = "Asynchronous de-/encoding of Protobuf structs using asynchronous-codec, unsigned-varint and prost."
version = "0.3.0" version = "0.3.0"
authors = ["Max Inden <mail@max-inden.de>"] authors = ["Max Inden <mail@max-inden.de>"]

View File

@ -2,6 +2,7 @@
name = "rw-stream-sink" name = "rw-stream-sink"
edition = "2021" edition = "2021"
description = "Adaptator between Stream/Sink and AsyncRead/AsyncWrite" description = "Adaptator between Stream/Sink and AsyncRead/AsyncWrite"
rust-version = "1.60.0"
version = "0.3.0" version = "0.3.0"
authors = ["Parity Technologies <admin@parity.io>"] authors = ["Parity Technologies <admin@parity.io>"]
license = "MIT" license = "MIT"

View File

@ -2,6 +2,10 @@
- Update to `libp2p-core` `v0.38.0`. - Update to `libp2p-core` `v0.38.0`.
- Update `rust-version` to reflect the actual MSRV: 1.60.0. See [PR 3090].
[PR 3090]: https://github.com/libp2p/rust-libp2p/pull/3090
# 0.37.0 # 0.37.0
- Bump rand to 0.8 and quickcheck to 1. See [PR 2857]. - Bump rand to 0.8 and quickcheck to 1. See [PR 2857].

View File

@ -1,7 +1,7 @@
[package] [package]
name = "libp2p-mplex" name = "libp2p-mplex"
edition = "2021" edition = "2021"
rust-version = "1.56.1" rust-version = "1.60.0"
description = "Mplex multiplexing protocol for libp2p" description = "Mplex multiplexing protocol for libp2p"
version = "0.38.0" version = "0.38.0"
authors = ["Parity Technologies <admin@parity.io>"] authors = ["Parity Technologies <admin@parity.io>"]

View File

@ -2,6 +2,10 @@
- Update to `libp2p-core` `v0.38.0`. - Update to `libp2p-core` `v0.38.0`.
- Update `rust-version` to reflect the actual MSRV: 1.60.0. See [PR 3090].
[PR 3090]: https://github.com/libp2p/rust-libp2p/pull/3090
# 0.41.1 # 0.41.1
- Yield from `StreamMuxer::poll` as soon as we receive a single substream. - Yield from `StreamMuxer::poll` as soon as we receive a single substream.

View File

@ -1,7 +1,7 @@
[package] [package]
name = "libp2p-yamux" name = "libp2p-yamux"
edition = "2021" edition = "2021"
rust-version = "1.56.1" rust-version = "1.60.0"
description = "Yamux multiplexing protocol for libp2p" description = "Yamux multiplexing protocol for libp2p"
version = "0.42.0" version = "0.42.0"
authors = ["Parity Technologies <admin@parity.io>"] authors = ["Parity Technologies <admin@parity.io>"]

View File

@ -9,7 +9,10 @@
- Replace `Behaviour`'s `NetworkBehaviour` implemention `inject_*` methods with the new `on_*` methods. - Replace `Behaviour`'s `NetworkBehaviour` implemention `inject_*` methods with the new `on_*` methods.
See [PR 3011]. See [PR 3011].
- Update `rust-version` to reflect the actual MSRV: 1.62.0. See [PR 3090].
[PR 3011]: https://github.com/libp2p/rust-libp2p/pull/3011 [PR 3011]: https://github.com/libp2p/rust-libp2p/pull/3011
[PR 3090]: https://github.com/libp2p/rust-libp2p/pull/3090
# 0.8.0 # 0.8.0

View File

@ -1,7 +1,7 @@
[package] [package]
name = "libp2p-autonat" name = "libp2p-autonat"
edition = "2021" edition = "2021"
rust-version = "1.56.1" rust-version = "1.62.0"
description = "NAT and firewall detection for libp2p" description = "NAT and firewall detection for libp2p"
version = "0.9.0" version = "0.9.0"
authors = ["David Craven <david@craven.ch>", "Elena Frank <elena.frank@protonmail.com>"] authors = ["David Craven <david@craven.ch>", "Elena Frank <elena.frank@protonmail.com>"]

View File

@ -150,7 +150,7 @@ impl<'a> HandleInnerEvent for AsClient<'a> {
// Update observed address score if it is finite. // Update observed address score if it is finite.
let score = params let score = params
.external_addresses() .external_addresses()
.find_map(|r| (r.addr == address).then(|| r.score)) .find_map(|r| (r.addr == address).then_some(r.score))
.unwrap_or(AddressScore::Finite(0)); .unwrap_or(AddressScore::Finite(0));
if let AddressScore::Finite(finite_score) = score { if let AddressScore::Finite(finite_score) = score {
action = Some(NetworkBehaviourAction::ReportObservedAddr { action = Some(NetworkBehaviourAction::ReportObservedAddr {
@ -266,7 +266,7 @@ impl<'a> AsClient<'a> {
// Filter servers for which no qualified address is known. // Filter servers for which no qualified address is known.
// This is the case if the connection is relayed or the address is // This is the case if the connection is relayed or the address is
// not global (in case of Config::only_global_ips). // not global (in case of Config::only_global_ips).
addrs.values().any(|a| a.is_some()).then(|| id) addrs.values().any(|a| a.is_some()).then_some(id)
})); }));
} }

View File

@ -346,7 +346,7 @@ impl<'a> AsServer<'a> {
addr.push(Protocol::P2p(peer.into())) addr.push(Protocol::P2p(peer.into()))
} }
// Only collect distinct addresses. // Only collect distinct addresses.
distinct.insert(addr.clone()).then(|| addr) distinct.insert(addr.clone()).then_some(addr)
}) })
.collect() .collect()
} }

View File

@ -12,8 +12,11 @@
- Replace `direct::Handler` and `relayed::Handler`'s `ConnectionHandler` implemention `inject_*` - Replace `direct::Handler` and `relayed::Handler`'s `ConnectionHandler` implemention `inject_*`
methods with the new `on_*` methods. See [PR 3085]. methods with the new `on_*` methods. See [PR 3085].
- Update `rust-version` to reflect the actual MSRV: 1.62.0. See [PR 3090].
[PR 3085]: https://github.com/libp2p/rust-libp2p/pull/3085 [PR 3085]: https://github.com/libp2p/rust-libp2p/pull/3085
[PR 3011]: https://github.com/libp2p/rust-libp2p/pull/3011 [PR 3011]: https://github.com/libp2p/rust-libp2p/pull/3011
[PR 3090]: https://github.com/libp2p/rust-libp2p/pull/3090
# 0.7.0 # 0.7.0

View File

@ -1,7 +1,7 @@
[package] [package]
name = "libp2p-dcutr" name = "libp2p-dcutr"
edition = "2021" edition = "2021"
rust-version = "1.56.1" rust-version = "1.62.0"
description = "Direct connection upgrade through relay" description = "Direct connection upgrade through relay"
version = "0.8.0" version = "0.8.0"
authors = ["Max Inden <mail@max-inden.de>"] authors = ["Max Inden <mail@max-inden.de>"]

View File

@ -183,7 +183,7 @@ impl Behaviour {
.expect("Peer of direct connection to be tracked."); .expect("Peer of direct connection to be tracked.");
connections connections
.remove(&connection_id) .remove(&connection_id)
.then(|| ()) .then_some(())
.expect("Direct connection to be tracked."); .expect("Direct connection to be tracked.");
if connections.is_empty() { if connections.is_empty() {
self.direct_connections.remove(&peer_id); self.direct_connections.remove(&peer_id);

View File

@ -7,7 +7,10 @@
- Replace `Floodsub`'s `NetworkBehaviour` implemention `inject_*` methods with the new `on_*` methods. - Replace `Floodsub`'s `NetworkBehaviour` implemention `inject_*` methods with the new `on_*` methods.
See [PR 3011]. See [PR 3011].
- Update `rust-version` to reflect the actual MSRV: 1.62.0. See [PR 3090].
[PR 3011]: https://github.com/libp2p/rust-libp2p/pull/3011 [PR 3011]: https://github.com/libp2p/rust-libp2p/pull/3011
[PR 3090]: https://github.com/libp2p/rust-libp2p/pull/3090
# 0.40.0 # 0.40.0

View File

@ -1,7 +1,7 @@
[package] [package]
name = "libp2p-floodsub" name = "libp2p-floodsub"
edition = "2021" edition = "2021"
rust-version = "1.56.1" rust-version = "1.62.0"
description = "Floodsub protocol for libp2p" description = "Floodsub protocol for libp2p"
version = "0.41.0" version = "0.41.0"
authors = ["Parity Technologies <admin@parity.io>"] authors = ["Parity Technologies <admin@parity.io>"]

View File

@ -8,15 +8,18 @@
- Refactoring GossipsubCodec to use common protobuf Codec. See [PR 3070]. - Refactoring GossipsubCodec to use common protobuf Codec. See [PR 3070].
- Replace `Gossipsub`'s `NetworkBehaviour` implemention `inject_*` methods with the new `on_*` methods. - Replace `Gossipsub`'s `NetworkBehaviour` implementation `inject_*` methods with the new `on_*` methods.
See [PR 3011]. See [PR 3011].
- Replace `GossipsubHandler`'s `ConnectionHandler` implemention `inject_*` methods with the new `on_*` methods. - Replace `GossipsubHandler`'s `ConnectionHandler` implementation `inject_*` methods with the new `on_*` methods.
See [PR 3085]. See [PR 3085].
- Update `rust-version` to reflect the actual MSRV: 1.62.0. See [PR 3090].
[PR 3085]: https://github.com/libp2p/rust-libp2p/pull/3085 [PR 3085]: https://github.com/libp2p/rust-libp2p/pull/3085
[PR 3070]: https://github.com/libp2p/rust-libp2p/pull/3070 [PR 3070]: https://github.com/libp2p/rust-libp2p/pull/3070
[PR 3011]: https://github.com/libp2p/rust-libp2p/pull/3011 [PR 3011]: https://github.com/libp2p/rust-libp2p/pull/3011
[PR 3090]: https://github.com/libp2p/rust-libp2p/pull/3090
# 0.42.0 # 0.42.0

View File

@ -1,7 +1,7 @@
[package] [package]
name = "libp2p-gossipsub" name = "libp2p-gossipsub"
edition = "2021" edition = "2021"
rust-version = "1.56.1" rust-version = "1.62.0"
description = "Gossipsub protocol for libp2p" description = "Gossipsub protocol for libp2p"
version = "0.43.0" version = "0.43.0"
authors = ["Age Manning <Age@AgeManning.com>"] authors = ["Age Manning <Age@AgeManning.com>"]

View File

@ -14,9 +14,12 @@
- Replace `Handler`'s `ConnectionHandler` implemention `inject_*` methods with the new `on_*` methods. - Replace `Handler`'s `ConnectionHandler` implemention `inject_*` methods with the new `on_*` methods.
See [PR 3085]. See [PR 3085].
- Update `rust-version` to reflect the actual MSRV: 1.62.0. See [PR 3090].
[PR 3085]: https://github.com/libp2p/rust-libp2p/pull/3085 [PR 3085]: https://github.com/libp2p/rust-libp2p/pull/3085
[PR 3011]: https://github.com/libp2p/rust-libp2p/pull/3011 [PR 3011]: https://github.com/libp2p/rust-libp2p/pull/3011
[PR 2995]: https://github.com/libp2p/rust-libp2p/pull/2995 [PR 2995]: https://github.com/libp2p/rust-libp2p/pull/2995
[PR 3090]: https://github.com/libp2p/rust-libp2p/pull/3090
# 0.40.0 # 0.40.0

View File

@ -1,7 +1,7 @@
[package] [package]
name = "libp2p-identify" name = "libp2p-identify"
edition = "2021" edition = "2021"
rust-version = "1.56.1" rust-version = "1.62.0"
description = "Nodes identifcation protocol for libp2p" description = "Nodes identifcation protocol for libp2p"
version = "0.41.0" version = "0.41.0"
authors = ["Parity Technologies <admin@parity.io>"] authors = ["Parity Technologies <admin@parity.io>"]

View File

@ -10,8 +10,11 @@
- Replace `KademliaHandler`'s `ConnectionHandler` implemention `inject_*` methods with the new `on_*` methods. - Replace `KademliaHandler`'s `ConnectionHandler` implemention `inject_*` methods with the new `on_*` methods.
See [PR 3085]. See [PR 3085].
- Update `rust-version` to reflect the actual MSRV: 1.62.0. See [PR 3090].
[PR 3085]: https://github.com/libp2p/rust-libp2p/pull/3085 [PR 3085]: https://github.com/libp2p/rust-libp2p/pull/3085
[PR 3011]: https://github.com/libp2p/rust-libp2p/pull/3011 [PR 3011]: https://github.com/libp2p/rust-libp2p/pull/3011
[PR 3090]: https://github.com/libp2p/rust-libp2p/pull/3090
# 0.41.0 # 0.41.0

View File

@ -1,7 +1,7 @@
[package] [package]
name = "libp2p-kad" name = "libp2p-kad"
edition = "2021" edition = "2021"
rust-version = "1.56.1" rust-version = "1.62.0"
description = "Kademlia protocol for libp2p" description = "Kademlia protocol for libp2p"
version = "0.42.0" version = "0.42.0"
authors = ["Parity Technologies <admin@parity.io>"] authors = ["Parity Technologies <admin@parity.io>"]

View File

@ -17,10 +17,13 @@ and move and rename `Mdns` to `async_io::Behaviour`. See [PR 3096].
- Use `trust-dns-proto` to parse DNS messages. See [PR 3102]. - Use `trust-dns-proto` to parse DNS messages. See [PR 3102].
- Update `rust-version` to reflect the actual MSRV: 1.62.0. See [PR 3090].
[discussion 2174]: https://github.com/libp2p/rust-libp2p/discussions/2174 [discussion 2174]: https://github.com/libp2p/rust-libp2p/discussions/2174
[PR 3096]: https://github.com/libp2p/rust-libp2p/pull/3096 [PR 3096]: https://github.com/libp2p/rust-libp2p/pull/3096
[PR 3011]: https://github.com/libp2p/rust-libp2p/pull/3011 [PR 3011]: https://github.com/libp2p/rust-libp2p/pull/3011
[PR 3102]: https://github.com/libp2p/rust-libp2p/pull/3102 [PR 3102]: https://github.com/libp2p/rust-libp2p/pull/3102
[PR 3090]: https://github.com/libp2p/rust-libp2p/pull/3090
# 0.41.0 # 0.41.0

View File

@ -1,7 +1,7 @@
[package] [package]
name = "libp2p-mdns" name = "libp2p-mdns"
edition = "2021" edition = "2021"
rust-version = "1.56.1" rust-version = "1.62.0"
version = "0.42.0" version = "0.42.0"
description = "Implementation of the libp2p mDNS discovery method" description = "Implementation of the libp2p mDNS discovery method"
authors = ["Parity Technologies <admin@parity.io>"] authors = ["Parity Technologies <admin@parity.io>"]

View File

@ -10,8 +10,11 @@
- Replace `Handler`'s `ConnectionHandler` implemention `inject_*` methods with the new `on_*` methods. - Replace `Handler`'s `ConnectionHandler` implemention `inject_*` methods with the new `on_*` methods.
See [PR 3085]. See [PR 3085].
- Update `rust-version` to reflect the actual MSRV: 1.62.0. See [PR 3090].
[PR 3085]: https://github.com/libp2p/rust-libp2p/pull/3085 [PR 3085]: https://github.com/libp2p/rust-libp2p/pull/3085
[PR 3011]: https://github.com/libp2p/rust-libp2p/pull/3011 [PR 3011]: https://github.com/libp2p/rust-libp2p/pull/3011
[PR 3090]: https://github.com/libp2p/rust-libp2p/pull/3090
# 0.40.0 # 0.40.0

View File

@ -1,7 +1,7 @@
[package] [package]
name = "libp2p-ping" name = "libp2p-ping"
edition = "2021" edition = "2021"
rust-version = "1.56.1" rust-version = "1.62.0"
description = "Ping protocol for libp2p" description = "Ping protocol for libp2p"
version = "0.41.0" version = "0.41.0"
authors = ["Parity Technologies <admin@parity.io>"] authors = ["Parity Technologies <admin@parity.io>"]

View File

@ -12,8 +12,11 @@
- Replace `client::Handler` and `relay::Handler`'s `ConnectionHandler` implemention `inject_*` methods - Replace `client::Handler` and `relay::Handler`'s `ConnectionHandler` implemention `inject_*` methods
with the new `on_*` methods. See [PR 3085]. with the new `on_*` methods. See [PR 3085].
- Update `rust-version` to reflect the actual MSRV: 1.62.0. See [PR 3090].
[PR 3085]: https://github.com/libp2p/rust-libp2p/pull/3085 [PR 3085]: https://github.com/libp2p/rust-libp2p/pull/3085
[PR 3011]: https://github.com/libp2p/rust-libp2p/pull/3011 [PR 3011]: https://github.com/libp2p/rust-libp2p/pull/3011
[PR 3090]: https://github.com/libp2p/rust-libp2p/pull/3090
# 0.13.0 # 0.13.0

View File

@ -1,7 +1,7 @@
[package] [package]
name = "libp2p-relay" name = "libp2p-relay"
edition = "2021" edition = "2021"
rust-version = "1.56.1" rust-version = "1.62.0"
description = "Communications relaying for libp2p" description = "Communications relaying for libp2p"
version = "0.14.0" version = "0.14.0"
authors = ["Parity Technologies <admin@parity.io>", "Max Inden <mail@max-inden.de>"] authors = ["Parity Technologies <admin@parity.io>", "Max Inden <mail@max-inden.de>"]

View File

@ -9,8 +9,11 @@
- Replace `Client` and `Server`'s `NetworkBehaviour` implemention `inject_*` methods with the new `on_*` methods. - Replace `Client` and `Server`'s `NetworkBehaviour` implemention `inject_*` methods with the new `on_*` methods.
See [PR 3011]. See [PR 3011].
- Update `rust-version` to reflect the actual MSRV: 1.62.0. See [PR 3090].
[PR 3011]: https://github.com/libp2p/rust-libp2p/pull/3011 [PR 3011]: https://github.com/libp2p/rust-libp2p/pull/3011
[PR 3058]: https://github.com/libp2p/rust-libp2p/pull/3058 [PR 3058]: https://github.com/libp2p/rust-libp2p/pull/3058
[PR 3090]: https://github.com/libp2p/rust-libp2p/pull/3090
# 0.10.0 # 0.10.0

View File

@ -1,7 +1,7 @@
[package] [package]
name = "libp2p-rendezvous" name = "libp2p-rendezvous"
edition = "2021" edition = "2021"
rust-version = "1.56.1" rust-version = "1.62.0"
description = "Rendezvous protocol for libp2p" description = "Rendezvous protocol for libp2p"
version = "0.11.0" version = "0.11.0"
authors = ["The COMIT guys <hello@comit.network>"] authors = ["The COMIT guys <hello@comit.network>"]

View File

@ -178,7 +178,7 @@ impl NetworkBehaviour for Behaviour {
fn addresses_of_peer(&mut self, peer: &PeerId) -> Vec<Multiaddr> { fn addresses_of_peer(&mut self, peer: &PeerId) -> Vec<Multiaddr> {
self.discovered_peers self.discovered_peers
.iter() .iter()
.filter_map(|((candidate, _), addresses)| (candidate == peer).then(|| addresses)) .filter_map(|((candidate, _), addresses)| (candidate == peer).then_some(addresses))
.flatten() .flatten()
.cloned() .cloned()
.collect() .collect()

View File

@ -10,8 +10,11 @@
- Replace `RequestResponseHandler`'s `ConnectionHandler` implemention `inject_*` methods - Replace `RequestResponseHandler`'s `ConnectionHandler` implemention `inject_*` methods
with the new `on_*` methods. See [PR 3085]. with the new `on_*` methods. See [PR 3085].
- Update `rust-version` to reflect the actual MSRV: 1.62.0. See [PR 3090].
[PR 3085]: https://github.com/libp2p/rust-libp2p/pull/3085 [PR 3085]: https://github.com/libp2p/rust-libp2p/pull/3085
[PR 3011]: https://github.com/libp2p/rust-libp2p/pull/3011 [PR 3011]: https://github.com/libp2p/rust-libp2p/pull/3011
[PR 3090]: https://github.com/libp2p/rust-libp2p/pull/3090
# 0.22.0 # 0.22.0

View File

@ -1,7 +1,7 @@
[package] [package]
name = "libp2p-request-response" name = "libp2p-request-response"
edition = "2021" edition = "2021"
rust-version = "1.56.1" rust-version = "1.62.0"
description = "Generic Request/Response Protocols" description = "Generic Request/Response Protocols"
version = "0.23.0" version = "0.23.0"
authors = ["Parity Technologies <admin@parity.io>"] authors = ["Parity Technologies <admin@parity.io>"]

View File

@ -117,6 +117,7 @@ pub use libp2p_swarm as swarm;
pub use libp2p_tcp as tcp; pub use libp2p_tcp as tcp;
#[cfg(feature = "tls")] #[cfg(feature = "tls")]
#[cfg_attr(docsrs, doc(cfg(feature = "tls")))] #[cfg_attr(docsrs, doc(cfg(feature = "tls")))]
#[cfg(not(any(target_os = "emscripten", target_os = "wasi", target_os = "unknown")))]
#[doc(inline)] #[doc(inline)]
pub use libp2p_tls as tls; pub use libp2p_tls as tls;
#[cfg(feature = "uds")] #[cfg(feature = "uds")]
@ -127,6 +128,7 @@ pub use libp2p_uds as uds;
pub use libp2p_wasm_ext as wasm_ext; pub use libp2p_wasm_ext as wasm_ext;
#[cfg(feature = "webrtc")] #[cfg(feature = "webrtc")]
#[cfg_attr(docsrs, doc(cfg(feature = "webrtc")))] #[cfg_attr(docsrs, doc(cfg(feature = "webrtc")))]
#[cfg(not(any(target_os = "emscripten", target_os = "wasi", target_os = "unknown")))]
#[doc(inline)] #[doc(inline)]
pub use libp2p_webrtc as webrtc; pub use libp2p_webrtc as webrtc;
#[cfg(feature = "websocket")] #[cfg(feature = "websocket")]

View File

@ -7,8 +7,11 @@
- Add `prelude` configuration option. - Add `prelude` configuration option.
The derive-macro generates code that needs to refer to various symbols. See [PR 3055]. The derive-macro generates code that needs to refer to various symbols. See [PR 3055].
- Update `rust-version` to reflect the actual MSRV: 1.60.0. See [PR 3090].
[PR 3011]: https://github.com/libp2p/rust-libp2p/pull/3011 [PR 3011]: https://github.com/libp2p/rust-libp2p/pull/3011
[PR 3055]: https://github.com/libp2p/rust-libp2p/pull/3055 [PR 3055]: https://github.com/libp2p/rust-libp2p/pull/3055
[PR 3090]: https://github.com/libp2p/rust-libp2p/pull/3090
# 0.30.1 # 0.30.1

View File

@ -1,7 +1,7 @@
[package] [package]
name = "libp2p-swarm-derive" name = "libp2p-swarm-derive"
edition = "2021" edition = "2021"
rust-version = "1.56.1" rust-version = "1.60.0"
description = "Procedural macros of libp2p-core" description = "Procedural macros of libp2p-core"
version = "0.30.2" version = "0.30.2"
authors = ["Parity Technologies <admin@parity.io>"] authors = ["Parity Technologies <admin@parity.io>"]

View File

@ -94,11 +94,14 @@
- `SwarmBuilder::new` - `SwarmBuilder::new`
- `SwarmBuilder::executor` - `SwarmBuilder::executor`
- Update `rust-version` to reflect the actual MSRV: 1.62.0. See [PR 3090].
[PR 3085]: https://github.com/libp2p/rust-libp2p/pull/3085 [PR 3085]: https://github.com/libp2p/rust-libp2p/pull/3085
[PR 3011]: https://github.com/libp2p/rust-libp2p/pull/3011 [PR 3011]: https://github.com/libp2p/rust-libp2p/pull/3011
[PR 3055]: https://github.com/libp2p/rust-libp2p/pull/3055 [PR 3055]: https://github.com/libp2p/rust-libp2p/pull/3055
[PR 3097]: https://github.com/libp2p/rust-libp2p/pull/3097 [PR 3097]: https://github.com/libp2p/rust-libp2p/pull/3097
[Issue 3107]: https://github.com/libp2p/rust-libp2p/issues/3107 [Issue 3107]: https://github.com/libp2p/rust-libp2p/issues/3107
[PR 3090]: https://github.com/libp2p/rust-libp2p/pull/3090
# 0.40.1 # 0.40.1

View File

@ -1,7 +1,7 @@
[package] [package]
name = "libp2p-swarm" name = "libp2p-swarm"
edition = "2021" edition = "2021"
rust-version = "1.56.1" rust-version = "1.62.0"
description = "The libp2p swarm" description = "The libp2p swarm"
version = "0.41.0" version = "0.41.0"
authors = ["Parity Technologies <admin@parity.io>"] authors = ["Parity Technologies <admin@parity.io>"]
@ -24,8 +24,10 @@ rand = "0.8"
smallvec = "1.6.1" smallvec = "1.6.1"
thiserror = "1.0" thiserror = "1.0"
void = "1" void = "1"
tokio = { version = "1.15", features = ["rt"], optional = true }
[target.'cfg(not(any(target_os = "emscripten", target_os = "wasi", target_os = "unknown")))'.dependencies]
async-std = { version = "1.6.2", optional = true } async-std = { version = "1.6.2", optional = true }
tokio = { version = "1.15", features = ["rt"], optional = true }
[features] [features]
macros = ["dep:libp2p-swarm-derive"] macros = ["dep:libp2p-swarm-derive"]

View File

@ -25,22 +25,34 @@ impl Executor for ThreadPool {
} }
} }
#[cfg(feature = "tokio")] #[cfg(all(
feature = "tokio",
not(any(target_os = "emscripten", target_os = "wasi", target_os = "unknown"))
))]
#[derive(Default, Debug, Clone, Copy)] #[derive(Default, Debug, Clone, Copy)]
pub(crate) struct TokioExecutor; pub(crate) struct TokioExecutor;
#[cfg(feature = "tokio")] #[cfg(all(
feature = "tokio",
not(any(target_os = "emscripten", target_os = "wasi", target_os = "unknown"))
))]
impl Executor for TokioExecutor { impl Executor for TokioExecutor {
fn exec(&self, future: Pin<Box<dyn Future<Output = ()> + Send>>) { fn exec(&self, future: Pin<Box<dyn Future<Output = ()> + Send>>) {
let _ = tokio::spawn(future); let _ = tokio::spawn(future);
} }
} }
#[cfg(feature = "async-std")] #[cfg(all(
feature = "async-std",
not(any(target_os = "emscripten", target_os = "wasi", target_os = "unknown"))
))]
#[derive(Default, Debug, Clone, Copy)] #[derive(Default, Debug, Clone, Copy)]
pub(crate) struct AsyncStdExecutor; pub(crate) struct AsyncStdExecutor;
#[cfg(feature = "async-std")] #[cfg(all(
feature = "async-std",
not(any(target_os = "emscripten", target_os = "wasi", target_os = "unknown"))
))]
impl Executor for AsyncStdExecutor { impl Executor for AsyncStdExecutor {
fn exec(&self, future: Pin<Box<dyn Future<Output = ()> + Send>>) { fn exec(&self, future: Pin<Box<dyn Future<Output = ()> + Send>>) {
let _ = async_std::task::spawn(future); let _ = async_std::task::spawn(future);

View File

@ -366,7 +366,10 @@ where
} }
/// Builds a new `Swarm` with a tokio executor. /// Builds a new `Swarm` with a tokio executor.
#[cfg(feature = "tokio")] #[cfg(all(
feature = "tokio",
not(any(target_os = "emscripten", target_os = "wasi", target_os = "unknown"))
))]
pub fn with_tokio_executor( pub fn with_tokio_executor(
transport: transport::Boxed<(PeerId, StreamMuxerBox)>, transport: transport::Boxed<(PeerId, StreamMuxerBox)>,
behaviour: TBehaviour, behaviour: TBehaviour,
@ -381,7 +384,10 @@ where
} }
/// Builds a new `Swarm` with an async-std executor. /// Builds a new `Swarm` with an async-std executor.
#[cfg(feature = "async-std")] #[cfg(all(
feature = "async-std",
not(any(target_os = "emscripten", target_os = "wasi", target_os = "unknown"))
))]
pub fn with_async_std_executor( pub fn with_async_std_executor(
transport: transport::Boxed<(PeerId, StreamMuxerBox)>, transport: transport::Boxed<(PeerId, StreamMuxerBox)>,
behaviour: TBehaviour, behaviour: TBehaviour,

View File

@ -2,6 +2,10 @@
- Update to `libp2p-core` `v0.38.0`. - Update to `libp2p-core` `v0.38.0`.
- Update `rust-version` to reflect the actual MSRV: 1.60.0. See [PR 3090].
[PR 3090]: https://github.com/libp2p/rust-libp2p/pull/3090
# 0.37.0 # 0.37.0
- Update to `libp2p-core` `v0.37.0`. - Update to `libp2p-core` `v0.37.0`.

View File

@ -1,7 +1,7 @@
[package] [package]
name = "libp2p-deflate" name = "libp2p-deflate"
edition = "2021" edition = "2021"
rust-version = "1.56.1" rust-version = "1.60.0"
description = "Deflate encryption protocol for libp2p" description = "Deflate encryption protocol for libp2p"
version = "0.38.0" version = "0.38.0"
authors = ["Parity Technologies <admin@parity.io>"] authors = ["Parity Technologies <admin@parity.io>"]

View File

@ -2,6 +2,10 @@
- Update to `libp2p-core` `v0.38.0`. - Update to `libp2p-core` `v0.38.0`.
- Update `rust-version` to reflect the actual MSRV: 1.60.0. See [PR 3090].
[PR 3090]: https://github.com/libp2p/rust-libp2p/pull/3090
# 0.37.0 # 0.37.0
- Remove default features. If you previously depended on `async-std` you need to enable this explicitly now. See [PR 2918]. - Remove default features. If you previously depended on `async-std` you need to enable this explicitly now. See [PR 2918].

View File

@ -1,7 +1,7 @@
[package] [package]
name = "libp2p-dns" name = "libp2p-dns"
edition = "2021" edition = "2021"
rust-version = "1.56.1" rust-version = "1.60.0"
description = "DNS transport implementation for libp2p" description = "DNS transport implementation for libp2p"
version = "0.38.0" version = "0.38.0"
authors = ["Parity Technologies <admin@parity.io>"] authors = ["Parity Technologies <admin@parity.io>"]

View File

@ -4,7 +4,10 @@
- Update to `libp2p-core` `v0.38.0`. - Update to `libp2p-core` `v0.38.0`.
- Update `rust-version` to reflect the actual MSRV: 1.60.0. See [PR 3090].
[PR 3058]: https://github.com/libp2p/rust-libp2p/pull/3058 [PR 3058]: https://github.com/libp2p/rust-libp2p/pull/3058
[PR 3090]: https://github.com/libp2p/rust-libp2p/pull/3090
# 0.40.0 # 0.40.0

View File

@ -1,7 +1,7 @@
[package] [package]
name = "libp2p-noise" name = "libp2p-noise"
edition = "2021" edition = "2021"
rust-version = "1.56.1" rust-version = "1.60.0"
description = "Cryptographic handshake protocol using the noise framework." description = "Cryptographic handshake protocol using the noise framework."
version = "0.41.0" version = "0.41.0"
authors = ["Parity Technologies <admin@parity.io>"] authors = ["Parity Technologies <admin@parity.io>"]

View File

@ -4,7 +4,10 @@
- Update to `libp2p-core` `v0.38.0`. - Update to `libp2p-core` `v0.38.0`.
- Update `rust-version` to reflect the actual MSRV: 1.60.0. See [PR 3090].
[PR 3058]: https://github.com/libp2p/rust-libp2p/pull/3058 [PR 3058]: https://github.com/libp2p/rust-libp2p/pull/3058
[PR 3090]: https://github.com/libp2p/rust-libp2p/pull/3090
# 0.37.0 # 0.37.0

View File

@ -1,7 +1,7 @@
[package] [package]
name = "libp2p-plaintext" name = "libp2p-plaintext"
edition = "2021" edition = "2021"
rust-version = "1.56.1" rust-version = "1.60.0"
description = "Plaintext encryption dummy protocol for libp2p" description = "Plaintext encryption dummy protocol for libp2p"
version = "0.38.0" version = "0.38.0"
authors = ["Parity Technologies <admin@parity.io>"] authors = ["Parity Technologies <admin@parity.io>"]

View File

@ -1,3 +1,9 @@
# 0.22.2 [unreleased]
- Update `rust-version` to reflect the actual MSRV: 1.60.0. See [PR 3090].
[PR 3090]: https://github.com/libp2p/rust-libp2p/pull/3090
# 0.22.1 # 0.22.1
- Bump rand to 0.8 and quickcheck to 1. See [PR 2857]. - Bump rand to 0.8 and quickcheck to 1. See [PR 2857].

View File

@ -1,9 +1,9 @@
[package] [package]
name = "libp2p-pnet" name = "libp2p-pnet"
edition = "2021" edition = "2021"
rust-version = "1.56.1" rust-version = "1.60.0"
description = "Private swarm support for libp2p" description = "Private swarm support for libp2p"
version = "0.22.1" version = "0.22.2"
authors = ["Parity Technologies <admin@parity.io>"] authors = ["Parity Technologies <admin@parity.io>"]
license = "MIT" license = "MIT"
repository = "https://github.com/libp2p/rust-libp2p" repository = "https://github.com/libp2p/rust-libp2p"

View File

@ -3,12 +3,13 @@ name = "libp2p-quic"
version = "0.7.0-alpha" version = "0.7.0-alpha"
authors = ["Parity Technologies <admin@parity.io>"] authors = ["Parity Technologies <admin@parity.io>"]
edition = "2021" edition = "2021"
rust-version = "1.62.0"
description = "TLS based QUIC transport implementation for libp2p" description = "TLS based QUIC transport implementation for libp2p"
repository = "https://github.com/libp2p/rust-libp2p" repository = "https://github.com/libp2p/rust-libp2p"
license = "MIT" license = "MIT"
[dependencies] [dependencies]
async-std = { version = "1.12.0", default-features = false, optional = true } async-std = { version = "1.12.0", optional = true }
bytes = "1.2.1" bytes = "1.2.1"
futures = "0.3.15" futures = "0.3.15"
futures-timer = "3.0.2" futures-timer = "3.0.2"

View File

@ -288,7 +288,7 @@ fn prop<P: Provider + BlockOn>(
// Wait for all streams to complete. // Wait for all streams to complete.
P::block_on( P::block_on(
completed_streams_rx completed_streams_rx
.take(completed_streams as usize) .take(completed_streams)
.collect::<Vec<_>>(), .collect::<Vec<_>>(),
Duration::from_secs(30), Duration::from_secs(30),
); );

View File

@ -8,8 +8,11 @@
- Update to `libp2p-core` `v0.38.0`. - Update to `libp2p-core` `v0.38.0`.
- Update `rust-version` to reflect the actual MSRV: 1.60.0. See [PR 3090].
[PR 3101]: https://github.com/libp2p/rust-libp2p/pull/3101 [PR 3101]: https://github.com/libp2p/rust-libp2p/pull/3101
[PR 2961]: https://github.com/libp2p/rust-libp2p/pull/2961 [PR 2961]: https://github.com/libp2p/rust-libp2p/pull/2961
[PR 3090]: https://github.com/libp2p/rust-libp2p/pull/3090
# 0.37.0 # 0.37.0

View File

@ -1,7 +1,7 @@
[package] [package]
name = "libp2p-tcp" name = "libp2p-tcp"
edition = "2021" edition = "2021"
rust-version = "1.56.1" rust-version = "1.60.0"
description = "TCP/IP transport protocol for libp2p" description = "TCP/IP transport protocol for libp2p"
version = "0.38.0" version = "0.38.0"
authors = ["Parity Technologies <admin@parity.io>"] authors = ["Parity Technologies <admin@parity.io>"]

View File

@ -2,6 +2,7 @@
name = "libp2p-tls" name = "libp2p-tls"
version = "0.1.0-alpha" version = "0.1.0-alpha"
edition = "2021" edition = "2021"
rust-version = "1.60.0"
license = "MIT" license = "MIT"
exclude = ["src/test_assets"] exclude = ["src/test_assets"]
@ -25,7 +26,7 @@ features = ["dangerous_configuration"] # Must enable this to allow for custom ve
[dev-dependencies] [dev-dependencies]
hex = "0.4.3" hex = "0.4.3"
hex-literal = "0.3.4" hex-literal = "0.3.4"
libp2p = { path = "../..", features = ["yamux"], default-features = false } libp2p = { path = "../..", features = ["yamux", "rsa", "ecdsa", "secp256k1"], default-features = false }
tokio = { version = "1.21.1", features = ["full"] } tokio = { version = "1.21.1", features = ["full"] }
# 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.

View File

@ -1,5 +1,9 @@
# 0.37.0 [unreleased] # 0.37.0 [unreleased]
- Update `rust-version` to reflect the actual MSRV: 1.60.0. See [PR 3090].
[PR 3090]: https://github.com/libp2p/rust-libp2p/pull/3090
# 0.36.0 # 0.36.0
- Remove default features. If you previously depended on `async-std` you need to enable this explicitly now. See [PR 2918]. - Remove default features. If you previously depended on `async-std` you need to enable this explicitly now. See [PR 2918].

View File

@ -1,7 +1,7 @@
[package] [package]
name = "libp2p-uds" name = "libp2p-uds"
edition = "2021" edition = "2021"
rust-version = "1.56.1" rust-version = "1.60.0"
description = "Unix domain sockets transport for libp2p" description = "Unix domain sockets transport for libp2p"
version = "0.37.0" version = "0.37.0"
authors = ["Parity Technologies <admin@parity.io>"] authors = ["Parity Technologies <admin@parity.io>"]

View File

@ -2,6 +2,10 @@
- Update to `libp2p-core` `v0.38.0`. - Update to `libp2p-core` `v0.38.0`.
- Update `rust-version` to reflect the actual MSRV: 1.60.0. See [PR 3090].
[PR 3090]: https://github.com/libp2p/rust-libp2p/pull/3090
# 0.37.0 # 0.37.0
- Update to `libp2p-core` `v0.37.0`. - Update to `libp2p-core` `v0.37.0`.

View File

@ -1,7 +1,7 @@
[package] [package]
name = "libp2p-wasm-ext" name = "libp2p-wasm-ext"
edition = "2021" edition = "2021"
rust-version = "1.56.1" rust-version = "1.60.0"
description = "Allows passing in an external transport in a WASM environment" description = "Allows passing in an external transport in a WASM environment"
version = "0.38.0" version = "0.38.0"
authors = ["Pierre Krieger <pierre.krieger1708@gmail.com>"] authors = ["Pierre Krieger <pierre.krieger1708@gmail.com>"]

View File

@ -6,6 +6,7 @@ description = "WebRTC transport for libp2p"
repository = "https://github.com/libp2p/rust-libp2p" repository = "https://github.com/libp2p/rust-libp2p"
license = "MIT" license = "MIT"
edition = "2021" edition = "2021"
rust-version = "1.60.0"
keywords = ["peer-to-peer", "libp2p", "networking"] keywords = ["peer-to-peer", "libp2p", "networking"]
categories = ["network-programming", "asynchronous"] categories = ["network-programming", "asynchronous"]

View File

@ -107,7 +107,7 @@ mod tests {
let prologue1 = noise_prologue(a, b); let prologue1 = noise_prologue(a, b);
let prologue2 = noise_prologue(b, a); let prologue2 = noise_prologue(b, a);
assert_eq!(hex::encode(&prologue1), "6c69627032702d7765627274632d6e6f6973653a12203e79af40d6059617a0d83b83a52ce73b0c1f37a72c6043ad2969e2351bdca870122030fc9f469c207419dfdd0aab5f27a86c973c94e40548db9375cca2e915973b99"); assert_eq!(hex::encode(prologue1), "6c69627032702d7765627274632d6e6f6973653a12203e79af40d6059617a0d83b83a52ce73b0c1f37a72c6043ad2969e2351bdca870122030fc9f469c207419dfdd0aab5f27a86c973c94e40548db9375cca2e915973b99");
assert_eq!(hex::encode(&prologue2), "6c69627032702d7765627274632d6e6f6973653a122030fc9f469c207419dfdd0aab5f27a86c973c94e40548db9375cca2e915973b9912203e79af40d6059617a0d83b83a52ce73b0c1f37a72c6043ad2969e2351bdca870"); assert_eq!(hex::encode(prologue2), "6c69627032702d7765627274632d6e6f6973653a122030fc9f469c207419dfdd0aab5f27a86c973c94e40548db9375cca2e915973b9912203e79af40d6059617a0d83b83a52ce73b0c1f37a72c6043ad2969e2351bdca870");
} }
} }

View File

@ -2,6 +2,10 @@
- Update to `libp2p-core` `v0.38.0`. - Update to `libp2p-core` `v0.38.0`.
- Update `rust-version` to reflect the actual MSRV: 1.60.0. See [PR 3090].
[PR 3090]: https://github.com/libp2p/rust-libp2p/pull/3090
# 0.39.0 # 0.39.0
- Update to `libp2p-core` `v0.37.0`. - Update to `libp2p-core` `v0.37.0`.

View File

@ -1,7 +1,7 @@
[package] [package]
name = "libp2p-websocket" name = "libp2p-websocket"
edition = "2021" edition = "2021"
rust-version = "1.56.1" rust-version = "1.60.0"
description = "WebSocket transport for libp2p" description = "WebSocket transport for libp2p"
version = "0.40.0" version = "0.40.0"
authors = ["Parity Technologies <admin@parity.io>"] authors = ["Parity Technologies <admin@parity.io>"]