From a4b8ff4673c5fcef001b662cd5befa4653daa5bc Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 14 Aug 2023 09:00:31 +0000 Subject: [PATCH 01/11] deps: bump tokio from 1.29.1 to 1.31.0 Pull-Request: #4318. --- Cargo.lock | 45 ++++++++++++++++----------------- examples/rendezvous/Cargo.toml | 2 +- interop-tests/Cargo.toml | 2 +- protocols/mdns/Cargo.toml | 4 +-- protocols/perf/Cargo.toml | 2 +- protocols/rendezvous/Cargo.toml | 2 +- swarm/Cargo.toml | 2 +- transports/pnet/Cargo.toml | 2 +- transports/quic/Cargo.toml | 4 +-- transports/tcp/Cargo.toml | 4 +-- transports/tls/Cargo.toml | 2 +- transports/uds/Cargo.toml | 2 +- transports/webrtc/Cargo.toml | 4 +-- 13 files changed, 38 insertions(+), 39 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 979bc43d8d9..db69052abcb 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -455,7 +455,7 @@ dependencies = [ "log", "memchr", "once_cell", - "pin-project-lite 0.2.10", + "pin-project-lite 0.2.12", "pin-utils", "slab", "wasm-bindgen-futures", @@ -503,7 +503,7 @@ dependencies = [ "futures-sink", "futures-util", "memchr", - "pin-project-lite 0.2.10", + "pin-project-lite 0.2.12", ] [[package]] @@ -548,7 +548,7 @@ dependencies = [ "memchr", "mime", "percent-encoding", - "pin-project-lite 0.2.10", + "pin-project-lite 0.2.12", "rustversion", "serde", "serde_json", @@ -945,7 +945,7 @@ dependencies = [ "bytes", "futures-core", "memchr", - "pin-project-lite 0.2.10", + "pin-project-lite 0.2.12", "tokio", "tokio-util", ] @@ -1794,7 +1794,7 @@ dependencies = [ "futures-io", "memchr", "parking", - "pin-project-lite 0.2.10", + "pin-project-lite 0.2.12", "waker-fn", ] @@ -1876,7 +1876,7 @@ dependencies = [ "futures-sink", "futures-task", "memchr", - "pin-project-lite 0.2.10", + "pin-project-lite 0.2.12", "pin-utils", "slab", ] @@ -2134,7 +2134,7 @@ checksum = "d5f38f16d184e36f2408a55281cd658ecbd3ca05cce6d6510a176eca393e26d1" dependencies = [ "bytes", "http", - "pin-project-lite 0.2.10", + "pin-project-lite 0.2.12", ] [[package]] @@ -2177,7 +2177,7 @@ dependencies = [ "httparse", "httpdate", "itoa", - "pin-project-lite 0.2.10", + "pin-project-lite 0.2.12", "socket2 0.4.9", "tokio", "tower-service", @@ -4082,9 +4082,9 @@ checksum = "257b64915a082f7811703966789728173279bdebb956b143dbcd23f6f970a777" [[package]] name = "pin-project-lite" -version = "0.2.10" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c40d25201921e5ff0c862a505c6557ea88568a4e3ace775ab55e93f2f4f9d57" +checksum = "12cc1b0bf1727a77a54b6654e7b5f1af8604923edc8b81885f8ec92f9e3f0a05" [[package]] name = "pin-utils" @@ -4174,7 +4174,7 @@ dependencies = [ "concurrent-queue", "libc", "log", - "pin-project-lite 0.2.10", + "pin-project-lite 0.2.12", "windows-sys", ] @@ -4361,7 +4361,7 @@ dependencies = [ "async-std", "bytes", "futures-io", - "pin-project-lite 0.2.10", + "pin-project-lite 0.2.12", "quinn-proto", "quinn-udp", "rustc-hash", @@ -4540,7 +4540,7 @@ dependencies = [ "futures-util", "itoa", "percent-encoding", - "pin-project-lite 0.2.10", + "pin-project-lite 0.2.12", "ryu", "tokio", "tokio-util", @@ -4649,7 +4649,7 @@ dependencies = [ "native-tls", "once_cell", "percent-encoding", - "pin-project-lite 0.2.10", + "pin-project-lite 0.2.12", "serde", "serde_json", "serde_urlencoded", @@ -5669,20 +5669,19 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.29.1" +version = "1.31.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "532826ff75199d5833b9d2c5fe410f29235e25704ee5f0ef599fb51c21f4a4da" +checksum = "40de3a2ba249dcb097e01be5e67a5ff53cf250397715a071a81543e8a832a920" dependencies = [ - "autocfg", "backtrace", "bytes", "libc", "mio", "num_cpus", "parking_lot", - "pin-project-lite 0.2.10", + "pin-project-lite 0.2.12", "signal-hook-registry", - "socket2 0.4.9", + "socket2 0.5.3", "tokio-macros", "windows-sys", ] @@ -5729,7 +5728,7 @@ dependencies = [ "futures-core", "futures-io", "futures-sink", - "pin-project-lite 0.2.10", + "pin-project-lite 0.2.12", "tokio", "tracing", ] @@ -5743,7 +5742,7 @@ dependencies = [ "futures-core", "futures-util", "pin-project", - "pin-project-lite 0.2.10", + "pin-project-lite 0.2.12", "tokio", "tower-layer", "tower-service", @@ -5767,7 +5766,7 @@ dependencies = [ "mime", "mime_guess", "percent-encoding", - "pin-project-lite 0.2.10", + "pin-project-lite 0.2.12", "tokio", "tokio-util", "tower-layer", @@ -5795,7 +5794,7 @@ checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8" dependencies = [ "cfg-if 1.0.0", "log", - "pin-project-lite 0.2.10", + "pin-project-lite 0.2.12", "tracing-attributes", "tracing-core", ] diff --git a/examples/rendezvous/Cargo.toml b/examples/rendezvous/Cargo.toml index ffbde3fd7dc..e0cf39bafab 100644 --- a/examples/rendezvous/Cargo.toml +++ b/examples/rendezvous/Cargo.toml @@ -12,4 +12,4 @@ env_logger = "0.10.0" futures = "0.3.28" libp2p = { path = "../../libp2p", features = ["async-std", "identify", "macros", "noise", "ping", "rendezvous", "tcp", "tokio", "yamux"] } log = "0.4" -tokio = { version = "1.29", features = [ "rt-multi-thread", "macros", "time" ] } +tokio = { version = "1.31", features = [ "rt-multi-thread", "macros", "time" ] } diff --git a/interop-tests/Cargo.toml b/interop-tests/Cargo.toml index 2d0d8ea25b7..d03c0403f49 100644 --- a/interop-tests/Cargo.toml +++ b/interop-tests/Cargo.toml @@ -28,7 +28,7 @@ redis = { version = "0.23.0", default-features = false, features = ["tokio-comp" rust-embed = "6.8" serde_json = "1" 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"] } tracing = "0.1" tracing-subscriber = { version = "0.3", features = ["env-filter"] } diff --git a/protocols/mdns/Cargo.toml b/protocols/mdns/Cargo.toml index 830547e7bbd..338e410b5b5 100644 --- a/protocols/mdns/Cargo.toml +++ b/protocols/mdns/Cargo.toml @@ -22,7 +22,7 @@ log = "0.4.19" rand = "0.8.3" smallvec = "1.11.0" 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"] } void = "1.0.2" @@ -37,7 +37,7 @@ libp2p-noise = { workspace = true } libp2p-swarm = { workspace = true, features = ["tokio", "async-std"] } libp2p-tcp = { workspace = true, features = ["tokio", "async-io"] } 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" } [[test]] diff --git a/protocols/perf/Cargo.toml b/protocols/perf/Cargo.toml index 5374c68ac9a..758b8a52c9e 100644 --- a/protocols/perf/Cargo.toml +++ b/protocols/perf/Cargo.toml @@ -30,7 +30,7 @@ log = "0.4" serde = { version = "1.0", features = ["derive"] } serde_json = "1.0" thiserror = "1.0" -tokio = { version = "1.29.1", features = ["full"] } +tokio = { version = "1.31.0", features = ["full"] } void = "1" [dev-dependencies] diff --git a/protocols/rendezvous/Cargo.toml b/protocols/rendezvous/Cargo.toml index b24781dcd74..7929d3c4a06 100644 --- a/protocols/rendezvous/Cargo.toml +++ b/protocols/rendezvous/Cargo.toml @@ -37,7 +37,7 @@ libp2p-identify = { workspace = true } libp2p-yamux = { workspace = true } libp2p-tcp = { workspace = true, features = ["tokio"] } 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" } # Passing arguments to the docsrs builder in order to properly document cfg's. diff --git a/swarm/Cargo.toml b/swarm/Cargo.toml index 189fa5c52a4..1290bfdddf4 100644 --- a/swarm/Cargo.toml +++ b/swarm/Cargo.toml @@ -30,7 +30,7 @@ multistream-select = { workspace = true } [target.'cfg(not(any(target_os = "emscripten", target_os = "wasi", target_os = "unknown")))'.dependencies] async-std = { version = "1.6.2", optional = true } -tokio = { version = "1.29", features = ["rt"], optional = true } +tokio = { version = "1.31", features = ["rt"], optional = true } [features] macros = ["dep:libp2p-swarm-derive"] diff --git a/transports/pnet/Cargo.toml b/transports/pnet/Cargo.toml index b74c4ef29a7..11c27266057 100644 --- a/transports/pnet/Cargo.toml +++ b/transports/pnet/Cargo.toml @@ -27,7 +27,7 @@ libp2p-tcp = { workspace = true, features = ["tokio"] } libp2p-websocket = { workspace = true } libp2p-yamux = { 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. # More information: https://docs.rs/about/builds#cross-compiling diff --git a/transports/quic/Cargo.toml b/transports/quic/Cargo.toml index 9dba8c692c5..2500e5d7b6f 100644 --- a/transports/quic/Cargo.toml +++ b/transports/quic/Cargo.toml @@ -23,7 +23,7 @@ quinn = { version = "0.10.1", default-features = false, features = ["tls-rustls" rand = "0.8.5" rustls = { version = "0.21.2", default-features = false } 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" [features] @@ -45,7 +45,7 @@ libp2p-noise = { workspace = true } libp2p-tcp = { workspace = true, features = ["async-io"] } libp2p-yamux = { workspace = true } 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]] name = "stream_compliance" diff --git a/transports/tcp/Cargo.toml b/transports/tcp/Cargo.toml index aaf409169dc..5103ee9576a 100644 --- a/transports/tcp/Cargo.toml +++ b/transports/tcp/Cargo.toml @@ -20,7 +20,7 @@ libp2p-core = { workspace = true } libp2p-identity = { workspace = true } log = "0.4.19" 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] tokio = ["dep:tokio", "if-watch/tokio"] @@ -28,7 +28,7 @@ async-io = ["dep:async-io", "if-watch/smol"] [dev-dependencies] 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" # Passing arguments to the docsrs builder in order to properly document cfg's. diff --git a/transports/tls/Cargo.toml b/transports/tls/Cargo.toml index 5275a9c07a6..191a24d6741 100644 --- a/transports/tls/Cargo.toml +++ b/transports/tls/Cargo.toml @@ -33,7 +33,7 @@ libp2p-core = { workspace = true } libp2p-identity = { workspace = true, features = ["ed25519", "rsa", "secp256k1", "ecdsa"] } libp2p-swarm = { 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. # More information: https://docs.rs/about/builds#cross-compiling diff --git a/transports/uds/Cargo.toml b/transports/uds/Cargo.toml index be011b5ca8d..a01cc9c6916 100644 --- a/transports/uds/Cargo.toml +++ b/transports/uds/Cargo.toml @@ -15,7 +15,7 @@ async-std = { version = "1.6.2", optional = true } libp2p-core = { workspace = true } log = "0.4.19" 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] tempfile = "3.7" diff --git a/transports/webrtc/Cargo.toml b/transports/webrtc/Cargo.toml index 70d5553e293..05271951a33 100644 --- a/transports/webrtc/Cargo.toml +++ b/transports/webrtc/Cargo.toml @@ -32,7 +32,7 @@ serde = { version = "1.0", features = ["derive"] } stun = "0.4" thiserror = "1" 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 } webrtc = { version = "0.8.0", optional = true } @@ -46,7 +46,7 @@ env_logger = "0.10" hex-literal = "0.4" libp2p-swarm = { workspace = true, features = ["macros", "tokio"] } libp2p-ping = { workspace = true } -tokio = { version = "1.29", features = ["full"] } +tokio = { version = "1.31", features = ["full"] } unsigned-varint = { version = "0.7", features = ["asynchronous_codec"] } void = "1" quickcheck = "1.0.3" From 8022769dafd01d0833e98f933345a65a9d134637 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 14 Aug 2023 09:20:07 +0000 Subject: [PATCH 02/11] deps: bump clap from 4.3.19 to 4.3.21 Pull-Request: #4319. --- Cargo.lock | 8 ++++---- examples/autonat/Cargo.toml | 2 +- examples/dcutr/Cargo.toml | 2 +- examples/file-sharing/Cargo.toml | 2 +- examples/relay-server/Cargo.toml | 2 +- misc/keygen/Cargo.toml | 2 +- protocols/dcutr/Cargo.toml | 2 +- protocols/perf/Cargo.toml | 2 +- 8 files changed, 11 insertions(+), 11 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index db69052abcb..f84c97fd456 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -891,9 +891,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.3.19" +version = "4.3.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5fd304a20bff958a57f04c4e96a2e7594cc4490a0e809cbd48bb6437edaa452d" +checksum = "c27cdf28c0f604ba3f512b0c9a409f8de8513e4816705deb0498b627e7c3a3fd" dependencies = [ "clap_builder", "clap_derive", @@ -902,9 +902,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.3.19" +version = "4.3.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01c6a3f08f1fe5662a35cfe393aec09c4df95f60ee93b7556505260f75eee9e1" +checksum = "08a9f1ab5e9f01a9b81f202e8562eb9a10de70abf9eaeac1be465c28b75aa4aa" dependencies = [ "anstream", "anstyle", diff --git a/examples/autonat/Cargo.toml b/examples/autonat/Cargo.toml index 9f40dbbc3f3..9ca936b638a 100644 --- a/examples/autonat/Cargo.toml +++ b/examples/autonat/Cargo.toml @@ -7,7 +7,7 @@ license = "MIT" [dependencies] 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" futures = "0.3.28" libp2p = { path = "../../libp2p", features = ["async-std", "tcp", "noise", "yamux", "autonat", "identify", "macros"] } diff --git a/examples/dcutr/Cargo.toml b/examples/dcutr/Cargo.toml index 5a6389f00c0..38394ee3e2c 100644 --- a/examples/dcutr/Cargo.toml +++ b/examples/dcutr/Cargo.toml @@ -6,7 +6,7 @@ publish = false license = "MIT" [dependencies] -clap = { version = "4.3.12", features = ["derive"] } +clap = { version = "4.3.21", features = ["derive"] } env_logger = "0.10.0" futures = "0.3.28" futures-timer = "3.0" diff --git a/examples/file-sharing/Cargo.toml b/examples/file-sharing/Cargo.toml index 348b62fd854..a2aa47cebb3 100644 --- a/examples/file-sharing/Cargo.toml +++ b/examples/file-sharing/Cargo.toml @@ -8,7 +8,7 @@ license = "MIT" [dependencies] serde = { version = "1.0", features = ["derive"] } async-std = { version = "1.12", features = ["attributes"] } -clap = { version = "4.3.12", features = ["derive"] } +clap = { version = "4.3.21", features = ["derive"] } either = "1.9" env_logger = "0.10" futures = "0.3.28" diff --git a/examples/relay-server/Cargo.toml b/examples/relay-server/Cargo.toml index 263a25b34ba..296b50d31b9 100644 --- a/examples/relay-server/Cargo.toml +++ b/examples/relay-server/Cargo.toml @@ -6,7 +6,7 @@ publish = false license = "MIT" [dependencies] -clap = { version = "4.3.12", features = ["derive"] } +clap = { version = "4.3.21", features = ["derive"] } async-std = { version = "1.12", features = ["attributes"] } async-trait = "0.1" env_logger = "0.10.0" diff --git a/misc/keygen/Cargo.toml b/misc/keygen/Cargo.toml index 49eee550319..6de32895ccb 100644 --- a/misc/keygen/Cargo.toml +++ b/misc/keygen/Cargo.toml @@ -10,7 +10,7 @@ categories = ["network-programming", "asynchronous"] publish = false [dependencies] -clap = { version = "4.3.12", features = ["derive"] } +clap = { version = "4.3.21", features = ["derive"] } zeroize = "1" serde = { version = "1.0.183", features = ["derive"] } serde_json = "1.0.100" diff --git a/protocols/dcutr/Cargo.toml b/protocols/dcutr/Cargo.toml index 5ef81f0dcf3..2b9d3c3a669 100644 --- a/protocols/dcutr/Cargo.toml +++ b/protocols/dcutr/Cargo.toml @@ -27,7 +27,7 @@ void = "1" [dev-dependencies] 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" libp2p-dns = { workspace = true, features = ["async-std"] } libp2p-identify = { workspace = true } diff --git a/protocols/perf/Cargo.toml b/protocols/perf/Cargo.toml index 758b8a52c9e..499cfd82834 100644 --- a/protocols/perf/Cargo.toml +++ b/protocols/perf/Cargo.toml @@ -13,7 +13,7 @@ categories = ["network-programming", "asynchronous"] [dependencies] anyhow = "1" async-trait = "0.1" -clap = { version = "4.3.12", features = ["derive"] } +clap = { version = "4.3.21", features = ["derive"] } env_logger = "0.10.0" futures = "0.3.28" instant = "0.1.12" From c2648d775ac0c25256738fda3cf94c3cd1ace093 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 14 Aug 2023 09:38:56 +0000 Subject: [PATCH 03/11] deps: bump async-trait from 0.1.72 to 0.1.73 Pull-Request: #4321. --- Cargo.lock | 4 ++-- swarm-test/Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index f84c97fd456..137752fcb9d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -484,9 +484,9 @@ checksum = "ecc7ab41815b3c653ccd2978ec3255c81349336702dfdf62ee6f7069b12a3aae" [[package]] name = "async-trait" -version = "0.1.72" +version = "0.1.73" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc6dde6e4ed435a4c1ee4e73592f5ba9da2151af10076cc04858746af9352d09" +checksum = "bc00ceb34980c03614e35a3a4e218276a0a824e911d07651cd0d858a51e8c0f0" dependencies = [ "proc-macro2", "quote", diff --git a/swarm-test/Cargo.toml b/swarm-test/Cargo.toml index 69aa312b428..e762183b6be 100644 --- a/swarm-test/Cargo.toml +++ b/swarm-test/Cargo.toml @@ -12,7 +12,7 @@ categories = ["network-programming", "asynchronous"] # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -async-trait = "0.1.72" +async-trait = "0.1.73" libp2p-core = { workspace = true } libp2p-identity = { workspace = true } libp2p-plaintext = { workspace = true } From a648b273b244375c052db017d916d6ccf8171d1c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 14 Aug 2023 09:57:25 +0000 Subject: [PATCH 04/11] deps: bump webpki-roots from 0.25.1 to 0.25.2 Pull-Request: #4320. --- Cargo.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 137752fcb9d..079c4a93aa1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3349,7 +3349,7 @@ dependencies = [ "rw-stream-sink", "soketto", "url", - "webpki-roots 0.25.1", + "webpki-roots 0.25.2", ] [[package]] @@ -6305,9 +6305,9 @@ dependencies = [ [[package]] name = "webpki-roots" -version = "0.25.1" +version = "0.25.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c9c6eda1c830a36f361e7721c87fd79ea84293b54f8c48c959f85ec636f0f196" +checksum = "14247bb57be4f377dfb94c72830b8ce8fc6beac03cf4bf7b9732eadd414123fc" [[package]] name = "webrtc" From 2c4c961d693414dccf338cbe8fe327bc57279609 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 14 Aug 2023 10:16:13 +0000 Subject: [PATCH 05/11] deps: bump log from 0.4.19 to 0.4.20 Pull-Request: #4322. --- Cargo.lock | 4 ++-- examples/metrics/Cargo.toml | 2 +- protocols/gossipsub/Cargo.toml | 2 +- protocols/identify/Cargo.toml | 2 +- protocols/mdns/Cargo.toml | 2 +- protocols/ping/Cargo.toml | 2 +- protocols/request-response/Cargo.toml | 2 +- swarm-test/Cargo.toml | 2 +- transports/dns/Cargo.toml | 2 +- transports/plaintext/Cargo.toml | 2 +- transports/pnet/Cargo.toml | 2 +- transports/tcp/Cargo.toml | 2 +- transports/uds/Cargo.toml | 2 +- transports/websocket/Cargo.toml | 2 +- transports/webtransport-websys/Cargo.toml | 2 +- 15 files changed, 16 insertions(+), 16 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 079c4a93aa1..19c99e8d974 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3463,9 +3463,9 @@ dependencies = [ [[package]] name = "log" -version = "0.4.19" +version = "0.4.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b06a4cde4c0f271a446782e3eff8de789548ce57dbc8eca9292c27f4a42004b4" +checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" dependencies = [ "value-bag", ] diff --git a/examples/metrics/Cargo.toml b/examples/metrics/Cargo.toml index f883127ee25..b81c0142fd9 100644 --- a/examples/metrics/Cargo.toml +++ b/examples/metrics/Cargo.toml @@ -10,6 +10,6 @@ env_logger = "0.10.0" futures = "0.3.27" hyper = { version = "0.14", features = ["server", "tcp", "http1"] } 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"] } prometheus-client = "0.21.2" diff --git a/protocols/gossipsub/Cargo.toml b/protocols/gossipsub/Cargo.toml index a9cf8b2a2fe..acbab0c82e9 100644 --- a/protocols/gossipsub/Cargo.toml +++ b/protocols/gossipsub/Cargo.toml @@ -28,7 +28,7 @@ instant = "0.1.12" libp2p-core = { workspace = true } libp2p-identity = { workspace = true } libp2p-swarm = { workspace = true } -log = "0.4.19" +log = "0.4.20" quick-protobuf = "0.8" quick-protobuf-codec = { workspace = true } rand = "0.8" diff --git a/protocols/identify/Cargo.toml b/protocols/identify/Cargo.toml index 61d38ede934..fb207dd7e8a 100644 --- a/protocols/identify/Cargo.toml +++ b/protocols/identify/Cargo.toml @@ -17,7 +17,7 @@ futures-timer = "3.0.2" libp2p-core = { workspace = true } libp2p-swarm = { workspace = true } libp2p-identity = { workspace = true } -log = "0.4.19" +log = "0.4.20" lru = "0.11.0" quick-protobuf-codec = { workspace = true } quick-protobuf = "0.8" diff --git a/protocols/mdns/Cargo.toml b/protocols/mdns/Cargo.toml index 338e410b5b5..14a30e6b923 100644 --- a/protocols/mdns/Cargo.toml +++ b/protocols/mdns/Cargo.toml @@ -18,7 +18,7 @@ if-watch = "3.0.1" libp2p-core = { workspace = true } libp2p-swarm = { workspace = true } libp2p-identity = { workspace = true } -log = "0.4.19" +log = "0.4.20" rand = "0.8.3" smallvec = "1.11.0" socket2 = { version = "0.5.3", features = ["all"] } diff --git a/protocols/ping/Cargo.toml b/protocols/ping/Cargo.toml index aebc473512b..f66222efff7 100644 --- a/protocols/ping/Cargo.toml +++ b/protocols/ping/Cargo.toml @@ -18,7 +18,7 @@ instant = "0.1.12" libp2p-core = { workspace = true } libp2p-swarm = { workspace = true } libp2p-identity = { workspace = true } -log = "0.4.19" +log = "0.4.20" rand = "0.8" void = "1.0" diff --git a/protocols/request-response/Cargo.toml b/protocols/request-response/Cargo.toml index ddb87316f86..40e65f1cccc 100644 --- a/protocols/request-response/Cargo.toml +++ b/protocols/request-response/Cargo.toml @@ -23,7 +23,7 @@ serde = { version = "1.0", optional = true} serde_json = { version = "1.0.100", optional = true } smallvec = "1.11.0" void = "1.0.2" -log = "0.4.19" +log = "0.4.20" [features] json = ["dep:serde", "dep:serde_json", "libp2p-swarm/macros"] diff --git a/swarm-test/Cargo.toml b/swarm-test/Cargo.toml index e762183b6be..7b3faa453f5 100644 --- a/swarm-test/Cargo.toml +++ b/swarm-test/Cargo.toml @@ -20,6 +20,6 @@ libp2p-swarm = { workspace = true } libp2p-tcp = { workspace = true, features = ["async-io"] } libp2p-yamux = { workspace = true } futures = "0.3.28" -log = "0.4.19" +log = "0.4.20" rand = "0.8.5" futures-timer = "3.0.2" diff --git a/transports/dns/Cargo.toml b/transports/dns/Cargo.toml index d1afd0411f9..a85307aad32 100644 --- a/transports/dns/Cargo.toml +++ b/transports/dns/Cargo.toml @@ -13,7 +13,7 @@ categories = ["network-programming", "asynchronous"] [dependencies] libp2p-core = { workspace = true } libp2p-identity = { workspace = true } -log = "0.4.19" +log = "0.4.20" futures = "0.3.28" async-std-resolver = { version = "0.22", optional = true } parking_lot = "0.12.0" diff --git a/transports/plaintext/Cargo.toml b/transports/plaintext/Cargo.toml index 6990a846c27..1f15004d3f4 100644 --- a/transports/plaintext/Cargo.toml +++ b/transports/plaintext/Cargo.toml @@ -16,7 +16,7 @@ bytes = "1" futures = "0.3.28" libp2p-core = { workspace = true } libp2p-identity = { workspace = true } -log = "0.4.19" +log = "0.4.20" quick-protobuf = "0.8" unsigned-varint = { version = "0.7", features = ["asynchronous_codec"] } diff --git a/transports/pnet/Cargo.toml b/transports/pnet/Cargo.toml index 11c27266057..831b3f599e7 100644 --- a/transports/pnet/Cargo.toml +++ b/transports/pnet/Cargo.toml @@ -12,7 +12,7 @@ categories = ["network-programming", "asynchronous"] [dependencies] futures = "0.3.28" -log = "0.4.19" +log = "0.4.20" salsa20 = "0.10" sha3 = "0.10" rand = "0.8" diff --git a/transports/tcp/Cargo.toml b/transports/tcp/Cargo.toml index 5103ee9576a..5aa01133335 100644 --- a/transports/tcp/Cargo.toml +++ b/transports/tcp/Cargo.toml @@ -18,7 +18,7 @@ if-watch = "3.0.1" libc = "0.2.147" libp2p-core = { workspace = true } libp2p-identity = { workspace = true } -log = "0.4.19" +log = "0.4.20" socket2 = { version = "0.5.3", features = ["all"] } tokio = { version = "1.31.0", default-features = false, features = ["net"], optional = true } diff --git a/transports/uds/Cargo.toml b/transports/uds/Cargo.toml index a01cc9c6916..269eced5fa3 100644 --- a/transports/uds/Cargo.toml +++ b/transports/uds/Cargo.toml @@ -13,7 +13,7 @@ categories = ["network-programming", "asynchronous"] [dependencies] async-std = { version = "1.6.2", optional = true } libp2p-core = { workspace = true } -log = "0.4.19" +log = "0.4.20" futures = "0.3.28" tokio = { version = "1.31", default-features = false, features = ["net"], optional = true } diff --git a/transports/websocket/Cargo.toml b/transports/websocket/Cargo.toml index 3ebeb83bc16..39a96d69901 100644 --- a/transports/websocket/Cargo.toml +++ b/transports/websocket/Cargo.toml @@ -16,7 +16,7 @@ either = "1.9.0" futures = "0.3.28" libp2p-core = { workspace = true } libp2p-identity = { workspace = true } -log = "0.4.19" +log = "0.4.20" parking_lot = "0.12.0" quicksink = "0.1" rw-stream-sink = { workspace = true } diff --git a/transports/webtransport-websys/Cargo.toml b/transports/webtransport-websys/Cargo.toml index 21ca077fce9..695a62f4cde 100644 --- a/transports/webtransport-websys/Cargo.toml +++ b/transports/webtransport-websys/Cargo.toml @@ -19,7 +19,7 @@ js-sys = "0.3.64" libp2p-core = { workspace = true } libp2p-identity = { workspace = true } libp2p-noise = { workspace = true } -log = "0.4.19" +log = "0.4.20" multiaddr = { workspace = true } multihash = { workspace = true } send_wrapper = { version = "0.6.0", features = ["futures"] } From cbdbaa836e1159fb4e8b20e76c32f1af5ec66926 Mon Sep 17 00:00:00 2001 From: Max Inden Date: Thu, 17 Aug 2023 09:54:29 +0200 Subject: [PATCH 06/11] feat(quic): promote to stable release - Cut a stable release of `libp2p-quic`. - Export `libp2p-quic` as `libp2p::quic`. - Update examples to use `libp2p-quic` through `libp2p`. Pull-Request: #4325. --- Cargo.lock | 9 +++------ Cargo.toml | 2 +- examples/chat-example/Cargo.toml | 3 +-- examples/chat-example/src/main.rs | 3 +-- examples/dcutr/Cargo.toml | 3 +-- examples/dcutr/src/main.rs | 3 +-- examples/relay-server/Cargo.toml | 3 +-- examples/relay-server/src/main.rs | 3 +-- interop-tests/Cargo.toml | 3 +-- interop-tests/src/arch.rs | 3 +-- libp2p/CHANGELOG.md | 4 ++++ libp2p/Cargo.toml | 9 ++++++--- libp2p/src/lib.rs | 3 +++ transports/quic/CHANGELOG.md | 4 ++++ transports/quic/Cargo.toml | 2 +- 15 files changed, 30 insertions(+), 27 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 19c99e8d974..459afe3ece5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -831,7 +831,6 @@ dependencies = [ "env_logger 0.10.0", "futures", "libp2p", - "libp2p-quic", ] [[package]] @@ -1309,7 +1308,6 @@ dependencies = [ "futures", "futures-timer", "libp2p", - "libp2p-quic", "log", ] @@ -2354,7 +2352,6 @@ dependencies = [ "instant", "libp2p", "libp2p-mplex", - "libp2p-quic", "libp2p-webrtc", "log", "mime_guess", @@ -2512,7 +2509,7 @@ checksum = "7fc7aa29613bd6a620df431842069224d8bc9011086b1db4c0e0cd47fa03ec9a" [[package]] name = "libp2p" -version = "0.52.2" +version = "0.52.3" dependencies = [ "async-std", "async-trait", @@ -2543,6 +2540,7 @@ dependencies = [ "libp2p-ping", "libp2p-plaintext", "libp2p-pnet", + "libp2p-quic", "libp2p-relay", "libp2p-rendezvous", "libp2p-request-response", @@ -3058,7 +3056,7 @@ dependencies = [ [[package]] name = "libp2p-quic" -version = "0.9.2-alpha" +version = "0.9.2" dependencies = [ "async-std", "bytes", @@ -4610,7 +4608,6 @@ dependencies = [ "env_logger 0.10.0", "futures", "libp2p", - "libp2p-quic", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index fb503a12e61..03b3833033b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -85,7 +85,7 @@ libp2p-perf = { version = "0.2.0", path = "protocols/perf" } libp2p-ping = { version = "0.43.0", path = "protocols/ping" } libp2p-plaintext = { version = "0.40.0", path = "transports/plaintext" } libp2p-pnet = { version = "0.23.0", path = "transports/pnet" } -libp2p-quic = { version = "0.9.2-alpha", path = "transports/quic" } +libp2p-quic = { version = "0.9.2", path = "transports/quic" } libp2p-relay = { version = "0.16.1", path = "protocols/relay" } libp2p-rendezvous = { version = "0.13.0", path = "protocols/rendezvous" } libp2p-request-response = { version = "0.25.1", path = "protocols/request-response" } diff --git a/examples/chat-example/Cargo.toml b/examples/chat-example/Cargo.toml index 1d865711ea8..cfc417cf3cb 100644 --- a/examples/chat-example/Cargo.toml +++ b/examples/chat-example/Cargo.toml @@ -10,5 +10,4 @@ async-std = { version = "1.12", features = ["attributes"] } async-trait = "0.1" env_logger = "0.10.0" futures = "0.3.28" -libp2p = { path = "../../libp2p", features = ["async-std", "gossipsub", "mdns", "noise", "macros", "tcp", "yamux"] } -libp2p-quic = { path = "../../transports/quic", features = ["async-std"] } +libp2p = { path = "../../libp2p", features = ["async-std", "gossipsub", "mdns", "noise", "macros", "tcp", "yamux", "quic"] } diff --git a/examples/chat-example/src/main.rs b/examples/chat-example/src/main.rs index 9dc2d92a56f..95a16f388d9 100644 --- a/examples/chat-example/src/main.rs +++ b/examples/chat-example/src/main.rs @@ -24,12 +24,11 @@ use async_std::io; use futures::{future::Either, prelude::*, select}; use libp2p::{ core::{muxing::StreamMuxerBox, transport::OrTransport, upgrade}, - gossipsub, identity, mdns, noise, + gossipsub, identity, mdns, noise, quic, swarm::NetworkBehaviour, swarm::{SwarmBuilder, SwarmEvent}, tcp, yamux, PeerId, Transport, }; -use libp2p_quic as quic; use std::collections::hash_map::DefaultHasher; use std::error::Error; use std::hash::{Hash, Hasher}; diff --git a/examples/dcutr/Cargo.toml b/examples/dcutr/Cargo.toml index 38394ee3e2c..7a13dd23910 100644 --- a/examples/dcutr/Cargo.toml +++ b/examples/dcutr/Cargo.toml @@ -10,6 +10,5 @@ clap = { version = "4.3.21", features = ["derive"] } env_logger = "0.10.0" futures = "0.3.28" futures-timer = "3.0" -libp2p = { path = "../../libp2p", features = ["async-std", "dns", "dcutr", "identify", "macros", "noise", "ping", "relay", "rendezvous", "tcp", "tokio", "yamux"] } -libp2p-quic = { path = "../../transports/quic", features = ["async-std"] } +libp2p = { path = "../../libp2p", features = ["async-std", "dns", "dcutr", "identify", "macros", "noise", "ping", "quic", "relay", "rendezvous", "tcp", "tokio", "yamux"] } log = "0.4" diff --git a/examples/dcutr/src/main.rs b/examples/dcutr/src/main.rs index 8359bb1902a..8837df783b4 100644 --- a/examples/dcutr/src/main.rs +++ b/examples/dcutr/src/main.rs @@ -35,11 +35,10 @@ use libp2p::{ }, dcutr, dns::DnsConfig, - identify, identity, noise, ping, relay, + identify, identity, noise, ping, quic, relay, swarm::{NetworkBehaviour, SwarmBuilder, SwarmEvent}, tcp, yamux, PeerId, }; -use libp2p_quic as quic; use log::info; use std::error::Error; use std::str::FromStr; diff --git a/examples/relay-server/Cargo.toml b/examples/relay-server/Cargo.toml index 296b50d31b9..62d3cc0a710 100644 --- a/examples/relay-server/Cargo.toml +++ b/examples/relay-server/Cargo.toml @@ -11,5 +11,4 @@ async-std = { version = "1.12", features = ["attributes"] } async-trait = "0.1" env_logger = "0.10.0" futures = "0.3.28" -libp2p = { path = "../../libp2p", features = ["async-std", "noise", "macros", "ping", "tcp", "identify", "yamux", "relay"] } -libp2p-quic = { path = "../../transports/quic", features = ["async-std"] } +libp2p = { path = "../../libp2p", features = ["async-std", "noise", "macros", "ping", "tcp", "identify", "yamux", "relay", "quic"] } diff --git a/examples/relay-server/src/main.rs b/examples/relay-server/src/main.rs index 6a1d956b5a5..7526a076e92 100644 --- a/examples/relay-server/src/main.rs +++ b/examples/relay-server/src/main.rs @@ -31,11 +31,10 @@ use libp2p::{ core::{Multiaddr, Transport}, identify, identity, identity::PeerId, - noise, ping, relay, + noise, ping, quic, relay, swarm::{NetworkBehaviour, SwarmBuilder, SwarmEvent}, tcp, }; -use libp2p_quic as quic; use std::error::Error; use std::net::{Ipv4Addr, Ipv6Addr}; diff --git a/interop-tests/Cargo.toml b/interop-tests/Cargo.toml index d03c0403f49..1c9ef732e7c 100644 --- a/interop-tests/Cargo.toml +++ b/interop-tests/Cargo.toml @@ -19,8 +19,7 @@ rand = "0.8.5" [target.'cfg(not(target_arch = "wasm32"))'.dependencies] axum = "0.6" -libp2p = { path = "../libp2p", features = ["ping", "noise", "tls", "rsa", "macros", "websocket", "tokio", "yamux", "tcp", "dns", "identify"] } -libp2p-quic = { workspace = true, features = ["tokio"] } +libp2p = { path = "../libp2p", features = ["ping", "noise", "tls", "rsa", "macros", "websocket", "tokio", "yamux", "tcp", "dns", "identify", "quic"] } libp2p-webrtc = { workspace = true, features = ["tokio"] } libp2p-mplex = { path = "../muxers/mplex" } mime_guess = "2.0" diff --git a/interop-tests/src/arch.rs b/interop-tests/src/arch.rs index 2f4a7495a04..2b2181f2459 100644 --- a/interop-tests/src/arch.rs +++ b/interop-tests/src/arch.rs @@ -26,9 +26,8 @@ pub(crate) mod native { use libp2p::identity::Keypair; use libp2p::swarm::{NetworkBehaviour, SwarmBuilder}; 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_quic as quic; use libp2p_webrtc as webrtc; use redis::AsyncCommands; diff --git a/libp2p/CHANGELOG.md b/libp2p/CHANGELOG.md index 50774aaa97f..642d4103729 100644 --- a/libp2p/CHANGELOG.md +++ b/libp2p/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.52.3 - unreleased + +- Add `libp2p-quic` stable release. + ## 0.52.2 - Include gossipsub when compiling for wasm. diff --git a/libp2p/Cargo.toml b/libp2p/Cargo.toml index e057c9e8dd4..f02ec1c6d8a 100644 --- a/libp2p/Cargo.toml +++ b/libp2p/Cargo.toml @@ -3,7 +3,7 @@ name = "libp2p" edition = "2021" rust-version = "1.65.0" description = "Peer-to-peer networking library" -version = "0.52.2" +version = "0.52.3" authors = ["Parity Technologies "] license = "MIT" repository = "https://github.com/libp2p/rust-libp2p" @@ -33,6 +33,7 @@ full = [ "ping", "plaintext", "pnet", + "quic", "relay", "rendezvous", "request-response", @@ -51,7 +52,7 @@ full = [ "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"] cbor = ["libp2p-request-response?/cbor"] dcutr = ["dep:libp2p-dcutr", "libp2p-metrics?/dcutr"] @@ -72,6 +73,7 @@ noise = ["dep:libp2p-noise"] ping = ["dep:libp2p-ping", "libp2p-metrics?/ping"] plaintext = ["dep:libp2p-plaintext"] pnet = ["dep:libp2p-pnet"] +quic = ["dep:libp2p-quic"] relay = ["dep:libp2p-relay", "libp2p-metrics?/relay"] rendezvous = ["dep:libp2p-rendezvous"] request-response = ["dep:libp2p-request-response"] @@ -80,7 +82,7 @@ secp256k1 = ["libp2p-identity/secp256k1"] serde = ["libp2p-core/serde", "libp2p-kad?/serde", "libp2p-gossipsub?/serde"] tcp = ["dep:libp2p-tcp"] 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"] 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"] @@ -127,6 +129,7 @@ libp2p-deflate = { workspace = true, optional = true } libp2p-dns = { workspace = true, optional = true } libp2p-mdns = { 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-tls = { workspace = true, optional = true } libp2p-uds = { workspace = true, optional = true } diff --git a/libp2p/src/lib.rs b/libp2p/src/lib.rs index 9ec1fe48af4..349427ffdfe 100644 --- a/libp2p/src/lib.rs +++ b/libp2p/src/lib.rs @@ -98,6 +98,9 @@ pub use libp2p_plaintext as plaintext; #[cfg(feature = "pnet")] #[doc(inline)] pub use libp2p_pnet as pnet; +#[cfg(feature = "quic")] +#[cfg(not(target_arch = "wasm32"))] +pub use libp2p_quic as quic; #[cfg(feature = "relay")] #[doc(inline)] pub use libp2p_relay as relay; diff --git a/transports/quic/CHANGELOG.md b/transports/quic/CHANGELOG.md index 66a6dec3a2e..c7da2895b58 100644 --- a/transports/quic/CHANGELOG.md +++ b/transports/quic/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.9.2 - unreleased + +- Cut stable release. + ## 0.9.2-alpha - Add support for reusing an existing socket when dialing localhost address. diff --git a/transports/quic/Cargo.toml b/transports/quic/Cargo.toml index 2500e5d7b6f..13fbe9bb3c5 100644 --- a/transports/quic/Cargo.toml +++ b/transports/quic/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "libp2p-quic" -version = "0.9.2-alpha" +version = "0.9.2" authors = ["Parity Technologies "] edition = "2021" rust-version = { workspace = true } From fb61697390081b908e2b79fdcb8b3cc4cf00f5ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Oliveira?= Date: Fri, 18 Aug 2023 09:03:22 +0100 Subject: [PATCH 07/11] deps(identity): update ed25519-dalek to 2.0 Pull-Request: #4337. --- Cargo.lock | 61 +++++++++++++++++---------------- Cargo.toml | 2 +- identity/CHANGELOG.md | 8 +++++ identity/Cargo.toml | 4 +-- identity/src/ed25519.rs | 74 +++++++++++++---------------------------- 5 files changed, 65 insertions(+), 84 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 459afe3ece5..dc4c8439718 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1226,18 +1226,32 @@ dependencies = [ [[package]] name = "curve25519-dalek" -version = "4.0.0-rc.1" +version = "4.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d4ba9852b42210c7538b75484f9daa0655e9a3ac04f693747bb0f02cf3cfe16" +checksum = "f711ade317dd348950a9910f81c5947e3d8907ebd2b83f76203ff1807e6a2bc2" dependencies = [ "cfg-if 1.0.0", + "cpufeatures", + "curve25519-dalek-derive", + "digest 0.10.7", "fiat-crypto", - "packed_simd_2", "platforms", + "rustc_version", "subtle", "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]] name = "darling" version = "0.14.4" @@ -1469,24 +1483,25 @@ dependencies = [ [[package]] name = "ed25519" -version = "1.5.3" +version = "2.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91cff35c70bba8a626e3185d8cd48cc11b5437e1a5bcd15b9b5fa3c64b6dfee7" +checksum = "60f6d271ca33075c88028be6f04d502853d63a5ece419d269c15315d4fc1cf1d" dependencies = [ - "signature 1.6.4", + "pkcs8 0.10.2", + "signature 2.1.0", ] [[package]] name = "ed25519-dalek" -version = "1.0.1" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c762bae6dcaf24c4c84667b8579785430908723d5c889f469d76a41d59cc7a9d" +checksum = "7277392b266383ef8396db7fdeb1e77b6c52fed775f5df15bb24f35b72156980" dependencies = [ - "curve25519-dalek 3.2.0", + "curve25519-dalek 4.0.0", "ed25519", - "rand 0.7.3", + "rand_core 0.6.4", "serde", - "sha2 0.9.9", + "sha2 0.10.7", "zeroize", ] @@ -2501,12 +2516,6 @@ version = "0.2.147" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b4668fb0ea861c1df094127ac5f1da3409a82116a4ba74fca2e58ef927159bb3" -[[package]] -name = "libm" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fc7aa29613bd6a620df431842069224d8bc9011086b1db4c0e0cd47fa03ec9a" - [[package]] name = "libp2p" version = "0.52.3" @@ -2783,7 +2792,7 @@ dependencies = [ [[package]] name = "libp2p-identity" -version = "0.2.2" +version = "0.2.3" dependencies = [ "asn1_der", "base64 0.21.2", @@ -3974,16 +3983,6 @@ dependencies = [ "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]] name = "parking" version = "2.1.0" @@ -5315,14 +5314,14 @@ dependencies = [ [[package]] name = "snow" -version = "0.9.2" +version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ccba027ba85743e09d15c03296797cad56395089b832b48b5a5217880f57733" +checksum = "0c9d1425eb528a21de2755c75af4c9b5d57f50a0d4c3b7f1828a4cd03f8ba155" dependencies = [ "aes-gcm 0.9.2", "blake2", "chacha20poly1305", - "curve25519-dalek 4.0.0-rc.1", + "curve25519-dalek 4.0.0", "rand_core 0.6.4", "ring", "rustc_version", diff --git a/Cargo.toml b/Cargo.toml index 03b3833033b..e42a905bc39 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -73,7 +73,7 @@ libp2p-dns = { version = "0.40.0", path = "transports/dns" } libp2p-floodsub = { version = "0.43.0", path = "protocols/floodsub" } libp2p-gossipsub = { version = "0.45.1", path = "protocols/gossipsub" } 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-mdns = { version = "0.44.0", path = "protocols/mdns" } libp2p-memory-connection-limits = { version = "0.1.0", path = "misc/memory-connection-limits" } diff --git a/identity/CHANGELOG.md b/identity/CHANGELOG.md index bfe46076a3a..b52f001827f 100644 --- a/identity/CHANGELOG.md +++ b/identity/CHANGELOG.md @@ -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 - Implement `from_protobuf_encoding` for RSA `Keypair`. diff --git a/identity/Cargo.toml b/identity/Cargo.toml index 09ba3c155ee..ed74c5e9836 100644 --- a/identity/Cargo.toml +++ b/identity/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "libp2p-identity" -version = "0.2.2" +version = "0.2.3" edition = "2021" description = "Data structures and algorithms for identifying peers in libp2p." rust-version = { workspace = true } @@ -14,7 +14,7 @@ categories = ["cryptography"] [dependencies] asn1_der = { version = "0.7.6", 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 } log = "0.4" multihash = { version = "0.19.0", optional = true } diff --git a/identity/src/ed25519.rs b/identity/src/ed25519.rs index bcd3eb44359..23d11932425 100644 --- a/identity/src/ed25519.rs +++ b/identity/src/ed25519.rs @@ -25,12 +25,12 @@ use core::cmp; use core::fmt; use core::hash; use ed25519_dalek::{self as ed25519, Signer as _, Verifier as _}; -use rand::RngCore; use std::convert::TryFrom; use zeroize::Zeroize; /// An Ed25519 keypair. -pub struct Keypair(ed25519::Keypair); +#[derive(Clone)] +pub struct Keypair(ed25519::SigningKey); impl Keypair { /// Generate a new random Ed25519 keypair. @@ -42,7 +42,7 @@ impl Keypair { /// of the secret scalar and the compressed public point, /// an informal standard for encoding Ed25519 keypairs. 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) @@ -50,7 +50,10 @@ impl Keypair { /// /// 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 { - 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| { kp.zeroize(); Keypair(k) @@ -65,60 +68,41 @@ impl Keypair { /// Get the public key of this keypair. pub fn public(&self) -> PublicKey { - PublicKey(self.0.public) + PublicKey(self.0.verifying_key()) } /// Get the secret key of this keypair. pub fn secret(&self) -> SecretKey { - SecretKey::try_from_bytes(&mut self.0.secret.to_bytes()) - .expect("ed25519::SecretKey::from_bytes(to_bytes(k)) != k") + SecretKey(self.0.to_bytes()) } } impl fmt::Debug for Keypair { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { f.debug_struct("Keypair") - .field("public", &self.0.public) + .field("public", &self.0.verifying_key()) .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. impl From for SecretKey { fn from(kp: Keypair) -> SecretKey { - SecretKey(kp.0.secret) + SecretKey(kp.0.to_bytes()) } } /// Promote an Ed25519 secret key into a keypair. impl From for Keypair { fn from(sk: SecretKey) -> Keypair { - let secret: ed25519::ExpandedSecretKey = (&sk.0).into(); - let public = ed25519::PublicKey::from(&secret); - Keypair(ed25519::Keypair { - secret: sk.0, - public, - }) + let signing = ed25519::SigningKey::from_bytes(&sk.0); + Keypair(signing) } } /// An Ed25519 public key. #[derive(Eq, Clone)] -pub struct PublicKey(ed25519::PublicKey); +pub struct PublicKey(ed25519::VerifyingKey); impl fmt::Debug for PublicKey { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { @@ -170,27 +154,22 @@ impl PublicKey { /// 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 { - 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(PublicKey) } } /// An Ed25519 secret key. +#[derive(Clone)] pub struct SecretKey(ed25519::SecretKey); /// View the bytes of the secret key. impl AsRef<[u8]> for SecretKey { fn as_ref(&self) -> &[u8] { - self.0.as_bytes() - } -} - -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") + &self.0[..] } } @@ -203,13 +182,8 @@ impl fmt::Debug for SecretKey { impl SecretKey { /// Generate a new Ed25519 secret key. pub fn generate() -> SecretKey { - let mut bytes = [0u8; 32]; - rand::thread_rng().fill_bytes(&mut bytes); - SecretKey( - ed25519::SecretKey::from_bytes(&bytes).expect( - "this returns `Err` only if the length is wrong; the length is correct; qed", - ), - ) + let signing = ed25519::SigningKey::generate(&mut rand::rngs::OsRng); + SecretKey(signing.to_bytes()) } /// Try to parse an Ed25519 secret key from a byte slice @@ -218,7 +192,7 @@ impl SecretKey { /// returned. pub fn try_from_bytes(mut sk_bytes: impl AsMut<[u8]>) -> Result { 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))?; sk_bytes.zeroize(); Ok(SecretKey(secret)) @@ -231,7 +205,7 @@ mod tests { use quickcheck::*; 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] @@ -249,7 +223,7 @@ mod tests { fn ed25519_keypair_from_secret() { fn prop() -> bool { 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()); eq_keypairs(&kp1, &kp2) && sk == [0u8; 32] } From 16b2f1563d2d16c4e35cc8c8024dca7764a88598 Mon Sep 17 00:00:00 2001 From: Max Inden Date: Fri, 18 Aug 2023 11:02:22 +0200 Subject: [PATCH 08/11] chore: use workspace `rust-version` Pull-Request: #4344. --- libp2p/Cargo.toml | 2 +- misc/metrics/Cargo.toml | 2 +- protocols/kad/Cargo.toml | 2 +- swarm-test/Cargo.toml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/libp2p/Cargo.toml b/libp2p/Cargo.toml index f02ec1c6d8a..5cb8741afa0 100644 --- a/libp2p/Cargo.toml +++ b/libp2p/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "libp2p" edition = "2021" -rust-version = "1.65.0" +rust-version = { workspace = true } description = "Peer-to-peer networking library" version = "0.52.3" authors = ["Parity Technologies "] diff --git a/misc/metrics/Cargo.toml b/misc/metrics/Cargo.toml index e93d1f663ed..1ea026a9202 100644 --- a/misc/metrics/Cargo.toml +++ b/misc/metrics/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "libp2p-metrics" edition = "2021" -rust-version = "1.65.0" +rust-version = { workspace = true } description = "Metrics for libp2p" version = "0.13.1" authors = ["Max Inden "] diff --git a/protocols/kad/Cargo.toml b/protocols/kad/Cargo.toml index 80e8946f871..fa937033908 100644 --- a/protocols/kad/Cargo.toml +++ b/protocols/kad/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "libp2p-kad" edition = "2021" -rust-version = "1.65.0" +rust-version = { workspace = true } description = "Kademlia protocol for libp2p" version = "0.44.4" authors = ["Parity Technologies "] diff --git a/swarm-test/Cargo.toml b/swarm-test/Cargo.toml index 7b3faa453f5..67753b1c522 100644 --- a/swarm-test/Cargo.toml +++ b/swarm-test/Cargo.toml @@ -2,7 +2,7 @@ name = "libp2p-swarm-test" version = "0.2.0" edition = "2021" -rust-version = "1.65.0" +rust-version = { workspace = true } license = "MIT" description = "Test framework for code building on top of libp2p-swarm" repository = "https://github.com/libp2p/rust-libp2p" From 08292c567e36ab86999f329bfe62908a7781c416 Mon Sep 17 00:00:00 2001 From: Prithvi Shahi Date: Fri, 18 Aug 2023 11:40:42 -0700 Subject: [PATCH 09/11] docs: remove archived `ursa` project from README Pull-Request: #4340. --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index da228391ff1..90e2947e637 100644 --- a/README.md +++ b/README.md @@ -103,4 +103,3 @@ used and maintained by [Actyx](https://www.actyx.com). - [Subspace](https://github.com/subspace/subspace) - Subspace Network reference implementation - [Substrate](https://github.com/paritytech/substrate) - Framework for blockchain innovation, used by [Polkadot](https://www.parity.io/technologies/polkadot/). -- [Ursa](https://github.com/fleek-network/ursa) - Decentralized Content Delivery & Edge Compute. From bf7fe680ac257c70511309c14043cf8d9d2daf3e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Oliveira?= Date: Fri, 18 Aug 2023 20:30:14 +0100 Subject: [PATCH 10/11] refactor(tcp): reducing branching in `Transport::create_socket` Following https://github.com/libp2p/rust-libp2p/pull/4289#discussion_r1285812762, hereby is the PR to also improve the `create_socket` using [`for_addr`](https://docs.rs/socket2/latest/socket2/struct.Domain.html#method.for_address). We also add a test for listening on IPv4 and IPv6 separately. Pull-Request: #4328. --- transports/quic/src/transport.rs | 8 +++-- transports/tcp/src/lib.rs | 55 ++++++++++++++++++++++++++------ 2 files changed, 52 insertions(+), 11 deletions(-) diff --git a/transports/quic/src/transport.rs b/transports/quic/src/transport.rs index 9f025cd63fc..16ffbc5a163 100644 --- a/transports/quic/src/transport.rs +++ b/transports/quic/src/transport.rs @@ -926,17 +926,21 @@ mod tests { let keypair = libp2p_identity::Keypair::generate_ed25519(); let config = Config::new(&keypair); 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 .listen_on( 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(); transport .listen_on( ListenerId::next(), - "/ip6/::/udp/4001/quic-v1".parse().unwrap(), + format!("/ip6/::/udp/{port}/quic-v1").parse().unwrap(), ) .unwrap(); } diff --git a/transports/tcp/src/lib.rs b/transports/tcp/src/lib.rs index b1737cf7bed..5efdf16fff5 100644 --- a/transports/tcp/src/lib.rs +++ b/transports/tcp/src/lib.rs @@ -346,13 +346,12 @@ where } } - fn create_socket(&self, socket_addr: &SocketAddr) -> io::Result { - let domain = if socket_addr.is_ipv4() { - Domain::IPV4 - } else { - Domain::IPV6 - }; - let socket = Socket::new(domain, Type::STREAM, Some(socket2::Protocol::TCP))?; + fn create_socket(&self, socket_addr: SocketAddr) -> io::Result { + let socket = Socket::new( + Domain::for_address(socket_addr), + Type::STREAM, + Some(socket2::Protocol::TCP), + )?; if socket_addr.is_ipv6() { socket.set_only_v6(true)?; } @@ -375,7 +374,7 @@ where id: ListenerId, socket_addr: SocketAddr, ) -> io::Result> { - let socket = self.create_socket(&socket_addr)?; + let socket = self.create_socket(socket_addr)?; socket.bind(&socket_addr.into())?; socket.listen(self.config.backlog as _)?; socket.set_nonblocking(true)?; @@ -476,7 +475,7 @@ where log::debug!("dialing {}", socket_addr); let socket = self - .create_socket(&socket_addr) + .create_socket(socket_addr) .map_err(TransportError::Other)?; 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::())); } } + + #[test] + fn test_listens_ipv4_ipv6_separately() { + fn test() { + let port = { + let listener = TcpListener::bind("127.0.0.1:0").unwrap(); + listener.local_addr().unwrap().port() + }; + let mut tcp = Transport::::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::(); + }) + } + #[cfg(feature = "tokio")] + { + let rt = ::tokio::runtime::Builder::new_current_thread() + .enable_io() + .build() + .unwrap(); + rt.block_on(async { + test::(); + }); + } + } } From ffdd8125b3787dda2236481614104c8a4d52f04a Mon Sep 17 00:00:00 2001 From: Yeray Rodriguez Date: Fri, 18 Aug 2023 21:16:02 +0100 Subject: [PATCH 11/11] docs(readme): add taple to notable users Request to add [TAPLE](https://www.taple.es) Project to rust-libp2p notable users. TAPLE is a permissioned DLT solution for traceability of assets and processes. We use libp2p for the network layer. Pull-Request: #4309. --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 90e2947e637..6bd528fc680 100644 --- a/README.md +++ b/README.md @@ -103,3 +103,4 @@ used and maintained by [Actyx](https://www.actyx.com). - [Subspace](https://github.com/subspace/subspace) - Subspace Network reference implementation - [Substrate](https://github.com/paritytech/substrate) - Framework for blockchain innovation, used by [Polkadot](https://www.parity.io/technologies/polkadot/). +- [Taple](https://github.com/opencanarias/taple-core) - Sustainable DLT for asset and process traceability by [OpenCanarias](https://www.opencanarias.com/en/). \ No newline at end of file