From e3177af8a033bb7da73726a8d4d02eeb296ce4af Mon Sep 17 00:00:00 2001 From: Kasey Date: Tue, 4 Feb 2025 15:25:55 -0500 Subject: [PATCH] chore: upgrade to `iroh@v0.32` and `quinn@v0.13` (#50) --- Cargo.lock | 213 +++++++++++++++++++++++++++++++++++++++------------- Cargo.toml | 6 +- src/main.rs | 9 +-- 3 files changed, 166 insertions(+), 62 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index ca9bbc9..eae9c60 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -449,6 +449,16 @@ dependencies = [ "libc", ] +[[package]] +name = "core-foundation" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b55271e5c8c478ad3f38ad24ef34923091e0548492a266d19b3c0b4d82574c63" +dependencies = [ + "core-foundation-sys", + "libc", +] + [[package]] name = "core-foundation-sys" version = "0.8.7" @@ -1573,12 +1583,13 @@ checksum = "ddc24109865250148c2e0f3d25d4f0f479571723792d3802153c60922a4fb708" [[package]] name = "iroh" -version = "0.31.0" +version = "0.32.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "27ee97c8412bbf06d7c5253c6638a8bac741cb44d405669cedbfd7d47cd68090" +checksum = "ac3a813bde213da0740a28141ea97be251bd8df27f00d9d0938a3d55c0c6e5cb" dependencies = [ "aead", "anyhow", + "atomic-waker", "backoff", "bytes", "concurrent-queue", @@ -1587,9 +1598,6 @@ dependencies = [ "der", "derive_more", "ed25519-dalek", - "futures-buffered", - "futures-lite", - "futures-sink", "futures-util", "governor", "hickory-resolver", @@ -1605,6 +1613,7 @@ dependencies = [ "iroh-quinn-proto", "iroh-quinn-udp", "iroh-relay", + "n0-future", "netdev", "netwatch", "pin-project", @@ -1624,8 +1633,6 @@ dependencies = [ "tokio", "tokio-rustls", "tokio-stream", - "tokio-tungstenite", - "tokio-tungstenite-wasm", "tokio-util", "tracing", "url", @@ -1636,9 +1643,9 @@ dependencies = [ [[package]] name = "iroh-base" -version = "0.31.0" +version = "0.32.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0546d176f79fb63a5efeb8eb8c692c483920e35bd9ba66c028928cf2ca27239b" +checksum = "d56b4a9e4db1e505710d0aaca2afc17dd92aeac2dd06a34ccf9934dab7240bc9" dependencies = [ "curve25519-dalek", "data-encoding", @@ -1673,20 +1680,19 @@ dependencies = [ [[package]] name = "iroh-net-report" -version = "0.31.0" +version = "0.32.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "547eacca10cd072412b04d784336e29c5e81e7ba4fbb9c1ad70777f7874a5d1a" +checksum = "6043244fda74da51f46c6199ff7f7e1c350d58b650e39983ae24ca4cfd46f4be" dependencies = [ "anyhow", "bytes", "derive_more", - "futures-buffered", - "futures-lite", "hickory-resolver", "iroh-base", "iroh-metrics", "iroh-quinn", "iroh-relay", + "n0-future", "netwatch", "portmapper", "rand", @@ -1702,46 +1708,52 @@ dependencies = [ [[package]] name = "iroh-quinn" -version = "0.12.0" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35ba75a5c57cff299d2d7ca1ddee053f66339d1756bd79ec637bcad5aa61100e" +checksum = "76c6245c9ed906506ab9185e8d7f64857129aee4f935e899f398a3bd3b70338d" dependencies = [ "bytes", + "cfg_aliases", "iroh-quinn-proto", "iroh-quinn-udp", "pin-project-lite", "rustc-hash", "rustls", "socket2", - "thiserror 1.0.69", + "thiserror 2.0.11", "tokio", "tracing", + "web-time", ] [[package]] name = "iroh-quinn-proto" -version = "0.12.0" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2c869ba52683d3d067c83ab4c00a2fda18eaf13b1434d4c1352f428674d4a5d" +checksum = "929d5d8fa77d5c304d3ee7cae9aede31f13908bd049f9de8c7c0094ad6f7c535" dependencies = [ "bytes", + "getrandom", "rand", "ring", "rustc-hash", "rustls", + "rustls-pki-types", "rustls-platform-verifier", "slab", - "thiserror 1.0.69", + "thiserror 2.0.11", "tinyvec", "tracing", + "web-time", ] [[package]] name = "iroh-quinn-udp" -version = "0.5.5" +version = "0.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfcfc0abc2fdf8cf18a6c72893b7cbebeac2274a3b1306c1760c48c0e10ac5e0" +checksum = "c53afaa1049f7c83ea1331f5ebb9e6ebc5fdd69c468b7a22dd598b02c9bcc973" dependencies = [ + "cfg_aliases", "libc", "once_cell", "socket2", @@ -1751,20 +1763,15 @@ dependencies = [ [[package]] name = "iroh-relay" -version = "0.31.0" +version = "0.32.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21e4c13758cac9d81a6793b59eba17da2ccbf90a76278ec160d7c8f90b1bb903" +checksum = "b0700bfc2dcd5d6b28a9176dddbc989a6c90b06fc49e9e60069213408450ab47" dependencies = [ "anyhow", "bytes", + "cfg_aliases", "data-encoding", "derive_more", - "futures-buffered", - "futures-lite", - "futures-sink", - "futures-util", - "governor", - "hickory-proto", "hickory-resolver", "http 1.2.0", "http-body-util", @@ -1775,6 +1782,7 @@ dependencies = [ "iroh-quinn", "iroh-quinn-proto", "lru", + "n0-future", "num_enum", "pin-project", "postcard", @@ -1785,10 +1793,8 @@ dependencies = [ "serde", "stun-rs", "thiserror 2.0.11", - "time", "tokio", "tokio-rustls", - "tokio-tungstenite", "tokio-tungstenite-wasm", "tokio-util", "tracing", @@ -1810,16 +1816,18 @@ checksum = "d75a2a4b1b190afb6f5425f10f6a8f959d2ea0b9c2b1d79553551850539e4674" [[package]] name = "jni" -version = "0.19.0" +version = "0.21.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6df18c2e3db7e453d3c6ac5b3e9d5182664d28788126d39b91f2d1e22b017ec" +checksum = "1a87aa2bb7d2af34197c04845522473242e1aa17c12f4935d5856491a7fb8c97" dependencies = [ "cesu8", + "cfg-if", "combine", "jni-sys", "log", "thiserror 1.0.69", "walkdir", + "windows-sys 0.45.0", ] [[package]] @@ -1991,6 +1999,27 @@ dependencies = [ "uuid", ] +[[package]] +name = "n0-future" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "399e11dc3b0e8d9d65b27170d22f5d779d52d9bed888db70d7e0c2c7ce3dfc52" +dependencies = [ + "cfg_aliases", + "derive_more", + "futures-buffered", + "futures-lite", + "futures-util", + "js-sys", + "pin-project", + "send_wrapper", + "tokio", + "tokio-util", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-time", +] + [[package]] name = "nanorand" version = "0.7.0" @@ -3026,12 +3055,11 @@ dependencies = [ [[package]] name = "rustls-native-certs" -version = "0.7.3" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5bfb394eeed242e909609f56089eecfe5fda225042e8b171791b9c95f5931e5" +checksum = "7fcff2dd52b58a8d98a70243663a0d234c4e2b79235637849d15913394a247d3" dependencies = [ "openssl-probe", - "rustls-pemfile", "rustls-pki-types", "schannel", "security-framework", @@ -3057,11 +3085,11 @@ dependencies = [ [[package]] name = "rustls-platform-verifier" -version = "0.3.4" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "afbb878bdfdf63a336a5e63561b1835e7a8c91524f51621db870169eac84b490" +checksum = "e012c45844a1790332c9386ed4ca3a06def221092eda277e6f079728f8ea99da" dependencies = [ - "core-foundation", + "core-foundation 0.10.0", "core-foundation-sys", "jni", "log", @@ -3072,8 +3100,8 @@ dependencies = [ "rustls-webpki", "security-framework", "security-framework-sys", - "webpki-roots", - "winapi", + "webpki-root-certs", + "windows-sys 0.52.0", ] [[package]] @@ -3146,15 +3174,14 @@ checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" [[package]] name = "security-framework" -version = "2.11.1" +version = "3.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02" +checksum = "271720403f46ca04f7ba6f55d438f8bd878d6b8ca0a1046e8228c4145bcbb316" dependencies = [ "bitflags 2.7.0", - "core-foundation", + "core-foundation 0.10.0", "core-foundation-sys", "libc", - "num-bigint", "security-framework-sys", ] @@ -3180,6 +3207,12 @@ version = "1.0.24" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3cb6eb87a131f756572d7fb904f6e7b68633f09cca868c5df1c4b8d1a694bbba" +[[package]] +name = "send_wrapper" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd0b0ec5f1c1ca621c432a25813d8d60c88abe6d3e08a3eb9cf37d97a0fe3d73" + [[package]] name = "serde" version = "1.0.217" @@ -3519,7 +3552,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3c879d448e9d986b661742763247d3693ed13609438cf3d006f51f5368a5ba6b" dependencies = [ "bitflags 2.7.0", - "core-foundation", + "core-foundation 0.9.4", "system-configuration-sys", ] @@ -3697,9 +3730,9 @@ dependencies = [ [[package]] name = "tokio-tungstenite" -version = "0.21.0" +version = "0.24.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c83b561d025642014097b66e6c1bb422783339e0909e4429cde4749d1990bc38" +checksum = "edc5f74e248dc973e0dbb7b74c7e0d6fcc301c694ff50049504004ef4d0cdcd9" dependencies = [ "futures-util", "log", @@ -3709,9 +3742,9 @@ dependencies = [ [[package]] name = "tokio-tungstenite-wasm" -version = "0.3.1" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e57a65894797a018b28345fa298a00c450a574aa9671e50b18218a6292a55ac" +checksum = "e21a5c399399c3db9f08d8297ac12b500e86bca82e930253fdc62eaf9c0de6ae" dependencies = [ "futures-channel", "futures-util", @@ -3854,9 +3887,9 @@ checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" [[package]] name = "tungstenite" -version = "0.21.0" +version = "0.24.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ef1a641ea34f399a848dea702823bbecfb4c486f911735368f1f137cb8257e1" +checksum = "18e5b8366ee7a95b16d32197d0b2604b43a0be89dc5fac9f8e96ccafbaedda8a" dependencies = [ "byteorder", "bytes", @@ -3867,7 +3900,6 @@ dependencies = [ "rand", "sha1", "thiserror 1.0.69", - "url", "utf-8", ] @@ -4117,6 +4149,15 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "webpki-root-certs" +version = "0.26.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09aed61f5e8d2c18344b3faa33a4c837855fe56642757754775548fee21386c4" +dependencies = [ + "rustls-pki-types", +] + [[package]] name = "webpki-roots" version = "0.26.7" @@ -4256,6 +4297,15 @@ dependencies = [ "windows-targets 0.52.6", ] +[[package]] +name = "windows-sys" +version = "0.45.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0" +dependencies = [ + "windows-targets 0.42.2", +] + [[package]] name = "windows-sys" version = "0.48.0" @@ -4283,6 +4333,21 @@ dependencies = [ "windows-targets 0.52.6", ] +[[package]] +name = "windows-targets" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e5180c00cd44c9b1c88adb3693291f1cd93605ded80c250a75d472756b4d071" +dependencies = [ + "windows_aarch64_gnullvm 0.42.2", + "windows_aarch64_msvc 0.42.2", + "windows_i686_gnu 0.42.2", + "windows_i686_msvc 0.42.2", + "windows_x86_64_gnu 0.42.2", + "windows_x86_64_gnullvm 0.42.2", + "windows_x86_64_msvc 0.42.2", +] + [[package]] name = "windows-targets" version = "0.48.5" @@ -4314,6 +4379,12 @@ dependencies = [ "windows_x86_64_msvc 0.52.6", ] +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" + [[package]] name = "windows_aarch64_gnullvm" version = "0.48.5" @@ -4326,6 +4397,12 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" +[[package]] +name = "windows_aarch64_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" + [[package]] name = "windows_aarch64_msvc" version = "0.48.5" @@ -4338,6 +4415,12 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" +[[package]] +name = "windows_i686_gnu" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" + [[package]] name = "windows_i686_gnu" version = "0.48.5" @@ -4356,6 +4439,12 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" +[[package]] +name = "windows_i686_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" + [[package]] name = "windows_i686_msvc" version = "0.48.5" @@ -4368,6 +4457,12 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" +[[package]] +name = "windows_x86_64_gnu" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" + [[package]] name = "windows_x86_64_gnu" version = "0.48.5" @@ -4380,6 +4475,12 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" + [[package]] name = "windows_x86_64_gnullvm" version = "0.48.5" @@ -4392,6 +4493,12 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" +[[package]] +name = "windows_x86_64_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" + [[package]] name = "windows_x86_64_msvc" version = "0.48.5" diff --git a/Cargo.toml b/Cargo.toml index 8f77204..34ec423 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -17,9 +17,9 @@ rust-version = "1.81" anyhow = "1.0.75" clap = { version = "4.4.10", features = ["derive"] } hex = "0.4.3" -iroh = { version = "0.31", default-features = false } -iroh-base = { version = "0.31", features = ["ticket"] } -quinn = { version = "0.12", package = "iroh-quinn" } +iroh = { version = "0.32", default-features = false } +iroh-base = { version = "0.32", features = ["ticket"] } +quinn = { version = "0.13", package = "iroh-quinn" } rand = "0.8.5" tokio = { version = "1.34.0", features = ["full"] } tokio-util = "0.7.10" diff --git a/src/main.rs b/src/main.rs index 68a2cf9..c1f3f49 100644 --- a/src/main.rs +++ b/src/main.rs @@ -2,10 +2,7 @@ use anyhow::Context; use clap::{Parser, Subcommand}; use dumbpipe::NodeTicket; -use iroh::{ - endpoint::{get_remote_node_id, Connecting}, - Endpoint, NodeAddr, SecretKey, -}; +use iroh::{endpoint::Connecting, Endpoint, NodeAddr, SecretKey}; use std::{ io, net::{SocketAddr, SocketAddrV4, SocketAddrV6, ToSocketAddrs}, @@ -305,7 +302,7 @@ async fn listen_stdio(args: ListenArgs) -> anyhow::Result<()> { continue; } }; - let remote_node_id = get_remote_node_id(&connection)?; + let remote_node_id = &connection.remote_node_id()?; tracing::info!("got connection from {}", remote_node_id); let (s, mut r) = match connection.accept_bi().await { Ok(x) => x, @@ -484,7 +481,7 @@ async fn listen_tcp(args: ListenTcpArgs) -> anyhow::Result<()> { handshake: bool, ) -> anyhow::Result<()> { let connection = connecting.await.context("error accepting connection")?; - let remote_node_id = get_remote_node_id(&connection)?; + let remote_node_id = &connection.remote_node_id()?; tracing::info!("got connection from {}", remote_node_id); let (s, mut r) = connection .accept_bi()