mirror of
https://github.com/fluencelabs/rust-libp2p
synced 2025-05-20 14:41:21 +00:00
Merge branch 'master' into rand-feature
This commit is contained in:
commit
79b3bdd79f
2
.github/workflows/cache-factory.yml
vendored
2
.github/workflows/cache-factory.yml
vendored
@ -22,7 +22,7 @@ jobs:
|
|||||||
|
|
||||||
- uses: dtolnay/rust-toolchain@stable
|
- uses: dtolnay/rust-toolchain@stable
|
||||||
|
|
||||||
- uses: Swatinem/rust-cache@b8a6852b4f997182bdea832df3f9e153038b5191 # v2.6.0
|
- uses: Swatinem/rust-cache@578b235f6e5f613f7727f1c17bd3305b4d4d4e1f # v2.6.1
|
||||||
with:
|
with:
|
||||||
shared-key: stable-cache
|
shared-key: stable-cache
|
||||||
|
|
||||||
|
20
.github/workflows/ci.yml
vendored
20
.github/workflows/ci.yml
vendored
@ -37,7 +37,7 @@ jobs:
|
|||||||
|
|
||||||
- uses: dtolnay/rust-toolchain@stable
|
- uses: dtolnay/rust-toolchain@stable
|
||||||
|
|
||||||
- uses: Swatinem/rust-cache@b8a6852b4f997182bdea832df3f9e153038b5191 # v2.6.0
|
- uses: Swatinem/rust-cache@578b235f6e5f613f7727f1c17bd3305b4d4d4e1f # v2.6.1
|
||||||
with:
|
with:
|
||||||
shared-key: stable-cache
|
shared-key: stable-cache
|
||||||
save-if: false
|
save-if: false
|
||||||
@ -136,7 +136,7 @@ jobs:
|
|||||||
|
|
||||||
- uses: r7kamura/rust-problem-matchers@2c2f1016021a7455a6b5b4bbae31145f3b3cd83a #v1.4.0
|
- uses: r7kamura/rust-problem-matchers@2c2f1016021a7455a6b5b4bbae31145f3b3cd83a #v1.4.0
|
||||||
|
|
||||||
- uses: Swatinem/rust-cache@b8a6852b4f997182bdea832df3f9e153038b5191 # v2.6.0
|
- uses: Swatinem/rust-cache@578b235f6e5f613f7727f1c17bd3305b4d4d4e1f # v2.6.1
|
||||||
with:
|
with:
|
||||||
key: ${{ matrix.target }}
|
key: ${{ matrix.target }}
|
||||||
save-if: ${{ github.ref == 'refs/heads/master' }}
|
save-if: ${{ github.ref == 'refs/heads/master' }}
|
||||||
@ -161,7 +161,7 @@ jobs:
|
|||||||
|
|
||||||
- uses: r7kamura/rust-problem-matchers@2c2f1016021a7455a6b5b4bbae31145f3b3cd83a #v1.4.0
|
- uses: r7kamura/rust-problem-matchers@2c2f1016021a7455a6b5b4bbae31145f3b3cd83a #v1.4.0
|
||||||
|
|
||||||
- uses: Swatinem/rust-cache@b8a6852b4f997182bdea832df3f9e153038b5191 # v2.6.0
|
- uses: Swatinem/rust-cache@578b235f6e5f613f7727f1c17bd3305b4d4d4e1f # v2.6.1
|
||||||
with:
|
with:
|
||||||
save-if: ${{ github.ref == 'refs/heads/master' }}
|
save-if: ${{ github.ref == 'refs/heads/master' }}
|
||||||
|
|
||||||
@ -182,7 +182,7 @@ jobs:
|
|||||||
|
|
||||||
- uses: r7kamura/rust-problem-matchers@2c2f1016021a7455a6b5b4bbae31145f3b3cd83a #v1.4.0
|
- uses: r7kamura/rust-problem-matchers@2c2f1016021a7455a6b5b4bbae31145f3b3cd83a #v1.4.0
|
||||||
|
|
||||||
- uses: Swatinem/rust-cache@b8a6852b4f997182bdea832df3f9e153038b5191 # v2.6.0
|
- uses: Swatinem/rust-cache@578b235f6e5f613f7727f1c17bd3305b4d4d4e1f # v2.6.1
|
||||||
with:
|
with:
|
||||||
key: ${{ matrix.features }}
|
key: ${{ matrix.features }}
|
||||||
save-if: ${{ github.ref == 'refs/heads/master' }}
|
save-if: ${{ github.ref == 'refs/heads/master' }}
|
||||||
@ -199,7 +199,7 @@ jobs:
|
|||||||
|
|
||||||
- uses: r7kamura/rust-problem-matchers@2c2f1016021a7455a6b5b4bbae31145f3b3cd83a #v1.4.0
|
- uses: r7kamura/rust-problem-matchers@2c2f1016021a7455a6b5b4bbae31145f3b3cd83a #v1.4.0
|
||||||
|
|
||||||
- uses: Swatinem/rust-cache@b8a6852b4f997182bdea832df3f9e153038b5191 # v2.6.0
|
- uses: Swatinem/rust-cache@578b235f6e5f613f7727f1c17bd3305b4d4d4e1f # v2.6.1
|
||||||
with:
|
with:
|
||||||
save-if: ${{ github.ref == 'refs/heads/master' }}
|
save-if: ${{ github.ref == 'refs/heads/master' }}
|
||||||
|
|
||||||
@ -225,7 +225,7 @@ jobs:
|
|||||||
|
|
||||||
- uses: r7kamura/rust-problem-matchers@2c2f1016021a7455a6b5b4bbae31145f3b3cd83a #v1.4.0
|
- uses: r7kamura/rust-problem-matchers@2c2f1016021a7455a6b5b4bbae31145f3b3cd83a #v1.4.0
|
||||||
|
|
||||||
- uses: Swatinem/rust-cache@b8a6852b4f997182bdea832df3f9e153038b5191 # v2.6.0
|
- uses: Swatinem/rust-cache@578b235f6e5f613f7727f1c17bd3305b4d4d4e1f # v2.6.1
|
||||||
with:
|
with:
|
||||||
save-if: ${{ github.ref == 'refs/heads/master' }}
|
save-if: ${{ github.ref == 'refs/heads/master' }}
|
||||||
|
|
||||||
@ -242,7 +242,7 @@ jobs:
|
|||||||
|
|
||||||
- uses: r7kamura/rust-problem-matchers@2c2f1016021a7455a6b5b4bbae31145f3b3cd83a #v1.4.0
|
- uses: r7kamura/rust-problem-matchers@2c2f1016021a7455a6b5b4bbae31145f3b3cd83a #v1.4.0
|
||||||
|
|
||||||
- uses: Swatinem/rust-cache@b8a6852b4f997182bdea832df3f9e153038b5191 # v2.6.0
|
- uses: Swatinem/rust-cache@578b235f6e5f613f7727f1c17bd3305b4d4d4e1f # v2.6.1
|
||||||
with:
|
with:
|
||||||
save-if: ${{ github.ref == 'refs/heads/master' }}
|
save-if: ${{ github.ref == 'refs/heads/master' }}
|
||||||
|
|
||||||
@ -258,7 +258,7 @@ jobs:
|
|||||||
|
|
||||||
- uses: r7kamura/rust-problem-matchers@2c2f1016021a7455a6b5b4bbae31145f3b3cd83a #v1.4.0
|
- uses: r7kamura/rust-problem-matchers@2c2f1016021a7455a6b5b4bbae31145f3b3cd83a #v1.4.0
|
||||||
|
|
||||||
- uses: Swatinem/rust-cache@b8a6852b4f997182bdea832df3f9e153038b5191 # v2.6.0
|
- uses: Swatinem/rust-cache@578b235f6e5f613f7727f1c17bd3305b4d4d4e1f # v2.6.1
|
||||||
with:
|
with:
|
||||||
shared-key: stable-cache
|
shared-key: stable-cache
|
||||||
save-if: false
|
save-if: false
|
||||||
@ -326,7 +326,7 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
- uses: Swatinem/rust-cache@b8a6852b4f997182bdea832df3f9e153038b5191 # v2.6.0
|
- uses: Swatinem/rust-cache@578b235f6e5f613f7727f1c17bd3305b4d4d4e1f # v2.6.1
|
||||||
|
|
||||||
- run: cargo install --version 0.10.0 pb-rs --locked
|
- run: cargo install --version 0.10.0 pb-rs --locked
|
||||||
|
|
||||||
@ -352,5 +352,5 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
- uses: Swatinem/rust-cache@b8a6852b4f997182bdea832df3f9e153038b5191 # v2.6.0
|
- uses: Swatinem/rust-cache@578b235f6e5f613f7727f1c17bd3305b4d4d4e1f # v2.6.1
|
||||||
- run: cargo metadata --locked --format-version=1 > /dev/null
|
- run: cargo metadata --locked --format-version=1 > /dev/null
|
||||||
|
185
Cargo.lock
generated
185
Cargo.lock
generated
@ -455,7 +455,7 @@ dependencies = [
|
|||||||
"log",
|
"log",
|
||||||
"memchr",
|
"memchr",
|
||||||
"once_cell",
|
"once_cell",
|
||||||
"pin-project-lite 0.2.10",
|
"pin-project-lite 0.2.12",
|
||||||
"pin-utils",
|
"pin-utils",
|
||||||
"slab",
|
"slab",
|
||||||
"wasm-bindgen-futures",
|
"wasm-bindgen-futures",
|
||||||
@ -484,9 +484,9 @@ checksum = "ecc7ab41815b3c653ccd2978ec3255c81349336702dfdf62ee6f7069b12a3aae"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "async-trait"
|
name = "async-trait"
|
||||||
version = "0.1.72"
|
version = "0.1.73"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "cc6dde6e4ed435a4c1ee4e73592f5ba9da2151af10076cc04858746af9352d09"
|
checksum = "bc00ceb34980c03614e35a3a4e218276a0a824e911d07651cd0d858a51e8c0f0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote",
|
"quote",
|
||||||
@ -503,7 +503,7 @@ dependencies = [
|
|||||||
"futures-sink",
|
"futures-sink",
|
||||||
"futures-util",
|
"futures-util",
|
||||||
"memchr",
|
"memchr",
|
||||||
"pin-project-lite 0.2.10",
|
"pin-project-lite 0.2.12",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@ -548,7 +548,7 @@ dependencies = [
|
|||||||
"memchr",
|
"memchr",
|
||||||
"mime",
|
"mime",
|
||||||
"percent-encoding",
|
"percent-encoding",
|
||||||
"pin-project-lite 0.2.10",
|
"pin-project-lite 0.2.12",
|
||||||
"rustversion",
|
"rustversion",
|
||||||
"serde",
|
"serde",
|
||||||
"serde_json",
|
"serde_json",
|
||||||
@ -831,7 +831,6 @@ dependencies = [
|
|||||||
"env_logger 0.10.0",
|
"env_logger 0.10.0",
|
||||||
"futures",
|
"futures",
|
||||||
"libp2p",
|
"libp2p",
|
||||||
"libp2p-quic",
|
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@ -891,9 +890,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "clap"
|
name = "clap"
|
||||||
version = "4.3.19"
|
version = "4.3.21"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "5fd304a20bff958a57f04c4e96a2e7594cc4490a0e809cbd48bb6437edaa452d"
|
checksum = "c27cdf28c0f604ba3f512b0c9a409f8de8513e4816705deb0498b627e7c3a3fd"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"clap_builder",
|
"clap_builder",
|
||||||
"clap_derive",
|
"clap_derive",
|
||||||
@ -902,9 +901,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "clap_builder"
|
name = "clap_builder"
|
||||||
version = "4.3.19"
|
version = "4.3.21"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "01c6a3f08f1fe5662a35cfe393aec09c4df95f60ee93b7556505260f75eee9e1"
|
checksum = "08a9f1ab5e9f01a9b81f202e8562eb9a10de70abf9eaeac1be465c28b75aa4aa"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anstream",
|
"anstream",
|
||||||
"anstyle",
|
"anstyle",
|
||||||
@ -945,7 +944,7 @@ dependencies = [
|
|||||||
"bytes",
|
"bytes",
|
||||||
"futures-core",
|
"futures-core",
|
||||||
"memchr",
|
"memchr",
|
||||||
"pin-project-lite 0.2.10",
|
"pin-project-lite 0.2.12",
|
||||||
"tokio",
|
"tokio",
|
||||||
"tokio-util",
|
"tokio-util",
|
||||||
]
|
]
|
||||||
@ -1227,18 +1226,32 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "curve25519-dalek"
|
name = "curve25519-dalek"
|
||||||
version = "4.0.0-rc.1"
|
version = "4.0.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "8d4ba9852b42210c7538b75484f9daa0655e9a3ac04f693747bb0f02cf3cfe16"
|
checksum = "f711ade317dd348950a9910f81c5947e3d8907ebd2b83f76203ff1807e6a2bc2"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"cfg-if 1.0.0",
|
"cfg-if 1.0.0",
|
||||||
|
"cpufeatures",
|
||||||
|
"curve25519-dalek-derive",
|
||||||
|
"digest 0.10.7",
|
||||||
"fiat-crypto",
|
"fiat-crypto",
|
||||||
"packed_simd_2",
|
|
||||||
"platforms",
|
"platforms",
|
||||||
|
"rustc_version",
|
||||||
"subtle",
|
"subtle",
|
||||||
"zeroize",
|
"zeroize",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "curve25519-dalek-derive"
|
||||||
|
version = "0.1.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "83fdaf97f4804dcebfa5862639bc9ce4121e82140bec2a987ac5140294865b5b"
|
||||||
|
dependencies = [
|
||||||
|
"proc-macro2",
|
||||||
|
"quote",
|
||||||
|
"syn 2.0.28",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "darling"
|
name = "darling"
|
||||||
version = "0.14.4"
|
version = "0.14.4"
|
||||||
@ -1309,7 +1322,6 @@ dependencies = [
|
|||||||
"futures",
|
"futures",
|
||||||
"futures-timer",
|
"futures-timer",
|
||||||
"libp2p",
|
"libp2p",
|
||||||
"libp2p-quic",
|
|
||||||
"log",
|
"log",
|
||||||
]
|
]
|
||||||
|
|
||||||
@ -1471,24 +1483,25 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "ed25519"
|
name = "ed25519"
|
||||||
version = "1.5.3"
|
version = "2.2.2"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "91cff35c70bba8a626e3185d8cd48cc11b5437e1a5bcd15b9b5fa3c64b6dfee7"
|
checksum = "60f6d271ca33075c88028be6f04d502853d63a5ece419d269c15315d4fc1cf1d"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"signature 1.6.4",
|
"pkcs8 0.10.2",
|
||||||
|
"signature 2.1.0",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "ed25519-dalek"
|
name = "ed25519-dalek"
|
||||||
version = "1.0.1"
|
version = "2.0.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "c762bae6dcaf24c4c84667b8579785430908723d5c889f469d76a41d59cc7a9d"
|
checksum = "7277392b266383ef8396db7fdeb1e77b6c52fed775f5df15bb24f35b72156980"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"curve25519-dalek 3.2.0",
|
"curve25519-dalek 4.0.0",
|
||||||
"ed25519",
|
"ed25519",
|
||||||
"rand 0.7.3",
|
"rand_core 0.6.4",
|
||||||
"serde",
|
"serde",
|
||||||
"sha2 0.9.9",
|
"sha2 0.10.7",
|
||||||
"zeroize",
|
"zeroize",
|
||||||
]
|
]
|
||||||
|
|
||||||
@ -1794,7 +1807,7 @@ dependencies = [
|
|||||||
"futures-io",
|
"futures-io",
|
||||||
"memchr",
|
"memchr",
|
||||||
"parking",
|
"parking",
|
||||||
"pin-project-lite 0.2.10",
|
"pin-project-lite 0.2.12",
|
||||||
"waker-fn",
|
"waker-fn",
|
||||||
]
|
]
|
||||||
|
|
||||||
@ -1827,7 +1840,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||||||
checksum = "35bd3cf68c183738046838e300353e4716c674dc5e56890de4826801a6622a28"
|
checksum = "35bd3cf68c183738046838e300353e4716c674dc5e56890de4826801a6622a28"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"futures-io",
|
"futures-io",
|
||||||
"rustls 0.21.5",
|
"rustls 0.21.6",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@ -1876,7 +1889,7 @@ dependencies = [
|
|||||||
"futures-sink",
|
"futures-sink",
|
||||||
"futures-task",
|
"futures-task",
|
||||||
"memchr",
|
"memchr",
|
||||||
"pin-project-lite 0.2.10",
|
"pin-project-lite 0.2.12",
|
||||||
"pin-utils",
|
"pin-utils",
|
||||||
"slab",
|
"slab",
|
||||||
]
|
]
|
||||||
@ -2134,7 +2147,7 @@ checksum = "d5f38f16d184e36f2408a55281cd658ecbd3ca05cce6d6510a176eca393e26d1"
|
|||||||
dependencies = [
|
dependencies = [
|
||||||
"bytes",
|
"bytes",
|
||||||
"http",
|
"http",
|
||||||
"pin-project-lite 0.2.10",
|
"pin-project-lite 0.2.12",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@ -2177,7 +2190,7 @@ dependencies = [
|
|||||||
"httparse",
|
"httparse",
|
||||||
"httpdate",
|
"httpdate",
|
||||||
"itoa",
|
"itoa",
|
||||||
"pin-project-lite 0.2.10",
|
"pin-project-lite 0.2.12",
|
||||||
"socket2 0.4.9",
|
"socket2 0.4.9",
|
||||||
"tokio",
|
"tokio",
|
||||||
"tower-service",
|
"tower-service",
|
||||||
@ -2354,7 +2367,6 @@ dependencies = [
|
|||||||
"instant",
|
"instant",
|
||||||
"libp2p",
|
"libp2p",
|
||||||
"libp2p-mplex",
|
"libp2p-mplex",
|
||||||
"libp2p-quic",
|
|
||||||
"libp2p-webrtc",
|
"libp2p-webrtc",
|
||||||
"log",
|
"log",
|
||||||
"mime_guess",
|
"mime_guess",
|
||||||
@ -2504,15 +2516,9 @@ version = "0.2.147"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "b4668fb0ea861c1df094127ac5f1da3409a82116a4ba74fca2e58ef927159bb3"
|
checksum = "b4668fb0ea861c1df094127ac5f1da3409a82116a4ba74fca2e58ef927159bb3"
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "libm"
|
|
||||||
version = "0.1.4"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "7fc7aa29613bd6a620df431842069224d8bc9011086b1db4c0e0cd47fa03ec9a"
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "libp2p"
|
name = "libp2p"
|
||||||
version = "0.52.2"
|
version = "0.52.3"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"async-std",
|
"async-std",
|
||||||
"async-trait",
|
"async-trait",
|
||||||
@ -2543,6 +2549,7 @@ dependencies = [
|
|||||||
"libp2p-ping",
|
"libp2p-ping",
|
||||||
"libp2p-plaintext",
|
"libp2p-plaintext",
|
||||||
"libp2p-pnet",
|
"libp2p-pnet",
|
||||||
|
"libp2p-quic",
|
||||||
"libp2p-relay",
|
"libp2p-relay",
|
||||||
"libp2p-rendezvous",
|
"libp2p-rendezvous",
|
||||||
"libp2p-request-response",
|
"libp2p-request-response",
|
||||||
@ -2785,7 +2792,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "libp2p-identity"
|
name = "libp2p-identity"
|
||||||
version = "0.2.2"
|
version = "0.2.3"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"asn1_der",
|
"asn1_der",
|
||||||
"base64 0.21.2",
|
"base64 0.21.2",
|
||||||
@ -3058,7 +3065,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "libp2p-quic"
|
name = "libp2p-quic"
|
||||||
version = "0.9.1-alpha"
|
version = "0.9.2"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"async-std",
|
"async-std",
|
||||||
"bytes",
|
"bytes",
|
||||||
@ -3078,7 +3085,7 @@ dependencies = [
|
|||||||
"quickcheck",
|
"quickcheck",
|
||||||
"quinn",
|
"quinn",
|
||||||
"rand 0.8.5",
|
"rand 0.8.5",
|
||||||
"rustls 0.21.5",
|
"rustls 0.21.6",
|
||||||
"socket2 0.5.3",
|
"socket2 0.5.3",
|
||||||
"thiserror",
|
"thiserror",
|
||||||
"tokio",
|
"tokio",
|
||||||
@ -3260,7 +3267,7 @@ dependencies = [
|
|||||||
"libp2p-yamux",
|
"libp2p-yamux",
|
||||||
"rcgen 0.10.0",
|
"rcgen 0.10.0",
|
||||||
"ring",
|
"ring",
|
||||||
"rustls 0.21.5",
|
"rustls 0.21.6",
|
||||||
"thiserror",
|
"thiserror",
|
||||||
"tokio",
|
"tokio",
|
||||||
"webpki 0.22.0",
|
"webpki 0.22.0",
|
||||||
@ -3345,11 +3352,11 @@ dependencies = [
|
|||||||
"log",
|
"log",
|
||||||
"parking_lot",
|
"parking_lot",
|
||||||
"quicksink",
|
"quicksink",
|
||||||
"rcgen 0.9.3",
|
"rcgen 0.10.0",
|
||||||
"rw-stream-sink",
|
"rw-stream-sink",
|
||||||
"soketto",
|
"soketto",
|
||||||
"url",
|
"url",
|
||||||
"webpki-roots 0.25.1",
|
"webpki-roots 0.25.2",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@ -3463,9 +3470,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "log"
|
name = "log"
|
||||||
version = "0.4.19"
|
version = "0.4.20"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "b06a4cde4c0f271a446782e3eff8de789548ce57dbc8eca9292c27f4a42004b4"
|
checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"value-bag",
|
"value-bag",
|
||||||
]
|
]
|
||||||
@ -3976,16 +3983,6 @@ dependencies = [
|
|||||||
"sha2 0.10.7",
|
"sha2 0.10.7",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "packed_simd_2"
|
|
||||||
version = "0.3.8"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "a1914cd452d8fccd6f9db48147b29fd4ae05bea9dc5d9ad578509f72415de282"
|
|
||||||
dependencies = [
|
|
||||||
"cfg-if 1.0.0",
|
|
||||||
"libm",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "parking"
|
name = "parking"
|
||||||
version = "2.1.0"
|
version = "2.1.0"
|
||||||
@ -4056,18 +4053,18 @@ checksum = "9b2a4787296e9989611394c33f193f676704af1686e70b8f8033ab5ba9a35a94"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "pin-project"
|
name = "pin-project"
|
||||||
version = "1.1.2"
|
version = "1.1.3"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "030ad2bc4db10a8944cb0d837f158bdfec4d4a4873ab701a95046770d11f8842"
|
checksum = "fda4ed1c6c173e3fc7a83629421152e01d7b1f9b7f65fb301e490e8cfc656422"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"pin-project-internal",
|
"pin-project-internal",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "pin-project-internal"
|
name = "pin-project-internal"
|
||||||
version = "1.1.2"
|
version = "1.1.3"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "ec2e072ecce94ec471b13398d5402c188e76ac03cf74dd1a975161b23a3f6d9c"
|
checksum = "4359fd9c9171ec6e8c62926d6faaf553a8dc3f64e1507e76da7911b4f6a04405"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote",
|
"quote",
|
||||||
@ -4082,9 +4079,9 @@ checksum = "257b64915a082f7811703966789728173279bdebb956b143dbcd23f6f970a777"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "pin-project-lite"
|
name = "pin-project-lite"
|
||||||
version = "0.2.10"
|
version = "0.2.12"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "4c40d25201921e5ff0c862a505c6557ea88568a4e3ace775ab55e93f2f4f9d57"
|
checksum = "12cc1b0bf1727a77a54b6654e7b5f1af8604923edc8b81885f8ec92f9e3f0a05"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "pin-utils"
|
name = "pin-utils"
|
||||||
@ -4174,7 +4171,7 @@ dependencies = [
|
|||||||
"concurrent-queue",
|
"concurrent-queue",
|
||||||
"libc",
|
"libc",
|
||||||
"log",
|
"log",
|
||||||
"pin-project-lite 0.2.10",
|
"pin-project-lite 0.2.12",
|
||||||
"windows-sys",
|
"windows-sys",
|
||||||
]
|
]
|
||||||
|
|
||||||
@ -4353,19 +4350,19 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "quinn"
|
name = "quinn"
|
||||||
version = "0.10.1"
|
version = "0.10.2"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "21252f1c0fc131f1b69182db8f34837e8a69737b8251dff75636a9be0518c324"
|
checksum = "8cc2c5017e4b43d5995dcea317bc46c1e09404c0a9664d2908f7f02dfe943d75"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"async-io",
|
"async-io",
|
||||||
"async-std",
|
"async-std",
|
||||||
"bytes",
|
"bytes",
|
||||||
"futures-io",
|
"futures-io",
|
||||||
"pin-project-lite 0.2.10",
|
"pin-project-lite 0.2.12",
|
||||||
"quinn-proto",
|
"quinn-proto",
|
||||||
"quinn-udp",
|
"quinn-udp",
|
||||||
"rustc-hash",
|
"rustc-hash",
|
||||||
"rustls 0.21.5",
|
"rustls 0.21.6",
|
||||||
"thiserror",
|
"thiserror",
|
||||||
"tokio",
|
"tokio",
|
||||||
"tracing",
|
"tracing",
|
||||||
@ -4373,15 +4370,15 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "quinn-proto"
|
name = "quinn-proto"
|
||||||
version = "0.10.1"
|
version = "0.10.2"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "85af4ed6ee5a89f26a26086e9089a6643650544c025158449a3626ebf72884b3"
|
checksum = "f8c8bb234e70c863204303507d841e7fa2295e95c822b2bb4ca8ebf57f17b1cb"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bytes",
|
"bytes",
|
||||||
"rand 0.8.5",
|
"rand 0.8.5",
|
||||||
"ring",
|
"ring",
|
||||||
"rustc-hash",
|
"rustc-hash",
|
||||||
"rustls 0.21.5",
|
"rustls 0.21.6",
|
||||||
"slab",
|
"slab",
|
||||||
"thiserror",
|
"thiserror",
|
||||||
"tinyvec",
|
"tinyvec",
|
||||||
@ -4530,9 +4527,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "redis"
|
name = "redis"
|
||||||
version = "0.23.1"
|
version = "0.23.2"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "ff5d95dd18a4d76650f0c2607ed8ebdbf63baf9cb934e1c233cd220c694db1d7"
|
checksum = "ffd6543a7bc6428396845f6854ccf3d1ae8823816592e2cbe74f20f50f209d02"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"async-trait",
|
"async-trait",
|
||||||
"bytes",
|
"bytes",
|
||||||
@ -4540,7 +4537,7 @@ dependencies = [
|
|||||||
"futures-util",
|
"futures-util",
|
||||||
"itoa",
|
"itoa",
|
||||||
"percent-encoding",
|
"percent-encoding",
|
||||||
"pin-project-lite 0.2.10",
|
"pin-project-lite 0.2.12",
|
||||||
"ryu",
|
"ryu",
|
||||||
"tokio",
|
"tokio",
|
||||||
"tokio-util",
|
"tokio-util",
|
||||||
@ -4610,7 +4607,6 @@ dependencies = [
|
|||||||
"env_logger 0.10.0",
|
"env_logger 0.10.0",
|
||||||
"futures",
|
"futures",
|
||||||
"libp2p",
|
"libp2p",
|
||||||
"libp2p-quic",
|
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@ -4649,7 +4645,7 @@ dependencies = [
|
|||||||
"native-tls",
|
"native-tls",
|
||||||
"once_cell",
|
"once_cell",
|
||||||
"percent-encoding",
|
"percent-encoding",
|
||||||
"pin-project-lite 0.2.10",
|
"pin-project-lite 0.2.12",
|
||||||
"serde",
|
"serde",
|
||||||
"serde_json",
|
"serde_json",
|
||||||
"serde_urlencoded",
|
"serde_urlencoded",
|
||||||
@ -4898,9 +4894,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "rustls"
|
name = "rustls"
|
||||||
version = "0.21.5"
|
version = "0.21.6"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "79ea77c539259495ce8ca47f53e66ae0330a8819f67e23ac96ca02f50e7b7d36"
|
checksum = "1d1feddffcfcc0b33f5c6ce9a29e341e4cd59c3f78e7ee45f4a40c038b1d6cbb"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"log",
|
"log",
|
||||||
"ring",
|
"ring",
|
||||||
@ -5318,14 +5314,14 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "snow"
|
name = "snow"
|
||||||
version = "0.9.2"
|
version = "0.9.3"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "5ccba027ba85743e09d15c03296797cad56395089b832b48b5a5217880f57733"
|
checksum = "0c9d1425eb528a21de2755c75af4c9b5d57f50a0d4c3b7f1828a4cd03f8ba155"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"aes-gcm 0.9.2",
|
"aes-gcm 0.9.2",
|
||||||
"blake2",
|
"blake2",
|
||||||
"chacha20poly1305",
|
"chacha20poly1305",
|
||||||
"curve25519-dalek 4.0.0-rc.1",
|
"curve25519-dalek 4.0.0",
|
||||||
"rand_core 0.6.4",
|
"rand_core 0.6.4",
|
||||||
"ring",
|
"ring",
|
||||||
"rustc_version",
|
"rustc_version",
|
||||||
@ -5491,9 +5487,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "sysinfo"
|
name = "sysinfo"
|
||||||
version = "0.29.7"
|
version = "0.29.8"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "165d6d8539689e3d3bc8b98ac59541e1f21c7de7c85d60dc80e43ae0ed2113db"
|
checksum = "d10ed79c22663a35a255d289a7fdcb43559fc77ff15df5ce6c341809e7867528"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"cfg-if 1.0.0",
|
"cfg-if 1.0.0",
|
||||||
"core-foundation-sys",
|
"core-foundation-sys",
|
||||||
@ -5527,9 +5523,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "tempfile"
|
name = "tempfile"
|
||||||
version = "3.7.0"
|
version = "3.7.1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "5486094ee78b2e5038a6382ed7645bc084dc2ec433426ca4c3cb61e2007b8998"
|
checksum = "dc02fddf48964c42031a0b3fe0428320ecf3a73c401040fc0096f97794310651"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"cfg-if 1.0.0",
|
"cfg-if 1.0.0",
|
||||||
"fastrand 2.0.0",
|
"fastrand 2.0.0",
|
||||||
@ -5669,20 +5665,19 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "tokio"
|
name = "tokio"
|
||||||
version = "1.29.1"
|
version = "1.31.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "532826ff75199d5833b9d2c5fe410f29235e25704ee5f0ef599fb51c21f4a4da"
|
checksum = "40de3a2ba249dcb097e01be5e67a5ff53cf250397715a071a81543e8a832a920"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"autocfg",
|
|
||||||
"backtrace",
|
"backtrace",
|
||||||
"bytes",
|
"bytes",
|
||||||
"libc",
|
"libc",
|
||||||
"mio",
|
"mio",
|
||||||
"num_cpus",
|
"num_cpus",
|
||||||
"parking_lot",
|
"parking_lot",
|
||||||
"pin-project-lite 0.2.10",
|
"pin-project-lite 0.2.12",
|
||||||
"signal-hook-registry",
|
"signal-hook-registry",
|
||||||
"socket2 0.4.9",
|
"socket2 0.5.3",
|
||||||
"tokio-macros",
|
"tokio-macros",
|
||||||
"windows-sys",
|
"windows-sys",
|
||||||
]
|
]
|
||||||
@ -5729,7 +5724,7 @@ dependencies = [
|
|||||||
"futures-core",
|
"futures-core",
|
||||||
"futures-io",
|
"futures-io",
|
||||||
"futures-sink",
|
"futures-sink",
|
||||||
"pin-project-lite 0.2.10",
|
"pin-project-lite 0.2.12",
|
||||||
"tokio",
|
"tokio",
|
||||||
"tracing",
|
"tracing",
|
||||||
]
|
]
|
||||||
@ -5743,7 +5738,7 @@ dependencies = [
|
|||||||
"futures-core",
|
"futures-core",
|
||||||
"futures-util",
|
"futures-util",
|
||||||
"pin-project",
|
"pin-project",
|
||||||
"pin-project-lite 0.2.10",
|
"pin-project-lite 0.2.12",
|
||||||
"tokio",
|
"tokio",
|
||||||
"tower-layer",
|
"tower-layer",
|
||||||
"tower-service",
|
"tower-service",
|
||||||
@ -5767,7 +5762,7 @@ dependencies = [
|
|||||||
"mime",
|
"mime",
|
||||||
"mime_guess",
|
"mime_guess",
|
||||||
"percent-encoding",
|
"percent-encoding",
|
||||||
"pin-project-lite 0.2.10",
|
"pin-project-lite 0.2.12",
|
||||||
"tokio",
|
"tokio",
|
||||||
"tokio-util",
|
"tokio-util",
|
||||||
"tower-layer",
|
"tower-layer",
|
||||||
@ -5795,7 +5790,7 @@ checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8"
|
|||||||
dependencies = [
|
dependencies = [
|
||||||
"cfg-if 1.0.0",
|
"cfg-if 1.0.0",
|
||||||
"log",
|
"log",
|
||||||
"pin-project-lite 0.2.10",
|
"pin-project-lite 0.2.12",
|
||||||
"tracing-attributes",
|
"tracing-attributes",
|
||||||
"tracing-core",
|
"tracing-core",
|
||||||
]
|
]
|
||||||
@ -5915,9 +5910,9 @@ checksum = "3528ecfd12c466c6f163363caf2d02a71161dd5e1cc6ae7b34207ea2d42d81ed"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "trybuild"
|
name = "trybuild"
|
||||||
version = "1.0.82"
|
version = "1.0.83"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "a84e0202ea606ba5ebee8507ab2bfbe89b98551ed9b8f0be198109275cff284b"
|
checksum = "6df60d81823ed9c520ee897489573da4b1d79ffbe006b8134f46de1a1aa03555"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"basic-toml",
|
"basic-toml",
|
||||||
"glob",
|
"glob",
|
||||||
@ -6306,9 +6301,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "webpki-roots"
|
name = "webpki-roots"
|
||||||
version = "0.25.1"
|
version = "0.25.2"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "c9c6eda1c830a36f361e7721c87fd79ea84293b54f8c48c959f85ec636f0f196"
|
checksum = "14247bb57be4f377dfb94c72830b8ce8fc6beac03cf4bf7b9732eadd414123fc"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "webrtc"
|
name = "webrtc"
|
||||||
|
@ -73,7 +73,7 @@ libp2p-dns = { version = "0.40.0", path = "transports/dns" }
|
|||||||
libp2p-floodsub = { version = "0.43.0", path = "protocols/floodsub" }
|
libp2p-floodsub = { version = "0.43.0", path = "protocols/floodsub" }
|
||||||
libp2p-gossipsub = { version = "0.45.1", path = "protocols/gossipsub" }
|
libp2p-gossipsub = { version = "0.45.1", path = "protocols/gossipsub" }
|
||||||
libp2p-identify = { version = "0.43.0", path = "protocols/identify" }
|
libp2p-identify = { version = "0.43.0", path = "protocols/identify" }
|
||||||
libp2p-identity = { version = "0.2.2" }
|
libp2p-identity = { version = "0.2.3" }
|
||||||
libp2p-kad = { version = "0.44.4", path = "protocols/kad" }
|
libp2p-kad = { version = "0.44.4", path = "protocols/kad" }
|
||||||
libp2p-mdns = { version = "0.44.0", path = "protocols/mdns" }
|
libp2p-mdns = { version = "0.44.0", path = "protocols/mdns" }
|
||||||
libp2p-memory-connection-limits = { version = "0.1.0", path = "misc/memory-connection-limits" }
|
libp2p-memory-connection-limits = { version = "0.1.0", path = "misc/memory-connection-limits" }
|
||||||
@ -85,7 +85,7 @@ libp2p-perf = { version = "0.2.0", path = "protocols/perf" }
|
|||||||
libp2p-ping = { version = "0.43.0", path = "protocols/ping" }
|
libp2p-ping = { version = "0.43.0", path = "protocols/ping" }
|
||||||
libp2p-plaintext = { version = "0.40.0", path = "transports/plaintext" }
|
libp2p-plaintext = { version = "0.40.0", path = "transports/plaintext" }
|
||||||
libp2p-pnet = { version = "0.23.0", path = "transports/pnet" }
|
libp2p-pnet = { version = "0.23.0", path = "transports/pnet" }
|
||||||
libp2p-quic = { version = "0.9.1-alpha", path = "transports/quic" }
|
libp2p-quic = { version = "0.9.2", path = "transports/quic" }
|
||||||
libp2p-relay = { version = "0.16.1", path = "protocols/relay" }
|
libp2p-relay = { version = "0.16.1", path = "protocols/relay" }
|
||||||
libp2p-rendezvous = { version = "0.13.0", path = "protocols/rendezvous" }
|
libp2p-rendezvous = { version = "0.13.0", path = "protocols/rendezvous" }
|
||||||
libp2p-request-response = { version = "0.25.1", path = "protocols/request-response" }
|
libp2p-request-response = { version = "0.25.1", path = "protocols/request-response" }
|
||||||
|
@ -103,4 +103,4 @@ used and maintained by [Actyx](https://www.actyx.com).
|
|||||||
- [Subspace](https://github.com/subspace/subspace) - Subspace Network reference implementation
|
- [Subspace](https://github.com/subspace/subspace) - Subspace Network reference implementation
|
||||||
- [Substrate](https://github.com/paritytech/substrate) - Framework for blockchain innovation,
|
- [Substrate](https://github.com/paritytech/substrate) - Framework for blockchain innovation,
|
||||||
used by [Polkadot](https://www.parity.io/technologies/polkadot/).
|
used by [Polkadot](https://www.parity.io/technologies/polkadot/).
|
||||||
- [Ursa](https://github.com/fleek-network/ursa) - Decentralized Content Delivery & Edge Compute.
|
- [Taple](https://github.com/opencanarias/taple-core) - Sustainable DLT for asset and process traceability by [OpenCanarias](https://www.opencanarias.com/en/).
|
@ -67,7 +67,7 @@ Though (a) I think we should prioritize improving existing functionality over ne
|
|||||||
|
|
||||||
| Category | Status | Target Completion | Tracking | Dependencies | Dependents |
|
| Category | Status | Target Completion | Tracking | Dependencies | Dependents |
|
||||||
|--------------|--------|-------------------|--------------------------------------------|-------------------------------------------------------------------------------------------|------------|
|
|--------------|--------|-------------------|--------------------------------------------|-------------------------------------------------------------------------------------------|------------|
|
||||||
| Connectivity | todo | | https://github.com/libp2p/specs/issues/475 | [Improved WASM support](#improved-wasm-support), https://github.com/libp2p/specs/pull/497 | |
|
| Connectivity | In progress | | https://github.com/libp2p/specs/issues/475 | [Improved WASM support](#improved-wasm-support), https://github.com/libp2p/specs/pull/497 | https://github.com/libp2p/rust-libp2p/pull/4248 |
|
||||||
|
|
||||||
Use the browser's WebRTC stack to support [`/webrtc`](https://github.com/libp2p/specs/blob/master/webrtc/webrtc.md) and [`/webrtc-direct`](https://github.com/libp2p/specs/blob/master/webrtc/webrtc-direct.md) from within the browser using rust-libp2p compiled to WASM.
|
Use the browser's WebRTC stack to support [`/webrtc`](https://github.com/libp2p/specs/blob/master/webrtc/webrtc.md) and [`/webrtc-direct`](https://github.com/libp2p/specs/blob/master/webrtc/webrtc-direct.md) from within the browser using rust-libp2p compiled to WASM.
|
||||||
This makes rust-libp2p a truly end-to-end solution, enabling users to use rust-libp2p on both the client (browser) and server side.
|
This makes rust-libp2p a truly end-to-end solution, enabling users to use rust-libp2p on both the client (browser) and server side.
|
||||||
|
@ -23,7 +23,7 @@ multihash = { workspace = true }
|
|||||||
multistream-select = { workspace = true }
|
multistream-select = { workspace = true }
|
||||||
once_cell = "1.18.0"
|
once_cell = "1.18.0"
|
||||||
parking_lot = "0.12.0"
|
parking_lot = "0.12.0"
|
||||||
pin-project = "1.1.2"
|
pin-project = "1.1.3"
|
||||||
quick-protobuf = "0.8"
|
quick-protobuf = "0.8"
|
||||||
rand = "0.8"
|
rand = "0.8"
|
||||||
rw-stream-sink = { workspace = true }
|
rw-stream-sink = { workspace = true }
|
||||||
|
@ -7,7 +7,7 @@ license = "MIT"
|
|||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
async-std = { version = "1.12", features = ["attributes"] }
|
async-std = { version = "1.12", features = ["attributes"] }
|
||||||
clap = { version = "4.3.12", features = ["derive"] }
|
clap = { version = "4.3.21", features = ["derive"] }
|
||||||
env_logger = "0.10.0"
|
env_logger = "0.10.0"
|
||||||
futures = "0.3.28"
|
futures = "0.3.28"
|
||||||
libp2p = { path = "../../libp2p", features = ["async-std", "tcp", "noise", "yamux", "autonat", "identify", "macros"] }
|
libp2p = { path = "../../libp2p", features = ["async-std", "tcp", "noise", "yamux", "autonat", "identify", "macros"] }
|
||||||
|
@ -10,5 +10,4 @@ async-std = { version = "1.12", features = ["attributes"] }
|
|||||||
async-trait = "0.1"
|
async-trait = "0.1"
|
||||||
env_logger = "0.10.0"
|
env_logger = "0.10.0"
|
||||||
futures = "0.3.28"
|
futures = "0.3.28"
|
||||||
libp2p = { path = "../../libp2p", features = ["async-std", "gossipsub", "mdns", "noise", "macros", "tcp", "yamux"] }
|
libp2p = { path = "../../libp2p", features = ["async-std", "gossipsub", "mdns", "noise", "macros", "tcp", "yamux", "quic"] }
|
||||||
libp2p-quic = { path = "../../transports/quic", features = ["async-std"] }
|
|
||||||
|
@ -24,12 +24,11 @@ use async_std::io;
|
|||||||
use futures::{future::Either, prelude::*, select};
|
use futures::{future::Either, prelude::*, select};
|
||||||
use libp2p::{
|
use libp2p::{
|
||||||
core::{muxing::StreamMuxerBox, transport::OrTransport, upgrade},
|
core::{muxing::StreamMuxerBox, transport::OrTransport, upgrade},
|
||||||
gossipsub, identity, mdns, noise,
|
gossipsub, identity, mdns, noise, quic,
|
||||||
swarm::NetworkBehaviour,
|
swarm::NetworkBehaviour,
|
||||||
swarm::{SwarmBuilder, SwarmEvent},
|
swarm::{SwarmBuilder, SwarmEvent},
|
||||||
tcp, yamux, PeerId, Transport,
|
tcp, yamux, PeerId, Transport,
|
||||||
};
|
};
|
||||||
use libp2p_quic as quic;
|
|
||||||
use std::collections::hash_map::DefaultHasher;
|
use std::collections::hash_map::DefaultHasher;
|
||||||
use std::error::Error;
|
use std::error::Error;
|
||||||
use std::hash::{Hash, Hasher};
|
use std::hash::{Hash, Hasher};
|
||||||
|
@ -6,10 +6,9 @@ publish = false
|
|||||||
license = "MIT"
|
license = "MIT"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
clap = { version = "4.3.12", features = ["derive"] }
|
clap = { version = "4.3.21", features = ["derive"] }
|
||||||
env_logger = "0.10.0"
|
env_logger = "0.10.0"
|
||||||
futures = "0.3.28"
|
futures = "0.3.28"
|
||||||
futures-timer = "3.0"
|
futures-timer = "3.0"
|
||||||
libp2p = { path = "../../libp2p", features = ["async-std", "dns", "dcutr", "identify", "macros", "noise", "ping", "relay", "rendezvous", "tcp", "tokio", "yamux"] }
|
libp2p = { path = "../../libp2p", features = ["async-std", "dns", "dcutr", "identify", "macros", "noise", "ping", "quic", "relay", "rendezvous", "tcp", "tokio", "yamux"] }
|
||||||
libp2p-quic = { path = "../../transports/quic", features = ["async-std"] }
|
|
||||||
log = "0.4"
|
log = "0.4"
|
||||||
|
@ -35,11 +35,10 @@ use libp2p::{
|
|||||||
},
|
},
|
||||||
dcutr,
|
dcutr,
|
||||||
dns::DnsConfig,
|
dns::DnsConfig,
|
||||||
identify, identity, noise, ping, relay,
|
identify, identity, noise, ping, quic, relay,
|
||||||
swarm::{NetworkBehaviour, SwarmBuilder, SwarmEvent},
|
swarm::{NetworkBehaviour, SwarmBuilder, SwarmEvent},
|
||||||
tcp, yamux, PeerId,
|
tcp, yamux, PeerId,
|
||||||
};
|
};
|
||||||
use libp2p_quic as quic;
|
|
||||||
use log::info;
|
use log::info;
|
||||||
use std::error::Error;
|
use std::error::Error;
|
||||||
use std::str::FromStr;
|
use std::str::FromStr;
|
||||||
|
@ -8,7 +8,7 @@ license = "MIT"
|
|||||||
[dependencies]
|
[dependencies]
|
||||||
serde = { version = "1.0", features = ["derive"] }
|
serde = { version = "1.0", features = ["derive"] }
|
||||||
async-std = { version = "1.12", features = ["attributes"] }
|
async-std = { version = "1.12", features = ["attributes"] }
|
||||||
clap = { version = "4.3.12", features = ["derive"] }
|
clap = { version = "4.3.21", features = ["derive"] }
|
||||||
either = "1.9"
|
either = "1.9"
|
||||||
env_logger = "0.10"
|
env_logger = "0.10"
|
||||||
futures = "0.3.28"
|
futures = "0.3.28"
|
||||||
|
@ -10,6 +10,6 @@ env_logger = "0.10.0"
|
|||||||
futures = "0.3.27"
|
futures = "0.3.27"
|
||||||
hyper = { version = "0.14", features = ["server", "tcp", "http1"] }
|
hyper = { version = "0.14", features = ["server", "tcp", "http1"] }
|
||||||
libp2p = { path = "../../libp2p", features = ["async-std", "metrics", "ping", "noise", "identify", "tcp", "yamux", "macros"] }
|
libp2p = { path = "../../libp2p", features = ["async-std", "metrics", "ping", "noise", "identify", "tcp", "yamux", "macros"] }
|
||||||
log = "0.4.19"
|
log = "0.4.20"
|
||||||
tokio = { version = "1", features = ["rt-multi-thread"] }
|
tokio = { version = "1", features = ["rt-multi-thread"] }
|
||||||
prometheus-client = "0.21.2"
|
prometheus-client = "0.21.2"
|
||||||
|
@ -6,10 +6,9 @@ publish = false
|
|||||||
license = "MIT"
|
license = "MIT"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
clap = { version = "4.3.12", features = ["derive"] }
|
clap = { version = "4.3.21", features = ["derive"] }
|
||||||
async-std = { version = "1.12", features = ["attributes"] }
|
async-std = { version = "1.12", features = ["attributes"] }
|
||||||
async-trait = "0.1"
|
async-trait = "0.1"
|
||||||
env_logger = "0.10.0"
|
env_logger = "0.10.0"
|
||||||
futures = "0.3.28"
|
futures = "0.3.28"
|
||||||
libp2p = { path = "../../libp2p", features = ["async-std", "noise", "macros", "ping", "tcp", "identify", "yamux", "relay"] }
|
libp2p = { path = "../../libp2p", features = ["async-std", "noise", "macros", "ping", "tcp", "identify", "yamux", "relay", "quic"] }
|
||||||
libp2p-quic = { path = "../../transports/quic", features = ["async-std"] }
|
|
||||||
|
@ -31,11 +31,10 @@ use libp2p::{
|
|||||||
core::{Multiaddr, Transport},
|
core::{Multiaddr, Transport},
|
||||||
identify, identity,
|
identify, identity,
|
||||||
identity::PeerId,
|
identity::PeerId,
|
||||||
noise, ping, relay,
|
noise, ping, quic, relay,
|
||||||
swarm::{NetworkBehaviour, SwarmBuilder, SwarmEvent},
|
swarm::{NetworkBehaviour, SwarmBuilder, SwarmEvent},
|
||||||
tcp,
|
tcp,
|
||||||
};
|
};
|
||||||
use libp2p_quic as quic;
|
|
||||||
use std::error::Error;
|
use std::error::Error;
|
||||||
use std::net::{Ipv4Addr, Ipv6Addr};
|
use std::net::{Ipv4Addr, Ipv6Addr};
|
||||||
|
|
||||||
|
@ -12,4 +12,4 @@ env_logger = "0.10.0"
|
|||||||
futures = "0.3.28"
|
futures = "0.3.28"
|
||||||
libp2p = { path = "../../libp2p", features = ["async-std", "identify", "macros", "noise", "ping", "rendezvous", "tcp", "tokio", "yamux"] }
|
libp2p = { path = "../../libp2p", features = ["async-std", "identify", "macros", "noise", "ping", "rendezvous", "tcp", "tokio", "yamux"] }
|
||||||
log = "0.4"
|
log = "0.4"
|
||||||
tokio = { version = "1.29", features = [ "rt-multi-thread", "macros", "time" ] }
|
tokio = { version = "1.31", features = [ "rt-multi-thread", "macros", "time" ] }
|
||||||
|
@ -1,3 +1,11 @@
|
|||||||
|
## 0.2.3
|
||||||
|
|
||||||
|
- Fix [RUSTSEC-2022-0093] by updating `ed25519-dalek` to `2.0`.
|
||||||
|
See [PR 4337]
|
||||||
|
|
||||||
|
[RUSTSEC-2022-0093]: https://rustsec.org/advisories/RUSTSEC-2022-0093
|
||||||
|
[PR 4337]: https://github.com/libp2p/rust-libp2p/pull/4337
|
||||||
|
|
||||||
## 0.2.2
|
## 0.2.2
|
||||||
|
|
||||||
- Implement `from_protobuf_encoding` for RSA `Keypair`.
|
- Implement `from_protobuf_encoding` for RSA `Keypair`.
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "libp2p-identity"
|
name = "libp2p-identity"
|
||||||
version = "0.2.2"
|
version = "0.2.3"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
description = "Data structures and algorithms for identifying peers in libp2p."
|
description = "Data structures and algorithms for identifying peers in libp2p."
|
||||||
rust-version = { workspace = true }
|
rust-version = { workspace = true }
|
||||||
@ -14,7 +14,7 @@ categories = ["cryptography"]
|
|||||||
[dependencies]
|
[dependencies]
|
||||||
asn1_der = { version = "0.7.6", optional = true }
|
asn1_der = { version = "0.7.6", optional = true }
|
||||||
bs58 = { version = "0.5.0", optional = true }
|
bs58 = { version = "0.5.0", optional = true }
|
||||||
ed25519-dalek = { version = "1.0.1", optional = true }
|
ed25519-dalek = { version = "2.0", optional = true, features = ["rand_core"] }
|
||||||
libsecp256k1 = { version = "0.7.0", optional = true }
|
libsecp256k1 = { version = "0.7.0", optional = true }
|
||||||
log = "0.4"
|
log = "0.4"
|
||||||
multihash = { version = "0.19.0", optional = true }
|
multihash = { version = "0.19.0", optional = true }
|
||||||
|
@ -25,13 +25,12 @@ use core::cmp;
|
|||||||
use core::fmt;
|
use core::fmt;
|
||||||
use core::hash;
|
use core::hash;
|
||||||
use ed25519_dalek::{self as ed25519, Signer as _, Verifier as _};
|
use ed25519_dalek::{self as ed25519, Signer as _, Verifier as _};
|
||||||
#[cfg(feature = "rand")]
|
|
||||||
use rand::RngCore;
|
|
||||||
use std::convert::TryFrom;
|
use std::convert::TryFrom;
|
||||||
use zeroize::Zeroize;
|
use zeroize::Zeroize;
|
||||||
|
|
||||||
/// An Ed25519 keypair.
|
/// An Ed25519 keypair.
|
||||||
pub struct Keypair(ed25519::Keypair);
|
#[derive(Clone)]
|
||||||
|
pub struct Keypair(ed25519::SigningKey);
|
||||||
|
|
||||||
impl Keypair {
|
impl Keypair {
|
||||||
/// Generate a new random Ed25519 keypair.
|
/// Generate a new random Ed25519 keypair.
|
||||||
@ -44,7 +43,7 @@ impl Keypair {
|
|||||||
/// of the secret scalar and the compressed public point,
|
/// of the secret scalar and the compressed public point,
|
||||||
/// an informal standard for encoding Ed25519 keypairs.
|
/// an informal standard for encoding Ed25519 keypairs.
|
||||||
pub fn to_bytes(&self) -> [u8; 64] {
|
pub fn to_bytes(&self) -> [u8; 64] {
|
||||||
self.0.to_bytes()
|
self.0.to_keypair_bytes()
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Try to parse a keypair from the [binary format](https://datatracker.ietf.org/doc/html/rfc8032#section-5.1.5)
|
/// Try to parse a keypair from the [binary format](https://datatracker.ietf.org/doc/html/rfc8032#section-5.1.5)
|
||||||
@ -52,7 +51,10 @@ impl Keypair {
|
|||||||
///
|
///
|
||||||
/// Note that this binary format is the same as `ed25519_dalek`'s and `ed25519_zebra`'s.
|
/// Note that this binary format is the same as `ed25519_dalek`'s and `ed25519_zebra`'s.
|
||||||
pub fn try_from_bytes(kp: &mut [u8]) -> Result<Keypair, DecodingError> {
|
pub fn try_from_bytes(kp: &mut [u8]) -> Result<Keypair, DecodingError> {
|
||||||
ed25519::Keypair::from_bytes(kp)
|
let bytes = <[u8; 64]>::try_from(&*kp)
|
||||||
|
.map_err(|e| DecodingError::failed_to_parse("Ed25519 keypair", e))?;
|
||||||
|
|
||||||
|
ed25519::SigningKey::from_keypair_bytes(&bytes)
|
||||||
.map(|k| {
|
.map(|k| {
|
||||||
kp.zeroize();
|
kp.zeroize();
|
||||||
Keypair(k)
|
Keypair(k)
|
||||||
@ -67,60 +69,41 @@ impl Keypair {
|
|||||||
|
|
||||||
/// Get the public key of this keypair.
|
/// Get the public key of this keypair.
|
||||||
pub fn public(&self) -> PublicKey {
|
pub fn public(&self) -> PublicKey {
|
||||||
PublicKey(self.0.public)
|
PublicKey(self.0.verifying_key())
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Get the secret key of this keypair.
|
/// Get the secret key of this keypair.
|
||||||
pub fn secret(&self) -> SecretKey {
|
pub fn secret(&self) -> SecretKey {
|
||||||
SecretKey::try_from_bytes(&mut self.0.secret.to_bytes())
|
SecretKey(self.0.to_bytes())
|
||||||
.expect("ed25519::SecretKey::from_bytes(to_bytes(k)) != k")
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl fmt::Debug for Keypair {
|
impl fmt::Debug for Keypair {
|
||||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||||
f.debug_struct("Keypair")
|
f.debug_struct("Keypair")
|
||||||
.field("public", &self.0.public)
|
.field("public", &self.0.verifying_key())
|
||||||
.finish()
|
.finish()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Clone for Keypair {
|
|
||||||
fn clone(&self) -> Keypair {
|
|
||||||
let mut sk_bytes = self.0.secret.to_bytes();
|
|
||||||
let secret = SecretKey::try_from_bytes(&mut sk_bytes)
|
|
||||||
.expect("ed25519::SecretKey::from_bytes(to_bytes(k)) != k")
|
|
||||||
.0;
|
|
||||||
|
|
||||||
Keypair(ed25519::Keypair {
|
|
||||||
secret,
|
|
||||||
public: self.0.public,
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Demote an Ed25519 keypair to a secret key.
|
/// Demote an Ed25519 keypair to a secret key.
|
||||||
impl From<Keypair> for SecretKey {
|
impl From<Keypair> for SecretKey {
|
||||||
fn from(kp: Keypair) -> SecretKey {
|
fn from(kp: Keypair) -> SecretKey {
|
||||||
SecretKey(kp.0.secret)
|
SecretKey(kp.0.to_bytes())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Promote an Ed25519 secret key into a keypair.
|
/// Promote an Ed25519 secret key into a keypair.
|
||||||
impl From<SecretKey> for Keypair {
|
impl From<SecretKey> for Keypair {
|
||||||
fn from(sk: SecretKey) -> Keypair {
|
fn from(sk: SecretKey) -> Keypair {
|
||||||
let secret: ed25519::ExpandedSecretKey = (&sk.0).into();
|
let signing = ed25519::SigningKey::from_bytes(&sk.0);
|
||||||
let public = ed25519::PublicKey::from(&secret);
|
Keypair(signing)
|
||||||
Keypair(ed25519::Keypair {
|
|
||||||
secret: sk.0,
|
|
||||||
public,
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// An Ed25519 public key.
|
/// An Ed25519 public key.
|
||||||
#[derive(Eq, Clone)]
|
#[derive(Eq, Clone)]
|
||||||
pub struct PublicKey(ed25519::PublicKey);
|
pub struct PublicKey(ed25519::VerifyingKey);
|
||||||
|
|
||||||
impl fmt::Debug for PublicKey {
|
impl fmt::Debug for PublicKey {
|
||||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||||
@ -172,27 +155,22 @@ impl PublicKey {
|
|||||||
|
|
||||||
/// Try to parse a public key from a byte array containing the actual key as produced by `to_bytes`.
|
/// Try to parse a public key from a byte array containing the actual key as produced by `to_bytes`.
|
||||||
pub fn try_from_bytes(k: &[u8]) -> Result<PublicKey, DecodingError> {
|
pub fn try_from_bytes(k: &[u8]) -> Result<PublicKey, DecodingError> {
|
||||||
ed25519::PublicKey::from_bytes(k)
|
let k = <[u8; 32]>::try_from(k)
|
||||||
|
.map_err(|e| DecodingError::failed_to_parse("Ed25519 public key", e))?;
|
||||||
|
ed25519::VerifyingKey::from_bytes(&k)
|
||||||
.map_err(|e| DecodingError::failed_to_parse("Ed25519 public key", e))
|
.map_err(|e| DecodingError::failed_to_parse("Ed25519 public key", e))
|
||||||
.map(PublicKey)
|
.map(PublicKey)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// An Ed25519 secret key.
|
/// An Ed25519 secret key.
|
||||||
|
#[derive(Clone)]
|
||||||
pub struct SecretKey(ed25519::SecretKey);
|
pub struct SecretKey(ed25519::SecretKey);
|
||||||
|
|
||||||
/// View the bytes of the secret key.
|
/// View the bytes of the secret key.
|
||||||
impl AsRef<[u8]> for SecretKey {
|
impl AsRef<[u8]> for SecretKey {
|
||||||
fn as_ref(&self) -> &[u8] {
|
fn as_ref(&self) -> &[u8] {
|
||||||
self.0.as_bytes()
|
&self.0[..]
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl Clone for SecretKey {
|
|
||||||
fn clone(&self) -> SecretKey {
|
|
||||||
let mut sk_bytes = self.0.to_bytes();
|
|
||||||
Self::try_from_bytes(&mut sk_bytes)
|
|
||||||
.expect("ed25519::SecretKey::from_bytes(to_bytes(k)) != k")
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -206,13 +184,8 @@ impl SecretKey {
|
|||||||
/// Generate a new Ed25519 secret key.
|
/// Generate a new Ed25519 secret key.
|
||||||
#[cfg(feature = "rand")]
|
#[cfg(feature = "rand")]
|
||||||
pub fn generate() -> SecretKey {
|
pub fn generate() -> SecretKey {
|
||||||
let mut bytes = [0u8; 32];
|
let signing = ed25519::SigningKey::generate(&mut rand::rngs::OsRng);
|
||||||
rand::thread_rng().fill_bytes(&mut bytes);
|
SecretKey(signing.to_bytes())
|
||||||
SecretKey(
|
|
||||||
ed25519::SecretKey::from_bytes(&bytes).expect(
|
|
||||||
"this returns `Err` only if the length is wrong; the length is correct; qed",
|
|
||||||
),
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Try to parse an Ed25519 secret key from a byte slice
|
/// Try to parse an Ed25519 secret key from a byte slice
|
||||||
@ -221,7 +194,7 @@ impl SecretKey {
|
|||||||
/// returned.
|
/// returned.
|
||||||
pub fn try_from_bytes(mut sk_bytes: impl AsMut<[u8]>) -> Result<SecretKey, DecodingError> {
|
pub fn try_from_bytes(mut sk_bytes: impl AsMut<[u8]>) -> Result<SecretKey, DecodingError> {
|
||||||
let sk_bytes = sk_bytes.as_mut();
|
let sk_bytes = sk_bytes.as_mut();
|
||||||
let secret = ed25519::SecretKey::from_bytes(&*sk_bytes)
|
let secret = <[u8; 32]>::try_from(&*sk_bytes)
|
||||||
.map_err(|e| DecodingError::failed_to_parse("Ed25519 secret key", e))?;
|
.map_err(|e| DecodingError::failed_to_parse("Ed25519 secret key", e))?;
|
||||||
sk_bytes.zeroize();
|
sk_bytes.zeroize();
|
||||||
Ok(SecretKey(secret))
|
Ok(SecretKey(secret))
|
||||||
@ -234,7 +207,7 @@ mod tests {
|
|||||||
use quickcheck::*;
|
use quickcheck::*;
|
||||||
|
|
||||||
fn eq_keypairs(kp1: &Keypair, kp2: &Keypair) -> bool {
|
fn eq_keypairs(kp1: &Keypair, kp2: &Keypair) -> bool {
|
||||||
kp1.public() == kp2.public() && kp1.0.secret.as_bytes() == kp2.0.secret.as_bytes()
|
kp1.public() == kp2.public() && kp1.0.to_bytes() == kp2.0.to_bytes()
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
@ -254,7 +227,7 @@ mod tests {
|
|||||||
fn ed25519_keypair_from_secret() {
|
fn ed25519_keypair_from_secret() {
|
||||||
fn prop() -> bool {
|
fn prop() -> bool {
|
||||||
let kp1 = Keypair::generate();
|
let kp1 = Keypair::generate();
|
||||||
let mut sk = kp1.0.secret.to_bytes();
|
let mut sk = kp1.0.to_bytes();
|
||||||
let kp2 = Keypair::from(SecretKey::try_from_bytes(&mut sk).unwrap());
|
let kp2 = Keypair::from(SecretKey::try_from_bytes(&mut sk).unwrap());
|
||||||
eq_keypairs(&kp1, &kp2) && sk == [0u8; 32]
|
eq_keypairs(&kp1, &kp2) && sk == [0u8; 32]
|
||||||
}
|
}
|
||||||
|
@ -19,16 +19,15 @@ rand = "0.8.5"
|
|||||||
|
|
||||||
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
|
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
|
||||||
axum = "0.6"
|
axum = "0.6"
|
||||||
libp2p = { path = "../libp2p", features = ["ping", "noise", "tls", "rsa", "macros", "websocket", "tokio", "yamux", "tcp", "dns", "identify"] }
|
libp2p = { path = "../libp2p", features = ["ping", "noise", "tls", "rsa", "macros", "websocket", "tokio", "yamux", "tcp", "dns", "identify", "quic"] }
|
||||||
libp2p-quic = { workspace = true, features = ["tokio"] }
|
|
||||||
libp2p-webrtc = { workspace = true, features = ["tokio"] }
|
libp2p-webrtc = { workspace = true, features = ["tokio"] }
|
||||||
libp2p-mplex = { path = "../muxers/mplex" }
|
libp2p-mplex = { path = "../muxers/mplex" }
|
||||||
mime_guess = "2.0"
|
mime_guess = "2.0"
|
||||||
redis = { version = "0.23.0", default-features = false, features = ["tokio-comp"] }
|
redis = { version = "0.23.2", default-features = false, features = ["tokio-comp"] }
|
||||||
rust-embed = "6.8"
|
rust-embed = "6.8"
|
||||||
serde_json = "1"
|
serde_json = "1"
|
||||||
thirtyfour = "=0.32.0-rc.8" # https://github.com/stevepryde/thirtyfour/issues/169
|
thirtyfour = "=0.32.0-rc.8" # https://github.com/stevepryde/thirtyfour/issues/169
|
||||||
tokio = { version = "1.29.1", features = ["full"] }
|
tokio = { version = "1.31.0", features = ["full"] }
|
||||||
tower-http = { version = "0.4", features = ["cors", "fs", "trace"] }
|
tower-http = { version = "0.4", features = ["cors", "fs", "trace"] }
|
||||||
tracing = "0.1"
|
tracing = "0.1"
|
||||||
tracing-subscriber = { version = "0.3", features = ["env-filter"] }
|
tracing-subscriber = { version = "0.3", features = ["env-filter"] }
|
||||||
|
@ -26,9 +26,8 @@ pub(crate) mod native {
|
|||||||
use libp2p::identity::Keypair;
|
use libp2p::identity::Keypair;
|
||||||
use libp2p::swarm::{NetworkBehaviour, SwarmBuilder};
|
use libp2p::swarm::{NetworkBehaviour, SwarmBuilder};
|
||||||
use libp2p::websocket::WsConfig;
|
use libp2p::websocket::WsConfig;
|
||||||
use libp2p::{noise, tcp, tls, yamux, PeerId, Transport as _};
|
use libp2p::{noise, quic, tcp, tls, yamux, PeerId, Transport as _};
|
||||||
use libp2p_mplex as mplex;
|
use libp2p_mplex as mplex;
|
||||||
use libp2p_quic as quic;
|
|
||||||
use libp2p_webrtc as webrtc;
|
use libp2p_webrtc as webrtc;
|
||||||
use redis::AsyncCommands;
|
use redis::AsyncCommands;
|
||||||
|
|
||||||
|
@ -1,4 +1,8 @@
|
|||||||
## 0.52.2 - unreleased
|
## 0.52.3 - unreleased
|
||||||
|
|
||||||
|
- Add `libp2p-quic` stable release.
|
||||||
|
|
||||||
|
## 0.52.2
|
||||||
|
|
||||||
- Include gossipsub when compiling for wasm.
|
- Include gossipsub when compiling for wasm.
|
||||||
See [PR 4217].
|
See [PR 4217].
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "libp2p"
|
name = "libp2p"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
rust-version = "1.65.0"
|
rust-version = { workspace = true }
|
||||||
description = "Peer-to-peer networking library"
|
description = "Peer-to-peer networking library"
|
||||||
version = "0.52.2"
|
version = "0.52.3"
|
||||||
authors = ["Parity Technologies <admin@parity.io>"]
|
authors = ["Parity Technologies <admin@parity.io>"]
|
||||||
license = "MIT"
|
license = "MIT"
|
||||||
repository = "https://github.com/libp2p/rust-libp2p"
|
repository = "https://github.com/libp2p/rust-libp2p"
|
||||||
@ -33,6 +33,7 @@ full = [
|
|||||||
"ping",
|
"ping",
|
||||||
"plaintext",
|
"plaintext",
|
||||||
"pnet",
|
"pnet",
|
||||||
|
"quic",
|
||||||
"relay",
|
"relay",
|
||||||
"rendezvous",
|
"rendezvous",
|
||||||
"request-response",
|
"request-response",
|
||||||
@ -51,7 +52,7 @@ full = [
|
|||||||
"yamux",
|
"yamux",
|
||||||
]
|
]
|
||||||
|
|
||||||
async-std = ["libp2p-swarm/async-std", "libp2p-mdns?/async-io", "libp2p-tcp?/async-io", "libp2p-dns?/async-std"]
|
async-std = ["libp2p-swarm/async-std", "libp2p-mdns?/async-io", "libp2p-tcp?/async-io", "libp2p-dns?/async-std", "libp2p-quic?/async-std"]
|
||||||
autonat = ["dep:libp2p-autonat"]
|
autonat = ["dep:libp2p-autonat"]
|
||||||
cbor = ["libp2p-request-response?/cbor"]
|
cbor = ["libp2p-request-response?/cbor"]
|
||||||
dcutr = ["dep:libp2p-dcutr", "libp2p-metrics?/dcutr"]
|
dcutr = ["dep:libp2p-dcutr", "libp2p-metrics?/dcutr"]
|
||||||
@ -72,6 +73,7 @@ noise = ["dep:libp2p-noise"]
|
|||||||
ping = ["dep:libp2p-ping", "libp2p-metrics?/ping"]
|
ping = ["dep:libp2p-ping", "libp2p-metrics?/ping"]
|
||||||
plaintext = ["dep:libp2p-plaintext"]
|
plaintext = ["dep:libp2p-plaintext"]
|
||||||
pnet = ["dep:libp2p-pnet"]
|
pnet = ["dep:libp2p-pnet"]
|
||||||
|
quic = ["dep:libp2p-quic"]
|
||||||
relay = ["dep:libp2p-relay", "libp2p-metrics?/relay"]
|
relay = ["dep:libp2p-relay", "libp2p-metrics?/relay"]
|
||||||
rendezvous = ["dep:libp2p-rendezvous"]
|
rendezvous = ["dep:libp2p-rendezvous"]
|
||||||
request-response = ["dep:libp2p-request-response"]
|
request-response = ["dep:libp2p-request-response"]
|
||||||
@ -80,7 +82,7 @@ secp256k1 = ["libp2p-identity/secp256k1"]
|
|||||||
serde = ["libp2p-core/serde", "libp2p-kad?/serde", "libp2p-gossipsub?/serde"]
|
serde = ["libp2p-core/serde", "libp2p-kad?/serde", "libp2p-gossipsub?/serde"]
|
||||||
tcp = ["dep:libp2p-tcp"]
|
tcp = ["dep:libp2p-tcp"]
|
||||||
tls = ["dep:libp2p-tls"]
|
tls = ["dep:libp2p-tls"]
|
||||||
tokio = ["libp2p-swarm/tokio", "libp2p-mdns?/tokio", "libp2p-tcp?/tokio", "libp2p-dns?/tokio"]
|
tokio = ["libp2p-swarm/tokio", "libp2p-mdns?/tokio", "libp2p-tcp?/tokio", "libp2p-dns?/tokio", "libp2p-quic?/tokio"]
|
||||||
uds = ["dep:libp2p-uds"]
|
uds = ["dep:libp2p-uds"]
|
||||||
wasm-bindgen = ["futures-timer/wasm-bindgen", "instant/wasm-bindgen", "getrandom/js", "libp2p-swarm/wasm-bindgen", "libp2p-gossipsub?/wasm-bindgen"]
|
wasm-bindgen = ["futures-timer/wasm-bindgen", "instant/wasm-bindgen", "getrandom/js", "libp2p-swarm/wasm-bindgen", "libp2p-gossipsub?/wasm-bindgen"]
|
||||||
wasm-ext = ["dep:libp2p-wasm-ext"]
|
wasm-ext = ["dep:libp2p-wasm-ext"]
|
||||||
@ -127,6 +129,7 @@ libp2p-deflate = { workspace = true, optional = true }
|
|||||||
libp2p-dns = { workspace = true, optional = true }
|
libp2p-dns = { workspace = true, optional = true }
|
||||||
libp2p-mdns = { workspace = true, optional = true }
|
libp2p-mdns = { workspace = true, optional = true }
|
||||||
libp2p-memory-connection-limits = { workspace = true, optional = true }
|
libp2p-memory-connection-limits = { workspace = true, optional = true }
|
||||||
|
libp2p-quic = { workspace = true, optional = true }
|
||||||
libp2p-tcp = { workspace = true, optional = true }
|
libp2p-tcp = { workspace = true, optional = true }
|
||||||
libp2p-tls = { workspace = true, optional = true }
|
libp2p-tls = { workspace = true, optional = true }
|
||||||
libp2p-uds = { workspace = true, optional = true }
|
libp2p-uds = { workspace = true, optional = true }
|
||||||
|
@ -98,6 +98,9 @@ pub use libp2p_plaintext as plaintext;
|
|||||||
#[cfg(feature = "pnet")]
|
#[cfg(feature = "pnet")]
|
||||||
#[doc(inline)]
|
#[doc(inline)]
|
||||||
pub use libp2p_pnet as pnet;
|
pub use libp2p_pnet as pnet;
|
||||||
|
#[cfg(feature = "quic")]
|
||||||
|
#[cfg(not(target_arch = "wasm32"))]
|
||||||
|
pub use libp2p_quic as quic;
|
||||||
#[cfg(feature = "relay")]
|
#[cfg(feature = "relay")]
|
||||||
#[doc(inline)]
|
#[doc(inline)]
|
||||||
pub use libp2p_relay as relay;
|
pub use libp2p_relay as relay;
|
||||||
|
@ -10,7 +10,7 @@ categories = ["network-programming", "asynchronous"]
|
|||||||
publish = false
|
publish = false
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
clap = { version = "4.3.12", features = ["derive"] }
|
clap = { version = "4.3.21", features = ["derive"] }
|
||||||
zeroize = "1"
|
zeroize = "1"
|
||||||
serde = { version = "1.0.183", features = ["derive"] }
|
serde = { version = "1.0.183", features = ["derive"] }
|
||||||
serde_json = "1.0.100"
|
serde_json = "1.0.100"
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
## 0.1.0 - unreleased
|
## 0.1.0
|
||||||
|
|
||||||
- Initial release.
|
- Initial release.
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
## 0.13.1 - unreleased
|
## 0.13.1
|
||||||
|
|
||||||
- Enable gossipsub related data-type fields when compiling for wasm.
|
- Enable gossipsub related data-type fields when compiling for wasm.
|
||||||
See [PR 4217].
|
See [PR 4217].
|
||||||
|
|
||||||
[PR 4217]: https://github.com/libp2p/rust-libp2p/pull/4217
|
[PR 4217]: https://github.com/libp2p/rust-libp2p/pull/4217
|
||||||
|
|
||||||
## 0.13.0
|
## 0.13.0
|
||||||
|
|
||||||
- Previously `libp2p-metrics::identify` would increase a counter / gauge / histogram on each
|
- Previously `libp2p-metrics::identify` would increase a counter / gauge / histogram on each
|
||||||
received identify information. These metrics are misleading, as e.g. they depend on the identify
|
received identify information. These metrics are misleading, as e.g. they depend on the identify
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "libp2p-metrics"
|
name = "libp2p-metrics"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
rust-version = "1.65.0"
|
rust-version = { workspace = true }
|
||||||
description = "Metrics for libp2p"
|
description = "Metrics for libp2p"
|
||||||
version = "0.13.1"
|
version = "0.13.1"
|
||||||
authors = ["Max Inden <mail@max-inden.de>"]
|
authors = ["Max Inden <mail@max-inden.de>"]
|
||||||
|
@ -14,7 +14,7 @@ categories = ["network-programming", "asynchronous"]
|
|||||||
bytes = "1"
|
bytes = "1"
|
||||||
futures = "0.3"
|
futures = "0.3"
|
||||||
log = "0.4"
|
log = "0.4"
|
||||||
pin-project = "1.1.2"
|
pin-project = "1.1.3"
|
||||||
smallvec = "1.11.0"
|
smallvec = "1.11.0"
|
||||||
unsigned-varint = "0.7"
|
unsigned-varint = "0.7"
|
||||||
|
|
||||||
|
@ -12,7 +12,7 @@ categories = ["network-programming", "asynchronous"]
|
|||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
futures = "0.3.28"
|
futures = "0.3.28"
|
||||||
pin-project = "1.1.2"
|
pin-project = "1.1.3"
|
||||||
static_assertions = "1"
|
static_assertions = "1"
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
## 0.44.1 - unreleased
|
## 0.44.1
|
||||||
|
|
||||||
- Update to `yamux` `v0.12` which brings performance improvements and introduces an ACK backlog of 256 inbound streams.
|
- Update to `yamux` `v0.12` which brings performance improvements and introduces an ACK backlog of 256 inbound streams.
|
||||||
When interacting with other libp2p nodes that are also running this or a newer version, the creation of inbound streams will be backpressured once the ACK backlog is hit.
|
When interacting with other libp2p nodes that are also running this or a newer version, the creation of inbound streams will be backpressured once the ACK backlog is hit.
|
||||||
@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
[PR 3013]: https://github.com/libp2p/rust-libp2p/pull/3013
|
[PR 3013]: https://github.com/libp2p/rust-libp2p/pull/3013
|
||||||
|
|
||||||
## 0.44.0
|
## 0.44.0
|
||||||
|
|
||||||
- Raise MSRV to 1.65.
|
- Raise MSRV to 1.65.
|
||||||
See [PR 3715].
|
See [PR 3715].
|
||||||
|
@ -27,7 +27,7 @@ void = "1"
|
|||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
async-std = { version = "1.12.0", features = ["attributes"] }
|
async-std = { version = "1.12.0", features = ["attributes"] }
|
||||||
clap = { version = "4.3.12", features = ["derive"] }
|
clap = { version = "4.3.21", features = ["derive"] }
|
||||||
env_logger = "0.10.0"
|
env_logger = "0.10.0"
|
||||||
libp2p-dns = { workspace = true, features = ["async-std"] }
|
libp2p-dns = { workspace = true, features = ["async-std"] }
|
||||||
libp2p-identify = { workspace = true }
|
libp2p-identify = { workspace = true }
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
## 0.45.1 - unreleased
|
## 0.45.1
|
||||||
|
|
||||||
- Add getter function to obtain `TopicScoreParams`.
|
- Add getter function to obtain `TopicScoreParams`.
|
||||||
See [PR 4231].
|
See [PR 4231].
|
||||||
|
@ -28,7 +28,7 @@ instant = "0.1.12"
|
|||||||
libp2p-core = { workspace = true }
|
libp2p-core = { workspace = true }
|
||||||
libp2p-identity = { workspace = true }
|
libp2p-identity = { workspace = true }
|
||||||
libp2p-swarm = { workspace = true }
|
libp2p-swarm = { workspace = true }
|
||||||
log = "0.4.19"
|
log = "0.4.20"
|
||||||
quick-protobuf = "0.8"
|
quick-protobuf = "0.8"
|
||||||
quick-protobuf-codec = { workspace = true }
|
quick-protobuf-codec = { workspace = true }
|
||||||
rand = "0.8"
|
rand = "0.8"
|
||||||
|
@ -17,7 +17,7 @@ futures-timer = "3.0.2"
|
|||||||
libp2p-core = { workspace = true }
|
libp2p-core = { workspace = true }
|
||||||
libp2p-swarm = { workspace = true }
|
libp2p-swarm = { workspace = true }
|
||||||
libp2p-identity = { workspace = true }
|
libp2p-identity = { workspace = true }
|
||||||
log = "0.4.19"
|
log = "0.4.20"
|
||||||
lru = "0.11.0"
|
lru = "0.11.0"
|
||||||
quick-protobuf-codec = { workspace = true }
|
quick-protobuf-codec = { workspace = true }
|
||||||
quick-protobuf = "0.8"
|
quick-protobuf = "0.8"
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
## 0.44.4 - unreleased
|
## 0.44.4
|
||||||
|
|
||||||
- Implement common traits on `RoutingUpdate`.
|
- Implement common traits on `RoutingUpdate`.
|
||||||
See [PR 4270].
|
See [PR 4270].
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "libp2p-kad"
|
name = "libp2p-kad"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
rust-version = "1.65.0"
|
rust-version = { workspace = true }
|
||||||
description = "Kademlia protocol for libp2p"
|
description = "Kademlia protocol for libp2p"
|
||||||
version = "0.44.4"
|
version = "0.44.4"
|
||||||
authors = ["Parity Technologies <admin@parity.io>"]
|
authors = ["Parity Technologies <admin@parity.io>"]
|
||||||
|
@ -18,11 +18,11 @@ if-watch = "3.0.1"
|
|||||||
libp2p-core = { workspace = true }
|
libp2p-core = { workspace = true }
|
||||||
libp2p-swarm = { workspace = true }
|
libp2p-swarm = { workspace = true }
|
||||||
libp2p-identity = { workspace = true }
|
libp2p-identity = { workspace = true }
|
||||||
log = "0.4.19"
|
log = "0.4.20"
|
||||||
rand = "0.8.3"
|
rand = "0.8.3"
|
||||||
smallvec = "1.11.0"
|
smallvec = "1.11.0"
|
||||||
socket2 = { version = "0.5.3", features = ["all"] }
|
socket2 = { version = "0.5.3", features = ["all"] }
|
||||||
tokio = { version = "1.29", default-features = false, features = ["net", "time"], optional = true}
|
tokio = { version = "1.31", 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.22.0", default-features = false, features = ["mdns", "tokio-runtime"] }
|
||||||
void = "1.0.2"
|
void = "1.0.2"
|
||||||
|
|
||||||
@ -37,7 +37,7 @@ libp2p-noise = { workspace = true }
|
|||||||
libp2p-swarm = { workspace = true, features = ["tokio", "async-std"] }
|
libp2p-swarm = { workspace = true, features = ["tokio", "async-std"] }
|
||||||
libp2p-tcp = { workspace = true, features = ["tokio", "async-io"] }
|
libp2p-tcp = { workspace = true, features = ["tokio", "async-io"] }
|
||||||
libp2p-yamux = { workspace = true }
|
libp2p-yamux = { workspace = true }
|
||||||
tokio = { version = "1.29", default-features = false, features = ["macros", "rt", "rt-multi-thread", "time"] }
|
tokio = { version = "1.31", default-features = false, features = ["macros", "rt", "rt-multi-thread", "time"] }
|
||||||
libp2p-swarm-test = { path = "../../swarm-test" }
|
libp2p-swarm-test = { path = "../../swarm-test" }
|
||||||
|
|
||||||
[[test]]
|
[[test]]
|
||||||
|
@ -13,7 +13,7 @@ categories = ["network-programming", "asynchronous"]
|
|||||||
[dependencies]
|
[dependencies]
|
||||||
anyhow = "1"
|
anyhow = "1"
|
||||||
async-trait = "0.1"
|
async-trait = "0.1"
|
||||||
clap = { version = "4.3.12", features = ["derive"] }
|
clap = { version = "4.3.21", features = ["derive"] }
|
||||||
env_logger = "0.10.0"
|
env_logger = "0.10.0"
|
||||||
futures = "0.3.28"
|
futures = "0.3.28"
|
||||||
instant = "0.1.12"
|
instant = "0.1.12"
|
||||||
@ -30,7 +30,7 @@ log = "0.4"
|
|||||||
serde = { version = "1.0", features = ["derive"] }
|
serde = { version = "1.0", features = ["derive"] }
|
||||||
serde_json = "1.0"
|
serde_json = "1.0"
|
||||||
thiserror = "1.0"
|
thiserror = "1.0"
|
||||||
tokio = { version = "1.29.1", features = ["full"] }
|
tokio = { version = "1.31.0", features = ["full"] }
|
||||||
void = "1"
|
void = "1"
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
|
@ -18,7 +18,7 @@ instant = "0.1.12"
|
|||||||
libp2p-core = { workspace = true }
|
libp2p-core = { workspace = true }
|
||||||
libp2p-swarm = { workspace = true }
|
libp2p-swarm = { workspace = true }
|
||||||
libp2p-identity = { workspace = true }
|
libp2p-identity = { workspace = true }
|
||||||
log = "0.4.19"
|
log = "0.4.20"
|
||||||
rand = "0.8"
|
rand = "0.8"
|
||||||
void = "1.0"
|
void = "1.0"
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
## 0.16.1 - unreleased
|
## 0.16.1
|
||||||
|
|
||||||
- Export `RateLimiter` type.
|
- Export `RateLimiter` type.
|
||||||
See [PR 3742].
|
See [PR 3742].
|
||||||
|
@ -37,7 +37,7 @@ libp2p-identify = { workspace = true }
|
|||||||
libp2p-yamux = { workspace = true }
|
libp2p-yamux = { workspace = true }
|
||||||
libp2p-tcp = { workspace = true, features = ["tokio"] }
|
libp2p-tcp = { workspace = true, features = ["tokio"] }
|
||||||
rand = "0.8"
|
rand = "0.8"
|
||||||
tokio = { version = "1.29", features = [ "rt-multi-thread", "time", "macros", "sync", "process", "fs", "net" ] }
|
tokio = { version = "1.31", features = [ "rt-multi-thread", "time", "macros", "sync", "process", "fs", "net" ] }
|
||||||
libp2p-swarm-test = { path = "../../swarm-test" }
|
libp2p-swarm-test = { path = "../../swarm-test" }
|
||||||
|
|
||||||
# Passing arguments to the docsrs builder in order to properly document cfg's.
|
# Passing arguments to the docsrs builder in order to properly document cfg's.
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
## 0.25.1 - unreleased
|
## 0.25.1
|
||||||
|
|
||||||
- Replace unmaintained `serde_cbor` dependency with `cbor4ii`.
|
- Replace unmaintained `serde_cbor` dependency with `cbor4ii`.
|
||||||
See [PR 4187].
|
See [PR 4187].
|
||||||
|
@ -23,7 +23,7 @@ serde = { version = "1.0", optional = true}
|
|||||||
serde_json = { version = "1.0.100", optional = true }
|
serde_json = { version = "1.0.100", optional = true }
|
||||||
smallvec = "1.11.0"
|
smallvec = "1.11.0"
|
||||||
void = "1.0.2"
|
void = "1.0.2"
|
||||||
log = "0.4.19"
|
log = "0.4.20"
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
json = ["dep:serde", "dep:serde_json", "libp2p-swarm/macros"]
|
json = ["dep:serde", "dep:serde_json", "libp2p-swarm/macros"]
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
name = "libp2p-swarm-test"
|
name = "libp2p-swarm-test"
|
||||||
version = "0.2.0"
|
version = "0.2.0"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
rust-version = "1.65.0"
|
rust-version = { workspace = true }
|
||||||
license = "MIT"
|
license = "MIT"
|
||||||
description = "Test framework for code building on top of libp2p-swarm"
|
description = "Test framework for code building on top of libp2p-swarm"
|
||||||
repository = "https://github.com/libp2p/rust-libp2p"
|
repository = "https://github.com/libp2p/rust-libp2p"
|
||||||
@ -12,7 +12,7 @@ categories = ["network-programming", "asynchronous"]
|
|||||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
async-trait = "0.1.72"
|
async-trait = "0.1.73"
|
||||||
libp2p-core = { workspace = true }
|
libp2p-core = { workspace = true }
|
||||||
libp2p-identity = { workspace = true }
|
libp2p-identity = { workspace = true }
|
||||||
libp2p-plaintext = { workspace = true }
|
libp2p-plaintext = { workspace = true }
|
||||||
@ -20,6 +20,6 @@ libp2p-swarm = { workspace = true }
|
|||||||
libp2p-tcp = { workspace = true, features = ["async-io"] }
|
libp2p-tcp = { workspace = true, features = ["async-io"] }
|
||||||
libp2p-yamux = { workspace = true }
|
libp2p-yamux = { workspace = true }
|
||||||
futures = "0.3.28"
|
futures = "0.3.28"
|
||||||
log = "0.4.19"
|
log = "0.4.20"
|
||||||
rand = "0.8.5"
|
rand = "0.8.5"
|
||||||
futures-timer = "3.0.2"
|
futures-timer = "3.0.2"
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
## 0.43.3 - unreleased
|
## 0.43.3
|
||||||
|
|
||||||
- Implement `Display` for `ConnectionId`.
|
- Implement `Display` for `ConnectionId`.
|
||||||
See [PR 4278].
|
See [PR 4278].
|
||||||
|
@ -30,7 +30,7 @@ multistream-select = { workspace = true }
|
|||||||
|
|
||||||
[target.'cfg(not(any(target_os = "emscripten", target_os = "wasi", target_os = "unknown")))'.dependencies]
|
[target.'cfg(not(any(target_os = "emscripten", target_os = "wasi", target_os = "unknown")))'.dependencies]
|
||||||
async-std = { version = "1.6.2", optional = true }
|
async-std = { version = "1.6.2", optional = true }
|
||||||
tokio = { version = "1.29", features = ["rt"], optional = true }
|
tokio = { version = "1.31", features = ["rt"], optional = true }
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
macros = ["dep:libp2p-swarm-derive"]
|
macros = ["dep:libp2p-swarm-derive"]
|
||||||
@ -48,13 +48,13 @@ libp2p-identity = { workspace = true, features = ["ed25519"] }
|
|||||||
libp2p-kad = { path = "../protocols/kad" } # Using `path` here because this is a cyclic dev-dependency which otherwise breaks releasing.
|
libp2p-kad = { path = "../protocols/kad" } # Using `path` here because this is a cyclic dev-dependency which otherwise breaks releasing.
|
||||||
libp2p-ping = { path = "../protocols/ping" } # Using `path` here because this is a cyclic dev-dependency which otherwise breaks releasing.
|
libp2p-ping = { path = "../protocols/ping" } # Using `path` here because this is a cyclic dev-dependency which otherwise breaks releasing.
|
||||||
libp2p-plaintext = { path = "../transports/plaintext" } # Using `path` here because this is a cyclic dev-dependency which otherwise breaks releasing.
|
libp2p-plaintext = { path = "../transports/plaintext" } # Using `path` here because this is a cyclic dev-dependency which otherwise breaks releasing.
|
||||||
libp2p-swarm-derive = { path = "../swarm-derive" }
|
libp2p-swarm-derive = { path = "../swarm-derive" } # Using `path` here because this is a cyclic dev-dependency which otherwise breaks releasing.
|
||||||
libp2p-swarm-test = { path = "../swarm-test" } # Using `path` here because this is a cyclic dev-dependency which otherwise breaks releasing.
|
libp2p-swarm-test = { path = "../swarm-test" } # Using `path` here because this is a cyclic dev-dependency which otherwise breaks releasing.
|
||||||
libp2p-yamux = { workspace = true }
|
libp2p-yamux = { path = "../muxers/yamux" } # Using `path` here because this is a cyclic dev-dependency which otherwise breaks releasing.
|
||||||
quickcheck = { workspace = true }
|
quickcheck = { workspace = true }
|
||||||
void = "1"
|
void = "1"
|
||||||
once_cell = "1.18.0"
|
once_cell = "1.18.0"
|
||||||
trybuild = "1.0.80"
|
trybuild = "1.0.83"
|
||||||
|
|
||||||
[[test]]
|
[[test]]
|
||||||
name = "swarm_derive"
|
name = "swarm_derive"
|
||||||
|
@ -13,7 +13,7 @@ categories = ["network-programming", "asynchronous"]
|
|||||||
[dependencies]
|
[dependencies]
|
||||||
libp2p-core = { workspace = true }
|
libp2p-core = { workspace = true }
|
||||||
libp2p-identity = { workspace = true }
|
libp2p-identity = { workspace = true }
|
||||||
log = "0.4.19"
|
log = "0.4.20"
|
||||||
futures = "0.3.28"
|
futures = "0.3.28"
|
||||||
async-std-resolver = { version = "0.22", optional = true }
|
async-std-resolver = { version = "0.22", optional = true }
|
||||||
parking_lot = "0.12.0"
|
parking_lot = "0.12.0"
|
||||||
|
@ -16,7 +16,7 @@ bytes = "1"
|
|||||||
futures = "0.3.28"
|
futures = "0.3.28"
|
||||||
libp2p-core = { workspace = true }
|
libp2p-core = { workspace = true }
|
||||||
libp2p-identity = { workspace = true }
|
libp2p-identity = { workspace = true }
|
||||||
log = "0.4.19"
|
log = "0.4.20"
|
||||||
quick-protobuf = "0.8"
|
quick-protobuf = "0.8"
|
||||||
unsigned-varint = { version = "0.7", features = ["asynchronous_codec"] }
|
unsigned-varint = { version = "0.7", features = ["asynchronous_codec"] }
|
||||||
|
|
||||||
|
@ -12,11 +12,11 @@ categories = ["network-programming", "asynchronous"]
|
|||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
futures = "0.3.28"
|
futures = "0.3.28"
|
||||||
log = "0.4.19"
|
log = "0.4.20"
|
||||||
salsa20 = "0.10"
|
salsa20 = "0.10"
|
||||||
sha3 = "0.10"
|
sha3 = "0.10"
|
||||||
rand = "0.8"
|
rand = "0.8"
|
||||||
pin-project = "1.1.2"
|
pin-project = "1.1.3"
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
libp2p-core = { workspace = true }
|
libp2p-core = { workspace = true }
|
||||||
@ -27,7 +27,7 @@ libp2p-tcp = { workspace = true, features = ["tokio"] }
|
|||||||
libp2p-websocket = { workspace = true }
|
libp2p-websocket = { workspace = true }
|
||||||
libp2p-yamux = { workspace = true }
|
libp2p-yamux = { workspace = true }
|
||||||
quickcheck = { workspace = true }
|
quickcheck = { workspace = true }
|
||||||
tokio = { version = "1.29.1", features = ["full"] }
|
tokio = { version = "1.31.0", features = ["full"] }
|
||||||
|
|
||||||
# Passing arguments to the docsrs builder in order to properly document cfg's.
|
# Passing arguments to the docsrs builder in order to properly document cfg's.
|
||||||
# More information: https://docs.rs/about/builds#cross-compiling
|
# More information: https://docs.rs/about/builds#cross-compiling
|
||||||
|
@ -1,4 +1,15 @@
|
|||||||
## 0.9.1-alpha - unreleased
|
## 0.9.2 - unreleased
|
||||||
|
|
||||||
|
- Cut stable release.
|
||||||
|
|
||||||
|
## 0.9.2-alpha
|
||||||
|
|
||||||
|
- Add support for reusing an existing socket when dialing localhost address.
|
||||||
|
See [PR 4304].
|
||||||
|
|
||||||
|
[PR 4304]: https://github.com/libp2p/rust-libp2p/pull/4304
|
||||||
|
|
||||||
|
## 0.9.1-alpha
|
||||||
|
|
||||||
- Allow listening on ipv4 and ipv6 separately.
|
- Allow listening on ipv4 and ipv6 separately.
|
||||||
See [PR 4289].
|
See [PR 4289].
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "libp2p-quic"
|
name = "libp2p-quic"
|
||||||
version = "0.9.1-alpha"
|
version = "0.9.2"
|
||||||
authors = ["Parity Technologies <admin@parity.io>"]
|
authors = ["Parity Technologies <admin@parity.io>"]
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
rust-version = { workspace = true }
|
rust-version = { workspace = true }
|
||||||
@ -19,11 +19,11 @@ libp2p-tls = { workspace = true }
|
|||||||
libp2p-identity = { workspace = true }
|
libp2p-identity = { workspace = true }
|
||||||
log = "0.4"
|
log = "0.4"
|
||||||
parking_lot = "0.12.0"
|
parking_lot = "0.12.0"
|
||||||
quinn = { version = "0.10.1", default-features = false, features = ["tls-rustls", "futures-io"] }
|
quinn = { version = "0.10.2", default-features = false, features = ["tls-rustls", "futures-io"] }
|
||||||
rand = "0.8.5"
|
rand = "0.8.5"
|
||||||
rustls = { version = "0.21.2", default-features = false }
|
rustls = { version = "0.21.6", default-features = false }
|
||||||
thiserror = "1.0.44"
|
thiserror = "1.0.44"
|
||||||
tokio = { version = "1.29.1", default-features = false, features = ["net", "rt", "time"], optional = true }
|
tokio = { version = "1.31.0", default-features = false, features = ["net", "rt", "time"], optional = true }
|
||||||
socket2 = "0.5.3"
|
socket2 = "0.5.3"
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
@ -45,7 +45,7 @@ libp2p-noise = { workspace = true }
|
|||||||
libp2p-tcp = { workspace = true, features = ["async-io"] }
|
libp2p-tcp = { workspace = true, features = ["async-io"] }
|
||||||
libp2p-yamux = { workspace = true }
|
libp2p-yamux = { workspace = true }
|
||||||
quickcheck = "1"
|
quickcheck = "1"
|
||||||
tokio = { version = "1.29.1", features = ["macros", "rt-multi-thread", "time"] }
|
tokio = { version = "1.31.0", features = ["macros", "rt-multi-thread", "time"] }
|
||||||
|
|
||||||
[[test]]
|
[[test]]
|
||||||
name = "stream_compliance"
|
name = "stream_compliance"
|
||||||
|
@ -39,7 +39,7 @@ use libp2p_core::{
|
|||||||
use libp2p_identity::PeerId;
|
use libp2p_identity::PeerId;
|
||||||
use socket2::{Domain, Socket, Type};
|
use socket2::{Domain, Socket, Type};
|
||||||
use std::collections::hash_map::{DefaultHasher, Entry};
|
use std::collections::hash_map::{DefaultHasher, Entry};
|
||||||
use std::collections::HashMap;
|
use std::collections::{HashMap, HashSet};
|
||||||
use std::hash::{Hash, Hasher};
|
use std::hash::{Hash, Hasher};
|
||||||
use std::net::{IpAddr, Ipv4Addr, Ipv6Addr, UdpSocket};
|
use std::net::{IpAddr, Ipv4Addr, Ipv6Addr, UdpSocket};
|
||||||
use std::time::Duration;
|
use std::time::Duration;
|
||||||
@ -155,9 +155,16 @@ impl<P: Provider> GenTransport<P> {
|
|||||||
if l.is_closed {
|
if l.is_closed {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
let listen_addr = l.socket_addr();
|
SocketFamily::is_same(&l.socket_addr().ip(), &socket_addr.ip())
|
||||||
SocketFamily::is_same(&listen_addr.ip(), &socket_addr.ip())
|
})
|
||||||
&& listen_addr.ip().is_loopback() == socket_addr.ip().is_loopback()
|
.filter(|l| {
|
||||||
|
if socket_addr.ip().is_loopback() {
|
||||||
|
l.listening_addresses
|
||||||
|
.iter()
|
||||||
|
.any(|ip_addr| ip_addr.is_loopback())
|
||||||
|
} else {
|
||||||
|
true
|
||||||
|
}
|
||||||
})
|
})
|
||||||
.collect();
|
.collect();
|
||||||
match listeners.len() {
|
match listeners.len() {
|
||||||
@ -428,6 +435,8 @@ struct Listener<P: Provider> {
|
|||||||
|
|
||||||
/// The stream must be awaken after it has been closed to deliver the last event.
|
/// The stream must be awaken after it has been closed to deliver the last event.
|
||||||
close_listener_waker: Option<Waker>,
|
close_listener_waker: Option<Waker>,
|
||||||
|
|
||||||
|
listening_addresses: HashSet<IpAddr>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<P: Provider> Listener<P> {
|
impl<P: Provider> Listener<P> {
|
||||||
@ -440,12 +449,14 @@ impl<P: Provider> Listener<P> {
|
|||||||
) -> Result<Self, Error> {
|
) -> Result<Self, Error> {
|
||||||
let if_watcher;
|
let if_watcher;
|
||||||
let pending_event;
|
let pending_event;
|
||||||
|
let mut listening_addresses = HashSet::new();
|
||||||
let local_addr = socket.local_addr()?;
|
let local_addr = socket.local_addr()?;
|
||||||
if local_addr.ip().is_unspecified() {
|
if local_addr.ip().is_unspecified() {
|
||||||
if_watcher = Some(P::new_if_watcher()?);
|
if_watcher = Some(P::new_if_watcher()?);
|
||||||
pending_event = None;
|
pending_event = None;
|
||||||
} else {
|
} else {
|
||||||
if_watcher = None;
|
if_watcher = None;
|
||||||
|
listening_addresses.insert(local_addr.ip());
|
||||||
let ma = socketaddr_to_multiaddr(&local_addr, version);
|
let ma = socketaddr_to_multiaddr(&local_addr, version);
|
||||||
pending_event = Some(TransportEvent::NewAddress {
|
pending_event = Some(TransportEvent::NewAddress {
|
||||||
listener_id,
|
listener_id,
|
||||||
@ -467,6 +478,7 @@ impl<P: Provider> Listener<P> {
|
|||||||
is_closed: false,
|
is_closed: false,
|
||||||
pending_event,
|
pending_event,
|
||||||
close_listener_waker: None,
|
close_listener_waker: None,
|
||||||
|
listening_addresses,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -513,7 +525,8 @@ impl<P: Provider> Listener<P> {
|
|||||||
if let Some(listen_addr) =
|
if let Some(listen_addr) =
|
||||||
ip_to_listenaddr(&endpoint_addr, inet.addr(), self.version)
|
ip_to_listenaddr(&endpoint_addr, inet.addr(), self.version)
|
||||||
{
|
{
|
||||||
log::debug!("New listen address: {}", listen_addr);
|
log::debug!("New listen address: {listen_addr}");
|
||||||
|
self.listening_addresses.insert(inet.addr());
|
||||||
return Poll::Ready(TransportEvent::NewAddress {
|
return Poll::Ready(TransportEvent::NewAddress {
|
||||||
listener_id: self.listener_id,
|
listener_id: self.listener_id,
|
||||||
listen_addr,
|
listen_addr,
|
||||||
@ -524,7 +537,8 @@ impl<P: Provider> Listener<P> {
|
|||||||
if let Some(listen_addr) =
|
if let Some(listen_addr) =
|
||||||
ip_to_listenaddr(&endpoint_addr, inet.addr(), self.version)
|
ip_to_listenaddr(&endpoint_addr, inet.addr(), self.version)
|
||||||
{
|
{
|
||||||
log::debug!("Expired listen address: {}", listen_addr);
|
log::debug!("Expired listen address: {listen_addr}");
|
||||||
|
self.listening_addresses.remove(&inet.addr());
|
||||||
return Poll::Ready(TransportEvent::AddressExpired {
|
return Poll::Ready(TransportEvent::AddressExpired {
|
||||||
listener_id: self.listener_id,
|
listener_id: self.listener_id,
|
||||||
listen_addr,
|
listen_addr,
|
||||||
@ -730,7 +744,7 @@ fn socketaddr_to_multiaddr(socket_addr: &SocketAddr, version: ProtocolVersion) -
|
|||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
#[cfg(any(feature = "async-std", feature = "tokio"))]
|
#[cfg(any(feature = "async-std", feature = "tokio"))]
|
||||||
mod test {
|
mod tests {
|
||||||
use futures::future::poll_fn;
|
use futures::future::poll_fn;
|
||||||
use std::net::{IpAddr, Ipv4Addr, Ipv6Addr};
|
use std::net::{IpAddr, Ipv4Addr, Ipv6Addr};
|
||||||
|
|
||||||
@ -912,17 +926,21 @@ mod test {
|
|||||||
let keypair = libp2p_identity::Keypair::generate_ed25519();
|
let keypair = libp2p_identity::Keypair::generate_ed25519();
|
||||||
let config = Config::new(&keypair);
|
let config = Config::new(&keypair);
|
||||||
let mut transport = crate::tokio::Transport::new(config);
|
let mut transport = crate::tokio::Transport::new(config);
|
||||||
|
let port = {
|
||||||
|
let socket = UdpSocket::bind("127.0.0.1:0").unwrap();
|
||||||
|
socket.local_addr().unwrap().port()
|
||||||
|
};
|
||||||
|
|
||||||
transport
|
transport
|
||||||
.listen_on(
|
.listen_on(
|
||||||
ListenerId::next(),
|
ListenerId::next(),
|
||||||
"/ip4/0.0.0.0/udp/4001/quic-v1".parse().unwrap(),
|
format!("/ip4/0.0.0.0/udp/{port}/quic-v1").parse().unwrap(),
|
||||||
)
|
)
|
||||||
.unwrap();
|
.unwrap();
|
||||||
transport
|
transport
|
||||||
.listen_on(
|
.listen_on(
|
||||||
ListenerId::next(),
|
ListenerId::next(),
|
||||||
"/ip6/::/udp/4001/quic-v1".parse().unwrap(),
|
format!("/ip6/::/udp/{port}/quic-v1").parse().unwrap(),
|
||||||
)
|
)
|
||||||
.unwrap();
|
.unwrap();
|
||||||
}
|
}
|
||||||
|
@ -414,6 +414,49 @@ async fn write_after_peer_dropped_stream() {
|
|||||||
stream_b.close().await.expect("Close failed.");
|
stream_b.close().await.expect("Close failed.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// - A listens on 0.0.0.0:0
|
||||||
|
/// - B listens on 127.0.0.1:0
|
||||||
|
/// - A dials B
|
||||||
|
/// - Source port of A at B is the A's listen port
|
||||||
|
#[cfg(feature = "tokio")]
|
||||||
|
#[tokio::test]
|
||||||
|
async fn test_local_listener_reuse() {
|
||||||
|
let (_, mut a_transport) = create_default_transport::<quic::tokio::Provider>();
|
||||||
|
let (_, mut b_transport) = create_default_transport::<quic::tokio::Provider>();
|
||||||
|
|
||||||
|
a_transport
|
||||||
|
.listen_on(
|
||||||
|
ListenerId::next(),
|
||||||
|
"/ip4/0.0.0.0/udp/0/quic-v1".parse().unwrap(),
|
||||||
|
)
|
||||||
|
.unwrap();
|
||||||
|
|
||||||
|
// wait until a listener reports a loopback address
|
||||||
|
let a_listen_addr = 'outer: loop {
|
||||||
|
let ev = a_transport.next().await.unwrap();
|
||||||
|
let listen_addr = ev.into_new_address().unwrap();
|
||||||
|
for proto in listen_addr.iter() {
|
||||||
|
if let Protocol::Ip4(ip4) = proto {
|
||||||
|
if ip4.is_loopback() {
|
||||||
|
break 'outer listen_addr;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
// If we do not poll until the end, `NewAddress` events may be `Ready` and `connect` function
|
||||||
|
// below will panic due to an unexpected event.
|
||||||
|
poll_fn(|cx| {
|
||||||
|
let mut pinned = Pin::new(&mut a_transport);
|
||||||
|
while pinned.as_mut().poll(cx).is_ready() {}
|
||||||
|
Poll::Ready(())
|
||||||
|
})
|
||||||
|
.await;
|
||||||
|
|
||||||
|
let b_addr = start_listening(&mut b_transport, "/ip4/127.0.0.1/udp/0/quic-v1").await;
|
||||||
|
let (_, send_back_addr, _) = connect(&mut b_transport, &mut a_transport, b_addr).await.0;
|
||||||
|
assert_eq!(send_back_addr, a_listen_addr);
|
||||||
|
}
|
||||||
|
|
||||||
async fn smoke<P: Provider>() {
|
async fn smoke<P: Provider>() {
|
||||||
let _ = env_logger::try_init();
|
let _ = env_logger::try_init();
|
||||||
|
|
||||||
|
@ -18,9 +18,9 @@ if-watch = "3.0.1"
|
|||||||
libc = "0.2.147"
|
libc = "0.2.147"
|
||||||
libp2p-core = { workspace = true }
|
libp2p-core = { workspace = true }
|
||||||
libp2p-identity = { workspace = true }
|
libp2p-identity = { workspace = true }
|
||||||
log = "0.4.19"
|
log = "0.4.20"
|
||||||
socket2 = { version = "0.5.3", features = ["all"] }
|
socket2 = { version = "0.5.3", features = ["all"] }
|
||||||
tokio = { version = "1.29.1", default-features = false, features = ["net"], optional = true }
|
tokio = { version = "1.31.0", default-features = false, features = ["net"], optional = true }
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
tokio = ["dep:tokio", "if-watch/tokio"]
|
tokio = ["dep:tokio", "if-watch/tokio"]
|
||||||
@ -28,7 +28,7 @@ async-io = ["dep:async-io", "if-watch/smol"]
|
|||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
async-std = { version = "1.6.5", features = ["attributes"] }
|
async-std = { version = "1.6.5", features = ["attributes"] }
|
||||||
tokio = { version = "1.29.1", default-features = false, features = ["full"] }
|
tokio = { version = "1.31.0", default-features = false, features = ["full"] }
|
||||||
env_logger = "0.10.0"
|
env_logger = "0.10.0"
|
||||||
|
|
||||||
# Passing arguments to the docsrs builder in order to properly document cfg's.
|
# Passing arguments to the docsrs builder in order to properly document cfg's.
|
||||||
|
@ -346,13 +346,12 @@ where
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn create_socket(&self, socket_addr: &SocketAddr) -> io::Result<Socket> {
|
fn create_socket(&self, socket_addr: SocketAddr) -> io::Result<Socket> {
|
||||||
let domain = if socket_addr.is_ipv4() {
|
let socket = Socket::new(
|
||||||
Domain::IPV4
|
Domain::for_address(socket_addr),
|
||||||
} else {
|
Type::STREAM,
|
||||||
Domain::IPV6
|
Some(socket2::Protocol::TCP),
|
||||||
};
|
)?;
|
||||||
let socket = Socket::new(domain, Type::STREAM, Some(socket2::Protocol::TCP))?;
|
|
||||||
if socket_addr.is_ipv6() {
|
if socket_addr.is_ipv6() {
|
||||||
socket.set_only_v6(true)?;
|
socket.set_only_v6(true)?;
|
||||||
}
|
}
|
||||||
@ -375,7 +374,7 @@ where
|
|||||||
id: ListenerId,
|
id: ListenerId,
|
||||||
socket_addr: SocketAddr,
|
socket_addr: SocketAddr,
|
||||||
) -> io::Result<ListenStream<T>> {
|
) -> io::Result<ListenStream<T>> {
|
||||||
let socket = self.create_socket(&socket_addr)?;
|
let socket = self.create_socket(socket_addr)?;
|
||||||
socket.bind(&socket_addr.into())?;
|
socket.bind(&socket_addr.into())?;
|
||||||
socket.listen(self.config.backlog as _)?;
|
socket.listen(self.config.backlog as _)?;
|
||||||
socket.set_nonblocking(true)?;
|
socket.set_nonblocking(true)?;
|
||||||
@ -476,7 +475,7 @@ where
|
|||||||
log::debug!("dialing {}", socket_addr);
|
log::debug!("dialing {}", socket_addr);
|
||||||
|
|
||||||
let socket = self
|
let socket = self
|
||||||
.create_socket(&socket_addr)
|
.create_socket(socket_addr)
|
||||||
.map_err(TransportError::Other)?;
|
.map_err(TransportError::Other)?;
|
||||||
|
|
||||||
if let Some(addr) = self.port_reuse.local_dial_addr(&socket_addr.ip()) {
|
if let Some(addr) = self.port_reuse.local_dial_addr(&socket_addr.ip()) {
|
||||||
@ -1329,4 +1328,42 @@ mod tests {
|
|||||||
assert!(rt.block_on(cycle_listeners::<tokio::Tcp>()));
|
assert!(rt.block_on(cycle_listeners::<tokio::Tcp>()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn test_listens_ipv4_ipv6_separately() {
|
||||||
|
fn test<T: Provider>() {
|
||||||
|
let port = {
|
||||||
|
let listener = TcpListener::bind("127.0.0.1:0").unwrap();
|
||||||
|
listener.local_addr().unwrap().port()
|
||||||
|
};
|
||||||
|
let mut tcp = Transport::<T>::default().boxed();
|
||||||
|
let listener_id = ListenerId::next();
|
||||||
|
tcp.listen_on(
|
||||||
|
listener_id,
|
||||||
|
format!("/ip4/0.0.0.0/tcp/{port}").parse().unwrap(),
|
||||||
|
)
|
||||||
|
.unwrap();
|
||||||
|
tcp.listen_on(
|
||||||
|
ListenerId::next(),
|
||||||
|
format!("/ip6/::/tcp/{port}").parse().unwrap(),
|
||||||
|
)
|
||||||
|
.unwrap();
|
||||||
|
}
|
||||||
|
#[cfg(feature = "async-io")]
|
||||||
|
{
|
||||||
|
async_std::task::block_on(async {
|
||||||
|
test::<async_io::Tcp>();
|
||||||
|
})
|
||||||
|
}
|
||||||
|
#[cfg(feature = "tokio")]
|
||||||
|
{
|
||||||
|
let rt = ::tokio::runtime::Builder::new_current_thread()
|
||||||
|
.enable_io()
|
||||||
|
.build()
|
||||||
|
.unwrap();
|
||||||
|
rt.block_on(async {
|
||||||
|
test::<async_io::Tcp>();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -22,7 +22,7 @@ yasna = "0.5.2"
|
|||||||
|
|
||||||
# Exposed dependencies. Breaking changes to these are breaking changes to us.
|
# Exposed dependencies. Breaking changes to these are breaking changes to us.
|
||||||
[dependencies.rustls]
|
[dependencies.rustls]
|
||||||
version = "0.21.2"
|
version = "0.21.6"
|
||||||
default-features = false
|
default-features = false
|
||||||
features = ["dangerous_configuration"] # Must enable this to allow for custom verification code.
|
features = ["dangerous_configuration"] # Must enable this to allow for custom verification code.
|
||||||
|
|
||||||
@ -33,7 +33,7 @@ libp2p-core = { workspace = true }
|
|||||||
libp2p-identity = { workspace = true, features = ["ed25519", "rsa", "secp256k1", "ecdsa"] }
|
libp2p-identity = { workspace = true, features = ["ed25519", "rsa", "secp256k1", "ecdsa"] }
|
||||||
libp2p-swarm = { workspace = true }
|
libp2p-swarm = { workspace = true }
|
||||||
libp2p-yamux = { workspace = true }
|
libp2p-yamux = { workspace = true }
|
||||||
tokio = { version = "1.29.1", features = ["full"] }
|
tokio = { version = "1.31.0", features = ["full"] }
|
||||||
|
|
||||||
# Passing arguments to the docsrs builder in order to properly document cfg's.
|
# Passing arguments to the docsrs builder in order to properly document cfg's.
|
||||||
# More information: https://docs.rs/about/builds#cross-compiling
|
# More information: https://docs.rs/about/builds#cross-compiling
|
||||||
|
@ -13,9 +13,9 @@ categories = ["network-programming", "asynchronous"]
|
|||||||
[dependencies]
|
[dependencies]
|
||||||
async-std = { version = "1.6.2", optional = true }
|
async-std = { version = "1.6.2", optional = true }
|
||||||
libp2p-core = { workspace = true }
|
libp2p-core = { workspace = true }
|
||||||
log = "0.4.19"
|
log = "0.4.20"
|
||||||
futures = "0.3.28"
|
futures = "0.3.28"
|
||||||
tokio = { version = "1.29", default-features = false, features = ["net"], optional = true }
|
tokio = { version = "1.31", default-features = false, features = ["net"], optional = true }
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
tempfile = "3.7"
|
tempfile = "3.7"
|
||||||
|
@ -32,7 +32,7 @@ serde = { version = "1.0", features = ["derive"] }
|
|||||||
stun = "0.4"
|
stun = "0.4"
|
||||||
thiserror = "1"
|
thiserror = "1"
|
||||||
tinytemplate = "1.2"
|
tinytemplate = "1.2"
|
||||||
tokio = { version = "1.29", features = ["net"], optional = true}
|
tokio = { version = "1.31", features = ["net"], optional = true}
|
||||||
tokio-util = { version = "0.7", features = ["compat"], optional = true }
|
tokio-util = { version = "0.7", features = ["compat"], optional = true }
|
||||||
webrtc = { version = "0.8.0", optional = true }
|
webrtc = { version = "0.8.0", optional = true }
|
||||||
|
|
||||||
@ -46,7 +46,7 @@ env_logger = "0.10"
|
|||||||
hex-literal = "0.4"
|
hex-literal = "0.4"
|
||||||
libp2p-swarm = { workspace = true, features = ["macros", "tokio"] }
|
libp2p-swarm = { workspace = true, features = ["macros", "tokio"] }
|
||||||
libp2p-ping = { workspace = true }
|
libp2p-ping = { workspace = true }
|
||||||
tokio = { version = "1.29", features = ["full"] }
|
tokio = { version = "1.31", features = ["full"] }
|
||||||
unsigned-varint = { version = "0.7", features = ["asynchronous_codec"] }
|
unsigned-varint = { version = "0.7", features = ["asynchronous_codec"] }
|
||||||
void = "1"
|
void = "1"
|
||||||
quickcheck = "1.0.3"
|
quickcheck = "1.0.3"
|
||||||
|
@ -16,7 +16,7 @@ either = "1.9.0"
|
|||||||
futures = "0.3.28"
|
futures = "0.3.28"
|
||||||
libp2p-core = { workspace = true }
|
libp2p-core = { workspace = true }
|
||||||
libp2p-identity = { workspace = true }
|
libp2p-identity = { workspace = true }
|
||||||
log = "0.4.19"
|
log = "0.4.20"
|
||||||
parking_lot = "0.12.0"
|
parking_lot = "0.12.0"
|
||||||
quicksink = "0.1"
|
quicksink = "0.1"
|
||||||
rw-stream-sink = { workspace = true }
|
rw-stream-sink = { workspace = true }
|
||||||
@ -28,7 +28,7 @@ webpki-roots = "0.25"
|
|||||||
libp2p-tcp = { workspace = true, features = ["async-io"] }
|
libp2p-tcp = { workspace = true, features = ["async-io"] }
|
||||||
libp2p-dns = { workspace = true, features = ["async-std"] }
|
libp2p-dns = { workspace = true, features = ["async-std"] }
|
||||||
async-std = { version = "1.6.5", features = ["attributes"] }
|
async-std = { version = "1.6.5", features = ["attributes"] }
|
||||||
rcgen = "0.9.3"
|
rcgen = "0.10.0"
|
||||||
|
|
||||||
# Passing arguments to the docsrs builder in order to properly document cfg's.
|
# Passing arguments to the docsrs builder in order to properly document cfg's.
|
||||||
# More information: https://docs.rs/about/builds#cross-compiling
|
# More information: https://docs.rs/about/builds#cross-compiling
|
||||||
|
@ -19,7 +19,7 @@ js-sys = "0.3.64"
|
|||||||
libp2p-core = { workspace = true }
|
libp2p-core = { workspace = true }
|
||||||
libp2p-identity = { workspace = true }
|
libp2p-identity = { workspace = true }
|
||||||
libp2p-noise = { workspace = true }
|
libp2p-noise = { workspace = true }
|
||||||
log = "0.4.19"
|
log = "0.4.20"
|
||||||
multiaddr = { workspace = true }
|
multiaddr = { workspace = true }
|
||||||
multihash = { workspace = true }
|
multihash = { workspace = true }
|
||||||
send_wrapper = { version = "0.6.0", features = ["futures"] }
|
send_wrapper = { version = "0.6.0", features = ["futures"] }
|
||||||
|
Loading…
x
Reference in New Issue
Block a user