From 3891778af99f373f34c5d684489d06392bf6cd4e Mon Sep 17 00:00:00 2001 From: Floris Bruynooghe Date: Mon, 13 Jan 2025 10:08:38 +0100 Subject: [PATCH 1/5] ci: Use variable to construct URL (#3122) ## Description ## Description ## Breaking Changes ## Notes & open questions ## Change checklist - [x] Self-review. - [x] Documentation updates following the [style guide](https://rust-lang.github.io/rfcs/1574-more-api-documentation-conventions.html#appendix-a-full-conventions-text), if relevant. - [x] Tests if relevant. - [x] All breaking changes documented. --- .github/workflows/beta.yaml | 2 +- .github/workflows/flaky.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/beta.yaml b/.github/workflows/beta.yaml index aeb7fd494a..d77a237521 100644 --- a/.github/workflows/beta.yaml +++ b/.github/workflows/beta.yaml @@ -38,6 +38,6 @@ jobs: severity: error details: | Rustc beta tests failed - See https://github.com/n0-computer/iroh/actions/workflows/beta.yaml + See https://github.com/${{ github.repository }}/actions/workflows/beta.yaml webhookUrl: ${{ secrets.DISCORD_N0_GITHUB_CHANNEL_WEBHOOK_URL }} diff --git a/.github/workflows/flaky.yaml b/.github/workflows/flaky.yaml index 094f6b39a9..cde63023fe 100644 --- a/.github/workflows/flaky.yaml +++ b/.github/workflows/flaky.yaml @@ -87,7 +87,7 @@ jobs: echo "$failure" >> $GITHUB_OUTPUT done echo "" >> $GITHUB_OUTPUT - echo "See https://github.com/n0-computer/iroh/actions/workflows/flaky.yaml" >> $GITHUB_OUTPUT + echo "See https://github.com/${{ github.repository }}/actions/workflows/flaky.yaml" >> $GITHUB_OUTPUT echo "$EOF" >> $GITHUB_OUTPUT - name: Notify discord on failure uses: n0-computer/discord-webhook-notify@v1 From f675525bba5bb70b3723983fe5692652c441351d Mon Sep 17 00:00:00 2001 From: Floris Bruynooghe Date: Mon, 13 Jan 2025 11:06:29 +0100 Subject: [PATCH 2/5] feat(iroh): implement Discovery for Arc'ed Discovery types (#3107) ## Description Nothing in the trait stops it from working for discovery structs which are Arc'ed. Not all discovery types are in control of the users so this is helpful. I stumbled upon this because StaticProvider is not Clone. ## Breaking Changes ## Notes & open questions ## Change checklist - [x] Self-review. - [x] Documentation updates following the [style guide](https://rust-lang.github.io/rfcs/1574-more-api-documentation-conventions.html#appendix-a-full-conventions-text), if relevant. - [x] Tests if relevant. - [x] All breaking changes documented. --- iroh/src/discovery.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/iroh/src/discovery.rs b/iroh/src/discovery.rs index e6ecc4493d..b37cae1522 100644 --- a/iroh/src/discovery.rs +++ b/iroh/src/discovery.rs @@ -111,7 +111,7 @@ doc = "[`LocalSwarmDiscovery`]: local_swarm_discovery::LocalSwarmDiscovery" )] -use std::{collections::BTreeSet, net::SocketAddr, time::Duration}; +use std::{collections::BTreeSet, net::SocketAddr, sync::Arc, time::Duration}; use anyhow::{anyhow, ensure, Result}; use futures_lite::stream::{Boxed as BoxStream, StreamExt}; @@ -194,6 +194,8 @@ pub trait Discovery: std::fmt::Debug + Send + Sync { } } +impl Discovery for Arc {} + /// The results returned from [`Discovery::resolve`]. #[derive(Debug, Clone)] pub struct DiscoveryItem { From 04d43a6526e29dc9e149999e2f207512af762127 Mon Sep 17 00:00:00 2001 From: Asmir Avdicevic Date: Mon, 13 Jan 2025 11:17:05 +0100 Subject: [PATCH 3/5] fix(dns): segfaults in pkarr (#3120) ## Description `simple-dns` had a number of risky parsing calls that could go out of bounds and produce a segfault. Through the power of OSS and the daisy chain of bumped dependencies this should now be fixed. Closes https://github.com/n0-computer/iroh/issues/2844 ## Breaking Changes ## Notes & open questions ## Change checklist - [ ] Self-review. - [ ] Documentation updates following the [style guide](https://rust-lang.github.io/rfcs/1574-more-api-documentation-conventions.html#appendix-a-full-conventions-text), if relevant. - [ ] Tests if relevant. - [ ] All breaking changes documented. --- Cargo.lock | 391 ++++++++++++++++++++----------------- iroh-dns-server/Cargo.toml | 4 +- 2 files changed, 210 insertions(+), 185 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 11246f5a97..066298f345 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -129,9 +129,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.94" +version = "1.0.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1fd03a028ef38ba2276dce7e33fcd6369c158a1bca17946c4b1b701891c1ff7" +checksum = "34ac096ce696dc2fcabef30516bb13c0a68a11d30131d3df6f04711467681b04" [[package]] name = "arc-swap" @@ -163,7 +163,7 @@ checksum = "965c2d33e53cb6b267e148a4cb0760bc01f4904c1cd4bb4002a085bb016d1490" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", "synstructure", ] @@ -175,7 +175,7 @@ checksum = "7b18050c2cd6fe86c3a76584ef5e0baf286d038cda203eb6223df2cc413565f7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] @@ -186,18 +186,18 @@ checksum = "3b43422f69d8ff38f95f1b2bb76517c91589a924d1559a0e935d7c8ce0274c11" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] name = "async-trait" -version = "0.1.83" +version = "0.1.85" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "721cae7de5c34fbb2acd27e21e6d2cf7b886dce0c27388d46c4e6c47ea4318dd" +checksum = "3f934833b4b7233644e5848f235df3f57ed8c80f1528a26c3dfa13d2147fa056" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] @@ -296,7 +296,7 @@ checksum = "57d123550fa8d071b7255cb0cc04dc302baa6c8c4a79f55701552684d8399bce" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] @@ -402,9 +402,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.6.0" +version = "2.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" +checksum = "1be3f42a67d6d345ecd59f675f3f012d6974981560836e938c22b424b85ce1be" [[package]] name = "block-buffer" @@ -447,9 +447,9 @@ checksum = "37b2a672a2cb129a2e41c10b1224bb368f9f37a2b16b612598138befd7b37eb5" [[package]] name = "cc" -version = "1.2.4" +version = "1.2.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9157bbaa6b165880c27a4293a474c91cdcf265cc68cc829bf10be0964a391caf" +checksum = "c8293772165d9345bdaaa39b45b2109591e63fe5e6fbc23c6ff930a048aa310b" dependencies = [ "shlex", ] @@ -536,9 +536,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.5.23" +version = "4.5.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3135e7ec2ef7b10c6ed8950f0f792ed96ee093fa088608f1c76e569722700c84" +checksum = "a8eb5e908ef3a6efbe1ed62520fb7287959888c88485abe072543190ecc66783" dependencies = [ "clap_builder", "clap_derive", @@ -546,9 +546,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.23" +version = "4.5.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30582fc632330df2bd26877bde0c1f4470d57c582bbc070376afcd04d8cb4838" +checksum = "96b01801b5fc6a0a232407abc821660c9c6d25a1cafc0d4f85f29fb8d9afc121" dependencies = [ "anstream", "anstyle", @@ -558,14 +558,14 @@ dependencies = [ [[package]] name = "clap_derive" -version = "4.5.18" +version = "4.5.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ac6a0c7b1a9e9a5186361f67dfa1b88213572f427fb9ab038efb2bd8c582dab" +checksum = "54b755194d6389280185988721fffba69495eed5ee9feeee9a599b53db80318c" dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] @@ -630,7 +630,7 @@ version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec10f0a762d93c4498d2e97a333805cb6250d60bead623f71d8034f9a4152ba3" dependencies = [ - "loom", + "loom 0.5.6", "tracing", ] @@ -825,7 +825,7 @@ checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] @@ -894,7 +894,7 @@ checksum = "8034092389675178f570469e6c3b0465d3d30b4505c294a6550db47f3c17ad18" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] @@ -923,7 +923,7 @@ checksum = "cb7330aeadfbe296029522e6c40f315320aba36fc43a5b3632f3795348f3bd22" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", "unicode-xid", ] @@ -979,7 +979,7 @@ checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] @@ -1073,7 +1073,7 @@ dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] @@ -1093,7 +1093,7 @@ checksum = "de0d48a183585823424a4ce1aa132d174a6a81bd540895822eb4c8373a8e49e8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] @@ -1165,9 +1165,9 @@ checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" [[package]] name = "foldhash" -version = "0.1.3" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f81ec6369c545a7d40e4589b5597581fa1c441fe1cce96dd1de43159910a36a2" +checksum = "a0d2fde1f7b3d48b8395d5f2de76c18a528bd6a9cdde438df747bfcba3e05d6f" [[package]] name = "form_urlencoded" @@ -1250,9 +1250,9 @@ checksum = "9e5c1b78ca4aae1ac06c48a526a655760685149f0d465d21f37abfe57ce075c6" [[package]] name = "futures-lite" -version = "2.5.0" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cef40d21ae2c515b51041df9ed313ed21e572df340ea58a922a0aefe7e8891a1" +checksum = "f5edaec856126859abb19ed65f39e90fea3a9574b9707f13539acf4abf7eb532" dependencies = [ "fastrand", "futures-core", @@ -1269,7 +1269,7 @@ checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] @@ -1321,6 +1321,19 @@ dependencies = [ "windows 0.48.0", ] +[[package]] +name = "generator" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc6bd114ceda131d3b1d665eba35788690ad37f5916457286b32ab6fd3c438dd" +dependencies = [ + "cfg-if", + "libc", + "log", + "rustversion", + "windows 0.58.0", +] + [[package]] name = "generic-array" version = "0.14.7" @@ -1353,9 +1366,9 @@ checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f" [[package]] name = "glob" -version = "0.3.1" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" +checksum = "a8d1add55171497b4705a648c6b583acafb01d58050a51727785f0b2c8e0a2b2" [[package]] name = "governor" @@ -1518,7 +1531,7 @@ dependencies = [ "rand", "rustls", "serde", - "thiserror 2.0.7", + "thiserror 2.0.11", "tinyvec", "tokio", "tokio-rustls", @@ -1544,7 +1557,7 @@ dependencies = [ "rustls", "serde", "smallvec", - "thiserror 2.0.7", + "thiserror 2.0.11", "tokio", "tokio-rustls", "tracing", @@ -1570,7 +1583,7 @@ dependencies = [ "prefix-trie", "rustls", "serde", - "thiserror 2.0.7", + "thiserror 2.0.11", "time", "tokio", "tokio-rustls", @@ -1716,9 +1729,9 @@ dependencies = [ [[package]] name = "hyper-rustls" -version = "0.27.3" +version = "0.27.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08afdbb5c31130e3034af566421053ab03787c640246a446327f550d11bcb333" +checksum = "2d191583f3da1305256f22463b9bb0471acad48a4e534a5218b9963e9c1f59b2" dependencies = [ "futures-util", "http 1.2.0", @@ -1889,7 +1902,7 @@ checksum = "1ec89e9337638ecdc08744df490b221a7399bf8d164eb52a665454e60e075ad6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] @@ -2054,7 +2067,7 @@ dependencies = [ "stun-rs", "swarm-discovery", "testresult", - "thiserror 2.0.7", + "thiserror 2.0.11", "tokio", "tokio-rustls", "tokio-stream", @@ -2086,7 +2099,7 @@ dependencies = [ "serde", "serde_json", "serde_test", - "thiserror 2.0.7", + "thiserror 2.0.11", "url", ] @@ -2175,7 +2188,7 @@ dependencies = [ "reqwest", "serde", "struct_iterable", - "thiserror 2.0.7", + "thiserror 2.0.11", "tokio", "tracing", ] @@ -2203,7 +2216,7 @@ dependencies = [ "rustls", "surge-ping", "testresult", - "thiserror 2.0.7", + "thiserror 2.0.11", "tokio", "tokio-util", "tracing", @@ -2306,7 +2319,7 @@ dependencies = [ "serde_json", "stun-rs", "testresult", - "thiserror 2.0.7", + "thiserror 2.0.11", "time", "tokio", "tokio-rustls", @@ -2397,9 +2410,9 @@ checksum = "8eaf4bc02d17cbdd7ff4c7438cafcdf7fb9a4613313ad11b4f8fefe7d3fa0130" [[package]] name = "js-sys" -version = "0.3.76" +version = "0.3.77" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6717b6b5b077764fb5966237269cb3c64edddde4b14ce42647430a78ced9e7b7" +checksum = "1cfaf33c695fc6e08064efbc1f72ec937429614f25eef83af942d0e227c3a28f" dependencies = [ "once_cell", "wasm-bindgen", @@ -2413,9 +2426,9 @@ checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" [[package]] name = "libc" -version = "0.2.168" +version = "0.2.169" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5aaeb2981e0606ca11d79718f8bb01164f1d6ed75080182d3abf017e6d244b6d" +checksum = "b5aba8db14291edd000dfcc4d620c7ebfb122c613afb886ca8803fa4e128a20a" [[package]] name = "libredox" @@ -2423,7 +2436,7 @@ version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.7.0", "libc", ] @@ -2435,9 +2448,9 @@ checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f" [[package]] name = "linux-raw-sys" -version = "0.4.14" +version = "0.4.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" +checksum = "d26c52dbd32dccf2d10cac7725f8eae5296885fb5703b261f7d0a0739ec807ab" [[package]] name = "litemap" @@ -2474,7 +2487,20 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ff50ecb28bb86013e935fb6683ab1f6d3a20016f123c76fd4c27470076ac30f5" dependencies = [ "cfg-if", - "generator", + "generator 0.7.5", + "scoped-tls", + "tracing", + "tracing-subscriber", +] + +[[package]] +name = "loom" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "419e0dc8046cb947daa77eb95ae174acfbddb7673b4151f56d1eed8e93fbfaca" +dependencies = [ + "cfg-if", + "generator 0.8.4", "scoped-tls", "tracing", "tracing-subscriber", @@ -2556,9 +2582,9 @@ checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" [[package]] name = "miniz_oxide" -version = "0.8.0" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2d80299ef12ff69b16a84bb182e3b9df68b5a91574d3d4fa6e41b65deec4df1" +checksum = "4ffbe83022cedc1d264172192511ae958937694cd57ce297164951b8b3568394" dependencies = [ "adler2", ] @@ -2576,21 +2602,20 @@ dependencies = [ [[package]] name = "moka" -version = "0.12.8" +version = "0.12.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32cf62eb4dd975d2dde76432fb1075c49e3ee2331cf36f1f8fd4b66550d32b6f" +checksum = "a9321642ca94a4282428e6ea4af8cc2ca4eac48ac7a6a4ea8f33f76d0ce70926" dependencies = [ "crossbeam-channel", "crossbeam-epoch", "crossbeam-utils", - "once_cell", + "loom 0.7.2", "parking_lot", - "quanta", + "portable-atomic", "rustc_version", "smallvec", "tagptr", "thiserror 1.0.69", - "triomphe", "uuid", ] @@ -2723,7 +2748,7 @@ dependencies = [ "rtnetlink 0.14.1", "serde", "socket2", - "thiserror 2.0.7", + "thiserror 2.0.11", "time", "tokio", "tokio-util", @@ -2749,7 +2774,7 @@ version = "0.27.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2eb04e9c688eff1c89d72b407f168cf79bb9e867a9d3323ed6c01519eb9cc053" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.7.0", "cfg-if", "libc", ] @@ -2850,7 +2875,7 @@ dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] @@ -2870,9 +2895,9 @@ checksum = "830b246a0e5f20af87141b25c173cd1b609bd7779a4617d6ec582abaf90870f3" [[package]] name = "object" -version = "0.36.5" +version = "0.36.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aedf0a2d09c573ed1d8d85b30c119153926a2b36dce0ab28322c09a117a4683e" +checksum = "62948e14d923ea95ea2c7c86c71013138b66525b86bdc08d2dcc262bdb497b87" dependencies = [ "memchr", ] @@ -2980,7 +3005,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b7cafe60d6cf8e62e1b9b2ea516a089c008945bb5a275416789e7db0bc199dc" dependencies = [ "memchr", - "thiserror 2.0.7", + "thiserror 2.0.11", "ucd-trie", ] @@ -3004,7 +3029,7 @@ dependencies = [ "pest_meta", "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] @@ -3020,29 +3045,29 @@ dependencies = [ [[package]] name = "pin-project" -version = "1.1.7" +version = "1.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be57f64e946e500c8ee36ef6331845d40a93055567ec57e8fae13efd33759b95" +checksum = "1e2ec53ad785f4d35dac0adea7f7dc6f1bb277ad84a680c7afefeae05d1f5916" dependencies = [ "pin-project-internal", ] [[package]] name = "pin-project-internal" -version = "1.1.7" +version = "1.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c0f5fad0874fc7abcd4d750e76917eaebbecaa2c20bde22e1dbeeba8beb758c" +checksum = "d56a66c0c55993aa927429d0f8a0abfd74f084e4d9c192cffed01e418d83eefb" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] name = "pin-project-lite" -version = "0.2.15" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "915a1e146535de9163f3987b8944ed8cf49a18bb0056bcebcdcece385cece4ff" +checksum = "3b3cff922bd51709b605d9ead9aa71031d81447142d828eb4a6eba76fe619f9b" [[package]] name = "pin-utils" @@ -3052,9 +3077,9 @@ checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" [[package]] name = "pkarr" -version = "2.2.0" +version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7945a08031b7e14de57e8385cea3bcc7e10a88701595dc11d82551ba07bae13e" +checksum = "92eff194c72f00f3076855b413ad2d940e3a6e307fa697e5c7733e738341aed4" dependencies = [ "bytes", "document-features", @@ -3068,7 +3093,7 @@ dependencies = [ "rand", "self_cell", "simple-dns", - "thiserror 1.0.69", + "thiserror 2.0.11", "tracing", "ureq", "wasm-bindgen", @@ -3133,7 +3158,7 @@ dependencies = [ "proc-macro2", "quote", "regex", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] @@ -3195,7 +3220,7 @@ dependencies = [ "serde", "smallvec", "socket2", - "thiserror 2.0.7", + "thiserror 2.0.11", "time", "tokio", "tokio-util", @@ -3308,9 +3333,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.92" +version = "1.0.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37d3544b3f2748c54e147655edb5025752e2303145b5aefb3c3ea2c78b973bb0" +checksum = "60946a68e5f9d28b0dc1c21bb8a97ee7d018a8b322fa57838ba31cc878e22d99" dependencies = [ "unicode-ident", ] @@ -3335,7 +3360,7 @@ checksum = "440f724eba9f6996b75d63681b0a92b06947f1457076d503a4d2e2c8f56442b8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] @@ -3346,7 +3371,7 @@ checksum = "14cae93065090804185d3b75f0bf93b8eeda30c7a9b4a33d3bdb3988d6229e50" dependencies = [ "bit-set", "bit-vec", - "bitflags 2.6.0", + "bitflags 2.7.0", "lazy_static", "num-traits", "rand", @@ -3360,9 +3385,9 @@ dependencies = [ [[package]] name = "quanta" -version = "0.12.4" +version = "0.12.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "773ce68d0bb9bc7ef20be3536ffe94e223e1f365bd374108b2659fac0c65cfe6" +checksum = "3bd1fe6824cea6538803de3ff1bc0cf3949024db3d43c9643024bfb33a807c0e" dependencies = [ "crossbeam-utils", "libc", @@ -3392,7 +3417,7 @@ dependencies = [ "rustc-hash", "rustls", "socket2", - "thiserror 2.0.7", + "thiserror 2.0.11", "tokio", "tracing", ] @@ -3411,7 +3436,7 @@ dependencies = [ "rustls", "rustls-pki-types", "slab", - "thiserror 2.0.7", + "thiserror 2.0.11", "tinyvec", "tracing", "web-time", @@ -3419,9 +3444,9 @@ dependencies = [ [[package]] name = "quinn-udp" -version = "0.5.8" +version = "0.5.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52cd4b1eff68bf27940dd39811292c49e007f4d0b4c357358dc9b0197be6b527" +checksum = "1c40286217b4ba3a71d644d752e6a0b71f13f1b6a2c5311acfcbe0c2418ed904" dependencies = [ "cfg_aliases", "libc", @@ -3433,9 +3458,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.37" +version = "1.0.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af" +checksum = "0e4dccaaaf89514f546c693ddc140f729f958c247918a13380cccc6078391acc" dependencies = [ "proc-macro2", ] @@ -3495,7 +3520,7 @@ version = "11.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1ab240315c661615f2ee9f0f2cd32d5a7343a84d5ebcccb99d46e6637565e7b0" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.7.0", ] [[package]] @@ -3520,9 +3545,9 @@ dependencies = [ [[package]] name = "rcgen" -version = "0.13.1" +version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54077e1872c46788540de1ea3d7f4ccb1983d12f9aa909b234468676c1a36779" +checksum = "75e669e5202259b5314d1ea5397316ad400819437857b90861765f24c4cf80a2" dependencies = [ "pem", "ring", @@ -3533,9 +3558,9 @@ dependencies = [ [[package]] name = "redb" -version = "2.3.0" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7c2a94325f9c5826b17c42af11067230f503747f870117a28180e85696e21ba" +checksum = "ea0a72cd7140de9fc3e318823b883abf819c20d478ec89ce880466dc2ef263c6" dependencies = [ "libc", ] @@ -3546,7 +3571,7 @@ version = "0.5.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "03a862b389f93e68874fbf580b9de08dd02facb9a788ebadaf4a3fd33cf58834" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.7.0", ] [[package]] @@ -3629,9 +3654,9 @@ dependencies = [ [[package]] name = "reqwest" -version = "0.12.9" +version = "0.12.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a77c62af46e79de0a562e1a9849205ffcb7fc1238876e9bd743357570e04046f" +checksum = "43e734407157c3c2034e0258f5e4473ddb361b1e85f95a66690d67264d7cd1da" dependencies = [ "base64", "bytes", @@ -3660,6 +3685,7 @@ dependencies = [ "sync_wrapper", "tokio", "tokio-rustls", + "tower 0.5.2", "tower-service", "url", "wasm-bindgen", @@ -3762,11 +3788,11 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.42" +version = "0.38.43" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f93dc38ecbab2eb790ff964bb77fa94faf256fd3e73285fd7ba0903b76bedb85" +checksum = "a78891ee6bf2340288408954ac787aa063d8e8817e9f53abb37c695c6d834ef6" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.7.0", "errno", "libc", "linux-raw-sys", @@ -3775,9 +3801,9 @@ dependencies = [ [[package]] name = "rustls" -version = "0.23.20" +version = "0.23.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5065c3f250cbd332cd894be57c40fa52387247659b14a2d6041d121547903b1b" +checksum = "8f287924602bf649d949c63dc8ac8b235fa5387d394020705b80c4eb597ce5b8" dependencies = [ "log", "once_cell", @@ -3797,7 +3823,7 @@ dependencies = [ "rustls-cert-read", "rustls-pemfile", "rustls-pki-types", - "thiserror 2.0.7", + "thiserror 2.0.11", "tokio", ] @@ -3820,7 +3846,7 @@ dependencies = [ "reloadable-state", "rustls", "rustls-cert-read", - "thiserror 2.0.7", + "thiserror 2.0.11", ] [[package]] @@ -3894,9 +3920,9 @@ dependencies = [ [[package]] name = "rustversion" -version = "1.0.18" +version = "1.0.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e819f2bc632f285be6d7cd36e25940d45b2391dd6d9b939e79de557f7014248" +checksum = "f7c45b9784283f1b2e7fb61b42047c2fd678ef0960d4f6f1eba131594cc369d4" [[package]] name = "rusty-fork" @@ -3961,7 +3987,7 @@ version = "2.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.7.0", "core-foundation", "core-foundation-sys", "libc", @@ -3971,9 +3997,9 @@ dependencies = [ [[package]] name = "security-framework-sys" -version = "2.12.1" +version = "2.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa39c7303dc58b5543c94d22c1766b0d31f2ee58306363ea622b10bbc075eaa2" +checksum = "49db231d56a190491cb4aeda9527f1ad45345af50b0851622a7adb8c03b01c32" dependencies = [ "core-foundation-sys", "libc", @@ -3993,9 +4019,9 @@ checksum = "3cb6eb87a131f756572d7fb904f6e7b68633f09cca868c5df1c4b8d1a694bbba" [[package]] name = "serde" -version = "1.0.216" +version = "1.0.217" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b9781016e935a97e8beecf0c933758c97a5520d32930e460142b4cd80c6338e" +checksum = "02fc4265df13d6fa1d00ecff087228cc0a2b5f3c0e87e258d8b94a156e984c70" dependencies = [ "serde_derive", ] @@ -4021,20 +4047,20 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.216" +version = "1.0.217" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46f859dbbf73865c6627ed570e78961cd3ac92407a2d117204c49232485da55e" +checksum = "5a9bf7cf98d04a2b28aead066b7496853d4779c9cc183c440dbac457641e19a0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] name = "serde_json" -version = "1.0.133" +version = "1.0.135" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7fceb2473b9166b2294ef05efcb65a3db80803f0b03ef86a5fc88a2b85ee377" +checksum = "2b0d7ba2887406110130a978386c4e1befb98c674b4fba677954e4db976630d9" dependencies = [ "itoa", "memchr", @@ -4155,11 +4181,11 @@ dependencies = [ [[package]] name = "simple-dns" -version = "0.6.2" +version = "0.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01607fe2e61894468c6dc0b26103abb073fb08b79a3d9e4b6d76a1a341549958" +checksum = "84330be8d9f218c15b4583c74d809643fb82bdcbbd48302a36469ea5b63a1d69" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.7.0", ] [[package]] @@ -4253,7 +4279,7 @@ dependencies = [ "proc-macro2", "quote", "struct_iterable_internal", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] @@ -4281,7 +4307,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] @@ -4358,9 +4384,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.90" +version = "2.0.96" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "919d3b74a5dd0ccd15aeb8f93e7006bd9e14c295087c9896a110f490752bcf31" +checksum = "d5d0adab1ae378d7f53bdebc67a39f1f151407ef230f0ce2883572f5d8985c80" dependencies = [ "proc-macro2", "quote", @@ -4384,7 +4410,7 @@ checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] @@ -4393,7 +4419,7 @@ version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3c879d448e9d986b661742763247d3693ed13609438cf3d006f51f5368a5ba6b" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.7.0", "core-foundation", "system-configuration-sys", ] @@ -4416,12 +4442,13 @@ checksum = "7b2093cf4c8eb1e67749a6762251bc9cd836b6fc171623bd0a9d324d37af2417" [[package]] name = "tempfile" -version = "3.14.0" +version = "3.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28cce251fcbc87fac86a866eeb0d6c2d536fc16d06f184bb61aeae11aa4cee0c" +checksum = "9a8a559c81686f576e8cd0290cd2a24a2a9ad80c98b3478856500fcbd7acd704" dependencies = [ "cfg-if", "fastrand", + "getrandom", "once_cell", "rustix", "windows-sys 0.59.0", @@ -4444,11 +4471,11 @@ dependencies = [ [[package]] name = "thiserror" -version = "2.0.7" +version = "2.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93605438cbd668185516ab499d589afb7ee1859ea3d5fc8f6b0755e1c7443767" +checksum = "d452f284b73e6d76dd36758a0c8684b1d5be31f92b89d07fd5822175732206fc" dependencies = [ - "thiserror-impl 2.0.7", + "thiserror-impl 2.0.11", ] [[package]] @@ -4459,18 +4486,18 @@ checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] name = "thiserror-impl" -version = "2.0.7" +version = "2.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1d8749b4531af2117677a5fcd12b1348a3fe2b81e36e61ffeac5c4aa3273e36" +checksum = "26afc1baea8a989337eeb52b6e72a039780ce45c3edfcc9c5b9d112feeb173c2" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] @@ -4538,9 +4565,9 @@ dependencies = [ [[package]] name = "tinyvec" -version = "1.8.0" +version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "445e881f4f6d382d5f27c034e25eb92edd7c784ceab92a0937db7f2e9471b938" +checksum = "022db8904dfa342efe721985167e9fcd16c29b226db4397ed752a761cfce81e8" dependencies = [ "tinyvec_macros", ] @@ -4553,9 +4580,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.42.0" +version = "1.43.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5cec9b21b0450273377fc97bd4c33a8acffc8c996c987a7c5b319a0083707551" +checksum = "3d61fa4ffa3de412bfea335c6ecff681de2b609ba3c77ef3e00e521813a9ed9e" dependencies = [ "backtrace", "bytes", @@ -4571,13 +4598,13 @@ dependencies = [ [[package]] name = "tokio-macros" -version = "2.4.0" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752" +checksum = "6e06d43f1345a3bcd39f6a56dbb7dcab2ba47e68e8ac134855e7e2bdbaf8cab8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] @@ -4611,7 +4638,7 @@ dependencies = [ "rustls", "serde", "serde_json", - "thiserror 2.0.7", + "thiserror 2.0.11", "time", "tokio", "tokio-rustls", @@ -4746,7 +4773,7 @@ version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "403fa3b783d4b626a8ad51d766ab03cb6d2dbfc46b1c5d4448395e6628dc9697" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.7.0", "bytes", "http 1.2.0", "http-body", @@ -4804,7 +4831,7 @@ checksum = "395ae124c09f9e6918a2310af6038fba074bcf474ac352496d5910dd59a2226d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] @@ -4847,12 +4874,6 @@ dependencies = [ "tracing-log", ] -[[package]] -name = "triomphe" -version = "0.1.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "859eb650cfee7434994602c3a68b25d77ad9e68c8a6cd491616ef86661382eb3" - [[package]] name = "try-lock" version = "0.2.5" @@ -5010,9 +5031,9 @@ checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" [[package]] name = "uuid" -version = "1.11.0" +version = "1.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8c5f0a0af699448548ad1a2fbf920fb4bee257eae39953ba95cb84891a0446a" +checksum = "b913a3b5fe84142e269d63cc62b64319ccaf89b748fc31fe025177f767a756c4" dependencies = [ "getrandom", ] @@ -5065,34 +5086,35 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.99" +version = "0.2.100" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a474f6281d1d70c17ae7aa6a613c87fce69a127e2624002df63dcb39d6cf6396" +checksum = "1edc8929d7499fc4e8f0be2262a241556cfc54a0bea223790e71446f2aab1ef5" dependencies = [ "cfg-if", "once_cell", + "rustversion", "wasm-bindgen-macro", ] [[package]] name = "wasm-bindgen-backend" -version = "0.2.99" +version = "0.2.100" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f89bb38646b4f81674e8f5c3fb81b562be1fd936d84320f3264486418519c79" +checksum = "2f0a0651a5c2bc21487bde11ee802ccaf4c51935d0d3d42a6101f98161700bc6" dependencies = [ "bumpalo", "log", "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-futures" -version = "0.4.49" +version = "0.4.50" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38176d9b44ea84e9184eff0bc34cc167ed044f816accfe5922e54d84cf48eca2" +checksum = "555d470ec0bc3bb57890405e5d4322cc9ea83cebb085523ced7be4144dac1e61" dependencies = [ "cfg-if", "js-sys", @@ -5103,9 +5125,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.99" +version = "0.2.100" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2cc6181fd9a7492eef6fef1f33961e3695e4579b9872a6f7c83aee556666d4fe" +checksum = "7fe63fc6d09ed3792bd0897b314f53de8e16568c2b3f7982f468c0bf9bd0b407" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -5113,28 +5135,31 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.99" +version = "0.2.100" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30d7a95b763d3c45903ed6c81f156801839e5ee968bb07e534c44df0fcd330c2" +checksum = "8ae87ea40c9f689fc23f209965b6fb8a99ad69aeeb0231408be24920604395de" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.99" +version = "0.2.100" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "943aab3fdaaa029a6e0271b35ea10b72b943135afe9bffca82384098ad0e06a6" +checksum = "1a05d73b933a847d6cccdda8f838a22ff101ad9bf93e33684f39c1f5f0eece3d" +dependencies = [ + "unicode-ident", +] [[package]] name = "web-sys" -version = "0.3.76" +version = "0.3.77" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04dd7223427d52553d3702c004d3b2fe07c148165faa56313cb00211e31c12bc" +checksum = "33b6dd2ef9186f1f2072e409e99cd22a975331a6b3591b12c764e0e55c60d5d2" dependencies = [ "js-sys", "wasm-bindgen", @@ -5245,7 +5270,7 @@ checksum = "2bbd5b46c938e506ecbce286b6628a02171d56153ba733b6c741fc627ec9579b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] @@ -5256,7 +5281,7 @@ checksum = "053c4c462dc91d3b1504c6fe5a726dd15e216ba718e84a0e46a88fbe5ded3515" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] @@ -5439,9 +5464,9 @@ checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" [[package]] name = "winnow" -version = "0.6.20" +version = "0.6.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "36c1fec1a2bb5866f07c25f68c26e565c4c200aebb96d7e55710c19d3e8ac49b" +checksum = "c8d71a593cc5c42ad7876e2c1fda56f314f3754c084128833e64f1345ff8a03a" dependencies = [ "memchr", ] @@ -5458,15 +5483,15 @@ dependencies = [ [[package]] name = "wmi" -version = "0.14.2" +version = "0.14.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc47c0776cc6c00d2f7a874a0c846d94d45535936e5a1187693a24f23b4dd701" +checksum = "2c960b3124cc00cefb350159cb43aba8984ed69c93d443df09f3299693171b37" dependencies = [ "chrono", "futures", "log", "serde", - "thiserror 2.0.7", + "thiserror 2.0.11", "windows 0.58.0", "windows-core 0.58.0", ] @@ -5502,9 +5527,9 @@ dependencies = [ [[package]] name = "xml-rs" -version = "0.8.24" +version = "0.8.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea8b391c9a790b496184c29f7f93b9ed5b16abb306c05415b68bcc16e4d06432" +checksum = "c5b940ebc25896e71dd073bad2dbaa2abfe97b0a391415e22ad1326d9c54e3c4" [[package]] name = "xmltree" @@ -5550,7 +5575,7 @@ checksum = "2380878cad4ac9aac1e2435f3eb4020e8374b5f13c296cb75b4620ff8e229154" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", "synstructure", ] @@ -5578,7 +5603,7 @@ checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] @@ -5598,7 +5623,7 @@ checksum = "595eed982f7d355beb85837f651fa22e90b3c044842dc7f2c2842c086f295808" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", "synstructure", ] @@ -5627,5 +5652,5 @@ checksum = "6eafa6dfb17584ea3e2bd6e76e0cc15ad7af12b09abdd1ca55961bed9b1063c6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", ] diff --git a/iroh-dns-server/Cargo.toml b/iroh-dns-server/Cargo.toml index 177e2317c1..7655e256cd 100644 --- a/iroh-dns-server/Cargo.toml +++ b/iroh-dns-server/Cargo.toml @@ -31,7 +31,7 @@ http = "1.0.0" humantime-serde = "1.1.1" iroh-metrics = { version = "0.30.0" } lru = "0.12.3" -pkarr = { version = "2.2.0", features = [ "async", "relay", "dht"], default-features = false } +pkarr = { version = "2.3.1", features = [ "async", "relay", "dht"], default-features = false } rcgen = "0.13" redb = "2.0.0" regex = "1.10.3" @@ -62,7 +62,7 @@ criterion = "0.5.1" hickory-resolver = "=0.25.0-alpha.4" iroh = { path = "../iroh" } iroh-test = { path = "../iroh-test" } -pkarr = { version = "2.2.0", features = ["rand"] } +pkarr = { version = "2.3.1", features = ["rand"] } rand = "0.8" rand_chacha = "0.3.1" testresult = "0.4.1" From 65cf6886eca1930b42de043f927a2c2cd5d518cc Mon Sep 17 00:00:00 2001 From: Floris Bruynooghe Date: Mon, 13 Jan 2025 11:36:03 +0100 Subject: [PATCH 4/5] fix(iroh): Implement Clone for StaticProvider discovery (#3108) ## Description This is not very useful without Clone, it already is Arc> on the inside so this clearly was intended. Write a test demonstrating why this is needed. ## Breaking Changes ## Notes & open questions ## Change checklist - [x] Self-review. - [x] Documentation updates following the [style guide](https://rust-lang.github.io/rfcs/1574-more-api-documentation-conventions.html#appendix-a-full-conventions-text), if relevant. - [x] Tests if relevant. - [x] All breaking changes documented. --- iroh/src/discovery.rs | 16 ++++++++++ iroh/src/discovery/static_provider.rs | 46 ++++++++++++++++++++++++++- 2 files changed, 61 insertions(+), 1 deletion(-) diff --git a/iroh/src/discovery.rs b/iroh/src/discovery.rs index b37cae1522..90627e99a1 100644 --- a/iroh/src/discovery.rs +++ b/iroh/src/discovery.rs @@ -448,6 +448,7 @@ mod tests { use anyhow::Context; use iroh_base::SecretKey; use rand::Rng; + use testresult::TestResult; use tokio_util::task::AbortOnDropHandle; use super::*; @@ -734,6 +735,21 @@ mod tests { .expect("time drift") .as_micros() as u64 } + + #[tokio::test] + async fn test_arc_discovery() -> TestResult { + let discovery = Arc::new(EmptyDiscovery); + + let _ep = Endpoint::builder() + .add_discovery({ + let discovery = discovery.clone(); + move |_| Some(discovery) + }) + .bind() + .await?; + + Ok(()) + } } /// This module contains end-to-end tests for DNS node discovery. diff --git a/iroh/src/discovery/static_provider.rs b/iroh/src/discovery/static_provider.rs index 34cb76f480..12f1d14871 100644 --- a/iroh/src/discovery/static_provider.rs +++ b/iroh/src/discovery/static_provider.rs @@ -12,7 +12,7 @@ use iroh_base::{NodeAddr, NodeId, RelayUrl}; use super::{Discovery, DiscoveryItem}; /// A static discovery implementation that allows providing info for nodes manually. -#[derive(Debug, Default)] +#[derive(Debug, Default, Clone)] #[repr(transparent)] pub struct StaticProvider { nodes: Arc>>, @@ -170,3 +170,47 @@ impl Discovery for StaticProvider { } } } + +#[cfg(test)] +mod tests { + use anyhow::Context; + use iroh_base::SecretKey; + use testresult::TestResult; + + use super::*; + use crate::Endpoint; + + #[tokio::test] + async fn test_basic() -> TestResult { + let discovery = StaticProvider::new(); + + let _ep = Endpoint::builder() + .add_discovery({ + let discovery = discovery.clone(); + move |_| Some(discovery) + }) + .bind() + .await?; + + let key = SecretKey::from_bytes(&[0u8; 32]); + let addr = NodeAddr { + node_id: key.public(), + relay_url: Some("https://example.com".parse()?), + direct_addresses: Default::default(), + }; + discovery.add_node_addr(addr.clone()); + + let back = discovery.get_node_addr(key.public()).context("no addr")?; + + assert_eq!(back, addr); + + let removed = discovery + .remove_node_addr(key.public()) + .context("nothing removed")?; + assert_eq!(removed, addr); + let res = discovery.get_node_addr(key.public()); + assert!(res.is_none()); + + Ok(()) + } +} From eb90bfc9bc9e9beaf8fd5a32dfb38da49399d729 Mon Sep 17 00:00:00 2001 From: Floris Bruynooghe Date: Mon, 13 Jan 2025 12:08:04 +0100 Subject: [PATCH 5/5] docs(iroh): Update discovery docs, mostly StaticProvider (#3109) ## Description Updates a bunch of docs around StaticProvider and links from the right places. This also removes the ability to build docs without using --all-features. The conditionals made things build but are not correct, items that should be documented on docs.rs were not. This goes back to the simpler solution and documents for everyone how they should build docs. ## Breaking Changes ## Notes & open questions ## Change checklist - [x] Self-review. - [x] Documentation updates following the [style guide](https://rust-lang.github.io/rfcs/1574-more-api-documentation-conventions.html#appendix-a-full-conventions-text), if relevant. - [x] Tests if relevant. - [x] All breaking changes documented. --- .github/workflows/ci.yml | 3 - iroh/README.md | 14 +++++ iroh/src/discovery.rs | 25 +++----- iroh/src/discovery/static_provider.rs | 82 +++++++++++++++++++++++---- iroh/src/endpoint.rs | 27 +++++++-- 5 files changed, 117 insertions(+), 34 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 16f6f2849b..80f3119f15 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -228,9 +228,6 @@ jobs: - name: Docs run: cargo doc --workspace --all-features --no-deps --document-private-items - - name: Docs (default features) - run: cargo doc --workspace --no-deps - clippy_check: timeout-minutes: 30 runs-on: ubuntu-latest diff --git a/iroh/README.md b/iroh/README.md index 3727aa750c..025516e5d6 100644 --- a/iroh/README.md +++ b/iroh/README.md @@ -73,6 +73,20 @@ event!( ); ``` +## Building documentation + +Building the documentation is only supported when using +`--all-features`. + +Additionally you might want to enable documenting the cargo features +required for certain APIs, which is done by also passing the `--cfg +iroh_docsrs` flag to rustdoc when building the documentation. This +also requires using nightly rust, e.g.: + +```sh +RUSTDOCFLAGS="--cfg iroh_docsrs" cargo +nightly doc --workspace --no-deps --all-features +``` + # License This project is licensed under either of diff --git a/iroh/src/discovery.rs b/iroh/src/discovery.rs index 90627e99a1..a580e341cf 100644 --- a/iroh/src/discovery.rs +++ b/iroh/src/discovery.rs @@ -23,6 +23,9 @@ //! //! Some generally useful discovery implementations are provided: //! +//! - [`StaticProvider`] which allows application to add and remove out-of-band addressing +//! information. +//! //! - The [`DnsDiscovery`] which performs lookups via the standard DNS systems. To publish //! to this DNS server a [`PkarrPublisher`] is needed. [Number 0] runs a public instance //! of a [`PkarrPublisher`] with attached DNS server which is globally available and a @@ -30,11 +33,9 @@ //! //! - The [`PkarrResolver`] which can perform lookups from designated [pkarr relay servers] //! using HTTP. -#![cfg_attr( - feature = "discovery-local-network", - doc = "- [`LocalSwarmDiscovery`]: local_swarm_discovery::LocalSwarmDiscovery - very similar to mDNS." -)] +//! +//! - [`LocalSwarmDiscovery`]: local_swarm_discovery::LocalSwarmDiscovery which is an mDNS +//! implementation. //! //! - The [`DhtDiscovery`] also uses the [`pkarr`] system but can also publish and lookup //! records to/from the Mainline DHT. @@ -68,13 +69,7 @@ //! # } //! ``` //! -//! To also enable -#![cfg_attr(feature = "discovery-local-network", doc = "[`LocalSwarmDiscovery`]")] -#![cfg_attr( - not(feature = "discovery-local-network"), - doc = "`LocalSwarmDiscovery`" -)] -//! it can be added as another service in the +//! To also enable [`LocalSwarmDiscovery`] it can be added as another service in the //! [`ConcurrentDiscovery`]: //! //! ```no_run @@ -106,10 +101,8 @@ //! [`PkarrPublisher`]: pkarr::PkarrPublisher //! [`DhtDiscovery`]: pkarr::dht::DhtDiscovery //! [pkarr relay servers]: https://pkarr.org/#servers -#![cfg_attr( - feature = "discovery-local-network", - doc = "[`LocalSwarmDiscovery`]: local_swarm_discovery::LocalSwarmDiscovery" -)] +//! [`LocalSwarmDiscovery`]: local_swarm_discovery::LocalSwarmDiscovery +//! [`StaticProvider`]: static_provider::StaticProvider use std::{collections::BTreeSet, net::SocketAddr, sync::Arc, time::Duration}; diff --git a/iroh/src/discovery/static_provider.rs b/iroh/src/discovery/static_provider.rs index 12f1d14871..77757ef3d9 100644 --- a/iroh/src/discovery/static_provider.rs +++ b/iroh/src/discovery/static_provider.rs @@ -1,4 +1,15 @@ -//! A static discovery implementation that allows adding info for nodes manually. +//! A static node discovery to manually add node addressing information. +//! +//! Often an application might get node addressing information out-of-band in an +//! application-specific way. [`NodeTicket`]'s are one common way used to achieve this. +//! This "static" addressing information is often only usable for a limited time so needs to +//! be able to be removed again once know it is no longer useful. +//! +//! This is where the [`StaticProvider`] is useful: it allows applications to add and +//! retract node addressing information that is otherwise out-of-band to iroh. +//! +//! [`NodeTicket`]: https://docs.rs/iroh-base/latest/iroh_base/ticket/struct.NodeTicket + use std::{ collections::{btree_map::Entry, BTreeMap, BTreeSet}, net::SocketAddr, @@ -11,7 +22,48 @@ use iroh_base::{NodeAddr, NodeId, RelayUrl}; use super::{Discovery, DiscoveryItem}; -/// A static discovery implementation that allows providing info for nodes manually. +/// A static node discovery to manually add node addressing information. +/// +/// Often an application might get node addressing information out-of-band in an +/// application-specific way. [`NodeTicket`]'s are one common way used to achieve this. +/// This "static" addressing information is often only usable for a limited time so needs to +/// be able to be removed again once know it is no longer useful. +/// +/// This is where the [`StaticProvider`] is useful: it allows applications to add and +/// retract node addressing information that is otherwise out-of-band to iroh. +/// +/// # Examples +/// +/// ```rust +/// use iroh::{discovery::static_provider::StaticProvider, Endpoint, NodeAddr}; +/// use iroh_base::SecretKey; +/// +/// # #[tokio::main] +/// # async fn main() -> anyhow::Result<()> { +/// // Create the discovery service and endpoint. +/// let discovery = StaticProvider::new(); +/// +/// let _ep = Endpoint::builder() +/// .add_discovery({ +/// let discovery = discovery.clone(); +/// move |_| Some(discovery) +/// }) +/// .bind() +/// .await?; +/// +/// /// Sometime later add a RelayUrl for a fake NodeId. +/// let key = SecretKey::from_bytes(&[0u8; 32]); // Do not use fake secret keys! +/// discovery.add_node_addr(NodeAddr { +/// node_id: key.public(), +/// relay_url: Some("https://example.com".parse()?), +/// direct_addresses: Default::default(), +/// }); +/// +/// # Ok(()) +/// # } +/// ``` +/// +/// [`NodeTicket`]: https://docs.rs/iroh-base/latest/iroh_base/ticket/struct.NodeTicket #[derive(Debug, Default, Clone)] #[repr(transparent)] pub struct StaticProvider { @@ -27,16 +79,22 @@ struct NodeInfo { impl StaticProvider { /// The provenance string for this discovery implementation. + /// + /// This is mostly used for debugging information and allows understanding the origin of + /// addressing information used by an iroh [`Endpoint`]. + /// + /// [`Endpoint`]: crate::Endpoint pub const PROVENANCE: &'static str = "static_discovery"; - /// Create a new static discovery instance. + /// Creates a new static discovery instance. pub fn new() -> Self { Self::default() } - /// Creates a static discovery instance from something that can be converted into node addresses. + /// Creates a static discovery instance from node addresses. + /// + /// # Examples /// - /// Example: /// ```rust /// use std::{net::SocketAddr, str::FromStr}; /// @@ -68,7 +126,7 @@ impl StaticProvider { res } - /// Add node info for the given node id. + /// Sets node addressing information for the given node ID. /// /// This will completely overwrite any existing info for the node. pub fn set_node_addr(&self, info: impl Into) -> Option { @@ -90,9 +148,11 @@ impl StaticProvider { }) } - /// Add node info for the given node id, combining it with any existing info. + /// Augments node addressing information for the given node ID. /// - /// This will add any new direct addresses and overwrite the relay url. + /// The provided addressing information is combined with the existing info in the static + /// provider. Any new direct addresses are added to those already present while the + /// relay URL is overwritten. pub fn add_node_addr(&self, info: impl Into) { let info: NodeAddr = info.into(); let last_updated = SystemTime::now(); @@ -114,7 +174,7 @@ impl StaticProvider { } } - /// Get node info for the given node id. + /// Returns node addressing information for the given node ID. pub fn get_node_addr(&self, node_id: NodeId) -> Option { let guard = self.nodes.read().expect("poisoned"); let info = guard.get(&node_id)?; @@ -125,7 +185,9 @@ impl StaticProvider { }) } - /// Remove node info for the given node id. + /// Removes all node addressing information for the given node ID. + /// + /// Any removed information is returned. pub fn remove_node_addr(&self, node_id: NodeId) -> Option { let mut guard = self.nodes.write().expect("poisoned"); let info = guard.remove(&node_id)?; diff --git a/iroh/src/endpoint.rs b/iroh/src/endpoint.rs index 781514cc0d..7189cb7183 100644 --- a/iroh/src/endpoint.rs +++ b/iroh/src/endpoint.rs @@ -493,11 +493,14 @@ pub fn make_server_config( /// while still remaining independent connections. This will result in more optimal network /// behaviour. /// -/// New connections are typically created using the [`Endpoint::connect`] and -/// [`Endpoint::accept`] methods. Once established, the [`Connection`] gives access to most -/// [QUIC] features. Individual streams to send data to the peer are created using the -/// [`Connection::open_bi`], [`Connection::accept_bi`], [`Connection::open_uni`] and -/// [`Connection::open_bi`] functions. +/// The endpoint is created using the [`Builder`], which can be created using +/// [`Endpoint::builder`]. +/// +/// Once an endpoint exists, new connections are typically created using the +/// [`Endpoint::connect`] and [`Endpoint::accept`] methods. Once established, the +/// [`Connection`] gives access to most [QUIC] features. Individual streams to send data to +/// the peer are created using the [`Connection::open_bi`], [`Connection::accept_bi`], +/// [`Connection::open_uni`] and [`Connection::open_bi`] functions. /// /// Note that due to the light-weight properties of streams a stream will only be accepted /// once the initiating peer has sent some data on it. @@ -713,10 +716,17 @@ impl Endpoint { /// /// See also [`Endpoint::add_node_addr_with_source`]. /// + /// # Using node discovery instead + /// + /// It is strongly advised to use node discovery using the [`StaticProvider`] instead. + /// This provides more flexibility and future proofing. + /// /// # Errors /// /// Will return an error if we attempt to add our own [`PublicKey`] to the node map or if the /// direct addresses are a subset of ours. + /// + /// [`StaticProvider`]: crate::discovery::static_provider::StaticProvider pub fn add_node_addr(&self, node_addr: NodeAddr) -> Result<()> { self.add_node_addr_inner(node_addr, magicsock::Source::App) } @@ -729,10 +739,17 @@ impl Endpoint { /// address that matches this node's direct addresses will be silently ignored. The *source* is /// used for logging exclusively and will not be stored. /// + /// # Using node discovery instead + /// + /// It is strongly advised to use node discovery using the [`StaticProvider`] instead. + /// This provides more flexibility and future proofing. + /// /// # Errors /// /// Will return an error if we attempt to add our own [`PublicKey`] to the node map or if the /// direct addresses are a subset of ours. + /// + /// [`StaticProvider`]: crate::discovery::static_provider::StaticProvider pub fn add_node_addr_with_source( &self, node_addr: NodeAddr,