diff --git a/Cargo.lock b/Cargo.lock index f96303c08..be6a17342 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -182,7 +182,7 @@ checksum = "965c2d33e53cb6b267e148a4cb0760bc01f4904c1cd4bb4002a085bb016d1490" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.98", "synstructure", ] @@ -194,7 +194,7 @@ checksum = "7b18050c2cd6fe86c3a76584ef5e0baf286d038cda203eb6223df2cc413565f7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.98", ] [[package]] @@ -217,18 +217,18 @@ checksum = "3b43422f69d8ff38f95f1b2bb76517c91589a924d1559a0e935d7c8ce0274c11" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.98", ] [[package]] name = "async-trait" -version = "0.1.85" +version = "0.1.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f934833b4b7233644e5848f235df3f57ed8c80f1528a26c3dfa13d2147fa056" +checksum = "644dd749086bf3771a2fbc5f256fdb982d53f011c7d5d560304eafeecebce79d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.98", ] [[package]] @@ -325,7 +325,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b62ddb9cb1ec0a098ad4bbf9344d0713fa193ae1a80af55febcff2627b6a00c1" dependencies = [ "futures-core", - "getrandom", + "getrandom 0.2.15", "instant", "pin-project-lite", "rand", @@ -426,15 +426,15 @@ dependencies = [ [[package]] name = "bounded-integer" -version = "0.5.7" +version = "0.5.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78a6932c88f1d2c29533a3b8a5f5a2f84cc19c3339b431677c3160c5c2e6ca85" +checksum = "102dbef1187b1893e6dfe05a774e79fd52265f49f214f6879c8ff49f52c8188b" [[package]] name = "bumpalo" -version = "3.16.0" +version = "3.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" +checksum = "1628fb46dfa0b37568d12e5edd512553eccf6a22a78e8bde00bb4aed84d5bdbf" [[package]] name = "byteorder" @@ -444,9 +444,9 @@ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" -version = "1.9.0" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "325918d6fe32f23b19878fe4b34794ae41fc19ddbe53b10571a4874d44ffd39b" +checksum = "f61dac84819c6588b558454b194026eb1f09c293b9036ae9b159e74e73ab6cf9" dependencies = [ "serde", ] @@ -484,9 +484,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.2.9" +version = "1.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8293772165d9345bdaaa39b45b2109591e63fe5e6fbc23c6ff930a048aa310b" +checksum = "755717a7de9ec452bf7f3f1a3099085deabd7f2962b861dae91ecd7a365903d2" dependencies = [ "shlex", ] @@ -548,9 +548,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.5.26" +version = "4.5.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8eb5e908ef3a6efbe1ed62520fb7287959888c88485abe072543190ecc66783" +checksum = "3e77c3243bd94243c03672cb5154667347c457ca271254724f9f393aee1c05ff" dependencies = [ "clap_builder", "clap_derive", @@ -558,9 +558,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.26" +version = "4.5.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96b01801b5fc6a0a232407abc821660c9c6d25a1cafc0d4f85f29fb8d9afc121" +checksum = "1b26884eb4b57140e4d2d93652abfa49498b938b3c9179f9fc487b0acc3edad7" dependencies = [ "anstream", "anstyle", @@ -570,14 +570,14 @@ dependencies = [ [[package]] name = "clap_derive" -version = "4.5.24" +version = "4.5.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54b755194d6389280185988721fffba69495eed5ee9feeee9a599b53db80318c" +checksum = "bf4ced95c6f4a675af3da73304b9ac4ed991640c36374e4b46795c49e17cf1ed" dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.98", ] [[package]] @@ -662,6 +662,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" @@ -670,9 +680,9 @@ checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" [[package]] name = "cpufeatures" -version = "0.2.16" +version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16b80225097f2e5ae4e7179dd2266824648f3e2f49d9134d584b76389d31c4c3" +checksum = "59ed5838eebb26a2bb2e58f6d5b5316989ae9d08bab10e0e6d103e656d1b0280" dependencies = [ "libc", ] @@ -803,7 +813,7 @@ checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.98", ] [[package]] @@ -859,7 +869,7 @@ checksum = "8034092389675178f570469e6c3b0465d3d30b4505c294a6550db47f3c17ad18" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.98", ] [[package]] @@ -888,7 +898,7 @@ checksum = "cb7330aeadfbe296029522e6c40f315320aba36fc43a5b3632f3795348f3bd22" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.98", "unicode-xid", ] @@ -918,7 +928,7 @@ checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.98", ] [[package]] @@ -947,12 +957,6 @@ version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dcbb2bf8e87535c23f7a8a321e364ce21462d0ff10cb6407820e8e96dfff6653" -[[package]] -name = "dyn-clone" -version = "1.0.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d6ef0072f8a535281e4876be788938b528e9a1d43900b82c2569af7da799125" - [[package]] name = "ecdsa" version = "0.16.9" @@ -1039,27 +1043,27 @@ dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.98", ] [[package]] name = "enumflags2" -version = "0.7.10" +version = "0.7.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d232db7f5956f3f14313dc2f87985c58bd2c695ce124c8cdd984e08e15ac133d" +checksum = "ba2f4b465f5318854c6f8dd686ede6c0a9dc67d4b1ac241cf0eb51521a309147" dependencies = [ "enumflags2_derive", ] [[package]] name = "enumflags2_derive" -version = "0.7.10" +version = "0.7.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de0d48a183585823424a4ce1aa132d174a6a81bd540895822eb4c8373a8e49e8" +checksum = "fc4caf64a58d7a6d65ab00639b046ff54399a39f5f2554728895ace4b297cd79" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.98", ] [[package]] @@ -1256,7 +1260,7 @@ checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.98", ] [[package]] @@ -1372,10 +1376,22 @@ dependencies = [ "cfg-if", "js-sys", "libc", - "wasi", + "wasi 0.11.0+wasi-snapshot-preview1", "wasm-bindgen", ] +[[package]] +name = "getrandom" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43a49c392881ce6d5c3b8cb70f98717b7c07aabbdff06687b9030dbfbe2725f8" +dependencies = [ + "cfg-if", + "libc", + "wasi 0.13.3+wasi-0.2.2", + "windows-targets 0.52.6", +] + [[package]] name = "gimli" version = "0.31.1" @@ -1644,9 +1660,9 @@ dependencies = [ [[package]] name = "httparse" -version = "1.9.5" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d71d3574edd2771538b901e6549113b4006ece66150fb69c0fb6d9a2adae946" +checksum = "f2d708df4e7140240a16cd6ab0ab65c972d7433ab77819ea693fde9c43811e2a" [[package]] name = "httpdate" @@ -1656,9 +1672,9 @@ checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" [[package]] name = "hyper" -version = "1.5.2" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "256fb8d4bd6413123cc9d91832d78325c48ff41677595be797d90f42969beae0" +checksum = "cc2b571658e38e0c01b1fdca3bbbe93c00d3d71693ff2770043f8c29bc7d6f80" dependencies = [ "bytes", "futures-channel", @@ -1850,7 +1866,7 @@ checksum = "1ec89e9337638ecdc08744df490b221a7399bf8d164eb52a665454e60e075ad6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.98", ] [[package]] @@ -1897,9 +1913,9 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.7.0" +version = "2.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62f822373a4fe84d4bb149bf54e584a7f4abec90e072ed49cda0edea5b95471f" +checksum = "8c9c992b02b5b4c94ea26e32fe5bccb7aa7d9f390ab5c1221ff895bc7ea8b652" dependencies = [ "equivalent", "hashbrown 0.15.2", @@ -1907,9 +1923,9 @@ dependencies = [ [[package]] name = "indicatif" -version = "0.17.9" +version = "0.17.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cbf675b85ed934d3c67b5c5469701eec7db22689d0a2139d856e0925fa28b281" +checksum = "183b3088984b400f4cfac3620d5e076c84da5364016b4f49473de574b2586235" dependencies = [ "console", "number_prefix", @@ -1959,18 +1975,19 @@ dependencies = [ [[package]] name = "ipnet" -version = "2.10.1" +version = "2.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ddc24109865250148c2e0f3d25d4f0f479571723792d3802153c60922a4fb708" +checksum = "469fb0b9cefa57e3ef31275ee7cacb78f2fdca44e4765491884a2b119d4eb130" [[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", "axum", "backoff", "bytes", @@ -1980,9 +1997,6 @@ dependencies = [ "der", "derive_more", "ed25519-dalek", - "futures-buffered", - "futures-lite", - "futures-sink", "futures-util", "governor", "hickory-resolver", @@ -1998,6 +2012,7 @@ dependencies = [ "iroh-quinn-proto", "iroh-quinn-udp", "iroh-relay", + "n0-future", "netdev", "netwatch", "pin-project", @@ -2018,8 +2033,6 @@ dependencies = [ "tokio", "tokio-rustls", "tokio-stream", - "tokio-tungstenite", - "tokio-tungstenite-wasm", "tokio-util", "tracing", "url", @@ -2030,15 +2043,15 @@ 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", "derive_more", "ed25519-dalek", - "getrandom", + "getrandom 0.2.15", "postcard", "rand_core", "serde", @@ -2086,7 +2099,6 @@ dependencies = [ "iroh-io", "iroh-metrics", "iroh-quinn", - "iroh-test", "nested_enum_utils", "num_cpus", "oneshot", @@ -2094,7 +2106,7 @@ dependencies = [ "portable-atomic", "postcard", "proptest", - "quic-rpc 0.18.0", + "quic-rpc 0.18.1", "quic-rpc-derive", "rand", "range-collections", @@ -2119,6 +2131,7 @@ dependencies = [ "tracing", "tracing-futures", "tracing-subscriber", + "tracing-test", "walkdir", ] @@ -2156,20 +2169,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", @@ -2185,46 +2197,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 0.2.15", "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", @@ -2234,20 +2252,17 @@ 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", "clap", "dashmap", "data-encoding", "derive_more", - "futures-buffered", - "futures-lite", - "futures-sink", - "futures-util", "governor", "hickory-proto", "hickory-resolver", @@ -2260,6 +2275,7 @@ dependencies = [ "iroh-quinn", "iroh-quinn-proto", "lru", + "n0-future", "num_enum", "pin-project", "postcard", @@ -2276,7 +2292,6 @@ dependencies = [ "serde", "stun-rs", "thiserror 2.0.11", - "time", "tokio", "tokio-rustls", "tokio-rustls-acme", @@ -2290,18 +2305,6 @@ dependencies = [ "webpki-roots", ] -[[package]] -name = "iroh-test" -version = "0.31.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aca0e7c59e447ab8ced8cd4841d95fe13ed44dce203c6ece1a963cf1be2aed25" -dependencies = [ - "anyhow", - "tokio", - "tracing", - "tracing-subscriber", -] - [[package]] name = "is_terminal_polyfill" version = "1.70.1" @@ -2316,16 +2319,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]] @@ -2434,26 +2439,6 @@ dependencies = [ "hashbrown 0.15.2", ] -[[package]] -name = "mainline" -version = "2.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b751ffb57303217bcae8f490eee6044a5b40eadf6ca05ff476cad37e7b7970d" -dependencies = [ - "bytes", - "crc", - "ed25519-dalek", - "flume", - "lru", - "rand", - "serde", - "serde_bencode", - "serde_bytes", - "sha1_smol", - "thiserror 1.0.69", - "tracing", -] - [[package]] name = "match_cfg" version = "0.1.0" @@ -2515,7 +2500,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2886843bf800fba2e3377cff24abf6379b4c4d5c6681eaf9ea5b0d15090450bd" dependencies = [ "libc", - "wasi", + "wasi 0.11.0+wasi-snapshot-preview1", "windows-sys 0.52.0", ] @@ -2538,13 +2523,34 @@ 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" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6a51313c5820b0b02bd422f4b44776fbf47961755c74ce64afc73bfad10226c3" dependencies = [ - "getrandom", + "getrandom 0.2.15", ] [[package]] @@ -2629,17 +2635,16 @@ dependencies = [ [[package]] name = "netlink-proto" -version = "0.11.3" +version = "0.11.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86b33524dc0968bfad349684447bfce6db937a9ac3332a1fe60c0c5a5ce63f21" +checksum = "72452e012c2f8d612410d89eea01e2d9b56205274abb35d53f60200b2ec41d60" dependencies = [ "bytes", "futures", "log", "netlink-packet-core", "netlink-sys", - "thiserror 1.0.69", - "tokio", + "thiserror 2.0.11", ] [[package]] @@ -2848,7 +2853,7 @@ dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.98", ] [[package]] @@ -2883,9 +2888,9 @@ checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" [[package]] name = "oneshot" -version = "0.1.8" +version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e296cf87e61c9cfc1a61c3c63a0f7f286ed4554e0e22be84e8a38e1d264a2a29" +checksum = "79d72a7c0f743d2ebb0a2ad1d219db75fdc799092ed3a884c9144c42a31225bd" [[package]] name = "opaque-debug" @@ -2895,9 +2900,9 @@ checksum = "c08d65885ee38876c4f86fa503fb49d7b507c2b62552df7c70b2fce627e06381" [[package]] name = "openssl-probe" -version = "0.1.5" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" +checksum = "d05e27ee213611ffe7d6348b942e8f942b37114c00cc03cec254295a4a17852e" [[package]] name = "overload" @@ -3034,7 +3039,7 @@ dependencies = [ "pest_meta", "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.98", ] [[package]] @@ -3050,22 +3055,22 @@ dependencies = [ [[package]] name = "pin-project" -version = "1.1.8" +version = "1.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e2ec53ad785f4d35dac0adea7f7dc6f1bb277ad84a680c7afefeae05d1f5916" +checksum = "dfe2e71e1471fe07709406bf725f710b02927c9c54b2b5b2ec0e8087d97c327d" dependencies = [ "pin-project-internal", ] [[package]] name = "pin-project-internal" -version = "1.1.8" +version = "1.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d56a66c0c55993aa927429d0f8a0abfd74f084e4d9c192cffed01e418d83eefb" +checksum = "f6e859e6e5bd50440ab63c47e3ebabc90f26251f7c73c3d3e837b74a1cc3fa67" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.98", ] [[package]] @@ -3088,13 +3093,11 @@ checksum = "92eff194c72f00f3076855b413ad2d940e3a6e307fa697e5c7733e738341aed4" dependencies = [ "bytes", "document-features", - "dyn-clone", "ed25519-dalek", "flume", "futures", "js-sys", "lru", - "mainline", "self_cell", "simple-dns", "thiserror 2.0.11", @@ -3145,7 +3148,7 @@ dependencies = [ "proc-macro2", "quote", "regex", - "syn 2.0.96", + "syn 2.0.98", ] [[package]] @@ -3378,7 +3381,7 @@ checksum = "440f724eba9f6996b75d63681b0a92b06947f1457076d503a4d2e2c8f56442b8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.98", ] [[package]] @@ -3411,7 +3414,7 @@ dependencies = [ "libc", "once_cell", "raw-cpuid", - "wasi", + "wasi 0.11.0+wasi-snapshot-preview1", "web-sys", "winapi", ] @@ -3440,9 +3443,9 @@ dependencies = [ [[package]] name = "quic-rpc" -version = "0.18.0" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc1e89cb44e77e732e6220d5184dfa8d1771614a7df7fd6c1258b4e4f444c9fb" +checksum = "09b61cd874b52a79146069fc15456f5cf7abafea818e2fdd828598456349d6a4" dependencies = [ "anyhow", "bytes", @@ -3509,7 +3512,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a2fe5ef3495d7d2e377ff17b1a8ce2ee2ec2a18cde8b6ad6619d65d0701c135d" dependencies = [ "bytes", - "getrandom", + "getrandom 0.2.15", "rand", "ring", "rustc-hash", @@ -3582,7 +3585,7 @@ version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" dependencies = [ - "getrandom", + "getrandom 0.2.15", ] [[package]] @@ -3663,16 +3666,17 @@ checksum = "bcc303e793d3734489387d205e9b186fac9c6cfacedd98cbb2e8a5943595f3e6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.98", ] [[package]] name = "reflink-copy" -version = "0.1.22" +version = "0.1.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a7aea22fc8204e0f291719120cbcdae4f25f0807d7b00f5b6b27d95a8f1a2ad" +checksum = "fbd3533fd4222b8337470456ea84d80436b4c91c53db51c372461d5f7e6eb0b4" dependencies = [ "cfg-if", + "libc", "rustix", "windows 0.59.0", ] @@ -3815,7 +3819,7 @@ checksum = "c17fa4cb658e3583423e915b9f3acc01cceaee1860e33d59ebae66adc3a2dc0d" dependencies = [ "cc", "cfg-if", - "getrandom", + "getrandom 0.2.15", "libc", "spin", "untrusted", @@ -3911,9 +3915,9 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.43" +version = "0.38.44" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a78891ee6bf2340288408954ac787aa063d8e8817e9f53abb37c695c6d834ef6" +checksum = "fdb5bc1ae2baa591800df16c9ca78619bf65c0488b41b96ccec5d11220d8c154" dependencies = [ "bitflags 2.8.0", "errno", @@ -3924,9 +3928,9 @@ dependencies = [ [[package]] name = "rustls" -version = "0.23.21" +version = "0.23.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f287924602bf649d949c63dc8ac8b235fa5387d394020705b80c4eb597ce5b8" +checksum = "9fb9263ab4eb695e42321db096e3b8fbd715a59b154d5c88d82db2175b681ba7" dependencies = [ "log", "once_cell", @@ -3974,12 +3978,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", @@ -3996,20 +3999,20 @@ dependencies = [ [[package]] name = "rustls-pki-types" -version = "1.10.1" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2bf47e6ff922db3825eb750c4e2ff784c6ff8fb9e13046ef6a1d1c5401b0b37" +checksum = "917ce264624a4b4db1c364dcc35bfca9ded014d0a958cd47ad3e960e988ea51c" dependencies = [ "web-time", ] [[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", @@ -4020,8 +4023,8 @@ dependencies = [ "rustls-webpki", "security-framework", "security-framework-sys", - "webpki-roots", - "winapi", + "webpki-root-certs", + "windows-sys 0.52.0", ] [[package]] @@ -4061,9 +4064,9 @@ dependencies = [ [[package]] name = "ryu" -version = "1.0.18" +version = "1.0.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" +checksum = "6ea1a2d0a644769cc99faa24c3ad26b379b786fe7c36fd3c546254801650e6dd" [[package]] name = "salsa20" @@ -4120,15 +4123,14 @@ dependencies = [ [[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.8.0", - "core-foundation", + "core-foundation 0.10.0", "core-foundation-sys", "libc", - "num-bigint", "security-framework-sys", ] @@ -4150,13 +4152,19 @@ checksum = "c2fdfc24bc566f839a2da4c4295b82db7d25a24253867d5c64355abb5799bdbe" [[package]] name = "semver" -version = "1.0.24" +version = "1.0.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3cb6eb87a131f756572d7fb904f6e7b68633f09cca868c5df1c4b8d1a694bbba" +checksum = "f79dfe2d285b0488816f30e700a7438c5a73d816b5b7d3ac72fbc48b0d185e03" dependencies = [ "serde", ] +[[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" @@ -4175,25 +4183,6 @@ dependencies = [ "serde", ] -[[package]] -name = "serde_bencode" -version = "0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a70dfc7b7438b99896e7f8992363ab8e2c4ba26aa5ec675d32d1c3c2c33d413e" -dependencies = [ - "serde", - "serde_bytes", -] - -[[package]] -name = "serde_bytes" -version = "0.11.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "387cc504cb06bb40a96c8e04e951fe01854cf6bc921053c954e4a606d9675c6a" -dependencies = [ - "serde", -] - [[package]] name = "serde_derive" version = "1.0.217" @@ -4202,14 +4191,14 @@ checksum = "5a9bf7cf98d04a2b28aead066b7496853d4779c9cc183c440dbac457641e19a0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.98", ] [[package]] name = "serde_json" -version = "1.0.135" +version = "1.0.138" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b0d7ba2887406110130a978386c4e1befb98c674b4fba677954e4db976630d9" +checksum = "d434192e7da787e94a6ea7e9670b26a036d0ca41e0b7efb2676dd32bae872949" dependencies = [ "itoa", "memchr", @@ -4278,12 +4267,6 @@ dependencies = [ "digest", ] -[[package]] -name = "sha1_smol" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbfa15b3dddfee50a0fff136974b3e1bde555604ba463834a7eb7deb6417705d" - [[package]] name = "sha2" version = "0.10.8" @@ -4331,9 +4314,9 @@ dependencies = [ [[package]] name = "simple-dns" -version = "0.9.2" +version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84330be8d9f218c15b4583c74d809643fb82bdcbbd48302a36469ea5b63a1d69" +checksum = "dee851d0e5e7af3721faea1843e8015e820a234f81fda3dea9247e15bac9a86a" dependencies = [ "bitflags 2.8.0", ] @@ -4474,7 +4457,7 @@ dependencies = [ "proc-macro2", "quote", "struct_iterable_internal", - "syn 2.0.96", + "syn 2.0.98", ] [[package]] @@ -4502,7 +4485,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.96", + "syn 2.0.98", ] [[package]] @@ -4579,9 +4562,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.96" +version = "2.0.98" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5d0adab1ae378d7f53bdebc67a39f1f151407ef230f0ce2883572f5d8985c80" +checksum = "36147f1a48ae0ec2b5b3bc5b537d267457555a10dc06f3dbc8cb11ba3006d3b1" dependencies = [ "proc-macro2", "quote", @@ -4616,7 +4599,7 @@ checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.98", ] [[package]] @@ -4640,7 +4623,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3c879d448e9d986b661742763247d3693ed13609438cf3d006f51f5368a5ba6b" dependencies = [ "bitflags 2.8.0", - "core-foundation", + "core-foundation 0.9.4", "system-configuration-sys", ] @@ -4662,13 +4645,13 @@ checksum = "7b2093cf4c8eb1e67749a6762251bc9cd836b6fc171623bd0a9d324d37af2417" [[package]] name = "tempfile" -version = "3.15.0" +version = "3.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a8a559c81686f576e8cd0290cd2a24a2a9ad80c98b3478856500fcbd7acd704" +checksum = "38c246215d7d24f48ae091a2902398798e05d978b24315d6efbc00ede9a8bb91" dependencies = [ "cfg-if", "fastrand", - "getrandom", + "getrandom 0.3.1", "once_cell", "rustix", "windows-sys 0.59.0", @@ -4721,7 +4704,7 @@ checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.98", ] [[package]] @@ -4732,7 +4715,7 @@ checksum = "26afc1baea8a989337eeb52b6e72a039780ce45c3edfcc9c5b9d112feeb173c2" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.98", ] [[package]] @@ -4811,7 +4794,6 @@ dependencies = [ "bytes", "libc", "mio", - "parking_lot", "pin-project-lite", "signal-hook-registry", "socket2", @@ -4827,7 +4809,7 @@ checksum = "6e06d43f1345a3bcd39f6a56dbb7dcab2ba47e68e8ac134855e7e2bdbaf8cab8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.98", ] [[package]] @@ -4893,9 +4875,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", @@ -4905,9 +4887,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", @@ -4960,9 +4942,9 @@ dependencies = [ [[package]] name = "toml_edit" -version = "0.22.22" +version = "0.22.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ae48d6208a266e853d946088ed816055e556cc6028c5e8e2b84d9fa5dd7c7f5" +checksum = "02a8b472d1a3d7c18e2d61a489aee3453fd9031c33e4f55bd533f4a7adca1bee" dependencies = [ "indexmap", "serde", @@ -5019,7 +5001,7 @@ checksum = "395ae124c09f9e6918a2310af6038fba074bcf474ac352496d5910dd59a2226d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.98", ] [[package]] @@ -5071,6 +5053,27 @@ dependencies = [ "tracing-log", ] +[[package]] +name = "tracing-test" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "557b891436fe0d5e0e363427fc7f217abf9ccd510d5136549847bdcbcd011d68" +dependencies = [ + "tracing-core", + "tracing-subscriber", + "tracing-test-macro", +] + +[[package]] +name = "tracing-test-macro" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04659ddb06c87d233c566112c1c9c5b9e98256d9af50ec3bc9c8327f873a7568" +dependencies = [ + "quote", + "syn 2.0.98", +] + [[package]] name = "try-lock" version = "0.2.5" @@ -5079,9 +5082,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", @@ -5092,7 +5095,6 @@ dependencies = [ "rand", "sha1", "thiserror 1.0.69", - "url", "utf-8", ] @@ -5125,9 +5127,9 @@ checksum = "eaea85b334db583fe3274d12b4cd1880032beab409c0d774be044d4480ab9a94" [[package]] name = "unicode-ident" -version = "1.0.14" +version = "1.0.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adb9e6ca4f869e1180728b7950e35922a7fc6397f7b641499e8f3ef06e50dc83" +checksum = "a210d160f08b701c8721ba1c726c11662f877ea6b7094007e1ca9a1041945034" [[package]] name = "unicode-normalization" @@ -5219,18 +5221,18 @@ checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" [[package]] name = "uuid" -version = "1.12.0" +version = "1.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "744018581f9a3454a9e15beb8a33b017183f1e7c0cd170232a2d1453b23a51c4" +checksum = "b3758f5e68192bb96cc8f9b7e2c2cfdabb435499a28499a42f8f984092adad4b" dependencies = [ - "getrandom", + "getrandom 0.2.15", ] [[package]] name = "valuable" -version = "0.1.0" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" +checksum = "ba73ea9cf16a25df0c8caa16c51acb937d5712a8429db78a3ee29d5dcacd3a65" [[package]] name = "version_check" @@ -5240,9 +5242,9 @@ checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" [[package]] name = "wait-timeout" -version = "0.2.0" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f200f5b12eb75f8c1ed65abd4b2db8a6e1b138a20de009dacee265a2498f3f6" +checksum = "09ac3b126d3914f9849036f826e054cbabdc8519970b8998ddaf3b5bd3c65f11" dependencies = [ "libc", ] @@ -5272,6 +5274,15 @@ version = "0.11.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" +[[package]] +name = "wasi" +version = "0.13.3+wasi-0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26816d2e1a4a36a2940b96c5296ce403917633dff8f3440e9b236ed6f6bacad2" +dependencies = [ + "wit-bindgen-rt", +] + [[package]] name = "wasite" version = "0.1.0" @@ -5300,7 +5311,7 @@ dependencies = [ "log", "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.98", "wasm-bindgen-shared", ] @@ -5335,7 +5346,7 @@ checksum = "8ae87ea40c9f689fc23f209965b6fb8a99ad69aeeb0231408be24920604395de" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.98", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -5369,11 +5380,20 @@ 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" +version = "0.26.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d642ff16b7e79272ae451b7322067cdc17cadf68c23264be9d94a32319efe7e" +checksum = "2210b291f7ea53617fbafcc4939f10914214ec15aace5ba62293a668f322c5c9" dependencies = [ "rustls-pki-types", ] @@ -5498,7 +5518,7 @@ checksum = "2bbd5b46c938e506ecbce286b6628a02171d56153ba733b6c741fc627ec9579b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.98", ] [[package]] @@ -5509,7 +5529,7 @@ checksum = "83577b051e2f49a058c308f17f273b570a6a758386fc291b5f6a934dd84e48c1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.98", ] [[package]] @@ -5520,7 +5540,7 @@ checksum = "053c4c462dc91d3b1504c6fe5a726dd15e216ba718e84a0e46a88fbe5ded3515" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.98", ] [[package]] @@ -5531,7 +5551,7 @@ checksum = "cb26fd936d991781ea39e87c3a27285081e3c0da5ca0fcbc02d368cc6f52ff01" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.98", ] [[package]] @@ -5582,6 +5602,15 @@ dependencies = [ "windows-targets 0.53.0", ] +[[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" @@ -5609,6 +5638,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" @@ -5656,6 +5700,12 @@ dependencies = [ "windows_x86_64_msvc 0.53.0", ] +[[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" @@ -5674,6 +5724,12 @@ version = "0.53.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "86b8d5f90ddd19cb4a147a5fa63ca848db3df085e25fee3cc10b39b6eebae764" +[[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" @@ -5692,6 +5748,12 @@ version = "0.53.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c7651a1f62a11b8cbd5e0d42526e55f2c99886c77e007179efff86c2b137e66c" +[[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" @@ -5722,6 +5784,12 @@ version = "0.53.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9ce6ccbdedbf6d6354471319e781c0dfef054c81fbc7cf83f338a4296c0cae11" +[[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" @@ -5740,6 +5808,12 @@ version = "0.53.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "581fee95406bb13382d2f65cd4a908ca7b1e4c2f1917f143ba16efe98a589b5d" +[[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" @@ -5758,6 +5832,12 @@ version = "0.53.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2e55b5ac9ea33f2fc1716d1742db15574fd6fc8dadc51caab1c16a3d3b4190ba" +[[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" @@ -5776,6 +5856,12 @@ version = "0.53.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0a6e035dd0599267ce1ee132e51c27dd29437f63325753051e71dd9e42406c57" +[[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" @@ -5796,9 +5882,9 @@ checksum = "271414315aff87387382ec3d271b52d7ae78726f5d44ac98b4f4030c91880486" [[package]] name = "winnow" -version = "0.6.24" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8d71a593cc5c42ad7876e2c1fda56f314f3754c084128833e64f1345ff8a03a" +checksum = "86e376c75f4f43f44db463cf729e0d3acbf954d13e22c51e26e4c264b4ab545f" dependencies = [ "memchr", ] @@ -5813,19 +5899,28 @@ dependencies = [ "windows-sys 0.48.0", ] +[[package]] +name = "wit-bindgen-rt" +version = "0.33.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3268f3d866458b787f390cf61f4bbb563b922d091359f9608842999eaee3943c" +dependencies = [ + "bitflags 2.8.0", +] + [[package]] name = "wmi" -version = "0.14.3" +version = "0.14.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c960b3124cc00cefb350159cb43aba8984ed69c93d443df09f3299693171b37" +checksum = "7787dacdd8e71cbc104658aade4009300777f9b5fda6a75f19145fedb8a18e71" dependencies = [ "chrono", "futures", "log", "serde", "thiserror 2.0.11", - "windows 0.58.0", - "windows-core 0.58.0", + "windows 0.59.0", + "windows-core 0.59.0", ] [[package]] @@ -5901,7 +5996,7 @@ checksum = "2380878cad4ac9aac1e2435f3eb4020e8374b5f13c296cb75b4620ff8e229154" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.98", "synstructure", ] @@ -5929,7 +6024,7 @@ checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.98", ] [[package]] @@ -5949,7 +6044,7 @@ checksum = "595eed982f7d355beb85837f651fa22e90b3c044842dc7f2c2842c086f295808" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.98", "synstructure", ] @@ -5978,5 +6073,5 @@ checksum = "6eafa6dfb17584ea3e2bd6e76e0cc15ad7af12b09abdd1ca55961bed9b1063c6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.98", ] diff --git a/Cargo.toml b/Cargo.toml index 9d5d12298..70a1d4dac 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -40,10 +40,10 @@ genawaiter = { version = "0.99.1", features = ["futures03"] } hashlink = { version = "0.9.0", optional = true } hex = "0.4.3" indicatif = { version = "0.17.8", optional = true } -iroh-base = { version = "0.31" } +iroh-base = { version = "0.32" } iroh-io = { version = "0.6.0", features = ["stats"] } iroh-metrics = { version = "0.31", default-features = false } -iroh = "0.31" +iroh = "0.32" nested_enum_utils = { version = "0.1.0", optional = true } num_cpus = "1.15.0" oneshot = "0.1.8" @@ -56,7 +56,6 @@ postcard = { version = "1", default-features = false, features = [ ] } quic-rpc = { version = "0.18", optional = true } quic-rpc-derive = { version = "0.17", optional = true } -quinn = { package = "iroh-quinn", version = "0.12", features = ["ring"] } rand = "0.8" range-collections = "0.4.0" redb = { version = "2.2.0", optional = true } @@ -77,11 +76,12 @@ walkdir = { version = "2.5.0", optional = true } # Examples console = { version = "0.15.8", optional = true } +tracing-test = "0.2.5" [dev-dependencies] http-body = "1.0" -iroh-test = { version = "0.31" } -iroh = { version = "0.31", features = ["test-utils"] } +iroh = { version = "0.32", features = ["test-utils"] } +quinn = { package = "iroh-quinn", version = "0.13", features = ["ring"] } futures-buffered = "0.2.4" proptest = "1.0.0" serde_json = "1.0.107" diff --git a/README.md b/README.md index c8f25a9f9..ef26c4e49 100644 --- a/README.md +++ b/README.md @@ -32,7 +32,7 @@ Here is a basic example of how to set up `iroh-blobs` with `iroh`: ```rust use iroh::{protocol::Router, Endpoint}; -use iroh_blobs::net_protocol::Blobs; +use iroh_blobs::{store::Store, net_protocol::Blobs}; #[tokio::main] async fn main() -> anyhow::Result<()> { diff --git a/examples/connect/mod.rs b/examples/connect/mod.rs deleted file mode 100644 index acb5481f0..000000000 --- a/examples/connect/mod.rs +++ /dev/null @@ -1,93 +0,0 @@ -//! Common code used to created quinn connections in the examples -use std::{path::PathBuf, sync::Arc}; - -use anyhow::{bail, Context, Result}; -use quinn::crypto::rustls::{QuicClientConfig, QuicServerConfig}; -use rustls::pki_types::{CertificateDer, PrivatePkcs8KeyDer}; -use tokio::fs; - -pub const EXAMPLE_ALPN: &[u8] = b"n0/iroh/examples/bytes/0"; - -// Path where the tls certificates are saved. This example expects that you have run the `provide-bytes` example first, which generates the certificates. -pub const CERT_PATH: &str = "./certs"; - -// derived from `quinn/examples/client.rs` -// load the certificates from CERT_PATH -// Assumes that you have already run the `provide-bytes` example, that generates the certificates -#[allow(unused)] -pub async fn load_certs() -> Result { - let mut roots = rustls::RootCertStore::empty(); - let path = PathBuf::from(CERT_PATH).join("cert.der"); - match fs::read(path).await { - Ok(cert) => { - roots.add(rustls::pki_types::CertificateDer::from(cert))?; - } - Err(e) => { - bail!("failed to open local server certificate: {}\nYou must run the `provide-bytes` example to create the certificate.\n\tcargo run --example provide-bytes", e); - } - } - Ok(roots) -} - -// derived from `quinn/examples/server.rs` -// creates a self signed certificate and saves it to "./certs" -#[allow(unused)] -pub async fn make_and_write_certs() -> Result<( - rustls::pki_types::PrivateKeyDer<'static>, - rustls::pki_types::CertificateDer<'static>, -)> { - let path = std::path::PathBuf::from(CERT_PATH); - let cert = rcgen::generate_simple_self_signed(vec!["localhost".into()]).unwrap(); - let key_path = path.join("key.der"); - let cert_path = path.join("cert.der"); - - let key = PrivatePkcs8KeyDer::from(cert.key_pair.serialize_der()); - let cert: CertificateDer = cert.cert.into(); - tokio::fs::create_dir_all(path) - .await - .context("failed to create certificate directory")?; - tokio::fs::write(cert_path, &cert) - .await - .context("failed to write certificate")?; - tokio::fs::write(key_path, key.secret_pkcs8_der()) - .await - .context("failed to write private key")?; - - Ok((rustls::pki_types::PrivateKeyDer::from(key), cert)) -} - -// derived from `quinn/examples/client.rs` -// Creates a client quinn::Endpoint -#[allow(unused)] -pub fn make_client_endpoint(roots: rustls::RootCertStore) -> Result { - let mut client_crypto = rustls::ClientConfig::builder() - .with_root_certificates(roots) - .with_no_client_auth(); - - client_crypto.alpn_protocols = vec![EXAMPLE_ALPN.to_vec()]; - let client_config: QuicClientConfig = client_crypto.try_into()?; - let client_config = quinn::ClientConfig::new(Arc::new(client_config)); - let mut endpoint = quinn::Endpoint::client("[::]:0".parse().unwrap())?; - endpoint.set_default_client_config(client_config); - Ok(endpoint) -} - -// derived from `quinn/examples/server.rs` -// makes a quinn server endpoint -#[allow(unused)] -pub fn make_server_endpoint( - key: rustls::pki_types::PrivateKeyDer<'static>, - cert: rustls::pki_types::CertificateDer<'static>, -) -> Result { - let mut server_crypto = rustls::ServerConfig::builder() - .with_no_client_auth() - .with_single_cert(vec![cert], key)?; - server_crypto.alpn_protocols = vec![EXAMPLE_ALPN.to_vec()]; - let server_config: QuicServerConfig = server_crypto.try_into()?; - let mut server_config = quinn::ServerConfig::with_crypto(Arc::new(server_config)); - let transport_config = Arc::get_mut(&mut server_config.transport).unwrap(); - transport_config.max_concurrent_uni_streams(0_u8.into()); - - let endpoint = quinn::Endpoint::server(server_config, "[::1]:4433".parse()?)?; - Ok(endpoint) -} diff --git a/examples/custom-protocol.rs b/examples/custom-protocol.rs index 83e0c6bb8..5baef3c9c 100644 --- a/examples/custom-protocol.rs +++ b/examples/custom-protocol.rs @@ -44,7 +44,7 @@ use anyhow::Result; use clap::Parser; use futures_lite::future::Boxed as BoxedFuture; use iroh::{ - endpoint::{get_remote_node_id, Connecting}, + endpoint::Connecting, protocol::{ProtocolHandler, Router}, Endpoint, NodeId, }; @@ -149,7 +149,7 @@ impl ProtocolHandler for BlobSearch { // Wait for the connection to be fully established. let connection = connecting.await?; // We can get the remote's node id from the connection. - let node_id = get_remote_node_id(&connection)?; + let node_id = connection.remote_node_id()?; println!("accepted connection from {node_id}"); // Our protocol is a simple request-response protocol, so we expect the @@ -225,7 +225,7 @@ impl BlobSearch { match recv.read_exact(&mut hash_bytes).await { // FinishedEarly means that the remote side did not send further data, // so in this case we break our loop. - Err(quinn::ReadExactError::FinishedEarly(_)) => break, + Err(iroh::endpoint::ReadExactError::FinishedEarly(_)) => break, // Other errors are connection errors, so we bail. Err(err) => return Err(err.into()), Ok(_) => {} diff --git a/examples/fetch-fsm.rs b/examples/fetch-fsm.rs index 6c7379b3a..4e0422043 100644 --- a/examples/fetch-fsm.rs +++ b/examples/fetch-fsm.rs @@ -3,20 +3,19 @@ //! Since this example does not use [`iroh-net::Endpoint`], it does not do any holepunching, and so will only work locally or between two processes that have public IP addresses. //! //! Run the provide-bytes example first. It will give instructions on how to run this example properly. -use std::net::SocketAddr; +use std::str::FromStr; use anyhow::{Context, Result}; use iroh_blobs::{ get::fsm::{AtInitial, ConnectedNext, EndBlobNext}, hashseq::HashSeq, protocol::GetRequest, - Hash, + BlobFormat, }; use iroh_io::ConcatenateSliceWriter; use tracing_subscriber::{prelude::*, EnvFilter}; -mod connect; -use connect::{load_certs, make_client_endpoint}; +const EXAMPLE_ALPN: &[u8] = b"n0/iroh/examples/bytes/0"; // set the RUST_LOG env var to one of {debug,info,warn} to see logging info pub fn setup_logging() { @@ -29,50 +28,49 @@ pub fn setup_logging() { #[tokio::main] async fn main() -> Result<()> { - println!("\nfetch bytes example!"); + println!("\nfetch fsm example!"); setup_logging(); let args: Vec<_> = std::env::args().collect(); - if args.len() != 4 { - anyhow::bail!("usage: fetch-bytes [HASH] [SOCKET_ADDR] [FORMAT]"); + if args.len() != 2 { + anyhow::bail!("usage: fetch-fsm [TICKET]"); } - let hash: Hash = args[1].parse().context("unable to parse [HASH]")?; - let addr: SocketAddr = args[2].parse().context("unable to parse [SOCKET_ADDR]")?; - let format = { - if args[3] != "blob" && args[3] != "collection" { - anyhow::bail!( - "expected either 'blob' or 'collection' for FORMAT argument, got {}", - args[3] - ); - } - args[3].clone() - }; + let ticket = + iroh_blobs::ticket::BlobTicket::from_str(&args[1]).context("unable to parse [TICKET]")?; - // load tls certificates - // This will error if you have not run the `provide-bytes` example - let roots = load_certs().await?; + let (node, hash, format) = ticket.into_parts(); // create an endpoint to listen for incoming connections - let endpoint = make_client_endpoint(roots)?; - println!("\nlistening on {}", endpoint.local_addr()?); - println!("fetching hash {hash} from {addr}"); + let endpoint = iroh::Endpoint::builder() + .relay_mode(iroh::RelayMode::Disabled) + .alpns(vec![EXAMPLE_ALPN.into()]) + .bind() + .await?; + println!( + "\nlistening on {:?}", + endpoint.node_addr().await?.direct_addresses + ); + println!("fetching hash {hash} from {:?}", node.node_id); // connect - let connection = endpoint.connect(addr, "localhost")?.await?; - - if format == "collection" { - // create a request for a collection - let request = GetRequest::all(hash); - // create the initial state of the finite state machine - let initial = iroh_blobs::get::fsm::start(connection, request); - - write_collection(initial).await - } else { - // create a request for a single blob - let request = GetRequest::single(hash); - // create the initial state of the finite state machine - let initial = iroh_blobs::get::fsm::start(connection, request); - - write_blob(initial).await + let connection = endpoint.connect(node, EXAMPLE_ALPN).await?; + + match format { + BlobFormat::HashSeq => { + // create a request for a collection + let request = GetRequest::all(hash); + // create the initial state of the finite state machine + let initial = iroh_blobs::get::fsm::start(connection, request); + + write_collection(initial).await + } + BlobFormat::Raw => { + // create a request for a single blob + let request = GetRequest::single(hash); + // create the initial state of the finite state machine + let initial = iroh_blobs::get::fsm::start(connection, request); + + write_blob(initial).await + } } } diff --git a/examples/fetch-stream.rs b/examples/fetch-stream.rs index 6b50d55f9..f9405abca 100644 --- a/examples/fetch-stream.rs +++ b/examples/fetch-stream.rs @@ -3,7 +3,7 @@ //! Since this example does not use [`iroh-net::Endpoint`], it does not do any holepunching, and so will only work locally or between two processes that have public IP addresses. //! //! Run the provide-bytes example first. It will give instructions on how to run this example properly. -use std::{io, net::SocketAddr}; +use std::{io, str::FromStr}; use anyhow::{Context, Result}; use bao_tree::io::fsm::BaoContentItem; @@ -14,13 +14,12 @@ use iroh_blobs::{ get::fsm::{AtInitial, BlobContentNext, ConnectedNext, EndBlobNext}, hashseq::HashSeq, protocol::GetRequest, - Hash, + BlobFormat, }; use tokio::io::AsyncWriteExt; use tracing_subscriber::{prelude::*, EnvFilter}; -mod connect; -use connect::{load_certs, make_client_endpoint}; +const EXAMPLE_ALPN: &[u8] = b"n0/iroh/examples/bytes/0"; // set the RUST_LOG env var to one of {debug,info,warn} to see logging info pub fn setup_logging() { @@ -36,51 +35,50 @@ async fn main() -> Result<()> { println!("\nfetch stream example!"); setup_logging(); let args: Vec<_> = std::env::args().collect(); - if args.len() != 4 { - anyhow::bail!("usage: fetch-bytes [HASH] [SOCKET_ADDR] [FORMAT]"); + if args.len() != 2 { + anyhow::bail!("usage: fetch-stream [TICKET]"); } - let hash: Hash = args[1].parse().context("unable to parse [HASH]")?; - let addr: SocketAddr = args[2].parse().context("unable to parse [SOCKET_ADDR]")?; - let format = { - if args[3] != "blob" && args[3] != "collection" { - anyhow::bail!( - "expected either 'blob' or 'collection' for FORMAT argument, got {}", - args[3] - ); - } - args[3].clone() - }; + let ticket = + iroh_blobs::ticket::BlobTicket::from_str(&args[1]).context("unable to parse [TICKET]")?; - // load tls certificates - // This will error if you have not run the `provide-bytes` example - let roots = load_certs().await?; + let (node, hash, format) = ticket.into_parts(); // create an endpoint to listen for incoming connections - let endpoint = make_client_endpoint(roots)?; - println!("\nlistening on {}", endpoint.local_addr()?); - println!("fetching hash {hash} from {addr}"); + let endpoint = iroh::Endpoint::builder() + .relay_mode(iroh::RelayMode::Disabled) + .alpns(vec![EXAMPLE_ALPN.into()]) + .bind() + .await?; + println!( + "\nlistening on {:?}", + endpoint.node_addr().await?.direct_addresses + ); + println!("fetching hash {hash} from {:?}", node.node_id); // connect - let connection = endpoint.connect(addr, "localhost")?.await?; + let connection = endpoint.connect(node, EXAMPLE_ALPN).await?; - let mut stream = if format == "collection" { - // create a request for a collection - let request = GetRequest::all(hash); + let mut stream = match format { + BlobFormat::HashSeq => { + // create a request for a collection + let request = GetRequest::all(hash); - // create the initial state of the finite state machine - let initial = iroh_blobs::get::fsm::start(connection, request); + // create the initial state of the finite state machine + let initial = iroh_blobs::get::fsm::start(connection, request); - // create a stream that yields all the data of the blob - stream_children(initial).boxed_local() - } else { - // create a request for a single blob - let request = GetRequest::single(hash); + // create a stream that yields all the data of the blob + stream_children(initial).boxed_local() + } + BlobFormat::Raw => { + // create a request for a single blob + let request = GetRequest::single(hash); - // create the initial state of the finite state machine - let initial = iroh_blobs::get::fsm::start(connection, request); + // create the initial state of the finite state machine + let initial = iroh_blobs::get::fsm::start(connection, request); - // create a stream that yields all the data of the blob - stream_blob(initial).boxed_local() + // create a stream that yields all the data of the blob + stream_blob(initial).boxed_local() + } }; while let Some(item) = stream.next().await { let item = item?; diff --git a/examples/provide-bytes.rs b/examples/provide-bytes.rs index 98146f28c..7f120ed3b 100644 --- a/examples/provide-bytes.rs +++ b/examples/provide-bytes.rs @@ -10,12 +10,11 @@ //! cargo run --example provide-bytes collection //! To provide a collection (multiple blobs) use anyhow::Result; -use iroh_blobs::{format::collection::Collection, util::local_pool::LocalPool, Hash}; +use iroh_blobs::{format::collection::Collection, util::local_pool::LocalPool, BlobFormat, Hash}; use tracing::warn; use tracing_subscriber::{prelude::*, EnvFilter}; -mod connect; -use connect::{make_and_write_certs, make_server_endpoint, CERT_PATH}; +const EXAMPLE_ALPN: &[u8] = b"n0/iroh/examples/bytes/0"; // set the RUST_LOG env var to one of {debug,info,warn} to see logging info pub fn setup_logging() { @@ -45,7 +44,7 @@ async fn main() -> Result<()> { }; println!("\nprovide bytes {format} example!"); - let (db, hash) = if format == "collection" { + let (db, hash, format) = if format == "collection" { let (mut db, names) = iroh_blobs::store::readonly_mem::Store::new([ ("blob1", b"the first blob of bytes".to_vec()), ("blob2", b"the second blob of bytes".to_vec()), @@ -56,7 +55,7 @@ async fn main() -> Result<()> { .collect(); // add it to the db let hash = db.insert_many(collection.to_blobs()).unwrap(); - (db, hash) + (db, hash, BlobFormat::HashSeq) } else { // create a new database and add a blob let (db, names) = @@ -64,20 +63,23 @@ async fn main() -> Result<()> { // get the hash of the content let hash = names.get("hello").unwrap(); - (db, Hash::from(hash.as_bytes())) + (db, Hash::from(hash.as_bytes()), BlobFormat::Raw) }; - // create tls certs and save to CERT_PATH - let (key, cert) = make_and_write_certs().await?; - // create an endpoint to listen for incoming connections - let endpoint = make_server_endpoint(key, cert)?; - let addr = endpoint.local_addr()?; - println!("\nlistening on {addr}"); + let endpoint = iroh::Endpoint::builder() + .relay_mode(iroh::RelayMode::Disabled) + .alpns(vec![EXAMPLE_ALPN.into()]) + .bind() + .await?; + let addr = endpoint.node_addr().await?; + println!("\nlistening on {:?}", addr.direct_addresses); println!("providing hash {hash}"); - println!("\nfetch the content using a finite state machine by running the following example:\n\ncargo run --example fetch-fsm {hash} \"{addr}\" {format}"); - println!("\nfetch the content using a stream by running the following example:\n\ncargo run --example fetch-stream {hash} \"{addr}\" {format}\n"); + let ticket = iroh_blobs::ticket::BlobTicket::new(addr, hash, format)?; + + println!("\nfetch the content using a finite state machine by running the following example:\n\ncargo run --example fetch-fsm {ticket}"); + println!("\nfetch the content using a stream by running the following example:\n\ncargo run --example fetch-stream {ticket}\n"); // create a new local pool handle with 1 worker thread let lp = LocalPool::single(); @@ -100,11 +102,10 @@ async fn main() -> Result<()> { // spawn a task to handle the connection tokio::spawn(async move { - let remote_addr = conn.remote_address(); let conn = match conn.await { Ok(conn) => conn, Err(err) => { - warn!(%remote_addr, "Error connecting: {err:#}"); + warn!("Error connecting: {err:#}"); return; } }; @@ -115,7 +116,6 @@ async fn main() -> Result<()> { match tokio::signal::ctrl_c().await { Ok(()) => { - tokio::fs::remove_dir_all(std::path::PathBuf::from(CERT_PATH)).await?; accept_task.abort(); Ok(()) } diff --git a/src/downloader.rs b/src/downloader.rs index a147131ae..87f0462b3 100644 --- a/src/downloader.rs +++ b/src/downloader.rs @@ -1523,7 +1523,7 @@ impl DialerT for Dialer { #[derive(Debug)] struct Dialer { endpoint: Endpoint, - pending: JoinSet<(NodeId, anyhow::Result)>, + pending: JoinSet<(NodeId, anyhow::Result)>, pending_dials: HashMap, } @@ -1572,7 +1572,7 @@ impl Dialer { } impl Stream for Dialer { - type Item = (NodeId, anyhow::Result); + type Item = (NodeId, anyhow::Result); fn poll_next( mut self: Pin<&mut Self>, diff --git a/src/downloader/test.rs b/src/downloader/test.rs index 63c22fe9b..0b5ea1f79 100644 --- a/src/downloader/test.rs +++ b/src/downloader/test.rs @@ -7,6 +7,7 @@ use std::{ use anyhow::anyhow; use futures_util::future::FutureExt; use iroh::SecretKey; +use tracing_test::traced_test; use super::*; use crate::{ @@ -48,8 +49,6 @@ impl Downloader { let lp = LocalPool::default(); lp.spawn_detached(move || async move { // we want to see the logs of the service - let _guard = iroh_test::logging::setup(); - let service = Service::new(getter, dialer, concurrency_limits, retry_config, msg_rx); service.run().await }); @@ -66,8 +65,8 @@ impl Downloader { /// Tests that receiving a download request and performing it doesn't explode. #[tokio::test] +#[traced_test] async fn smoke_test() { - let _guard = iroh_test::logging::setup(); let dialer = dialer::TestingDialer::default(); let getter = getter::TestingGetter::default(); let concurrency_limits = ConcurrencyLimits::default(); @@ -90,8 +89,8 @@ async fn smoke_test() { /// Tests that multiple intents produce a single request. #[tokio::test] +#[traced_test] async fn deduplication() { - let _guard = iroh_test::logging::setup(); let dialer = dialer::TestingDialer::default(); let getter = getter::TestingGetter::default(); // make request take some time to ensure the intents are received before completion @@ -123,8 +122,8 @@ async fn deduplication() { /// Tests that the request is cancelled only when all intents are cancelled. #[ignore = "flaky"] #[tokio::test] +#[traced_test] async fn cancellation() { - let _guard = iroh_test::logging::setup(); let dialer = dialer::TestingDialer::default(); let getter = getter::TestingGetter::default(); // make request take some time to ensure cancellations are received on time @@ -159,8 +158,8 @@ async fn cancellation() { /// maximum number of concurrent requests is not exceed. /// NOTE: This is internally tested by [`Service::check_invariants`]. #[tokio::test] +#[traced_test] async fn max_concurrent_requests_total() { - let _guard = iroh_test::logging::setup(); let dialer = dialer::TestingDialer::default(); let getter = getter::TestingGetter::default(); // make request take some time to ensure concurreny limits are hit @@ -202,8 +201,8 @@ async fn max_concurrent_requests_total() { /// the maximum number of requests per peer is still respected. /// NOTE: This is internally tested by [`Service::check_invariants`]. #[tokio::test] +#[traced_test] async fn max_concurrent_requests_per_peer() { - let _guard = iroh_test::logging::setup(); let dialer = dialer::TestingDialer::default(); let getter = getter::TestingGetter::default(); // make request take some time to ensure concurreny limits are hit @@ -239,8 +238,8 @@ async fn max_concurrent_requests_per_peer() { /// state. The download then finishes, and we make sure that all events are emitted properly, and /// the progress state of the handles converges. #[tokio::test] +#[traced_test] async fn concurrent_progress() { - let _guard = iroh_test::logging::setup(); let dialer = dialer::TestingDialer::default(); let getter = getter::TestingGetter::default(); @@ -356,8 +355,8 @@ async fn concurrent_progress() { } #[tokio::test] +#[traced_test] async fn long_queue() { - let _guard = iroh_test::logging::setup(); let dialer = dialer::TestingDialer::default(); let getter = getter::TestingGetter::default(); let concurrency_limits = ConcurrencyLimits { @@ -394,8 +393,8 @@ async fn long_queue() { /// If a download errors with [`FailureAction::DropPeer`], make sure that the peer is not dropped /// while other transfers are still running. #[tokio::test] +#[traced_test] async fn fail_while_running() { - let _guard = iroh_test::logging::setup(); let dialer = dialer::TestingDialer::default(); let getter = getter::TestingGetter::default(); let (downloader, _lp) = @@ -432,8 +431,8 @@ async fn fail_while_running() { } #[tokio::test] +#[traced_test] async fn retry_nodes_simple() { - let _guard = iroh_test::logging::setup(); let dialer = dialer::TestingDialer::default(); let getter = getter::TestingGetter::default(); let (downloader, _lp) = @@ -453,8 +452,8 @@ async fn retry_nodes_simple() { } #[tokio::test] +#[traced_test] async fn retry_nodes_fail() { - let _guard = iroh_test::logging::setup(); let dialer = dialer::TestingDialer::default(); let getter = getter::TestingGetter::default(); let config = RetryConfig { @@ -491,8 +490,8 @@ async fn retry_nodes_fail() { } #[tokio::test] +#[traced_test] async fn retry_nodes_jump_queue() { - let _guard = iroh_test::logging::setup(); let dialer = dialer::TestingDialer::default(); let getter = getter::TestingGetter::default(); let concurrency_limits = ConcurrencyLimits { diff --git a/src/get.rs b/src/get.rs index 7c1190f34..3365e1407 100644 --- a/src/get.rs +++ b/src/get.rs @@ -20,7 +20,7 @@ use std::{ use anyhow::Result; use bao_tree::{io::fsm::BaoContentItem, ChunkNum}; -use iroh::endpoint::{self, RecvStream, SendStream}; +use iroh::endpoint::{self, ClosedStream, RecvStream, SendStream, WriteError}; use serde::{Deserialize, Serialize}; use tracing::{debug, error}; @@ -189,10 +189,10 @@ pub mod fsm { RequestTooBig, /// Error when writing the request to the [`SendStream`]. #[error("write: {0}")] - Write(#[from] quinn::WriteError), + Write(#[from] WriteError), /// Quic connection is closed. #[error("closed")] - Closed(#[from] quinn::ClosedStream), + Closed(#[from] ClosedStream), /// A generic io error #[error("io {0}")] Io(io::Error), diff --git a/src/get/error.rs b/src/get/error.rs index 95f6beefc..03bec51e0 100644 --- a/src/get/error.rs +++ b/src/get/error.rs @@ -1,6 +1,6 @@ //! Error returned from get operations -use iroh::endpoint; +use iroh::endpoint::{self, ClosedStream}; use crate::util::progress::ProgressSendError; @@ -73,7 +73,7 @@ impl From for GetError { // TODO(@divma): don't see how this is reachable but let's just not use the peer GetError::Io(e.into()) } - e @ quinn::ConnectionError::CidsExhausted => { + e @ ConnectionError::CidsExhausted => { // > The connection could not be created because not enough of the CID space // > is available GetError::Io(e.into()) @@ -97,8 +97,8 @@ impl From for GetError { } } } -impl From for GetError { - fn from(value: quinn::ClosedStream) -> Self { +impl From for GetError { + fn from(value: ClosedStream) -> Self { GetError::Io(value.into()) } } diff --git a/src/hash.rs b/src/hash.rs index 4703bae59..95190793c 100644 --- a/src/hash.rs +++ b/src/hash.rs @@ -416,11 +416,10 @@ impl<'de> Deserialize<'de> for HashAndFormat { #[cfg(test)] mod tests { - - use iroh_test::{assert_eq_hex, hexdump::parse_hexdump}; use serde_test::{assert_tokens, Configure, Token}; use super::*; + use crate::{assert_eq_hex, util::hexdump::parse_hexdump}; #[test] fn test_display_parse_roundtrip() { diff --git a/src/protocol.rs b/src/protocol.rs index 5dddace25..5f9d2a1d6 100644 --- a/src/protocol.rs +++ b/src/protocol.rs @@ -483,9 +483,8 @@ impl TryFrom for Closed { #[cfg(test)] mod tests { - use iroh_test::{assert_eq_hex, hexdump::parse_hexdump}; - use super::{GetRequest, Request}; + use crate::{assert_eq_hex, util::hexdump::parse_hexdump}; #[test] fn request_wire_format() { diff --git a/src/protocol/range_spec.rs b/src/protocol/range_spec.rs index fcf608aa1..db3390a29 100644 --- a/src/protocol/range_spec.rs +++ b/src/protocol/range_spec.rs @@ -354,10 +354,10 @@ impl<'a> Iterator for NonEmptyRequestRangeSpecIter<'a> { mod tests { use std::ops::Range; - use iroh_test::{assert_eq_hex, hexdump::parse_hexdump}; use proptest::prelude::*; use super::*; + use crate::{assert_eq_hex, util::hexdump::parse_hexdump}; fn ranges(value_range: Range) -> impl Strategy { prop::collection::vec((value_range.clone(), value_range), 0..16).prop_map(|v| { diff --git a/src/provider.rs b/src/provider.rs index a63b334c6..bf55fe751 100644 --- a/src/provider.rs +++ b/src/provider.rs @@ -412,9 +412,8 @@ pub async fn handle_connection( events: EventSender, rt: LocalPoolHandle, ) { - let remote_addr = connection.remote_address(); let connection_id = connection.stable_id() as u64; - let span = debug_span!("connection", connection_id, %remote_addr); + let span = debug_span!("connection", connection_id); async move { while let Ok((writer, reader)) = connection.accept_bi().await { // The stream ID index is used to identify this request. Requests only arrive in diff --git a/src/rpc/client/blobs.rs b/src/rpc/client/blobs.rs index 3b003fba0..633034c8d 100644 --- a/src/rpc/client/blobs.rs +++ b/src/rpc/client/blobs.rs @@ -1002,6 +1002,7 @@ mod tests { use rand::RngCore; use testresult::TestResult; use tokio::{io::AsyncWriteExt, sync::mpsc}; + use tracing_test::traced_test; use super::*; use crate::{hashseq::HashSeq, ticket::BlobTicket}; @@ -1139,9 +1140,8 @@ mod tests { } #[tokio::test] + #[traced_test] async fn test_blob_create_collection() -> Result<()> { - let _guard = iroh_test::logging::setup(); - let node = node::Node::memory().spawn().await?; // create temp file @@ -1223,9 +1223,8 @@ mod tests { } #[tokio::test] + #[traced_test] async fn test_blob_read_at() -> Result<()> { - // let _guard = iroh_test::logging::setup(); - let node = node::Node::memory().spawn().await?; // create temp file @@ -1362,9 +1361,8 @@ mod tests { } #[tokio::test] + #[traced_test] async fn test_blob_get_collection() -> Result<()> { - let _guard = iroh_test::logging::setup(); - let node = node::Node::memory().spawn().await?; // create temp file @@ -1428,9 +1426,8 @@ mod tests { } #[tokio::test] + #[traced_test] async fn test_blob_share() -> Result<()> { - let _guard = iroh_test::logging::setup(); - let node = node::Node::memory().spawn().await?; // create temp file @@ -1502,9 +1499,8 @@ mod tests { } #[tokio::test] + #[traced_test] async fn test_blob_provide_events() -> Result<()> { - let _guard = iroh_test::logging::setup(); - let (node1_events, mut node1_events_r) = BlobEvents::new(16); let node1 = node::Node::memory() .blobs_events(node1_events) @@ -1567,9 +1563,8 @@ mod tests { } /// Download a existing blob from oneself #[tokio::test] + #[traced_test] async fn test_blob_get_self_existing() -> TestResult<()> { - let _guard = iroh_test::logging::setup(); - let node = node::Node::memory().spawn().await?; let node_id = node.node_id(); let blobs = node.blobs(); @@ -1615,9 +1610,8 @@ mod tests { /// Download a missing blob from oneself #[tokio::test] + #[traced_test] async fn test_blob_get_self_missing() -> TestResult<()> { - let _guard = iroh_test::logging::setup(); - let node = node::Node::memory().spawn().await?; let node_id = node.node_id(); let blobs = node.blobs(); @@ -1667,9 +1661,8 @@ mod tests { /// Download a existing collection. Check that things succeed and no download is performed. #[tokio::test] + #[traced_test] async fn test_blob_get_existing_collection() -> TestResult<()> { - let _guard = iroh_test::logging::setup(); - let node = node::Node::memory().spawn().await?; // We use a nonexisting node id because we just want to check that this succeeds without // hitting the network. @@ -1739,10 +1732,9 @@ mod tests { } #[tokio::test] + #[traced_test] #[cfg_attr(target_os = "windows", ignore = "flaky")] async fn test_blob_delete_mem() -> Result<()> { - let _guard = iroh_test::logging::setup(); - let node = node::Node::memory().spawn().await?; let res = node.blobs().add_bytes(&b"hello world"[..]).await?; @@ -1761,9 +1753,8 @@ mod tests { } #[tokio::test] + #[traced_test] async fn test_blob_delete_fs() -> Result<()> { - let _guard = iroh_test::logging::setup(); - let dir = tempfile::tempdir()?; let node = node::Node::persistent(dir.path()).await?.spawn().await?; @@ -1783,9 +1774,8 @@ mod tests { } #[tokio::test] + #[traced_test] async fn test_ticket_multiple_addrs() -> TestResult<()> { - let _guard = iroh_test::logging::setup(); - let node = Node::memory().spawn().await?; let hash = node .blobs() @@ -1801,9 +1791,8 @@ mod tests { } #[tokio::test] + #[traced_test] async fn test_node_add_blob_stream() -> Result<()> { - let _guard = iroh_test::logging::setup(); - use std::io::Cursor; let node = Node::memory().spawn().await?; @@ -1819,9 +1808,8 @@ mod tests { } #[tokio::test] + #[traced_test] async fn test_node_add_tagged_blob_event() -> Result<()> { - let _guard = iroh_test::logging::setup(); - let node = Node::memory().spawn().await?; let _got_hash = tokio::time::timeout(Duration::from_secs(10), async move { @@ -1856,8 +1844,8 @@ mod tests { } #[tokio::test] + #[traced_test] async fn test_download_via_relay() -> Result<()> { - let _guard = iroh_test::logging::setup(); let (relay_map, relay_url, _guard) = iroh::test_utils::run_relay_server().await?; let endpoint1 = iroh::Endpoint::builder() @@ -1886,9 +1874,9 @@ mod tests { } #[tokio::test] + #[traced_test] #[ignore = "flaky"] async fn test_download_via_relay_with_discovery() -> Result<()> { - let _guard = iroh_test::logging::setup(); let (relay_map, _relay_url, _guard) = iroh::test_utils::run_relay_server().await?; let dns_pkarr_server = DnsPkarrServer::run().await?; diff --git a/src/ticket.rs b/src/ticket.rs index 1cde760d7..69c512d14 100644 --- a/src/ticket.rs +++ b/src/ticket.rs @@ -154,9 +154,9 @@ mod tests { use std::net::SocketAddr; use iroh::{PublicKey, SecretKey}; - use iroh_test::{assert_eq_hex, hexdump::parse_hexdump}; use super::*; + use crate::{assert_eq_hex, util::hexdump::parse_hexdump}; fn make_ticket() -> BlobTicket { let hash = Hash::new(b"hi there"); diff --git a/src/util.rs b/src/util.rs index 735a9feb1..b2c0d76a8 100644 --- a/src/util.rs +++ b/src/util.rs @@ -24,6 +24,9 @@ mod sparse_mem_file; pub use sparse_mem_file::SparseMemFile; pub mod local_pool; +#[cfg(test)] +pub(crate) mod hexdump; + /// A tag #[derive(Clone, PartialEq, Eq, PartialOrd, Ord, Serialize, Deserialize, From, Into)] pub struct Tag(pub Bytes); diff --git a/src/util/hexdump.rs b/src/util/hexdump.rs new file mode 100644 index 000000000..0c36b1bc8 --- /dev/null +++ b/src/util/hexdump.rs @@ -0,0 +1,181 @@ +use anyhow::{ensure, Context, Result}; + +/// Parses a commented multi line hexdump into a vector of bytes. +/// +/// This is useful to write wire level protocol tests. +pub fn parse_hexdump(s: &str) -> Result> { + let mut result = Vec::new(); + + for (line_number, line) in s.lines().enumerate() { + let data_part = line.split('#').next().unwrap_or(""); + let cleaned: String = data_part.chars().filter(|c| !c.is_whitespace()).collect(); + + ensure!( + cleaned.len() % 2 == 0, + "Non-even number of hex chars detected on line {}.", + line_number + 1 + ); + + for i in (0..cleaned.len()).step_by(2) { + let byte_str = &cleaned[i..i + 2]; + let byte = u8::from_str_radix(byte_str, 16) + .with_context(|| format!("Invalid hex data on line {}.", line_number + 1))?; + + result.push(byte); + } + } + + Ok(result) +} + +/// Returns a hexdump of the given bytes in multiple lines as a String. +pub fn print_hexdump(bytes: impl AsRef<[u8]>, line_lengths: impl AsRef<[usize]>) -> String { + let line_lengths = line_lengths.as_ref(); + let mut bytes_iter = bytes.as_ref().iter(); + let default_line_length = line_lengths + .last() + .filter(|x| **x != 0) + .copied() + .unwrap_or(16); + let mut line_lengths_iter = line_lengths.iter(); + let mut output = String::new(); + + loop { + let line_length = line_lengths_iter + .next() + .copied() + .unwrap_or(default_line_length); + if line_length == 0 { + output.push('\n'); + } else { + let line: Vec<_> = bytes_iter.by_ref().take(line_length).collect(); + + if line.is_empty() { + break; + } + + for byte in &line { + output.push_str(&format!("{:02x} ", byte)); + } + output.pop(); // Remove the trailing space + output.push('\n'); + } + } + + output +} + +/// This is a macro to assert that two byte slices are equal. +/// +/// It is like assert_eq!, but it will print a nicely formatted hexdump of the +/// two slices if they are not equal. This makes it much easier to track down +/// a difference in a large byte slice. +#[macro_export] +macro_rules! assert_eq_hex { + ($a:expr, $b:expr) => { + assert_eq_hex!($a, $b, []) + }; + ($a:expr, $b:expr, $hint:expr) => { + let a = $a; + let b = $b; + let hint = $hint; + let ar: &[u8] = a.as_ref(); + let br: &[u8] = b.as_ref(); + let hintr: &[usize] = hint.as_ref(); + if ar != br { + use $crate::util::hexdump::print_hexdump; + panic!( + "assertion failed: `(left == right)`\nleft:\n{}\nright:\n{}\n", + print_hexdump(ar, hintr), + print_hexdump(br, hintr), + ) + } + }; +} + +#[cfg(test)] +mod tests { + use super::{parse_hexdump, print_hexdump}; + + #[test] + fn test_basic() { + let input = r" + a1b2 # comment + 3c4d + "; + let result = parse_hexdump(input).unwrap(); + assert_eq!(result, vec![0xa1, 0xb2, 0x3c, 0x4d]); + } + + #[test] + fn test_upper_case() { + let input = r" + A1B2 # comment + 3C4D + "; + let result = parse_hexdump(input).unwrap(); + assert_eq!(result, vec![0xa1, 0xb2, 0x3c, 0x4d]); + } + + #[test] + fn test_mixed_case() { + let input = r" + a1B2 # comment + 3C4d + "; + let result = parse_hexdump(input).unwrap(); + assert_eq!(result, vec![0xa1, 0xb2, 0x3c, 0x4d]); + } + + #[test] + fn test_odd_characters() { + let input = r" + a1b + "; + let result = parse_hexdump(input); + assert!(result.is_err()); + } + + #[test] + fn test_invalid_characters() { + let input = r" + a1g2 # 'g' is not valid in hex + "; + let result = parse_hexdump(input); + assert!(result.is_err()); + } + #[test] + fn test_basic_hexdump() { + let data: &[u8] = &[0x1, 0x2, 0x3, 0x4, 0x5]; + let output = print_hexdump(data, [1, 2]); + assert_eq!(output, "01\n02 03\n04 05\n"); + } + + #[test] + fn test_newline_insertion() { + let data: &[u8] = &[0x1, 0x2, 0x3, 0x4]; + let output = print_hexdump(data, [1, 0, 2]); + assert_eq!(output, "01\n\n02 03\n04\n"); + } + + #[test] + fn test_indefinite_line_length() { + let data: &[u8] = &[0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8]; + let output = print_hexdump(data, [2, 4]); + assert_eq!(output, "01 02\n03 04 05 06\n07 08\n"); + } + + #[test] + fn test_empty_data() { + let data: &[u8] = &[]; + let output = print_hexdump(data, [1, 2]); + assert_eq!(output, ""); + } + + #[test] + fn test_zeros_then_default() { + let data: &[u8] = &[0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8]; + let output = print_hexdump(data, [1, 0, 0, 2]); + assert_eq!(output, "01\n\n\n02 03\n04 05\n06 07\n08\n"); + } +} diff --git a/src/util/local_pool.rs b/src/util/local_pool.rs index e4a804a38..5b0880dd9 100644 --- a/src/util/local_pool.rs +++ b/src/util/local_pool.rs @@ -543,6 +543,7 @@ mod tests { use std::{sync::atomic::AtomicU64, time::Duration}; use tracing::info; + use tracing_test::traced_test; use super::*; @@ -586,6 +587,7 @@ mod tests { } #[tokio::test] + #[traced_test] async fn test_tracing() { // This test wants to make sure that logging inside the pool propagates to the // tracing subscriber that was set for the current thread at the time the pool was @@ -599,7 +601,6 @@ mod tests { // cargo nextest run -p iroh-blobs local_pool::tests::test_tracing --success-output final // // and eyeball the output. yolo - let _guard = iroh_test::logging::setup(); info!("hello from the test"); let pool = LocalPool::single(); pool.spawn(|| async move {