diff --git a/.github/actions/cargo-semver-checks/action.yml b/.github/actions/cargo-semver-checks/action.yml deleted file mode 100644 index e9e6844f49c..00000000000 --- a/.github/actions/cargo-semver-checks/action.yml +++ /dev/null @@ -1,36 +0,0 @@ -name: "Run cargo semver-checks" -description: "Install and run the cargo semver-checks tool" -inputs: - crate: - required: true - description: "The crate to run `cargo semver-checks` on." -runs: - using: "composite" - steps: - - run: wget -q -O- https://github.com/obi1kenobi/cargo-semver-checks/releases/download/v0.22.1/cargo-semver-checks-x86_64-unknown-linux-gnu.tar.gz | tar -xz -C ~/.cargo/bin - shell: bash - - - name: Get released version - shell: bash - id: get-released-version - run: | - MAX_STABLE_VERSION=$(curl https://crates.io/api/v1/crates/${{ inputs.crate }} --silent | jq '.crate.max_stable_version') - echo "version=${MAX_STABLE_VERSION}" >> $GITHUB_OUTPUT - - - shell: bash - run: | - rustc --version | tee .rustc-version - cargo semver-checks --version | tee .semver-checks-version - - - uses: actions/cache@v3 - with: - path: ${{ github.workspace }}/target/semver-checks/cache - key: semver-checks-cache-${{ hashFiles('.rustc-version') }}-${{ hashFiles('.semver-checks-version') }}-${{ inputs.crate }}-${{ steps.get-released-version.outputs.version }} - - - run: cargo semver-checks check-release --package ${{ inputs.crate }} --verbose - shell: bash - env: - CARGO_TERM_VERBOSE: "true" - # debugging https://github.com/libp2p/rust-libp2p/pull/3782#issuecomment-1523346255 - CARGO_HTTP_DEBUG: "true" - CARGO_LOG: "cargo::ops::registry=debug" diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 0bfe5069ae0..59915a71b6c 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -8,6 +8,11 @@ updates: commit-message: prefix: "deps" rebase-strategy: "disabled" + groups: + trust-dns: + patterns: + - "trust-dns-*" + - "async-std-resolver" - package-ecosystem: "github-actions" directory: "/" schedule: diff --git a/.github/workflows/cache-factory.yml b/.github/workflows/cache-factory.yml index 1ee127cf9cd..3f4abfbce93 100644 --- a/.github/workflows/cache-factory.yml +++ b/.github/workflows/cache-factory.yml @@ -18,7 +18,7 @@ jobs: make_stable_rust_cache: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: dtolnay/rust-toolchain@stable diff --git a/.github/workflows/cargo-audit.yml b/.github/workflows/cargo-audit.yml index 2b5abe19292..65c5de03f22 100644 --- a/.github/workflows/cargo-audit.yml +++ b/.github/workflows/cargo-audit.yml @@ -7,7 +7,7 @@ jobs: audit: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: actions-rs/audit-check@v1 with: token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b2a6651d43b..6e8dc32c7b4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -32,7 +32,7 @@ jobs: env: CRATE: ${{ matrix.crate }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: r7kamura/rust-problem-matchers@2c2f1016021a7455a6b5b4bbae31145f3b3cd83a #v1.4.0 @@ -49,20 +49,6 @@ jobs: - name: Check if we compile without any features activated run: cargo build --package "$CRATE" --no-default-features - - run: cargo clean - - - name: Check if crate has been released - id: check-released - run: | - RESPONSE_CODE=$(curl https://crates.io/api/v1/crates/"$CRATE" --silent --write-out "%{http_code}" --output /dev/null) - echo "code=${RESPONSE_CODE}" - echo "code=${RESPONSE_CODE}" >> $GITHUB_OUTPUT - - - uses: ./.github/actions/cargo-semver-checks - if: steps.check-released.outputs.code == 200 && !contains(fromJSON('["libp2p-swarm-derive", "libp2p-server"]'), env.CRATE) # Workaround until https://github.com/obi1kenobi/cargo-semver-check/issues/146 is shipped. - with: - crate: ${{ env.CRATE }} - - name: Enforce no dependency on meta crate if: env.CRATE != 'libp2p-server' run: | @@ -90,7 +76,7 @@ jobs: env: CHROMEDRIVER_VERSION: '114.0.5735.90' steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: dtolnay/rust-toolchain@stable with: @@ -130,7 +116,7 @@ jobs: os: windows-latest runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: dtolnay/rust-toolchain@stable with: @@ -149,7 +135,7 @@ jobs: name: Compile with MSRV runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Extract MSRV from workspace manifest shell: bash @@ -178,7 +164,7 @@ jobs: - features: "mdns tcp dns tokio" - features: "mdns tcp dns async-std" steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: dtolnay/rust-toolchain@stable @@ -195,7 +181,7 @@ jobs: name: Check rustdoc intra-doc links runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: dtolnay/rust-toolchain@stable @@ -214,11 +200,11 @@ jobs: fail-fast: false matrix: rust-version: [ - 1.71.0, # current stable + 1.72.0, # current stable beta ] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: dtolnay/rust-toolchain@master with: @@ -238,7 +224,7 @@ jobs: name: IPFS Integration tests runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: dtolnay/rust-toolchain@stable @@ -254,7 +240,7 @@ jobs: examples: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: dtolnay/rust-toolchain@stable @@ -273,10 +259,18 @@ jobs: cargo check --manifest-path "$toml"; done + semver: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - run: wget -q -O- https://github.com/obi1kenobi/cargo-semver-checks/releases/download/v0.23.0/cargo-semver-checks-x86_64-unknown-linux-gnu.tar.gz | tar -xz -C ~/.cargo/bin + shell: bash + - uses: obi1kenobi/cargo-semver-checks-action@v2 + rustfmt: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: dtolnay/rust-toolchain@stable with: @@ -290,7 +284,7 @@ jobs: manifest_lint: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: dtolnay/rust-toolchain@stable @@ -313,7 +307,7 @@ jobs: outputs: members: ${{ steps.cargo-metadata.outputs.members }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: dtolnay/rust-toolchain@stable @@ -326,7 +320,7 @@ jobs: name: Check for changes in proto files runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: Swatinem/rust-cache@e207df5d269b42b69c8bc5101da26f7d31feddb4 # v2.6.2 @@ -353,19 +347,14 @@ jobs: name: Ensure that `Cargo.lock` is up-to-date runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: Swatinem/rust-cache@e207df5d269b42b69c8bc5101da26f7d31feddb4 # v2.6.2 - run: cargo metadata --locked --format-version=1 > /dev/null cargo-deny: runs-on: ubuntu-latest - strategy: - matrix: - checks: - - advisories - - bans licenses sources steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: EmbarkStudios/cargo-deny-action@v1 with: - command: check ${{ matrix.checks }} + command: check advisories bans licenses sources diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index 29e58506386..7bde2040e2d 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -11,7 +11,7 @@ jobs: server: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: docker/login-action@v2 with: diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 8513493b41a..bffcc60d2ea 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -10,7 +10,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Install nightly toolchain run: rustup toolchain install nightly - name: Build Documentation diff --git a/.github/workflows/interop-test.yml b/.github/workflows/interop-test.yml index 4d63a76c811..5bda0622a72 100644 --- a/.github/workflows/interop-test.yml +++ b/.github/workflows/interop-test.yml @@ -17,7 +17,7 @@ jobs: matrix: flavour: [chromium, native] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: docker/setup-buildx-action@v2 - name: Build ${{ matrix.flavour }} image run: docker buildx build --load -t ${{ matrix.flavour }}-rust-libp2p-head . -f interop-tests/Dockerfile.${{ matrix.flavour }} diff --git a/Cargo.lock b/Cargo.lock index e5ba223f1eb..3f73d12dce6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -463,16 +463,16 @@ dependencies = [ [[package]] name = "async-std-resolver" -version = "0.22.0" +version = "0.23.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ba50e24d9ee0a8950d3d03fc6d0dd10aa14b5de3b101949b4e160f7fee7c723" +checksum = "0354a68a52265a3bde76005ddd2726624ef8624614f7f58871301de205a58a59" dependencies = [ "async-std", "async-trait", "futures-io", "futures-util", "pin-utils", - "socket2 0.4.9", + "socket2 0.5.3", "trust-dns-resolver", ] @@ -490,7 +490,7 @@ checksum = "bc00ceb34980c03614e35a3a4e218276a0a824e911d07651cd0d858a51e8c0f0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.29", + "syn 2.0.31", ] [[package]] @@ -619,9 +619,9 @@ checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" [[package]] name = "base64" -version = "0.21.2" +version = "0.21.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "604178f6c5c21f02dc555784810edfb88d34ac2c73b2eae109655649ee73ce3d" +checksum = "414dcefbc63d77c526a76b3afcf6fbb9b5e2791c19c3aa2297733208750c6e53" [[package]] name = "base64ct" @@ -746,9 +746,9 @@ checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" [[package]] name = "bytes" -version = "1.4.0" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89b2fd2a0dcf38d7971e2194b6b6eebab45ae01067456a7fd93d5547a61b70be" +checksum = "a2bd12c1caf447e69cd4528f47f94d203fd2582878ecb9e9465484c4148a8223" dependencies = [ "serde", ] @@ -920,7 +920,7 @@ dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.29", + "syn 2.0.31", ] [[package]] @@ -1249,7 +1249,7 @@ checksum = "83fdaf97f4804dcebfa5862639bc9ce4121e82140bec2a987ac5140294865b5b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.29", + "syn 2.0.31", ] [[package]] @@ -1435,7 +1435,7 @@ checksum = "487585f4d0c6655fe74905e2504d8ad6908e4db67f744eb140876906c2f3175d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.29", + "syn 2.0.31", ] [[package]] @@ -1564,14 +1564,14 @@ dependencies = [ [[package]] name = "enum-as-inner" -version = "0.5.1" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c9720bba047d567ffc8a3cba48bf19126600e249ab7f128e9233e6376976a116" +checksum = "5ffccbb6966c05b32ef8fbac435df276c4ae4d3dc55a8cd0eb9745e6c12f546a" dependencies = [ "heck", "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.31", ] [[package]] @@ -1819,7 +1819,7 @@ checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72" dependencies = [ "proc-macro2", "quote", - "syn 2.0.29", + "syn 2.0.31", ] [[package]] @@ -1829,7 +1829,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "35bd3cf68c183738046838e300353e4716c674dc5e56890de4826801a6622a28" dependencies = [ "futures-io", - "rustls 0.21.6", + "rustls 0.21.7", ] [[package]] @@ -2199,7 +2199,7 @@ dependencies = [ "rustls 0.20.8", "rustls-native-certs", "tokio", - "tokio-rustls", + "tokio-rustls 0.23.4", ] [[package]] @@ -2231,17 +2231,6 @@ dependencies = [ "libp2p", ] -[[package]] -name = "idna" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "418a0a6fab821475f634efe3ccc45c013f742efe03d853e8d3355d5cb850ecf8" -dependencies = [ - "matches", - "unicode-bidi", - "unicode-normalization", -] - [[package]] name = "idna" version = "0.4.0" @@ -2475,7 +2464,7 @@ dependencies = [ name = "keygen" version = "0.1.0" dependencies = [ - "base64 0.21.2", + "base64 0.21.3", "clap", "libp2p-core", "libp2p-identity", @@ -2607,7 +2596,7 @@ dependencies = [ [[package]] name = "libp2p-core" -version = "0.40.0" +version = "0.40.1" dependencies = [ "async-std", "either", @@ -2688,6 +2677,7 @@ version = "0.40.0" dependencies = [ "async-std", "async-std-resolver", + "async-trait", "env_logger 0.10.0", "futures", "libp2p-core", @@ -2724,7 +2714,7 @@ version = "0.45.1" dependencies = [ "async-std", "asynchronous-codec", - "base64 0.21.2", + "base64 0.21.3", "byteorder", "bytes", "either", @@ -2784,7 +2774,7 @@ name = "libp2p-identity" version = "0.2.3" dependencies = [ "asn1_der", - "base64 0.21.2", + "base64 0.21.3", "bs58", "criterion", "ed25519-dalek", @@ -2995,7 +2985,7 @@ dependencies = [ [[package]] name = "libp2p-ping" -version = "0.43.0" +version = "0.43.1" dependencies = [ "async-std", "either", @@ -3074,7 +3064,7 @@ dependencies = [ "quickcheck", "quinn", "rand 0.8.5", - "rustls 0.21.6", + "rustls 0.21.7", "socket2 0.5.3", "thiserror", "tokio", @@ -3167,7 +3157,7 @@ dependencies = [ name = "libp2p-server" version = "0.12.3" dependencies = [ - "base64 0.21.2", + "base64 0.21.3", "clap", "env_logger 0.10.0", "futures", @@ -3185,7 +3175,7 @@ dependencies = [ [[package]] name = "libp2p-swarm" -version = "0.43.3" +version = "0.43.4" dependencies = [ "async-std", "either", @@ -3224,7 +3214,7 @@ dependencies = [ "proc-macro-warning", "proc-macro2", "quote", - "syn 2.0.29", + "syn 2.0.31", ] [[package]] @@ -3276,7 +3266,7 @@ dependencies = [ "libp2p-yamux", "rcgen 0.10.0", "ring", - "rustls 0.21.6", + "rustls 0.21.7", "rustls-webpki", "thiserror", "tokio", @@ -3365,7 +3355,7 @@ dependencies = [ "rw-stream-sink", "soketto", "url", - "webpki-roots 0.25.2", + "webpki-roots", ] [[package]] @@ -3519,12 +3509,6 @@ dependencies = [ "regex-automata 0.1.10", ] -[[package]] -name = "matches" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2532096657941c2fea9c289d370a250971c689d4f143798ff67113ec042024a5" - [[package]] name = "matchit" version = "0.7.1" @@ -3542,9 +3526,9 @@ dependencies = [ [[package]] name = "memchr" -version = "2.5.0" +version = "2.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" +checksum = "8f232d6ef707e1956a43342693d2a31e72989554d58299d7a88738cc95b0d35c" [[package]] name = "memoffset" @@ -3661,9 +3645,9 @@ dependencies = [ [[package]] name = "multihash" -version = "0.19.0" +version = "0.19.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2fd59dcc2bbe70baabeac52cd22ae52c55eefe6c38ff11a9439f16a350a939f2" +checksum = "076d548d76a0e2a0d4ab471d0b1c36c577786dfc4471242035d97a12a735c492" dependencies = [ "arbitrary", "core2", @@ -3931,7 +3915,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.29", + "syn 2.0.31", ] [[package]] @@ -4077,7 +4061,7 @@ checksum = "4359fd9c9171ec6e8c62926d6faaf553a8dc3f64e1507e76da7911b4f6a04405" dependencies = [ "proc-macro2", "quote", - "syn 2.0.29", + "syn 2.0.31", ] [[package]] @@ -4260,13 +4244,13 @@ dependencies = [ [[package]] name = "proc-macro-warning" -version = "0.4.1" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70550716265d1ec349c41f70dd4f964b4fd88394efe4405f0c1da679c4799a07" +checksum = "3d1eaa7fa0aa1929ffdf7eeb6eac234dde6268914a14ad44d23521ab6a9b258e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.29", + "syn 2.0.31", ] [[package]] @@ -4371,7 +4355,7 @@ dependencies = [ "quinn-proto", "quinn-udp", "rustc-hash", - "rustls 0.21.6", + "rustls 0.21.7", "thiserror", "tokio", "tracing", @@ -4387,7 +4371,7 @@ dependencies = [ "rand 0.8.5", "ring", "rustc-hash", - "rustls 0.21.6", + "rustls 0.21.7", "slab", "thiserror", "tinyvec", @@ -4409,9 +4393,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.32" +version = "1.0.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50f3b39ccfb720540debaa0164757101c08ecb8d326b15358ce76a62c7e85965" +checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" dependencies = [ "proc-macro2", ] @@ -4536,9 +4520,9 @@ dependencies = [ [[package]] name = "redis" -version = "0.23.2" +version = "0.23.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffd6543a7bc6428396845f6854ccf3d1ae8823816592e2cbe74f20f50f209d02" +checksum = "4f49cdc0bb3f412bf8e7d1bd90fe1d9eb10bc5c399ba90973c14662a27b3f8ba" dependencies = [ "async-trait", "bytes", @@ -4564,14 +4548,14 @@ dependencies = [ [[package]] name = "regex" -version = "1.9.3" +version = "1.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81bc1d4caf89fac26a70747fe603c130093b53c773888797a6329091246d651a" +checksum = "697061221ea1b4a94a624f67d0ae2bfe4e22b8a17b6a192afb11046542cc8c47" dependencies = [ "aho-corasick", "memchr", - "regex-automata 0.3.6", - "regex-syntax 0.7.4", + "regex-automata 0.3.8", + "regex-syntax 0.7.5", ] [[package]] @@ -4585,13 +4569,13 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.3.6" +version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fed1ceff11a1dddaee50c9dc8e4938bd106e9d89ae372f192311e7da498e3b69" +checksum = "c2f401f4955220693b56f8ec66ee9c78abffd8d1c4f23dc41a23839eb88f0795" dependencies = [ "aho-corasick", "memchr", - "regex-syntax 0.7.4", + "regex-syntax 0.7.5", ] [[package]] @@ -4602,9 +4586,9 @@ checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" [[package]] name = "regex-syntax" -version = "0.7.4" +version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5ea92a5b6195c6ef2a0295ea818b312502c6fc94dde986c5553242e18fd4ce2" +checksum = "dbb5fb1acd8a1a18b3dd5be62d25485eb770e05afb408a9627d14d451bae12da" [[package]] name = "relay-server-example" @@ -4637,7 +4621,7 @@ version = "0.11.20" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3e9ad3fe7488d7e34558a2033d45a0c90b72d97b4f80705666fea71472e2e6a1" dependencies = [ - "base64 0.21.2", + "base64 0.21.3", "bytes", "encoding_rs", "futures-core", @@ -4787,9 +4771,9 @@ dependencies = [ [[package]] name = "rust-embed" -version = "6.8.1" +version = "8.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a36224c3276f8c4ebc8c20f158eca7ca4359c8db89991c4925132aaaf6702661" +checksum = "b1e7d90385b59f0a6bf3d3b757f3ca4ece2048265d70db20a2016043d4509a40" dependencies = [ "rust-embed-impl", "rust-embed-utils", @@ -4798,22 +4782,22 @@ dependencies = [ [[package]] name = "rust-embed-impl" -version = "6.8.1" +version = "8.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49b94b81e5b2c284684141a2fb9e2a31be90638caf040bf9afbc5a0416afe1ac" +checksum = "3c3d8c6fd84090ae348e63a84336b112b5c3918b3bf0493a581f7bd8ee623c29" dependencies = [ "proc-macro2", "quote", "rust-embed-utils", - "syn 2.0.29", + "syn 2.0.31", "walkdir", ] [[package]] name = "rust-embed-utils" -version = "7.8.1" +version = "8.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d38ff6bf570dc3bb7100fce9f7b60c33fa71d80e88da3f2580df4ff2bdded74" +checksum = "873feff8cb7bf86fdf0a71bb21c95159f4e4a37dd7a4bd1855a940909b583ada" dependencies = [ "sha2 0.10.7", "walkdir", @@ -4903,9 +4887,9 @@ dependencies = [ [[package]] name = "rustls" -version = "0.21.6" +version = "0.21.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d1feddffcfcc0b33f5c6ce9a29e341e4cd59c3f78e7ee45f4a40c038b1d6cbb" +checksum = "cd8d6c9f025a446bc4d18ad9632e69aec8f287aa84499ee335599fabd20c3fd8" dependencies = [ "log", "ring", @@ -4931,7 +4915,7 @@ version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2d3987094b1d07b653b7dfdc3f70ce9a1da9c51ac18c1b06b662e4f9a0e9f4b2" dependencies = [ - "base64 0.21.2", + "base64 0.21.3", ] [[package]] @@ -5126,7 +5110,7 @@ checksum = "4eca7ac642d82aa35b60049a6eccb4be6be75e599bd2e9adb5f875a737654af2" dependencies = [ "proc-macro2", "quote", - "syn 2.0.29", + "syn 2.0.31", ] [[package]] @@ -5159,7 +5143,7 @@ checksum = "8725e1dfadb3a50f7e5ce0b1a540466f6ed3fe7a0fca2ac2b8b831d31316bd00" dependencies = [ "proc-macro2", "quote", - "syn 2.0.29", + "syn 2.0.31", ] [[package]] @@ -5467,9 +5451,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.29" +version = "2.0.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c324c494eba9d92503e6f1ef2e6df781e78f6a7705a0202d9801b198807d518a" +checksum = "718fa2415bcb8d8bd775917a1bf12a7931b6dfa890753378538118181e0cb398" dependencies = [ "proc-macro2", "quote", @@ -5496,9 +5480,9 @@ dependencies = [ [[package]] name = "sysinfo" -version = "0.29.8" +version = "0.29.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d10ed79c22663a35a255d289a7fdcb43559fc77ff15df5ce6c341809e7867528" +checksum = "0a18d114d420ada3a891e6bc8e96a2023402203296a47cdd65083377dad18ba5" dependencies = [ "cfg-if 1.0.0", "core-foundation-sys", @@ -5559,7 +5543,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bf0fe180d5f1f7dd32bb5f1a8d19231bb63dc9bbb1985e1dbb6f07163b6a8578" dependencies = [ "async-trait", - "base64 0.21.2", + "base64 0.21.3", "cookie", "fantoccini", "futures", @@ -5592,22 +5576,22 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.44" +version = "1.0.48" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "611040a08a0439f8248d1990b111c95baa9c704c805fa1f62104b39655fd7f90" +checksum = "9d6d7a740b8a666a7e828dd00da9c0dc290dff53154ea77ac109281de90589b7" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.44" +version = "1.0.48" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "090198534930841fab3a5d1bb637cde49e339654e606195f8d9c76eeb081dc96" +checksum = "49922ecae66cc8a249b77e68d1d0623c1b2c514f0060c27cdc68bd62a1219d35" dependencies = [ "proc-macro2", "quote", - "syn 2.0.29", + "syn 2.0.31", ] [[package]] @@ -5699,7 +5683,7 @@ checksum = "630bdcf245f78637c13ec01ffae6187cca34625e8c63150d424b59e55af2675e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.29", + "syn 2.0.31", ] [[package]] @@ -5723,6 +5707,16 @@ dependencies = [ "webpki 0.22.0", ] +[[package]] +name = "tokio-rustls" +version = "0.24.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081" +dependencies = [ + "rustls 0.21.7", + "tokio", +] + [[package]] name = "tokio-util" version = "0.7.8" @@ -5756,9 +5750,9 @@ dependencies = [ [[package]] name = "tower-http" -version = "0.4.3" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55ae70283aba8d2a8b411c695c437fe25b8b5e44e23e780662002fc72fb47a82" +checksum = "61c5bb1d698276a2443e5ecfabc1008bf15a36c12e6a7176e7bf089ea9131140" dependencies = [ "bitflags 2.3.3", "bytes", @@ -5812,7 +5806,7 @@ checksum = "5f4f31f56159e98206da9efd823404b79b6ef3143b4a7ab76e67b1751b25a4ab" dependencies = [ "proc-macro2", "quote", - "syn 2.0.29", + "syn 2.0.31", ] [[package]] @@ -5856,9 +5850,9 @@ dependencies = [ [[package]] name = "trust-dns-proto" -version = "0.22.0" +version = "0.23.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f7f83d1e4a0e4358ac54c5c3681e5d7da5efc5a7a632c90bb6d6669ddd9bc26" +checksum = "0dc775440033cb114085f6f2437682b194fa7546466024b1037e82a48a052a69" dependencies = [ "async-trait", "bytes", @@ -5870,45 +5864,46 @@ dependencies = [ "futures-util", "h2", "http", - "idna 0.2.3", + "idna", "ipnet", - "lazy_static", + "once_cell", "rand 0.8.5", - "rustls 0.20.8", + "rustls 0.21.7", "rustls-pemfile", + "rustls-webpki", "smallvec", - "socket2 0.4.9", + "socket2 0.5.3", "thiserror", "tinyvec", "tokio", - "tokio-rustls", + "tokio-rustls 0.24.1", "tracing", "url", - "webpki 0.22.0", - "webpki-roots 0.22.6", + "webpki-roots", ] [[package]] name = "trust-dns-resolver" -version = "0.22.0" +version = "0.23.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aff21aa4dcefb0a1afbfac26deb0adc93888c7d295fb63ab273ef276ba2b7cfe" +checksum = "2dff7aed33ef3e8bf2c9966fccdfed93f93d46f432282ea875cd66faabc6ef2f" dependencies = [ "cfg-if 1.0.0", "futures-util", "ipconfig", - "lazy_static", "lru-cache", + "once_cell", "parking_lot", + "rand 0.8.5", "resolv-conf", - "rustls 0.20.8", + "rustls 0.21.7", "smallvec", "thiserror", "tokio", - "tokio-rustls", + "tokio-rustls 0.24.1", "tracing", "trust-dns-proto", - "webpki-roots 0.22.6", + "webpki-roots", ] [[package]] @@ -6049,12 +6044,12 @@ checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" [[package]] name = "url" -version = "2.4.0" +version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50bff7831e19200a85b17131d085c25d7811bc4e186efdaf54bbd132994a88cb" +checksum = "143b538f18257fac9cad154828a57c6bf5157e1aa604d4816b5995bf6de87ae5" dependencies = [ "form_urlencoded", - "idna 0.4.0", + "idna", "percent-encoding", ] @@ -6170,7 +6165,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.29", + "syn 2.0.31", "wasm-bindgen-shared", ] @@ -6204,7 +6199,7 @@ checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.29", + "syn 2.0.31", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -6299,15 +6294,6 @@ dependencies = [ "untrusted", ] -[[package]] -name = "webpki-roots" -version = "0.22.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6c71e40d7d2c34a5106301fb632274ca37242cd0c9d3e64dbece371a40a2d87" -dependencies = [ - "webpki 0.22.0", -] - [[package]] name = "webpki-roots" version = "0.25.2" @@ -6817,5 +6803,5 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.29", + "syn 2.0.31", ] diff --git a/Cargo.toml b/Cargo.toml index 17d34c07e2a..c4bf0b8606b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -68,7 +68,7 @@ libp2p = { version = "0.52.3", path = "libp2p" } libp2p-allow-block-list = { version = "0.2.0", path = "misc/allow-block-list" } libp2p-autonat = { version = "0.11.0", path = "protocols/autonat" } libp2p-connection-limits = { version = "0.2.1", path = "misc/connection-limits" } -libp2p-core = { version = "0.40.0", path = "core" } +libp2p-core = { version = "0.40.1", path = "core" } libp2p-dcutr = { version = "0.10.0", path = "protocols/dcutr" } libp2p-deflate = { version = "0.40.0", path = "transports/deflate" } libp2p-dns = { version = "0.40.0", path = "transports/dns" } @@ -84,15 +84,15 @@ libp2p-mplex = { version = "0.40.0", path = "muxers/mplex" } libp2p-muxer-test-harness = { path = "muxers/test-harness" } libp2p-noise = { version = "0.43.1", path = "transports/noise" } libp2p-perf = { version = "0.2.0", path = "protocols/perf" } -libp2p-ping = { version = "0.43.0", path = "protocols/ping" } -libp2p-plaintext = { version = "0.40.0", path = "transports/plaintext" } +libp2p-ping = { version = "0.43.1", path = "protocols/ping" } +libp2p-plaintext = { version = , path = "transports/plaintext" } libp2p-pnet = { version = "0.23.0", path = "transports/pnet" } libp2p-quic = { version = "0.9.2", path = "transports/quic" } libp2p-relay = { version = "0.16.1", path = "protocols/relay" } libp2p-rendezvous = { version = "0.13.0", path = "protocols/rendezvous" } libp2p-request-response = { version = "0.25.1", path = "protocols/request-response" } libp2p-server = { version = "0.12.3", path = "misc/server" } -libp2p-swarm = { version = "0.43.3", path = "swarm" } +libp2p-swarm = { version = "0.43.4", path = "swarm" } libp2p-swarm-derive = { version = "0.33.0", path = "swarm-derive" } libp2p-swarm-test = { version = "0.2.0", path = "swarm-test" } libp2p-tcp = { version = "0.40.0", path = "transports/tcp" } @@ -108,7 +108,7 @@ quick-protobuf-codec = { version = "0.2.0", path = "misc/quick-protobuf-codec" } quickcheck = { package = "quickcheck-ext", path = "misc/quickcheck-ext" } rw-stream-sink = { version = "0.4.0", path = "misc/rw-stream-sink" } multiaddr = "0.18.0" -multihash = "0.19.0" +multihash = "0.19.1" [patch.crates-io] diff --git a/core/CHANGELOG.md b/core/CHANGELOG.md index ecc1eff2d7a..2d5c47a1633 100644 --- a/core/CHANGELOG.md +++ b/core/CHANGELOG.md @@ -1,4 +1,11 @@ -## 0.40.0 +## 0.40.1 - unreleased + +- Implement `Debug` for `StreamMuxerEvent`. + See [PR 4426]. + +[PR 4426]: https://github.com/libp2p/rust-libp2p/pull/4426 + +## 0.40.0 - Allow `ListenerId` to be user-controlled, i.e. to be provided on `Transport::listen_on`. See [PR 3567]. diff --git a/core/Cargo.toml b/core/Cargo.toml index e71c4d0f243..a3912f0f5e4 100644 --- a/core/Cargo.toml +++ b/core/Cargo.toml @@ -3,7 +3,7 @@ name = "libp2p-core" edition = "2021" rust-version = { workspace = true } description = "Core traits and structs of libp2p" -version = "0.40.0" +version = "0.40.1" authors = ["Parity Technologies "] license = "MIT" repository = "https://github.com/libp2p/rust-libp2p" diff --git a/core/src/muxing.rs b/core/src/muxing.rs index 13b826ba840..477e1608073 100644 --- a/core/src/muxing.rs +++ b/core/src/muxing.rs @@ -112,6 +112,7 @@ pub trait StreamMuxer { } /// An event produced by a [`StreamMuxer`]. +#[derive(Debug)] pub enum StreamMuxerEvent { /// The address of the remote has changed. AddressChange(Multiaddr), diff --git a/examples/dcutr/README.md b/examples/dcutr/README.md index 52ce991e4b9..5c7a9c38f82 100644 --- a/examples/dcutr/README.md +++ b/examples/dcutr/README.md @@ -18,12 +18,12 @@ To run the example, follow these steps: - Example usage in client-listen mode: ```sh - cargo run -- --mode listen --secret-key-seed 42 --relay-address /ip4/127.0.0.1/tcp/12345 + cargo run -- --mode listen --secret-key-seed 42 --relay-address /ip4/$RELAY_IP/tcp/$PORT/p2p/$RELAY_PEERID ``` - Example usage in client-dial mode: ```sh - cargo run -- --mode dial --secret-key-seed 42 --relay-address /ip4/127.0.0.1/tcp/12345 --remote-peer-id + cargo run -- --mode dial --secret-key-seed 42 --relay-address /ip4/$RELAY_IP/tcp/$PORT/p2p/$RELAY_PEERID --remote-peer-id ``` For this example to work, it is also necessary to turn on a relay server (you will find the related instructions in the example in the `examples/relay-server` folder). diff --git a/identity/Cargo.toml b/identity/Cargo.toml index ed74c5e9836..e5da8595ebf 100644 --- a/identity/Cargo.toml +++ b/identity/Cargo.toml @@ -17,7 +17,7 @@ bs58 = { version = "0.5.0", optional = true } ed25519-dalek = { version = "2.0", optional = true, features = ["rand_core"] } libsecp256k1 = { version = "0.7.0", optional = true } log = "0.4" -multihash = { version = "0.19.0", optional = true } +multihash = { version = "0.19.1", optional = true } p256 = { version = "0.13", default-features = false, features = ["ecdsa", "std", "pem"], optional = true } quick-protobuf = "0.8.1" rand = { version = "0.8", optional = true } @@ -40,7 +40,7 @@ peerid = [ "dep:multihash", "dep:bs58", "dep:rand", "dep:thiserror", "dep:sha2" [dev-dependencies] quickcheck = { workspace = true } -base64 = "0.21.2" +base64 = "0.21.3" serde_json = "1.0" rmp-serde = "1.1" criterion = "0.5" diff --git a/interop-tests/Cargo.toml b/interop-tests/Cargo.toml index fb12812c229..d3a2e00647f 100644 --- a/interop-tests/Cargo.toml +++ b/interop-tests/Cargo.toml @@ -23,8 +23,8 @@ libp2p = { path = "../libp2p", features = ["ping", "noise", "tls", "rsa", "macro libp2p-webrtc = { workspace = true, features = ["tokio"] } libp2p-mplex = { path = "../muxers/mplex" } mime_guess = "2.0" -redis = { version = "0.23.2", default-features = false, features = ["tokio-comp"] } -rust-embed = "6.8" +redis = { version = "0.23.3", default-features = false, features = ["tokio-comp"] } +rust-embed = "8.0" serde_json = "1" thirtyfour = "=0.32.0-rc.8" # https://github.com/stevepryde/thirtyfour/issues/169 tokio = { version = "1.32.0", features = ["full"] } diff --git a/interop-tests/src/bin/wasm_ping.rs b/interop-tests/src/bin/wasm_ping.rs index 20350170d59..83ed3c37465 100644 --- a/interop-tests/src/bin/wasm_ping.rs +++ b/interop-tests/src/bin/wasm_ping.rs @@ -103,7 +103,12 @@ async fn open_in_browser() -> Result<(Child, WebDriver)> { // start a webdriver process // currently only the chromedriver is supported as firefox doesn't // have support yet for the certhashes - let mut chrome = tokio::process::Command::new("chromedriver") + let chromedriver = if cfg!(windows) { + "chromedriver.cmd" + } else { + "chromedriver" + }; + let mut chrome = tokio::process::Command::new(chromedriver) .arg("--port=45782") .stdout(Stdio::piped()) .spawn()?; diff --git a/libp2p/src/tutorials/hole_punching.rs b/libp2p/src/tutorials/hole_punching.rs index 161a2feeec4..c184274bbb0 100644 --- a/libp2p/src/tutorials/hole_punching.rs +++ b/libp2p/src/tutorials/hole_punching.rs @@ -54,16 +54,16 @@ //! //! ``` bash //! ## Inside the rust-libp2p repository. -//! cargo build --example relay_v2 -p libp2p-relay +//! cargo build --bin relay-server-example //! ``` //! -//! You can find the binary at `target/debug/examples/relay_v2`. In case you built it locally, copy +//! You can find the binary at `target/debug/relay-server-example`. In case you built it locally, copy //! it to your server. //! //! On your server, start the relay server binary: //! //! ``` bash -//! ./relay_v2 --port 4001 --secret-key-seed 0 +//! ./relay-server-example --port 4001 --secret-key-seed 0 //! ``` //! //! Now let's make sure that the server is public, in other words let's make sure one can reach it @@ -122,16 +122,16 @@ //! //! ``` bash //! ## Inside the rust-libp2p repository. -//! cargo build --example client -p libp2p-dcutr +//! cargo build --bin dcutr //! ``` //! -//! You can find the binary at `target/debug/examples/client`. In case you built it locally, copy +//! You can find the binary at `target/debug/dcutr`. In case you built it locally, copy //! it to your listening client machine. //! //! On the listening client machine: //! //! ``` bash -//! RUST_LOG=info ./client --secret-key-seed 1 --mode listen --relay-address /ip4/$RELAY_SERVER_IP/tcp/4001/p2p/12D3KooWDpJ7As7BWAwRMfu1VU2WCqNjvq387JEYKDBj4kx6nXTN +//! RUST_LOG=info ./dcutr --secret-key-seed 1 --mode listen --relay-address /ip4/$RELAY_SERVER_IP/tcp/4001/p2p/12D3KooWDpJ7As7BWAwRMfu1VU2WCqNjvq387JEYKDBj4kx6nXTN //! //! [2022-05-11T10:38:52Z INFO client] Local peer id: PeerId("XXX") //! [2022-05-11T10:38:52Z INFO client] Listening on "/ip4/127.0.0.1/tcp/44703" @@ -153,7 +153,7 @@ //! ## Connecting to the listening client from the dialing client //! //! ``` bash -//! RUST_LOG=info ./client --secret-key-seed 2 --mode dial --relay-address /ip4/$RELAY_SERVER_IP/tcp/4001/p2p/12D3KooWDpJ7As7BWAwRMfu1VU2WCqNjvq387JEYKDBj4kx6nXTN --remote-peer-id 12D3KooWPjceQrSwdWXPyLLeABRXmuqt69Rg3sBYbU1Nft9HyQ6X +//! RUST_LOG=info ./dcutr --secret-key-seed 2 --mode dial --relay-address /ip4/$RELAY_SERVER_IP/tcp/4001/p2p/12D3KooWDpJ7As7BWAwRMfu1VU2WCqNjvq387JEYKDBj4kx6nXTN --remote-peer-id 12D3KooWPjceQrSwdWXPyLLeABRXmuqt69Rg3sBYbU1Nft9HyQ6X //! ``` //! //! You should see the following logs appear: diff --git a/misc/keygen/Cargo.toml b/misc/keygen/Cargo.toml index ab0c2d624bc..0105c041b7e 100644 --- a/misc/keygen/Cargo.toml +++ b/misc/keygen/Cargo.toml @@ -15,5 +15,5 @@ zeroize = "1" serde = { version = "1.0.188", features = ["derive"] } serde_json = "1.0.105" libp2p-core = { workspace = true } -base64 = "0.21.2" +base64 = "0.21.3" libp2p-identity = { workspace = true } diff --git a/protocols/floodsub/Cargo.toml b/protocols/floodsub/Cargo.toml index d79ae5bc719..8dd3c80d95e 100644 --- a/protocols/floodsub/Cargo.toml +++ b/protocols/floodsub/Cargo.toml @@ -23,7 +23,7 @@ quick-protobuf = "0.8" quick-protobuf-codec = { workspace = true } rand = "0.8" smallvec = "1.11.0" -thiserror = "1.0.44" +thiserror = "1.0.48" # Passing arguments to the docsrs builder in order to properly document cfg's. # More information: https://docs.rs/about/builds#cross-compiling diff --git a/protocols/gossipsub/Cargo.toml b/protocols/gossipsub/Cargo.toml index acbab0c82e9..01902ae1a43 100644 --- a/protocols/gossipsub/Cargo.toml +++ b/protocols/gossipsub/Cargo.toml @@ -15,9 +15,9 @@ wasm-bindgen = ["getrandom/js", "instant/wasm-bindgen"] [dependencies] asynchronous-codec = "0.6" -base64 = "0.21.2" +base64 = "0.21.3" byteorder = "1.3.4" -bytes = "1.4" +bytes = "1.5" either = "1.9" fnv = "1.0.7" futures = "0.3.28" @@ -32,7 +32,7 @@ log = "0.4.20" quick-protobuf = "0.8" quick-protobuf-codec = { workspace = true } rand = "0.8" -regex = "1.9.3" +regex = "1.9.5" serde = { version = "1", optional = true, features = ["derive"] } sha2 = "0.10.7" smallvec = "1.11.0" diff --git a/protocols/mdns/Cargo.toml b/protocols/mdns/Cargo.toml index 41f5d9af428..01a30741914 100644 --- a/protocols/mdns/Cargo.toml +++ b/protocols/mdns/Cargo.toml @@ -23,7 +23,7 @@ rand = "0.8.3" smallvec = "1.11.0" socket2 = { version = "0.5.3", features = ["all"] } tokio = { version = "1.32", default-features = false, features = ["net", "time"], optional = true} -trust-dns-proto = { version = "0.22.0", default-features = false, features = ["mdns", "tokio-runtime"] } +trust-dns-proto = { version = "0.23.0", default-features = false, features = ["mdns"] } void = "1.0.2" [features] diff --git a/protocols/ping/CHANGELOG.md b/protocols/ping/CHANGELOG.md index fd0c0824ef0..7b46cdc3626 100644 --- a/protocols/ping/CHANGELOG.md +++ b/protocols/ping/CHANGELOG.md @@ -1,3 +1,11 @@ +## 0.43.1 - unreleased + +- Honor ping interval in case of errors. + Previously, we would immediately open another ping stream if the current one failed. + See [PR 4423]. + +[PR 4423]: https://github.com/libp2p/rust-libp2p/pull/4423 + ## 0.43.0 - Raise MSRV to 1.65. diff --git a/protocols/ping/Cargo.toml b/protocols/ping/Cargo.toml index f66222efff7..29cf5985b76 100644 --- a/protocols/ping/Cargo.toml +++ b/protocols/ping/Cargo.toml @@ -3,7 +3,7 @@ name = "libp2p-ping" edition = "2021" rust-version = { workspace = true } description = "Ping protocol for libp2p" -version = "0.43.0" +version = "0.43.1" authors = ["Parity Technologies "] license = "MIT" repository = "https://github.com/libp2p/rust-libp2p" diff --git a/protocols/ping/src/handler.rs b/protocols/ping/src/handler.rs index 0cf5c6e5f07..522663196e6 100644 --- a/protocols/ping/src/handler.rs +++ b/protocols/ping/src/handler.rs @@ -303,6 +303,7 @@ impl ConnectionHandler for Handler { return Poll::Ready(ConnectionHandlerEvent::NotifyBehaviour(Ok(rtt))); } Poll::Ready(Err(e)) => { + self.interval.reset(self.config.interval); self.pending_errors.push_front(e); } }, @@ -321,13 +322,16 @@ impl ConnectionHandler for Handler { self.outbound = Some(OutboundState::OpenStream); break; } - None => { - self.outbound = Some(OutboundState::OpenStream); - let protocol = SubstreamProtocol::new(ReadyUpgrade::new(PROTOCOL_NAME), ()); - return Poll::Ready(ConnectionHandlerEvent::OutboundSubstreamRequest { - protocol, - }); - } + None => match self.interval.poll_unpin(cx) { + Poll::Pending => break, + Poll::Ready(()) => { + self.outbound = Some(OutboundState::OpenStream); + let protocol = SubstreamProtocol::new(ReadyUpgrade::new(PROTOCOL_NAME), ()); + return Poll::Ready(ConnectionHandlerEvent::OutboundSubstreamRequest { + protocol, + }); + } + }, } } diff --git a/protocols/ping/src/protocol.rs b/protocols/ping/src/protocol.rs index 59e583a8b3b..28549e1c198 100644 --- a/protocols/ping/src/protocol.rs +++ b/protocols/ping/src/protocol.rs @@ -35,8 +35,7 @@ pub const PROTOCOL_NAME: StreamProtocol = StreamProtocol::new("/ipfs/ping/1.0.0" /// /// At most a single inbound and outbound substream is kept open at /// any time. In case of a ping timeout or another error on a substream, the -/// substream is dropped. If a configurable number of consecutive -/// outbound pings fail, the connection is closed. +/// substream is dropped. /// /// Successful pings report the round-trip time. /// diff --git a/swarm-derive/Cargo.toml b/swarm-derive/Cargo.toml index d8d4b83d033..ab8c4a80ee7 100644 --- a/swarm-derive/Cargo.toml +++ b/swarm-derive/Cargo.toml @@ -16,8 +16,8 @@ proc-macro = true [dependencies] heck = "0.4" quote = "1.0" -syn = { version = "2.0.29", default-features = false, features = ["clone-impls", "derive", "parsing", "printing", "proc-macro"] } -proc-macro-warning = "0.4.0" +syn = { version = "2.0.31", default-features = false, features = ["clone-impls", "derive", "parsing", "printing", "proc-macro"] } +proc-macro-warning = "0.4.2" proc-macro2 = "1.0" # Passing arguments to the docsrs builder in order to properly document cfg's. diff --git a/swarm/CHANGELOG.md b/swarm/CHANGELOG.md index 37a5cbc6157..77ddf3458d1 100644 --- a/swarm/CHANGELOG.md +++ b/swarm/CHANGELOG.md @@ -1,3 +1,14 @@ +## 0.43.4 - unreleased + +- Implement `Debug` for event structs. + See [PR 4426]. + +- Improve error message when `DialPeerCondition` prevents a dial. + See [PR 4409]. + +[PR 4426]: https://github.com/libp2p/rust-libp2p/pull/4426 +[PR 4409]: https://github.com/libp2p/rust-libp2p/pull/4409 + ## 0.43.3 - Implement `Display` for `ConnectionId`. diff --git a/swarm/Cargo.toml b/swarm/Cargo.toml index c2b959eea01..b739aa8dabb 100644 --- a/swarm/Cargo.toml +++ b/swarm/Cargo.toml @@ -3,7 +3,7 @@ name = "libp2p-swarm" edition = "2021" rust-version = { workspace = true } description = "The libp2p swarm" -version = "0.43.3" +version = "0.43.4" authors = ["Parity Technologies "] license = "MIT" repository = "https://github.com/libp2p/rust-libp2p" diff --git a/swarm/src/behaviour.rs b/swarm/src/behaviour.rs index 0ecdf7b31f0..d80f5f0c9a4 100644 --- a/swarm/src/behaviour.rs +++ b/swarm/src/behaviour.rs @@ -408,6 +408,7 @@ pub enum CloseConnection { /// Enumeration with the list of the possible events /// to pass to [`on_swarm_event`](NetworkBehaviour::on_swarm_event). +#[derive(Debug)] pub enum FromSwarm<'a, Handler> { /// Informs the behaviour about a newly established connection to a peer. ConnectionEstablished(ConnectionEstablished<'a>), @@ -450,7 +451,7 @@ pub enum FromSwarm<'a, Handler> { } /// [`FromSwarm`] variant that informs the behaviour about a newly established connection to a peer. -#[derive(Clone, Copy)] +#[derive(Debug, Clone, Copy)] pub struct ConnectionEstablished<'a> { pub peer_id: PeerId, pub connection_id: ConnectionId, @@ -464,6 +465,7 @@ pub struct ConnectionEstablished<'a> { /// This event is always paired with an earlier /// [`FromSwarm::ConnectionEstablished`] with the same peer ID, connection ID /// and endpoint. +#[derive(Debug)] pub struct ConnectionClosed<'a, Handler> { pub peer_id: PeerId, pub connection_id: ConnectionId, @@ -474,7 +476,7 @@ pub struct ConnectionClosed<'a, Handler> { /// [`FromSwarm`] variant that informs the behaviour that the [`ConnectedPoint`] of an existing /// connection has changed. -#[derive(Clone, Copy)] +#[derive(Debug, Clone, Copy)] pub struct AddressChange<'a> { pub peer_id: PeerId, pub connection_id: ConnectionId, @@ -484,7 +486,7 @@ pub struct AddressChange<'a> { /// [`FromSwarm`] variant that informs the behaviour that the dial to a known /// or unknown node failed. -#[derive(Clone, Copy)] +#[derive(Debug, Clone, Copy)] pub struct DialFailure<'a> { pub peer_id: Option, pub error: &'a DialError, @@ -496,7 +498,7 @@ pub struct DialFailure<'a> { /// /// This can include, for example, an error during the handshake of the encryption layer, or the /// connection unexpectedly closed. -#[derive(Clone, Copy)] +#[derive(Debug, Clone, Copy)] pub struct ListenFailure<'a> { pub local_addr: &'a Multiaddr, pub send_back_addr: &'a Multiaddr, @@ -505,14 +507,14 @@ pub struct ListenFailure<'a> { } /// [`FromSwarm`] variant that informs the behaviour that a new listener was created. -#[derive(Clone, Copy)] +#[derive(Debug, Clone, Copy)] pub struct NewListener { pub listener_id: ListenerId, } /// [`FromSwarm`] variant that informs the behaviour /// that we have started listening on a new multiaddr. -#[derive(Clone, Copy)] +#[derive(Debug, Clone, Copy)] pub struct NewListenAddr<'a> { pub listener_id: ListenerId, pub addr: &'a Multiaddr, @@ -521,40 +523,40 @@ pub struct NewListenAddr<'a> { /// [`FromSwarm`] variant that informs the behaviour that a multiaddr /// we were listening on has expired, /// which means that we are no longer listening on it. -#[derive(Clone, Copy)] +#[derive(Debug, Clone, Copy)] pub struct ExpiredListenAddr<'a> { pub listener_id: ListenerId, pub addr: &'a Multiaddr, } /// [`FromSwarm`] variant that informs the behaviour that a listener experienced an error. -#[derive(Clone, Copy)] +#[derive(Debug, Clone, Copy)] pub struct ListenerError<'a> { pub listener_id: ListenerId, pub err: &'a (dyn std::error::Error + 'static), } /// [`FromSwarm`] variant that informs the behaviour that a listener closed. -#[derive(Clone, Copy)] +#[derive(Debug, Clone, Copy)] pub struct ListenerClosed<'a> { pub listener_id: ListenerId, pub reason: Result<(), &'a std::io::Error>, } /// [`FromSwarm`] variant that informs the behaviour about a new candidate for an external address for us. -#[derive(Clone, Copy)] +#[derive(Debug, Clone, Copy)] pub struct NewExternalAddrCandidate<'a> { pub addr: &'a Multiaddr, } /// [`FromSwarm`] variant that informs the behaviour that an external address was confirmed. -#[derive(Clone, Copy)] +#[derive(Debug, Clone, Copy)] pub struct ExternalAddrConfirmed<'a> { pub addr: &'a Multiaddr, } /// [`FromSwarm`] variant that informs the behaviour that an external address was removed. -#[derive(Clone, Copy)] +#[derive(Debug, Clone, Copy)] pub struct ExternalAddrExpired<'a> { pub addr: &'a Multiaddr, } diff --git a/swarm/src/handler.rs b/swarm/src/handler.rs index dcc7ab1c09d..9374903f9b7 100644 --- a/swarm/src/handler.rs +++ b/swarm/src/handler.rs @@ -222,6 +222,42 @@ pub enum ConnectionEvent<'a, IP: InboundUpgradeSend, OP: OutboundUpgradeSend, IO RemoteProtocolsChange(ProtocolsChange<'a>), } +impl<'a, IP, OP, IOI, OOI> fmt::Debug for ConnectionEvent<'a, IP, OP, IOI, OOI> +where + IP: InboundUpgradeSend + fmt::Debug, + IP::Output: fmt::Debug, + IP::Error: fmt::Debug, + OP: OutboundUpgradeSend + fmt::Debug, + OP::Output: fmt::Debug, + OP::Error: fmt::Debug, + IOI: fmt::Debug, + OOI: fmt::Debug, +{ + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + match self { + ConnectionEvent::FullyNegotiatedInbound(v) => { + f.debug_tuple("FullyNegotiatedInbound").field(v).finish() + } + ConnectionEvent::FullyNegotiatedOutbound(v) => { + f.debug_tuple("FullyNegotiatedOutbound").field(v).finish() + } + ConnectionEvent::AddressChange(v) => f.debug_tuple("AddressChange").field(v).finish(), + ConnectionEvent::DialUpgradeError(v) => { + f.debug_tuple("DialUpgradeError").field(v).finish() + } + ConnectionEvent::ListenUpgradeError(v) => { + f.debug_tuple("ListenUpgradeError").field(v).finish() + } + ConnectionEvent::LocalProtocolsChange(v) => { + f.debug_tuple("LocalProtocolsChange").field(v).finish() + } + ConnectionEvent::RemoteProtocolsChange(v) => { + f.debug_tuple("RemoteProtocolsChange").field(v).finish() + } + } + } +} + impl<'a, IP: InboundUpgradeSend, OP: OutboundUpgradeSend, IOI, OOI> ConnectionEvent<'a, IP, OP, IOI, OOI> { @@ -262,6 +298,7 @@ impl<'a, IP: InboundUpgradeSend, OP: OutboundUpgradeSend, IOI, OOI> /// of simultaneously open negotiated inbound substreams. In other words it is up to the /// [`ConnectionHandler`] implementation to stop a malicious remote node to open and keep alive /// an excessive amount of inbound substreams. +#[derive(Debug)] pub struct FullyNegotiatedInbound { pub protocol: IP::Output, pub info: IOI, @@ -271,18 +308,20 @@ pub struct FullyNegotiatedInbound { /// /// The `protocol` field is the information that was previously passed to /// [`ConnectionHandlerEvent::OutboundSubstreamRequest`]. +#[derive(Debug)] pub struct FullyNegotiatedOutbound { pub protocol: OP::Output, pub info: OOI, } /// [`ConnectionEvent`] variant that informs the handler about a change in the address of the remote. +#[derive(Debug)] pub struct AddressChange<'a> { pub new_address: &'a Multiaddr, } /// [`ConnectionEvent`] variant that informs the handler about a change in the protocols supported on the connection. -#[derive(Clone)] +#[derive(Debug, Clone)] pub enum ProtocolsChange<'a> { Added(ProtocolsAdded<'a>), Removed(ProtocolsRemoved<'a>), @@ -352,7 +391,7 @@ impl<'a> ProtocolsChange<'a> { } /// An [`Iterator`] over all protocols that have been added. -#[derive(Clone)] +#[derive(Debug, Clone)] pub struct ProtocolsAdded<'a> { protocols: Peekable>, } @@ -366,7 +405,7 @@ impl<'a> ProtocolsAdded<'a> { } /// An [`Iterator`] over all protocols that have been removed. -#[derive(Clone)] +#[derive(Debug, Clone)] pub struct ProtocolsRemoved<'a> { protocols: Either< Peekable>, @@ -399,6 +438,7 @@ impl<'a> Iterator for ProtocolsRemoved<'a> { /// [`ConnectionEvent`] variant that informs the handler /// that upgrading an outbound substream to the given protocol has failed. +#[derive(Debug)] pub struct DialUpgradeError { pub info: OOI, pub error: StreamUpgradeError, @@ -406,6 +446,7 @@ pub struct DialUpgradeError { /// [`ConnectionEvent`] variant that informs the handler /// that upgrading an inbound substream to the given protocol has failed. +#[derive(Debug)] pub struct ListenUpgradeError { pub info: IOI, pub error: IP::Error, diff --git a/swarm/src/handler/map_in.rs b/swarm/src/handler/map_in.rs index af828999b03..82cb12a183d 100644 --- a/swarm/src/handler/map_in.rs +++ b/swarm/src/handler/map_in.rs @@ -24,6 +24,7 @@ use crate::handler::{ use std::{fmt::Debug, marker::PhantomData, task::Context, task::Poll}; /// Wrapper around a protocol handler that turns the input event into something else. +#[derive(Debug)] pub struct MapInEvent { inner: TConnectionHandler, map: TMap, diff --git a/swarm/src/handler/map_out.rs b/swarm/src/handler/map_out.rs index e92d1403ce6..8528b563ece 100644 --- a/swarm/src/handler/map_out.rs +++ b/swarm/src/handler/map_out.rs @@ -25,6 +25,7 @@ use std::fmt::Debug; use std::task::{Context, Poll}; /// Wrapper around a protocol handler that turns the output event into something else. +#[derive(Debug)] pub struct MapOutEvent { inner: TConnectionHandler, map: TMap, diff --git a/swarm/src/lib.rs b/swarm/src/lib.rs index 867e49410c5..9ebbc12d907 100644 --- a/swarm/src/lib.rs +++ b/swarm/src/lib.rs @@ -1580,9 +1580,9 @@ impl fmt::Display for DialError { f, "Dial error: tried to dial local peer id at {endpoint:?}." ), - DialError::DialPeerConditionFalse(c) => { - write!(f, "Dial error: condition {c:?} for dialing peer was false.") - } + DialError::DialPeerConditionFalse(PeerCondition::Disconnected) => write!(f, "Dial error: dial condition was configured to only happen when disconnected (`PeerCondition::Disconnected`), but node is already connected, thus cancelling new dial."), + DialError::DialPeerConditionFalse(PeerCondition::NotDialing) => write!(f, "Dial error: dial condition was configured to only happen if there is currently no ongoing dialing attempt (`PeerCondition::NotDialing`), but a dial is in progress, thus cancelling new dial."), + DialError::DialPeerConditionFalse(PeerCondition::Always) => unreachable!("Dial peer condition is by definition true."), DialError::Aborted => write!( f, "Dial error: Pending connection attempt has been aborted." diff --git a/transports/dns/Cargo.toml b/transports/dns/Cargo.toml index a85307aad32..77c8e57e3ff 100644 --- a/transports/dns/Cargo.toml +++ b/transports/dns/Cargo.toml @@ -11,13 +11,14 @@ keywords = ["peer-to-peer", "libp2p", "networking"] categories = ["network-programming", "asynchronous"] [dependencies] +async-trait = "0.1.72" libp2p-core = { workspace = true } libp2p-identity = { workspace = true } log = "0.4.20" futures = "0.3.28" -async-std-resolver = { version = "0.22", optional = true } +async-std-resolver = { version = "0.23", optional = true } parking_lot = "0.12.0" -trust-dns-resolver = { version = "0.22", default-features = false, features = ["system-config"] } +trust-dns-resolver = { version = "0.23", default-features = false, features = ["system-config"] } smallvec = "1.11.0" [dev-dependencies] diff --git a/transports/dns/src/lib.rs b/transports/dns/src/lib.rs index 771c7dbc94a..61d1f4fed91 100644 --- a/transports/dns/src/lib.rs +++ b/transports/dns/src/lib.rs @@ -58,7 +58,8 @@ #![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))] #[cfg(feature = "async-std")] -use async_std_resolver::{AsyncStdConnection, AsyncStdConnectionProvider}; +use async_std_resolver::AsyncStdResolver; +use async_trait::async_trait; use futures::{future::BoxFuture, prelude::*}; use libp2p_core::{ connection::Endpoint, @@ -69,10 +70,10 @@ use libp2p_core::{ use parking_lot::Mutex; use smallvec::SmallVec; use std::io; +use std::net::{Ipv4Addr, Ipv6Addr}; use std::{ convert::TryFrom, error, fmt, iter, - net::IpAddr, ops::DerefMut, pin::Pin, str, @@ -81,12 +82,15 @@ use std::{ }; #[cfg(any(feature = "async-std", feature = "tokio"))] use trust_dns_resolver::system_conf; -use trust_dns_resolver::{proto::xfer::dns_handle::DnsHandle, AsyncResolver, ConnectionProvider}; #[cfg(feature = "tokio")] -use trust_dns_resolver::{TokioAsyncResolver, TokioConnection, TokioConnectionProvider}; +use trust_dns_resolver::TokioAsyncResolver; pub use trust_dns_resolver::config::{ResolverConfig, ResolverOpts}; pub use trust_dns_resolver::error::{ResolveError, ResolveErrorKind}; +use trust_dns_resolver::lookup::{Ipv4Lookup, Ipv6Lookup, TxtLookup}; +use trust_dns_resolver::lookup_ip::LookupIp; +use trust_dns_resolver::name_server::ConnectionProvider; +use trust_dns_resolver::AsyncResolver; /// The prefix for `dnsaddr` protocol TXT record lookups. const DNSADDR_PREFIX: &str = "_dnsaddr."; @@ -109,23 +113,20 @@ const MAX_TXT_RECORDS: usize = 16; /// A `Transport` wrapper for performing DNS lookups when dialing `Multiaddr`esses /// using `async-std` for all async I/O. #[cfg(feature = "async-std")] -pub type DnsConfig = GenDnsConfig; +pub type DnsConfig = GenDnsConfig; /// A `Transport` wrapper for performing DNS lookups when dialing `Multiaddr`esses /// using `tokio` for all async I/O. #[cfg(feature = "tokio")] -pub type TokioDnsConfig = GenDnsConfig; +pub type TokioDnsConfig = GenDnsConfig; /// A `Transport` wrapper for performing DNS lookups when dialing `Multiaddr`esses. -pub struct GenDnsConfig -where - C: DnsHandle, - P: ConnectionProvider, -{ +#[derive(Debug)] +pub struct GenDnsConfig { /// The underlying transport. inner: Arc>, /// The DNS resolver used when dialing addresses with DNS components. - resolver: AsyncResolver, + resolver: R, } #[cfg(feature = "async-std")] @@ -145,9 +146,10 @@ where cfg: ResolverConfig, opts: ResolverOpts, ) -> Result, io::Error> { + // TODO: Make infallible in next breaking release. Or deprecation? Ok(DnsConfig { inner: Arc::new(Mutex::new(inner)), - resolver: async_std_resolver::resolver(cfg, opts).await?, + resolver: async_std_resolver::resolver(cfg, opts).await, }) } } @@ -170,31 +172,20 @@ where cfg: ResolverConfig, opts: ResolverOpts, ) -> Result, io::Error> { + // TODO: Make infallible in next breaking release. Or deprecation? Ok(TokioDnsConfig { inner: Arc::new(Mutex::new(inner)), - resolver: TokioAsyncResolver::tokio(cfg, opts)?, + resolver: TokioAsyncResolver::tokio(cfg, opts), }) } } -impl fmt::Debug for GenDnsConfig -where - C: DnsHandle, - P: ConnectionProvider, - T: fmt::Debug, -{ - fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result { - fmt.debug_tuple("GenDnsConfig").field(&self.inner).finish() - } -} - -impl Transport for GenDnsConfig +impl Transport for GenDnsConfig where T: Transport + Send + Unpin + 'static, T::Error: Send, T::Dial: Send, - C: DnsHandle, - P: ConnectionProvider, + R: Clone + Send + Sync + Resolver + 'static, { type Output = T::Output; type Error = DnsErr; @@ -247,13 +238,12 @@ where } } -impl GenDnsConfig +impl GenDnsConfig where T: Transport + Send + Unpin + 'static, T::Error: Send, T::Dial: Send, - C: DnsHandle, - P: ConnectionProvider, + R: Clone + Send + Sync + Resolver + 'static, { fn do_dial( &mut self, @@ -460,14 +450,10 @@ enum Resolved<'a> { /// Asynchronously resolves the domain name of a `Dns`, `Dns4`, `Dns6` or `Dnsaddr` protocol /// component. If the given protocol is of a different type, it is returned unchanged as a /// [`Resolved::One`]. -fn resolve<'a, E: 'a + Send, C, P>( +fn resolve<'a, E: 'a + Send, R: Resolver>( proto: &Protocol<'a>, - resolver: &'a AsyncResolver, -) -> BoxFuture<'a, Result, DnsErr>> -where - C: DnsHandle, - P: ConnectionProvider, -{ + resolver: &'a R, +) -> BoxFuture<'a, Result, DnsErr>> { match proto { Protocol::Dns(ref name) => resolver .lookup_ip(name.clone().into_owned()) @@ -505,12 +491,12 @@ where iter::once(one) .chain(iter::once(two)) .chain(ips) - .map(IpAddr::from) + .map(Ipv4Addr::from) .map(Protocol::from) .collect(), )) } else { - Ok(Resolved::One(Protocol::from(IpAddr::from(one)))) + Ok(Resolved::One(Protocol::from(Ipv4Addr::from(one)))) } } Err(e) => Err(DnsErr::ResolveError(e)), @@ -529,12 +515,12 @@ where iter::once(one) .chain(iter::once(two)) .chain(ips) - .map(IpAddr::from) + .map(Ipv6Addr::from) .map(Protocol::from) .collect(), )) } else { - Ok(Resolved::One(Protocol::from(IpAddr::from(one)))) + Ok(Resolved::One(Protocol::from(Ipv6Addr::from(one)))) } } Err(e) => Err(DnsErr::ResolveError(e)), @@ -583,6 +569,37 @@ fn invalid_data(e: impl Into>) -> io::E io::Error::new(io::ErrorKind::InvalidData, e) } +#[async_trait::async_trait] +#[doc(hidden)] +pub trait Resolver { + async fn lookup_ip(&self, name: String) -> Result; + async fn ipv4_lookup(&self, name: String) -> Result; + async fn ipv6_lookup(&self, name: String) -> Result; + async fn txt_lookup(&self, name: String) -> Result; +} + +#[async_trait] +impl Resolver for AsyncResolver +where + C: ConnectionProvider, +{ + async fn lookup_ip(&self, name: String) -> Result { + self.lookup_ip(name).await + } + + async fn ipv4_lookup(&self, name: String) -> Result { + self.ipv4_lookup(name).await + } + + async fn ipv6_lookup(&self, name: String) -> Result { + self.ipv6_lookup(name).await + } + + async fn txt_lookup(&self, name: String) -> Result { + self.txt_lookup(name).await + } +} + #[cfg(all(test, any(feature = "tokio", feature = "async-std")))] mod tests { use super::*; @@ -647,13 +664,12 @@ mod tests { } } - async fn run(mut transport: GenDnsConfig) + async fn run(mut transport: GenDnsConfig) where - C: DnsHandle, - P: ConnectionProvider, T: Transport + Clone + Send + Unpin + 'static, T::Error: Send, T::Dial: Send, + R: Clone + Send + Sync + Resolver + 'static, { // Success due to existing A record for example.com. let _ = transport diff --git a/transports/noise/Cargo.toml b/transports/noise/Cargo.toml index d957d4fdc59..04aae5fba59 100644 --- a/transports/noise/Cargo.toml +++ b/transports/noise/Cargo.toml @@ -22,7 +22,7 @@ quick-protobuf = "0.8" rand = "0.8.3" sha2 = "0.10.7" static_assertions = "1" -thiserror = "1.0.44" +thiserror = "1.0.48" x25519-dalek = "1.1.0" zeroize = "1" diff --git a/transports/quic/Cargo.toml b/transports/quic/Cargo.toml index 99ac616fa34..b0c445a8efc 100644 --- a/transports/quic/Cargo.toml +++ b/transports/quic/Cargo.toml @@ -10,7 +10,7 @@ license = "MIT" [dependencies] async-std = { version = "1.12.0", optional = true } -bytes = "1.4.0" +bytes = "1.5.0" futures = "0.3.28" futures-timer = "3.0.2" if-watch = "3.0.1" @@ -21,8 +21,8 @@ log = "0.4" parking_lot = "0.12.0" quinn = { version = "0.10.2", default-features = false, features = ["tls-rustls", "futures-io"] } rand = "0.8.5" -rustls = { version = "0.21.6", default-features = false } -thiserror = "1.0.44" +rustls = { version = "0.21.7", default-features = false } +thiserror = "1.0.48" tokio = { version = "1.32.0", default-features = false, features = ["net", "rt", "time"], optional = true } socket2 = "0.5.3" diff --git a/transports/tls/Cargo.toml b/transports/tls/Cargo.toml index cc5c464b500..ba60164cd3e 100644 --- a/transports/tls/Cargo.toml +++ b/transports/tls/Cargo.toml @@ -15,14 +15,14 @@ libp2p-core = { workspace = true } libp2p-identity = { workspace = true } rcgen = "0.10.0" ring = "0.16.20" -thiserror = "1.0.44" +thiserror = "1.0.48" webpki = { version = "0.101.4", package = "rustls-webpki", features = ["std"] } x509-parser = "0.15.1" yasna = "0.5.2" # Exposed dependencies. Breaking changes to these are breaking changes to us. [dependencies.rustls] -version = "0.21.6" +version = "0.21.7" default-features = false features = ["dangerous_configuration"] # Must enable this to allow for custom verification code. diff --git a/transports/websocket/Cargo.toml b/transports/websocket/Cargo.toml index 52d6df160a8..f3ebf5af000 100644 --- a/transports/websocket/Cargo.toml +++ b/transports/websocket/Cargo.toml @@ -21,7 +21,7 @@ parking_lot = "0.12.0" quicksink = "0.1" rw-stream-sink = { workspace = true } soketto = "0.7.0" -url = "2.1" +url = "2.4" webpki-roots = "0.25" [dev-dependencies] diff --git a/transports/webtransport-websys/Cargo.toml b/transports/webtransport-websys/Cargo.toml index 695a62f4cde..7825f64a8ab 100644 --- a/transports/webtransport-websys/Cargo.toml +++ b/transports/webtransport-websys/Cargo.toml @@ -23,7 +23,7 @@ log = "0.4.20" multiaddr = { workspace = true } multihash = { workspace = true } send_wrapper = { version = "0.6.0", features = ["futures"] } -thiserror = "1.0.44" +thiserror = "1.0.48" wasm-bindgen = "0.2.87" wasm-bindgen-futures = "0.4.37" web-sys = { version = "0.3.64", features = [