From 0c85839dabf06beeb853602c0e69f4753b25b751 Mon Sep 17 00:00:00 2001 From: Thomas Eizinger Date: Fri, 18 Nov 2022 22:04:16 +1100 Subject: [PATCH] .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. --- .github/workflows/ci.yml | 337 ++++++++++--------- CHANGELOG.md | 1 + Cargo.toml | 8 +- core/CHANGELOG.md | 5 + core/Cargo.toml | 4 +- misc/metrics/CHANGELOG.md | 3 + misc/metrics/Cargo.toml | 2 +- misc/multistream-select/CHANGELOG.md | 6 + misc/multistream-select/Cargo.toml | 4 +- misc/prost-codec/CHANGELOG.md | 3 + misc/prost-codec/Cargo.toml | 2 +- misc/rw-stream-sink/Cargo.toml | 1 + muxers/mplex/CHANGELOG.md | 4 + muxers/mplex/Cargo.toml | 2 +- muxers/yamux/CHANGELOG.md | 4 + muxers/yamux/Cargo.toml | 2 +- protocols/autonat/CHANGELOG.md | 3 + protocols/autonat/Cargo.toml | 2 +- protocols/autonat/src/behaviour/as_client.rs | 4 +- protocols/autonat/src/behaviour/as_server.rs | 2 +- protocols/dcutr/CHANGELOG.md | 3 + protocols/dcutr/Cargo.toml | 2 +- protocols/dcutr/src/behaviour.rs | 2 +- protocols/floodsub/CHANGELOG.md | 3 + protocols/floodsub/Cargo.toml | 2 +- protocols/gossipsub/CHANGELOG.md | 7 +- protocols/gossipsub/Cargo.toml | 2 +- protocols/identify/CHANGELOG.md | 3 + protocols/identify/Cargo.toml | 2 +- protocols/kad/CHANGELOG.md | 3 + protocols/kad/Cargo.toml | 2 +- protocols/mdns/CHANGELOG.md | 3 + protocols/mdns/Cargo.toml | 2 +- protocols/ping/CHANGELOG.md | 3 + protocols/ping/Cargo.toml | 2 +- protocols/relay/CHANGELOG.md | 3 + protocols/relay/Cargo.toml | 2 +- protocols/rendezvous/CHANGELOG.md | 3 + protocols/rendezvous/Cargo.toml | 2 +- protocols/rendezvous/src/client.rs | 2 +- protocols/request-response/CHANGELOG.md | 3 + protocols/request-response/Cargo.toml | 2 +- src/lib.rs | 2 + swarm-derive/CHANGELOG.md | 3 + swarm-derive/Cargo.toml | 2 +- swarm/CHANGELOG.md | 3 + swarm/Cargo.toml | 6 +- swarm/src/executor.rs | 20 +- swarm/src/lib.rs | 10 +- transports/deflate/CHANGELOG.md | 4 + transports/deflate/Cargo.toml | 2 +- transports/dns/CHANGELOG.md | 4 + transports/dns/Cargo.toml | 2 +- transports/noise/CHANGELOG.md | 3 + transports/noise/Cargo.toml | 2 +- transports/plaintext/CHANGELOG.md | 3 + transports/plaintext/Cargo.toml | 2 +- transports/pnet/CHANGELOG.md | 6 + transports/pnet/Cargo.toml | 4 +- transports/quic/Cargo.toml | 3 +- transports/quic/tests/smoke.rs | 2 +- transports/tcp/CHANGELOG.md | 3 + transports/tcp/Cargo.toml | 2 +- transports/tls/Cargo.toml | 3 +- transports/uds/CHANGELOG.md | 4 + transports/uds/Cargo.toml | 2 +- transports/wasm-ext/CHANGELOG.md | 4 + transports/wasm-ext/Cargo.toml | 2 +- transports/webrtc/Cargo.toml | 1 + transports/webrtc/src/tokio/upgrade/noise.rs | 4 +- transports/websocket/CHANGELOG.md | 4 + transports/websocket/Cargo.toml | 2 +- 72 files changed, 363 insertions(+), 208 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b5c2eea9..f74e0558 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,175 +11,235 @@ concurrency: cancel-in-progress: true jobs: - test-desktop: - name: Build and test + test: + name: Test ${{ matrix.crate }} runs-on: ubuntu-latest + needs: gather_published_crates strategy: + fail-fast: false matrix: - args: [ - "--no-default-features", - "--all-features", - "--benches --all-features", - ] + crate: ${{ fromJSON(needs.gather_published_crates.outputs.members) }} steps: - - name: Install Protoc - uses: arduino/setup-protoc@v1 + - name: Install Protoc + uses: arduino/setup-protoc@64c0c85d18e984422218383b81c52f8b077404d3 # v1.1.2 - - uses: actions/checkout@v3 + - uses: actions/checkout@v3 - - uses: Swatinem/rust-cache@359a70e43a0bb8a13953b04a90f76428b4959bb6 # v2.2.0 - with: - key: ${{ matrix.args }} + - name: Get MSRV for ${{ matrix.crate }} + id: parse-msrv + 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: Build on WASM - runs-on: ubuntu-latest + - name: Update to latest stable Rust + uses: actions-rs/toolchain@16499b5e05bf2e26879000db0c1d13f7e13fa3af # v1.0.7 + 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: matrix: - toolchain: [ - wasm32-unknown-emscripten, - wasm32-wasi - ] include: - - toolchain: wasm32-unknown-unknown - args: "--features wasm-bindgen" - env: - CC: clang-11 - defaults: - run: - shell: bash + - target: "wasm32-unknown-unknown" + os: ubuntu-latest + - target: "wasm32-unknown-emscripten" + os: ubuntu-latest + - target: "wasm32-wasi" + os: ubuntu-latest + - target: "x86_64-apple-darwin" + os: macos-latest + - target: "x86_64-pc-windows-msvc" + os: windows-latest + runs-on: ${{ matrix.os }} steps: - - name: Install Protoc - uses: arduino/setup-protoc@v1 + - name: Install Protoc + 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 - with: - toolchain: stable - target: ${{ matrix.toolchain }} - override: true + - uses: actions-rs/toolchain@16499b5e05bf2e26879000db0c1d13f7e13fa3af # v1.0.7 + with: + profile: minimal + toolchain: stable + override: true + target: ${{ matrix.target }} - - name: Install a recent version of clang - run: | - sudo bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)" + - uses: Swatinem/rust-cache@359a70e43a0bb8a13953b04a90f76428b4959bb6 # v2.2.0 - - name: Install CMake - run: sudo apt-get install -y cmake + - run: cargo check --package libp2p --all-features --target=${{ matrix.target }} - - uses: Swatinem/rust-cache@359a70e43a0bb8a13953b04a90f76428b4959bb6 # v2.2.0 - with: - key: ${{ matrix.toolchain }} + feature_matrix: # Test various feature combinations work correctly + name: Compile with select features (${{ matrix.features }}) + 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 }} - # TODO: also run `cargo test` - # TODO: ideally we would build `--workspace`, but not all crates compile for WASM - run: cargo build --target=${{ matrix.toolchain }} ${{ matrix.args }} + - 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 + with: + key: ${{ matrix.runtime }} + + - run: cargo check --package libp2p --features="${{ matrix.features }}" check-rustdoc-links: name: Check rustdoc intra-doc links runs-on: ubuntu-latest steps: - - name: Install Protoc - uses: arduino/setup-protoc@v1 + - name: Install Protoc + uses: arduino/setup-protoc@64c0c85d18e984422218383b81c52f8b077404d3 # v1.1.2 - - uses: actions/checkout@v3 + - uses: actions/checkout@v3 - - uses: actions-rs/toolchain@16499b5e05bf2e26879000db0c1d13f7e13fa3af # v1.0.7 - with: - profile: minimal - toolchain: stable - override: true + - uses: actions-rs/toolchain@16499b5e05bf2e26879000db0c1d13f7e13fa3af # v1.0.7 + with: + profile: minimal + toolchain: stable + override: true - - uses: Swatinem/rust-cache@359a70e43a0bb8a13953b04a90f76428b4959bb6 # v2.2.0 + - uses: Swatinem/rust-cache@359a70e43a0bb8a13953b04a90f76428b4959bb6 # v2.2.0 - - 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 + - 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 - 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 steps: - - name: Install Protoc - uses: arduino/setup-protoc@v1 + - name: Install Protoc + uses: arduino/setup-protoc@64c0c85d18e984422218383b81c52f8b077404d3 # v1.1.2 - - uses: actions/checkout@v3 + - uses: actions/checkout@v3 - - uses: actions-rs/toolchain@16499b5e05bf2e26879000db0c1d13f7e13fa3af # v1.0.7 - with: - profile: minimal - toolchain: stable - override: true - components: clippy + - uses: actions-rs/toolchain@16499b5e05bf2e26879000db0c1d13f7e13fa3af # v1.0.7 + with: + profile: minimal + toolchain: stable + override: true - - uses: Swatinem/rust-cache@359a70e43a0bb8a13953b04a90f76428b4959bb6 # v2.2.0 + - 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 - - 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 + - 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: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v3 - - uses: actions-rs/toolchain@16499b5e05bf2e26879000db0c1d13f7e13fa3af # v1.0.7 - with: - profile: minimal - toolchain: stable - override: true - components: rustfmt + - uses: actions-rs/toolchain@16499b5e05bf2e26879000db0c1d13f7e13fa3af # v1.0.7 + with: + profile: minimal + toolchain: stable + override: true + components: rustfmt - - name: Check formatting - run: cargo fmt -- --check + - name: Check formatting + run: cargo fmt -- --check manifest_lint: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v3 - - uses: actions-rs/toolchain@16499b5e05bf2e26879000db0c1d13f7e13fa3af # v1.0.7 - with: - profile: minimal - toolchain: stable - override: true + - uses: actions-rs/toolchain@16499b5e05bf2e26879000db0c1d13f7e13fa3af # v1.0.7 + with: + profile: minimal + toolchain: stable + override: true - - name: Ensure `full` feature contains all features - run: | - 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(" ")') - - test "$ALL_FEATURES = $FULL_FEATURE" + - name: Ensure `full` feature contains all features + run: | + 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(" ")') + + test "$ALL_FEATURES = $FULL_FEATURE" + + echo "$ALL_FEATURES"; + echo "$FULL_FEATURE"; + + test "$ALL_FEATURES" = "$FULL_FEATURE" - echo "$ALL_FEATURES"; - echo "$FULL_FEATURE"; - - test "$ALL_FEATURES" = "$FULL_FEATURE" - - gather_crates_for_semver_checks: + gather_published_crates: runs-on: ubuntu-latest outputs: members: ${{ steps.cargo-metadata.outputs.members }} @@ -189,35 +249,4 @@ jobs: - id: cargo-metadata run: | 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}" - - 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 }} + echo "members=${WORKSPACE_MEMBERS}" >> $GITHUB_OUTPUT diff --git a/CHANGELOG.md b/CHANGELOG.md index 1a6d4512..165517b0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -71,6 +71,7 @@ - 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-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-rendezvous` `v0.11.0`](protocols/rendezovus/CHANGELOG.md#0110). - Update to [`libp2p-request-response` `v0.23.0`](protocols/request-response/CHANGELOG.md#0230). diff --git a/Cargo.toml b/Cargo.toml index f6186f8b..7ba80244 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "libp2p" edition = "2021" -rust-version = "1.60.0" +rust-version = "1.62.0" description = "Peer-to-peer networking library" version = "0.50.0" authors = ["Parity Technologies "] @@ -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-ping = { version = "0.41.0", path = "protocols/ping", 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-rendezvous = { version = "0.11.0", path = "protocols/rendezvous", optional = true } libp2p-request-response = { version = "0.23.0", path = "protocols/request-response", optional = true } libp2p-swarm = { version = "0.41.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-webrtc = { version = "0.1.0-alpha", path = "transports/webrtc", optional = true } libp2p-yamux = { version = "0.42.0", path = "muxers/yamux", optional = true } multiaddr = { version = "0.16.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-quic = { version = "0.7.0-alpha", path = "transports/quic", 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-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] libp2p-gossipsub = { version = "0.43.0", path = "protocols/gossipsub", optional = true } diff --git a/core/CHANGELOG.md b/core/CHANGELOG.md index c3831a3b..ba80474b 100644 --- a/core/CHANGELOG.md +++ b/core/CHANGELOG.md @@ -6,9 +6,14 @@ - 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 3058]: https://github.com/libp2p/rust-libp2p/pull/3058 [PR 3097]: https://github.com/libp2p/rust-libp2p/pull/3097 +[PR 3090]: https://github.com/libp2p/rust-libp2p/pull/3090 # 0.37.0 diff --git a/core/Cargo.toml b/core/Cargo.toml index 3e39ee79..cdc50ee1 100644 --- a/core/Cargo.toml +++ b/core/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "libp2p-core" edition = "2021" -rust-version = "1.56.1" +rust-version = "1.60.0" description = "Core traits and structs of libp2p" version = "0.38.0" authors = ["Parity Technologies "] @@ -23,7 +23,7 @@ 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"] } -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 } parking_lot = "0.12.0" pin-project = "1.0.0" diff --git a/misc/metrics/CHANGELOG.md b/misc/metrics/CHANGELOG.md index 58460094..e321495e 100644 --- a/misc/metrics/CHANGELOG.md +++ b/misc/metrics/CHANGELOG.md @@ -18,7 +18,10 @@ - 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 3090]: https://github.com/libp2p/rust-libp2p/pull/3090 # 0.10.0 diff --git a/misc/metrics/Cargo.toml b/misc/metrics/Cargo.toml index 54f3271f..c2821752 100644 --- a/misc/metrics/Cargo.toml +++ b/misc/metrics/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "libp2p-metrics" edition = "2021" -rust-version = "1.56.1" +rust-version = "1.62.0" description = "Metrics for libp2p" version = "0.11.0" authors = ["Max Inden "] diff --git a/misc/multistream-select/CHANGELOG.md b/misc/multistream-select/CHANGELOG.md index 820d1844..e7ea086a 100644 --- a/misc/multistream-select/CHANGELOG.md +++ b/misc/multistream-select/CHANGELOG.md @@ -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 - Remove parallel dialing optimization, to avoid requiring the use of the `ls` command. See [PR 2934]. diff --git a/misc/multistream-select/Cargo.toml b/misc/multistream-select/Cargo.toml index 8dced22f..eefe7bf8 100644 --- a/misc/multistream-select/Cargo.toml +++ b/misc/multistream-select/Cargo.toml @@ -1,9 +1,9 @@ [package] name = "multistream-select" edition = "2021" -rust-version = "1.56.1" +rust-version = "1.60.0" description = "Multistream-select negotiation protocol for libp2p" -version = "0.12.0" +version = "0.12.1" authors = ["Parity Technologies "] license = "MIT" repository = "https://github.com/libp2p/rust-libp2p" diff --git a/misc/prost-codec/CHANGELOG.md b/misc/prost-codec/CHANGELOG.md index 09ebe061..ae3f7e10 100644 --- a/misc/prost-codec/CHANGELOG.md +++ b/misc/prost-codec/CHANGELOG.md @@ -4,8 +4,11 @@ - Implement `From` trait for `std::io::Error`. See [PR 2622]. - 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 3058]: https://github.com/libp2p/rust-libp2p/pull/3058/ +[PR 3090]: https://github.com/libp2p/rust-libp2p/pull/3090 # 0.2.0 diff --git a/misc/prost-codec/Cargo.toml b/misc/prost-codec/Cargo.toml index fdfe6eec..c0446db8 100644 --- a/misc/prost-codec/Cargo.toml +++ b/misc/prost-codec/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "prost-codec" 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." version = "0.3.0" authors = ["Max Inden "] diff --git a/misc/rw-stream-sink/Cargo.toml b/misc/rw-stream-sink/Cargo.toml index dba6ff99..df6b39cb 100644 --- a/misc/rw-stream-sink/Cargo.toml +++ b/misc/rw-stream-sink/Cargo.toml @@ -2,6 +2,7 @@ name = "rw-stream-sink" edition = "2021" description = "Adaptator between Stream/Sink and AsyncRead/AsyncWrite" +rust-version = "1.60.0" version = "0.3.0" authors = ["Parity Technologies "] license = "MIT" diff --git a/muxers/mplex/CHANGELOG.md b/muxers/mplex/CHANGELOG.md index 061d65ff..c575b0ca 100644 --- a/muxers/mplex/CHANGELOG.md +++ b/muxers/mplex/CHANGELOG.md @@ -2,6 +2,10 @@ - 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 - Bump rand to 0.8 and quickcheck to 1. See [PR 2857]. diff --git a/muxers/mplex/Cargo.toml b/muxers/mplex/Cargo.toml index 94bd697c..ed145426 100644 --- a/muxers/mplex/Cargo.toml +++ b/muxers/mplex/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "libp2p-mplex" edition = "2021" -rust-version = "1.56.1" +rust-version = "1.60.0" description = "Mplex multiplexing protocol for libp2p" version = "0.38.0" authors = ["Parity Technologies "] diff --git a/muxers/yamux/CHANGELOG.md b/muxers/yamux/CHANGELOG.md index e1dcdfb7..3d5aff98 100644 --- a/muxers/yamux/CHANGELOG.md +++ b/muxers/yamux/CHANGELOG.md @@ -2,6 +2,10 @@ - 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 - Yield from `StreamMuxer::poll` as soon as we receive a single substream. diff --git a/muxers/yamux/Cargo.toml b/muxers/yamux/Cargo.toml index 6c479092..94d3c387 100644 --- a/muxers/yamux/Cargo.toml +++ b/muxers/yamux/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "libp2p-yamux" edition = "2021" -rust-version = "1.56.1" +rust-version = "1.60.0" description = "Yamux multiplexing protocol for libp2p" version = "0.42.0" authors = ["Parity Technologies "] diff --git a/protocols/autonat/CHANGELOG.md b/protocols/autonat/CHANGELOG.md index ac7af065..d98a65cb 100644 --- a/protocols/autonat/CHANGELOG.md +++ b/protocols/autonat/CHANGELOG.md @@ -9,7 +9,10 @@ - Replace `Behaviour`'s `NetworkBehaviour` implemention `inject_*` methods with the new `on_*` methods. 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 3090]: https://github.com/libp2p/rust-libp2p/pull/3090 # 0.8.0 diff --git a/protocols/autonat/Cargo.toml b/protocols/autonat/Cargo.toml index 10fd0e71..80bbb54f 100644 --- a/protocols/autonat/Cargo.toml +++ b/protocols/autonat/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "libp2p-autonat" edition = "2021" -rust-version = "1.56.1" +rust-version = "1.62.0" description = "NAT and firewall detection for libp2p" version = "0.9.0" authors = ["David Craven ", "Elena Frank "] diff --git a/protocols/autonat/src/behaviour/as_client.rs b/protocols/autonat/src/behaviour/as_client.rs index 5a5e18b6..cbb63f6a 100644 --- a/protocols/autonat/src/behaviour/as_client.rs +++ b/protocols/autonat/src/behaviour/as_client.rs @@ -150,7 +150,7 @@ impl<'a> HandleInnerEvent for AsClient<'a> { // Update observed address score if it is finite. let score = params .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)); if let AddressScore::Finite(finite_score) = score { action = Some(NetworkBehaviourAction::ReportObservedAddr { @@ -266,7 +266,7 @@ impl<'a> AsClient<'a> { // Filter servers for which no qualified address is known. // This is the case if the connection is relayed or the address is // 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) })); } diff --git a/protocols/autonat/src/behaviour/as_server.rs b/protocols/autonat/src/behaviour/as_server.rs index 681076b9..f858c48c 100644 --- a/protocols/autonat/src/behaviour/as_server.rs +++ b/protocols/autonat/src/behaviour/as_server.rs @@ -346,7 +346,7 @@ impl<'a> AsServer<'a> { addr.push(Protocol::P2p(peer.into())) } // Only collect distinct addresses. - distinct.insert(addr.clone()).then(|| addr) + distinct.insert(addr.clone()).then_some(addr) }) .collect() } diff --git a/protocols/dcutr/CHANGELOG.md b/protocols/dcutr/CHANGELOG.md index c41ead17..00942711 100644 --- a/protocols/dcutr/CHANGELOG.md +++ b/protocols/dcutr/CHANGELOG.md @@ -12,8 +12,11 @@ - Replace `direct::Handler` and `relayed::Handler`'s `ConnectionHandler` implemention `inject_*` 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 3011]: https://github.com/libp2p/rust-libp2p/pull/3011 +[PR 3090]: https://github.com/libp2p/rust-libp2p/pull/3090 # 0.7.0 diff --git a/protocols/dcutr/Cargo.toml b/protocols/dcutr/Cargo.toml index 33486f49..fa161f47 100644 --- a/protocols/dcutr/Cargo.toml +++ b/protocols/dcutr/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "libp2p-dcutr" edition = "2021" -rust-version = "1.56.1" +rust-version = "1.62.0" description = "Direct connection upgrade through relay" version = "0.8.0" authors = ["Max Inden "] diff --git a/protocols/dcutr/src/behaviour.rs b/protocols/dcutr/src/behaviour.rs index df4aabfb..78b22c89 100644 --- a/protocols/dcutr/src/behaviour.rs +++ b/protocols/dcutr/src/behaviour.rs @@ -183,7 +183,7 @@ impl Behaviour { .expect("Peer of direct connection to be tracked."); connections .remove(&connection_id) - .then(|| ()) + .then_some(()) .expect("Direct connection to be tracked."); if connections.is_empty() { self.direct_connections.remove(&peer_id); diff --git a/protocols/floodsub/CHANGELOG.md b/protocols/floodsub/CHANGELOG.md index 128d22fb..6465f82e 100644 --- a/protocols/floodsub/CHANGELOG.md +++ b/protocols/floodsub/CHANGELOG.md @@ -7,7 +7,10 @@ - Replace `Floodsub`'s `NetworkBehaviour` implemention `inject_*` methods with the new `on_*` methods. 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 3090]: https://github.com/libp2p/rust-libp2p/pull/3090 # 0.40.0 diff --git a/protocols/floodsub/Cargo.toml b/protocols/floodsub/Cargo.toml index 1225d1cd..70731cd3 100644 --- a/protocols/floodsub/Cargo.toml +++ b/protocols/floodsub/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "libp2p-floodsub" edition = "2021" -rust-version = "1.56.1" +rust-version = "1.62.0" description = "Floodsub protocol for libp2p" version = "0.41.0" authors = ["Parity Technologies "] diff --git a/protocols/gossipsub/CHANGELOG.md b/protocols/gossipsub/CHANGELOG.md index c1caa980..a9edf7d2 100644 --- a/protocols/gossipsub/CHANGELOG.md +++ b/protocols/gossipsub/CHANGELOG.md @@ -8,15 +8,18 @@ - 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]. -- 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]. +- 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 3070]: https://github.com/libp2p/rust-libp2p/pull/3070 [PR 3011]: https://github.com/libp2p/rust-libp2p/pull/3011 +[PR 3090]: https://github.com/libp2p/rust-libp2p/pull/3090 # 0.42.0 diff --git a/protocols/gossipsub/Cargo.toml b/protocols/gossipsub/Cargo.toml index 819805fd..6ab3a8c1 100644 --- a/protocols/gossipsub/Cargo.toml +++ b/protocols/gossipsub/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "libp2p-gossipsub" edition = "2021" -rust-version = "1.56.1" +rust-version = "1.62.0" description = "Gossipsub protocol for libp2p" version = "0.43.0" authors = ["Age Manning "] diff --git a/protocols/identify/CHANGELOG.md b/protocols/identify/CHANGELOG.md index 93093b25..23be5807 100644 --- a/protocols/identify/CHANGELOG.md +++ b/protocols/identify/CHANGELOG.md @@ -14,9 +14,12 @@ - Replace `Handler`'s `ConnectionHandler` implemention `inject_*` 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 3011]: https://github.com/libp2p/rust-libp2p/pull/3011 [PR 2995]: https://github.com/libp2p/rust-libp2p/pull/2995 +[PR 3090]: https://github.com/libp2p/rust-libp2p/pull/3090 # 0.40.0 diff --git a/protocols/identify/Cargo.toml b/protocols/identify/Cargo.toml index c0d05b70..69dc2d97 100644 --- a/protocols/identify/Cargo.toml +++ b/protocols/identify/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "libp2p-identify" edition = "2021" -rust-version = "1.56.1" +rust-version = "1.62.0" description = "Nodes identifcation protocol for libp2p" version = "0.41.0" authors = ["Parity Technologies "] diff --git a/protocols/kad/CHANGELOG.md b/protocols/kad/CHANGELOG.md index bc1bcbe7..98e055f6 100644 --- a/protocols/kad/CHANGELOG.md +++ b/protocols/kad/CHANGELOG.md @@ -10,8 +10,11 @@ - Replace `KademliaHandler`'s `ConnectionHandler` implemention `inject_*` 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 3011]: https://github.com/libp2p/rust-libp2p/pull/3011 +[PR 3090]: https://github.com/libp2p/rust-libp2p/pull/3090 # 0.41.0 diff --git a/protocols/kad/Cargo.toml b/protocols/kad/Cargo.toml index 8f91f341..195cd763 100644 --- a/protocols/kad/Cargo.toml +++ b/protocols/kad/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "libp2p-kad" edition = "2021" -rust-version = "1.56.1" +rust-version = "1.62.0" description = "Kademlia protocol for libp2p" version = "0.42.0" authors = ["Parity Technologies "] diff --git a/protocols/mdns/CHANGELOG.md b/protocols/mdns/CHANGELOG.md index e9b2a266..1f757ada 100644 --- a/protocols/mdns/CHANGELOG.md +++ b/protocols/mdns/CHANGELOG.md @@ -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]. +- Update `rust-version` to reflect the actual MSRV: 1.62.0. See [PR 3090]. + [discussion 2174]: https://github.com/libp2p/rust-libp2p/discussions/2174 [PR 3096]: https://github.com/libp2p/rust-libp2p/pull/3096 [PR 3011]: https://github.com/libp2p/rust-libp2p/pull/3011 [PR 3102]: https://github.com/libp2p/rust-libp2p/pull/3102 +[PR 3090]: https://github.com/libp2p/rust-libp2p/pull/3090 # 0.41.0 diff --git a/protocols/mdns/Cargo.toml b/protocols/mdns/Cargo.toml index 4195b580..9dea638d 100644 --- a/protocols/mdns/Cargo.toml +++ b/protocols/mdns/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "libp2p-mdns" edition = "2021" -rust-version = "1.56.1" +rust-version = "1.62.0" version = "0.42.0" description = "Implementation of the libp2p mDNS discovery method" authors = ["Parity Technologies "] diff --git a/protocols/ping/CHANGELOG.md b/protocols/ping/CHANGELOG.md index 12f11597..f1742af7 100644 --- a/protocols/ping/CHANGELOG.md +++ b/protocols/ping/CHANGELOG.md @@ -10,8 +10,11 @@ - Replace `Handler`'s `ConnectionHandler` implemention `inject_*` 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 3011]: https://github.com/libp2p/rust-libp2p/pull/3011 +[PR 3090]: https://github.com/libp2p/rust-libp2p/pull/3090 # 0.40.0 diff --git a/protocols/ping/Cargo.toml b/protocols/ping/Cargo.toml index c26dbb22..b03cc6e7 100644 --- a/protocols/ping/Cargo.toml +++ b/protocols/ping/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "libp2p-ping" edition = "2021" -rust-version = "1.56.1" +rust-version = "1.62.0" description = "Ping protocol for libp2p" version = "0.41.0" authors = ["Parity Technologies "] diff --git a/protocols/relay/CHANGELOG.md b/protocols/relay/CHANGELOG.md index 0dcc650d..1805cc59 100644 --- a/protocols/relay/CHANGELOG.md +++ b/protocols/relay/CHANGELOG.md @@ -12,8 +12,11 @@ - Replace `client::Handler` and `relay::Handler`'s `ConnectionHandler` implemention `inject_*` 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 3011]: https://github.com/libp2p/rust-libp2p/pull/3011 +[PR 3090]: https://github.com/libp2p/rust-libp2p/pull/3090 # 0.13.0 diff --git a/protocols/relay/Cargo.toml b/protocols/relay/Cargo.toml index 9c6e3528..70bfea53 100644 --- a/protocols/relay/Cargo.toml +++ b/protocols/relay/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "libp2p-relay" edition = "2021" -rust-version = "1.56.1" +rust-version = "1.62.0" description = "Communications relaying for libp2p" version = "0.14.0" authors = ["Parity Technologies ", "Max Inden "] diff --git a/protocols/rendezvous/CHANGELOG.md b/protocols/rendezvous/CHANGELOG.md index e081eb2f..c48dfd7c 100644 --- a/protocols/rendezvous/CHANGELOG.md +++ b/protocols/rendezvous/CHANGELOG.md @@ -9,8 +9,11 @@ - Replace `Client` and `Server`'s `NetworkBehaviour` implemention `inject_*` methods with the new `on_*` methods. 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 3058]: https://github.com/libp2p/rust-libp2p/pull/3058 +[PR 3090]: https://github.com/libp2p/rust-libp2p/pull/3090 # 0.10.0 diff --git a/protocols/rendezvous/Cargo.toml b/protocols/rendezvous/Cargo.toml index 4f53d3cf..b4f5d127 100644 --- a/protocols/rendezvous/Cargo.toml +++ b/protocols/rendezvous/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "libp2p-rendezvous" edition = "2021" -rust-version = "1.56.1" +rust-version = "1.62.0" description = "Rendezvous protocol for libp2p" version = "0.11.0" authors = ["The COMIT guys "] diff --git a/protocols/rendezvous/src/client.rs b/protocols/rendezvous/src/client.rs index 5d443549..173831d9 100644 --- a/protocols/rendezvous/src/client.rs +++ b/protocols/rendezvous/src/client.rs @@ -178,7 +178,7 @@ impl NetworkBehaviour for Behaviour { fn addresses_of_peer(&mut self, peer: &PeerId) -> Vec { self.discovered_peers .iter() - .filter_map(|((candidate, _), addresses)| (candidate == peer).then(|| addresses)) + .filter_map(|((candidate, _), addresses)| (candidate == peer).then_some(addresses)) .flatten() .cloned() .collect() diff --git a/protocols/request-response/CHANGELOG.md b/protocols/request-response/CHANGELOG.md index f6c3a6a0..247e8ec8 100644 --- a/protocols/request-response/CHANGELOG.md +++ b/protocols/request-response/CHANGELOG.md @@ -10,8 +10,11 @@ - Replace `RequestResponseHandler`'s `ConnectionHandler` implemention `inject_*` 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 3011]: https://github.com/libp2p/rust-libp2p/pull/3011 +[PR 3090]: https://github.com/libp2p/rust-libp2p/pull/3090 # 0.22.0 diff --git a/protocols/request-response/Cargo.toml b/protocols/request-response/Cargo.toml index 63df7cd5..4069873d 100644 --- a/protocols/request-response/Cargo.toml +++ b/protocols/request-response/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "libp2p-request-response" edition = "2021" -rust-version = "1.56.1" +rust-version = "1.62.0" description = "Generic Request/Response Protocols" version = "0.23.0" authors = ["Parity Technologies "] diff --git a/src/lib.rs b/src/lib.rs index 1836af58..d4d72eea 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -117,6 +117,7 @@ pub use libp2p_swarm as swarm; pub use libp2p_tcp as tcp; #[cfg(feature = "tls")] #[cfg_attr(docsrs, doc(cfg(feature = "tls")))] +#[cfg(not(any(target_os = "emscripten", target_os = "wasi", target_os = "unknown")))] #[doc(inline)] pub use libp2p_tls as tls; #[cfg(feature = "uds")] @@ -127,6 +128,7 @@ pub use libp2p_uds as uds; pub use libp2p_wasm_ext as wasm_ext; #[cfg(feature = "webrtc")] #[cfg_attr(docsrs, doc(cfg(feature = "webrtc")))] +#[cfg(not(any(target_os = "emscripten", target_os = "wasi", target_os = "unknown")))] #[doc(inline)] pub use libp2p_webrtc as webrtc; #[cfg(feature = "websocket")] diff --git a/swarm-derive/CHANGELOG.md b/swarm-derive/CHANGELOG.md index 106c3a65..75a31df4 100644 --- a/swarm-derive/CHANGELOG.md +++ b/swarm-derive/CHANGELOG.md @@ -7,8 +7,11 @@ - Add `prelude` configuration option. 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 3055]: https://github.com/libp2p/rust-libp2p/pull/3055 +[PR 3090]: https://github.com/libp2p/rust-libp2p/pull/3090 # 0.30.1 diff --git a/swarm-derive/Cargo.toml b/swarm-derive/Cargo.toml index f21b86a9..3530d14e 100644 --- a/swarm-derive/Cargo.toml +++ b/swarm-derive/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "libp2p-swarm-derive" edition = "2021" -rust-version = "1.56.1" +rust-version = "1.60.0" description = "Procedural macros of libp2p-core" version = "0.30.2" authors = ["Parity Technologies "] diff --git a/swarm/CHANGELOG.md b/swarm/CHANGELOG.md index 7b668422..54b7a5d7 100644 --- a/swarm/CHANGELOG.md +++ b/swarm/CHANGELOG.md @@ -94,11 +94,14 @@ - `SwarmBuilder::new` - `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 3011]: https://github.com/libp2p/rust-libp2p/pull/3011 [PR 3055]: https://github.com/libp2p/rust-libp2p/pull/3055 [PR 3097]: https://github.com/libp2p/rust-libp2p/pull/3097 [Issue 3107]: https://github.com/libp2p/rust-libp2p/issues/3107 +[PR 3090]: https://github.com/libp2p/rust-libp2p/pull/3090 # 0.40.1 diff --git a/swarm/Cargo.toml b/swarm/Cargo.toml index a6f9a91a..223a8f56 100644 --- a/swarm/Cargo.toml +++ b/swarm/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "libp2p-swarm" edition = "2021" -rust-version = "1.56.1" +rust-version = "1.62.0" description = "The libp2p swarm" version = "0.41.0" authors = ["Parity Technologies "] @@ -24,8 +24,10 @@ rand = "0.8" smallvec = "1.6.1" thiserror = "1.0" 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 } +tokio = { version = "1.15", features = ["rt"], optional = true } [features] macros = ["dep:libp2p-swarm-derive"] diff --git a/swarm/src/executor.rs b/swarm/src/executor.rs index 7799d141..0d815cc2 100644 --- a/swarm/src/executor.rs +++ b/swarm/src/executor.rs @@ -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)] 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 { fn exec(&self, future: Pin + Send>>) { 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)] 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 { fn exec(&self, future: Pin + Send>>) { let _ = async_std::task::spawn(future); diff --git a/swarm/src/lib.rs b/swarm/src/lib.rs index 7894f1e5..c467b99c 100644 --- a/swarm/src/lib.rs +++ b/swarm/src/lib.rs @@ -366,7 +366,10 @@ where } /// 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( transport: transport::Boxed<(PeerId, StreamMuxerBox)>, behaviour: TBehaviour, @@ -381,7 +384,10 @@ where } /// 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( transport: transport::Boxed<(PeerId, StreamMuxerBox)>, behaviour: TBehaviour, diff --git a/transports/deflate/CHANGELOG.md b/transports/deflate/CHANGELOG.md index 542184b2..a08fd655 100644 --- a/transports/deflate/CHANGELOG.md +++ b/transports/deflate/CHANGELOG.md @@ -2,6 +2,10 @@ - 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 - Update to `libp2p-core` `v0.37.0`. diff --git a/transports/deflate/Cargo.toml b/transports/deflate/Cargo.toml index 144a9af7..83729d8e 100644 --- a/transports/deflate/Cargo.toml +++ b/transports/deflate/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "libp2p-deflate" edition = "2021" -rust-version = "1.56.1" +rust-version = "1.60.0" description = "Deflate encryption protocol for libp2p" version = "0.38.0" authors = ["Parity Technologies "] diff --git a/transports/dns/CHANGELOG.md b/transports/dns/CHANGELOG.md index c0a79751..d64e2cbf 100644 --- a/transports/dns/CHANGELOG.md +++ b/transports/dns/CHANGELOG.md @@ -2,6 +2,10 @@ - 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 - Remove default features. If you previously depended on `async-std` you need to enable this explicitly now. See [PR 2918]. diff --git a/transports/dns/Cargo.toml b/transports/dns/Cargo.toml index e0d27ba6..ec476685 100644 --- a/transports/dns/Cargo.toml +++ b/transports/dns/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "libp2p-dns" edition = "2021" -rust-version = "1.56.1" +rust-version = "1.60.0" description = "DNS transport implementation for libp2p" version = "0.38.0" authors = ["Parity Technologies "] diff --git a/transports/noise/CHANGELOG.md b/transports/noise/CHANGELOG.md index 0c1987bf..24bd7d11 100644 --- a/transports/noise/CHANGELOG.md +++ b/transports/noise/CHANGELOG.md @@ -4,7 +4,10 @@ - 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 3090]: https://github.com/libp2p/rust-libp2p/pull/3090 # 0.40.0 diff --git a/transports/noise/Cargo.toml b/transports/noise/Cargo.toml index 274e7830..a64d7fe3 100644 --- a/transports/noise/Cargo.toml +++ b/transports/noise/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "libp2p-noise" edition = "2021" -rust-version = "1.56.1" +rust-version = "1.60.0" description = "Cryptographic handshake protocol using the noise framework." version = "0.41.0" authors = ["Parity Technologies "] diff --git a/transports/plaintext/CHANGELOG.md b/transports/plaintext/CHANGELOG.md index 6af953ee..41be3837 100644 --- a/transports/plaintext/CHANGELOG.md +++ b/transports/plaintext/CHANGELOG.md @@ -4,7 +4,10 @@ - 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 3090]: https://github.com/libp2p/rust-libp2p/pull/3090 # 0.37.0 diff --git a/transports/plaintext/Cargo.toml b/transports/plaintext/Cargo.toml index 02317233..fcedb5ce 100644 --- a/transports/plaintext/Cargo.toml +++ b/transports/plaintext/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "libp2p-plaintext" edition = "2021" -rust-version = "1.56.1" +rust-version = "1.60.0" description = "Plaintext encryption dummy protocol for libp2p" version = "0.38.0" authors = ["Parity Technologies "] diff --git a/transports/pnet/CHANGELOG.md b/transports/pnet/CHANGELOG.md index e63f196c..da9130a4 100644 --- a/transports/pnet/CHANGELOG.md +++ b/transports/pnet/CHANGELOG.md @@ -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 - Bump rand to 0.8 and quickcheck to 1. See [PR 2857]. diff --git a/transports/pnet/Cargo.toml b/transports/pnet/Cargo.toml index edeb4ee8..1e74be39 100644 --- a/transports/pnet/Cargo.toml +++ b/transports/pnet/Cargo.toml @@ -1,9 +1,9 @@ [package] name = "libp2p-pnet" edition = "2021" -rust-version = "1.56.1" +rust-version = "1.60.0" description = "Private swarm support for libp2p" -version = "0.22.1" +version = "0.22.2" authors = ["Parity Technologies "] license = "MIT" repository = "https://github.com/libp2p/rust-libp2p" diff --git a/transports/quic/Cargo.toml b/transports/quic/Cargo.toml index 0a1235cd..4d5b2420 100644 --- a/transports/quic/Cargo.toml +++ b/transports/quic/Cargo.toml @@ -3,12 +3,13 @@ name = "libp2p-quic" version = "0.7.0-alpha" authors = ["Parity Technologies "] edition = "2021" +rust-version = "1.62.0" description = "TLS based QUIC transport implementation for libp2p" repository = "https://github.com/libp2p/rust-libp2p" license = "MIT" [dependencies] -async-std = { version = "1.12.0", default-features = false, optional = true } +async-std = { version = "1.12.0", optional = true } bytes = "1.2.1" futures = "0.3.15" futures-timer = "3.0.2" diff --git a/transports/quic/tests/smoke.rs b/transports/quic/tests/smoke.rs index 6eedcdfb..8bd8033c 100644 --- a/transports/quic/tests/smoke.rs +++ b/transports/quic/tests/smoke.rs @@ -288,7 +288,7 @@ fn prop( // Wait for all streams to complete. P::block_on( completed_streams_rx - .take(completed_streams as usize) + .take(completed_streams) .collect::>(), Duration::from_secs(30), ); diff --git a/transports/tcp/CHANGELOG.md b/transports/tcp/CHANGELOG.md index 58fb9980..b996413f 100644 --- a/transports/tcp/CHANGELOG.md +++ b/transports/tcp/CHANGELOG.md @@ -8,8 +8,11 @@ - 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 2961]: https://github.com/libp2p/rust-libp2p/pull/2961 +[PR 3090]: https://github.com/libp2p/rust-libp2p/pull/3090 # 0.37.0 diff --git a/transports/tcp/Cargo.toml b/transports/tcp/Cargo.toml index 585d5a91..7639a10c 100644 --- a/transports/tcp/Cargo.toml +++ b/transports/tcp/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "libp2p-tcp" edition = "2021" -rust-version = "1.56.1" +rust-version = "1.60.0" description = "TCP/IP transport protocol for libp2p" version = "0.38.0" authors = ["Parity Technologies "] diff --git a/transports/tls/Cargo.toml b/transports/tls/Cargo.toml index d627cae5..17d2d6c8 100644 --- a/transports/tls/Cargo.toml +++ b/transports/tls/Cargo.toml @@ -2,6 +2,7 @@ name = "libp2p-tls" version = "0.1.0-alpha" edition = "2021" +rust-version = "1.60.0" license = "MIT" exclude = ["src/test_assets"] @@ -25,7 +26,7 @@ features = ["dangerous_configuration"] # Must enable this to allow for custom ve [dev-dependencies] hex = "0.4.3" 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"] } # Passing arguments to the docsrs builder in order to properly document cfg's. diff --git a/transports/uds/CHANGELOG.md b/transports/uds/CHANGELOG.md index 2f1426af..b19c220a 100644 --- a/transports/uds/CHANGELOG.md +++ b/transports/uds/CHANGELOG.md @@ -1,5 +1,9 @@ # 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 - Remove default features. If you previously depended on `async-std` you need to enable this explicitly now. See [PR 2918]. diff --git a/transports/uds/Cargo.toml b/transports/uds/Cargo.toml index 8bad4c54..9dd1321a 100644 --- a/transports/uds/Cargo.toml +++ b/transports/uds/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "libp2p-uds" edition = "2021" -rust-version = "1.56.1" +rust-version = "1.60.0" description = "Unix domain sockets transport for libp2p" version = "0.37.0" authors = ["Parity Technologies "] diff --git a/transports/wasm-ext/CHANGELOG.md b/transports/wasm-ext/CHANGELOG.md index 8cb87863..82870514 100644 --- a/transports/wasm-ext/CHANGELOG.md +++ b/transports/wasm-ext/CHANGELOG.md @@ -2,6 +2,10 @@ - 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 - Update to `libp2p-core` `v0.37.0`. diff --git a/transports/wasm-ext/Cargo.toml b/transports/wasm-ext/Cargo.toml index e6317240..6c004aab 100644 --- a/transports/wasm-ext/Cargo.toml +++ b/transports/wasm-ext/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "libp2p-wasm-ext" edition = "2021" -rust-version = "1.56.1" +rust-version = "1.60.0" description = "Allows passing in an external transport in a WASM environment" version = "0.38.0" authors = ["Pierre Krieger "] diff --git a/transports/webrtc/Cargo.toml b/transports/webrtc/Cargo.toml index 959dd971..f77c66bb 100644 --- a/transports/webrtc/Cargo.toml +++ b/transports/webrtc/Cargo.toml @@ -6,6 +6,7 @@ description = "WebRTC transport for libp2p" repository = "https://github.com/libp2p/rust-libp2p" license = "MIT" edition = "2021" +rust-version = "1.60.0" keywords = ["peer-to-peer", "libp2p", "networking"] categories = ["network-programming", "asynchronous"] diff --git a/transports/webrtc/src/tokio/upgrade/noise.rs b/transports/webrtc/src/tokio/upgrade/noise.rs index 94566d00..37c99938 100644 --- a/transports/webrtc/src/tokio/upgrade/noise.rs +++ b/transports/webrtc/src/tokio/upgrade/noise.rs @@ -107,7 +107,7 @@ mod tests { let prologue1 = noise_prologue(a, b); let prologue2 = noise_prologue(b, a); - assert_eq!(hex::encode(&prologue1), "6c69627032702d7765627274632d6e6f6973653a12203e79af40d6059617a0d83b83a52ce73b0c1f37a72c6043ad2969e2351bdca870122030fc9f469c207419dfdd0aab5f27a86c973c94e40548db9375cca2e915973b99"); - assert_eq!(hex::encode(&prologue2), "6c69627032702d7765627274632d6e6f6973653a122030fc9f469c207419dfdd0aab5f27a86c973c94e40548db9375cca2e915973b9912203e79af40d6059617a0d83b83a52ce73b0c1f37a72c6043ad2969e2351bdca870"); + assert_eq!(hex::encode(prologue1), "6c69627032702d7765627274632d6e6f6973653a12203e79af40d6059617a0d83b83a52ce73b0c1f37a72c6043ad2969e2351bdca870122030fc9f469c207419dfdd0aab5f27a86c973c94e40548db9375cca2e915973b99"); + assert_eq!(hex::encode(prologue2), "6c69627032702d7765627274632d6e6f6973653a122030fc9f469c207419dfdd0aab5f27a86c973c94e40548db9375cca2e915973b9912203e79af40d6059617a0d83b83a52ce73b0c1f37a72c6043ad2969e2351bdca870"); } } diff --git a/transports/websocket/CHANGELOG.md b/transports/websocket/CHANGELOG.md index 382b0951..3b8f024a 100644 --- a/transports/websocket/CHANGELOG.md +++ b/transports/websocket/CHANGELOG.md @@ -2,6 +2,10 @@ - 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 - Update to `libp2p-core` `v0.37.0`. diff --git a/transports/websocket/Cargo.toml b/transports/websocket/Cargo.toml index 4b5e1da6..cc848e58 100644 --- a/transports/websocket/Cargo.toml +++ b/transports/websocket/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "libp2p-websocket" edition = "2021" -rust-version = "1.56.1" +rust-version = "1.60.0" description = "WebSocket transport for libp2p" version = "0.40.0" authors = ["Parity Technologies "]