From 06ada89671bb6d39b7fe472984ccc919a58ecdaf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Cramfox=E2=80=9D?= <“kasey@n0.computer”> Date: Mon, 3 Nov 2025 19:59:08 -0500 Subject: [PATCH 1/3] chore: add patch for `iroh` dependencies Updates the following dependencies to use their main branches: - `iroh` from `https://github.com/n0-computer/iroh.git` --- Cargo.lock | 126 ++++++++++++++++++++++++++++++++++------------------- Cargo.toml | 3 ++ deny.toml | 3 ++ 3 files changed, 88 insertions(+), 44 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 3ca0475..ade8e00 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1334,8 +1334,7 @@ dependencies = [ [[package]] name = "iroh" version = "0.94.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9428cef1eafd2eac584269986d1949e693877ac12065b401dfde69f664b07ac" +source = "git+https://github.com/n0-computer/iroh.git?branch=main#7b9c95b7a12415ded937a62858c72337d3e731a9" dependencies = [ "aead", "backon", @@ -1352,15 +1351,14 @@ dependencies = [ "igd-next", "instant", "iroh-base", - "iroh-metrics", + "iroh-metrics 0.37.0", "iroh-quinn", "iroh-quinn-proto", "iroh-quinn-udp", "iroh-relay", + "n0-error", "n0-future", - "n0-snafu", "n0-watcher", - "nested_enum_utils", "netdev", "netwatch", "pin-project", @@ -1375,7 +1373,6 @@ dependencies = [ "rustls-webpki", "serde", "smallvec", - "snafu", "strum", "time", "tokio", @@ -1390,19 +1387,16 @@ dependencies = [ [[package]] name = "iroh-base" -version = "0.94.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db942f6f3d6fa9b475690c6e8e6684d60591dd886bf1bdfef4c60d89d502215c" +version = "0.94.1" +source = "git+https://github.com/n0-computer/iroh.git?branch=main#7b9c95b7a12415ded937a62858c72337d3e731a9" dependencies = [ "curve25519-dalek", "data-encoding", "derive_more 2.0.1", "ed25519-dalek", - "n0-snafu", - "nested_enum_utils", + "n0-error", "rand_core 0.9.3", "serde", - "snafu", "url", "zeroize", "zeroize_derive", @@ -1414,7 +1408,7 @@ version = "0.36.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c84c167b59ae22f940e78eb347ca5f02aa25608e994cb5a7cc016ac2d5eada18" dependencies = [ - "iroh-metrics-derive", + "iroh-metrics-derive 0.3.1", "itoa", "postcard", "ryu", @@ -1423,6 +1417,21 @@ dependencies = [ "tracing", ] +[[package]] +name = "iroh-metrics" +version = "0.37.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "79e3381da7c93c12d353230c74bba26131d1c8bf3a4d8af0fec041546454582e" +dependencies = [ + "iroh-metrics-derive 0.4.0", + "itoa", + "n0-error", + "postcard", + "ryu", + "serde", + "tracing", +] + [[package]] name = "iroh-metrics-derive" version = "0.3.1" @@ -1435,13 +1444,25 @@ dependencies = [ "syn", ] +[[package]] +name = "iroh-metrics-derive" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d4e12bd0763fd16062f5cc5e8db15dd52d26e75a8af4c7fb57ccee3589b344b8" +dependencies = [ + "heck", + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "iroh-ping" version = "0.6.0" dependencies = [ "anyhow", "iroh", - "iroh-metrics", + "iroh-metrics 0.36.2", "n0-snafu", "tokio", ] @@ -1503,8 +1524,7 @@ dependencies = [ [[package]] name = "iroh-relay" version = "0.94.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "360e201ab1803201de9a125dd838f7a4d13e6ba3a79aeb46c7fbf023266c062e" +source = "git+https://github.com/n0-computer/iroh.git?branch=main#7b9c95b7a12415ded937a62858c72337d3e731a9" dependencies = [ "blake3", "bytes", @@ -1518,13 +1538,12 @@ dependencies = [ "hyper", "hyper-util", "iroh-base", - "iroh-metrics", + "iroh-metrics 0.37.0", "iroh-quinn", "iroh-quinn-proto", "lru 0.16.2", + "n0-error", "n0-future", - "n0-snafu", - "nested_enum_utils", "num_enum", "pin-project", "pkarr", @@ -1536,7 +1555,6 @@ dependencies = [ "serde", "serde_bytes", "sha1", - "snafu", "strum", "tokio", "tokio-rustls", @@ -1713,6 +1731,29 @@ dependencies = [ "uuid", ] +[[package]] +name = "n0-error" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a4839a11b62f1fdd75be912ee20634053c734c2240e867ded41c7f50822c549" +dependencies = [ + "derive_more 2.0.1", + "n0-error-macros", + "spez", +] + +[[package]] +name = "n0-error-macros" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ed2a7e5ca3cb5729d4a162d7bcab5b338bed299a2fee8457568d7e0a747ed89" +dependencies = [ + "heck", + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "n0-future" version = "0.3.0" @@ -1749,25 +1790,13 @@ dependencies = [ [[package]] name = "n0-watcher" -version = "0.4.0" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34c65e127e06e5a2781b28df6a33ea474a7bddc0ac0cfea888bd20c79a1b6516" +checksum = "38acf13c1ddafc60eb7316d52213467f8ccb70b6f02b65e7d97f7799b1f50be4" dependencies = [ "derive_more 2.0.1", + "n0-error", "n0-future", - "snafu", -] - -[[package]] -name = "nested_enum_utils" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1d5475271bdd36a4a2769eac1ef88df0f99428ea43e52dfd8b0ee5cb674695f" -dependencies = [ - "proc-macro-crate", - "proc-macro2", - "quote", - "syn", ] [[package]] @@ -1837,9 +1866,9 @@ dependencies = [ [[package]] name = "netwatch" -version = "0.11.0" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "98d7ec7abdbfe67ee70af3f2002326491178419caea22254b9070e6ff0c83491" +checksum = "26f2acd376ef48b6c326abf3ba23c449e0cb8aa5c2511d189dd8a8a3bfac889b" dependencies = [ "atomic-waker", "bytes", @@ -1848,9 +1877,9 @@ dependencies = [ "iroh-quinn-udp", "js-sys", "libc", + "n0-error", "n0-future", "n0-watcher", - "nested_enum_utils", "netdev", "netlink-packet-core", "netlink-packet-route", @@ -1858,7 +1887,6 @@ dependencies = [ "netlink-sys", "pin-project-lite", "serde", - "snafu", "socket2 0.6.1", "time", "tokio", @@ -2107,9 +2135,9 @@ checksum = "f84267b20a16ea918e43c6a88433c2d54fa145c92a811b5b047ccbe153674483" [[package]] name = "portmapper" -version = "0.11.0" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d73aa9bd141e0ff6060fea89a5437883f3b9ceea1cda71c790b90e17d072a3b3" +checksum = "7b575f975dcf03e258b0c7ab3f81497d7124f508884c37da66a7314aa2a8d467" dependencies = [ "base64", "bytes", @@ -2118,15 +2146,14 @@ dependencies = [ "futures-util", "hyper-util", "igd-next", - "iroh-metrics", + "iroh-metrics 0.37.0", "libc", - "nested_enum_utils", + "n0-error", "netwatch", "num_enum", "rand 0.9.2", "serde", "smallvec", - "snafu", "socket2 0.6.1", "time", "tokio", @@ -2810,6 +2837,17 @@ dependencies = [ "windows-sys 0.60.2", ] +[[package]] +name = "spez" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c87e960f4dca2788eeb86bbdde8dd246be8948790b7618d656e68f9b720a86e8" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "spin" version = "0.9.8" diff --git a/Cargo.toml b/Cargo.toml index ac406d6..ba28b1a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -17,3 +17,6 @@ n0-snafu = "0.2.2" [dev-dependencies] tokio = { version = "1", features = ["full"] } + +[patch.crates-io] +iroh = { git = "https://github.com/n0-computer/iroh.git", branch = "main" } diff --git a/deny.toml b/deny.toml index c9e62c4..0c28d12 100644 --- a/deny.toml +++ b/deny.toml @@ -38,3 +38,6 @@ name = "ring" [[licenses.clarify.license-files]] hash = 3171872035 path = "LICENSE" + +[sources] +allow-git = ["https://github.com/n0-computer/iroh.git"] From 1e01461abe492bcdc5f26ad12a97d3ffbd1a8e07 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Cramfox=E2=80=9D?= <“kasey@n0.computer”> Date: Wed, 5 Nov 2025 18:42:09 -0500 Subject: [PATCH 2/3] chore: upgrade iroh-metrics --- Cargo.lock | 188 +++++------------------------------------------------ Cargo.toml | 9 +-- src/lib.rs | 4 +- 3 files changed, 20 insertions(+), 181 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index ade8e00..f562b4f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2,21 +2,6 @@ # It is not intended for manual editing. version = 4 -[[package]] -name = "addr2line" -version = "0.25.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b5d307320b3181d6d7954e663bd7c774a838b8220fe0593c86d9fb09f498b4b" -dependencies = [ - "gimli", -] - -[[package]] -name = "adler2" -version = "2.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "320119579fcad9c21884f5c4861d16174d0e06250625266f50fe6898340abefa" - [[package]] name = "aead" version = "0.6.0-rc.2" @@ -57,9 +42,6 @@ name = "anyhow" version = "1.0.100" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a23eb6b1614318a8071c9b2521f36b424b2c83db5eb3a0fead4a6c0809af6e61" -dependencies = [ - "backtrace", -] [[package]] name = "arrayref" @@ -152,21 +134,6 @@ dependencies = [ "tokio", ] -[[package]] -name = "backtrace" -version = "0.3.76" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb531853791a215d7c62a30daf0dde835f381ab5de4589cfe7c649d2cbe92bd6" -dependencies = [ - "addr2line", - "cfg-if", - "libc", - "miniz_oxide", - "object", - "rustc-demangle", - "windows-link 0.2.1", -] - [[package]] name = "base16ct" version = "0.3.0" @@ -220,12 +187,6 @@ dependencies = [ "zeroize", ] -[[package]] -name = "btparse" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "387e80962b798815a2b5c4bcfdb6bf626fa922ffe9f74e373103b858738e9f31" - [[package]] name = "bumpalo" version = "3.19.0" @@ -317,17 +278,6 @@ dependencies = [ "thiserror 2.0.17", ] -[[package]] -name = "color-backtrace" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e49b1973af2a47b5b44f7dd0a344598da95c872e1556b045607888784e973b91" -dependencies = [ - "backtrace", - "btparse", - "termcolor", -] - [[package]] name = "combine" version = "4.6.7" @@ -870,12 +820,6 @@ dependencies = [ "wasm-bindgen", ] -[[package]] -name = "gimli" -version = "0.32.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e629b9b98ef3dd8afe6ca2bd0f89306cec16d43d907889945bc5d6687f2f13c7" - [[package]] name = "gloo-timers" version = "0.3.0" @@ -1333,8 +1277,9 @@ dependencies = [ [[package]] name = "iroh" -version = "0.94.0" -source = "git+https://github.com/n0-computer/iroh.git?branch=main#7b9c95b7a12415ded937a62858c72337d3e731a9" +version = "0.95.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2374ba3cdaac152dc6ada92d971f7328e6408286faab3b7350842b2ebbed4789" dependencies = [ "aead", "backon", @@ -1351,7 +1296,7 @@ dependencies = [ "igd-next", "instant", "iroh-base", - "iroh-metrics 0.37.0", + "iroh-metrics", "iroh-quinn", "iroh-quinn-proto", "iroh-quinn-udp", @@ -1387,8 +1332,9 @@ dependencies = [ [[package]] name = "iroh-base" -version = "0.94.1" -source = "git+https://github.com/n0-computer/iroh.git?branch=main#7b9c95b7a12415ded937a62858c72337d3e731a9" +version = "0.95.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "25a8c5fb1cc65589f0d7ab44269a76f615a8c4458356952c9b0ef1c93ea45ff8" dependencies = [ "curve25519-dalek", "data-encoding", @@ -1402,28 +1348,13 @@ dependencies = [ "zeroize_derive", ] -[[package]] -name = "iroh-metrics" -version = "0.36.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c84c167b59ae22f940e78eb347ca5f02aa25608e994cb5a7cc016ac2d5eada18" -dependencies = [ - "iroh-metrics-derive 0.3.1", - "itoa", - "postcard", - "ryu", - "serde", - "snafu", - "tracing", -] - [[package]] name = "iroh-metrics" version = "0.37.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "79e3381da7c93c12d353230c74bba26131d1c8bf3a4d8af0fec041546454582e" dependencies = [ - "iroh-metrics-derive 0.4.0", + "iroh-metrics-derive", "itoa", "n0-error", "postcard", @@ -1432,18 +1363,6 @@ dependencies = [ "tracing", ] -[[package]] -name = "iroh-metrics-derive" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "748d380f26f7c25307c0a7acd181b84b977ddc2a1b7beece1e5998623c323aa1" -dependencies = [ - "heck", - "proc-macro2", - "quote", - "syn", -] - [[package]] name = "iroh-metrics-derive" version = "0.4.0" @@ -1462,8 +1381,8 @@ version = "0.6.0" dependencies = [ "anyhow", "iroh", - "iroh-metrics 0.36.2", - "n0-snafu", + "iroh-metrics", + "n0-error", "tokio", ] @@ -1523,8 +1442,9 @@ dependencies = [ [[package]] name = "iroh-relay" -version = "0.94.0" -source = "git+https://github.com/n0-computer/iroh.git?branch=main#7b9c95b7a12415ded937a62858c72337d3e731a9" +version = "0.95.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43fbdf2aeffa7d6ede1a31f6570866c2199b1cee96a0b563994623795d1bac2c" dependencies = [ "blake3", "bytes", @@ -1538,7 +1458,7 @@ dependencies = [ "hyper", "hyper-util", "iroh-base", - "iroh-metrics 0.37.0", + "iroh-metrics", "iroh-quinn", "iroh-quinn-proto", "lru 0.16.2", @@ -1693,15 +1613,6 @@ version = "2.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f52b00d39961fc5b2736ea853c9cc86238e165017a493d1d5c8eac6bdc4cc273" -[[package]] -name = "miniz_oxide" -version = "0.8.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fa76a2c86f704bdb222d66965fb3d63269ce38518b83cb0575fca855ebb6316" -dependencies = [ - "adler2", -] - [[package]] name = "mio" version = "1.1.0" @@ -1775,19 +1686,6 @@ dependencies = [ "web-time", ] -[[package]] -name = "n0-snafu" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1815107e577a95bfccedb4cfabc73d709c0db6d12de3f14e0f284a8c5036dc4f" -dependencies = [ - "anyhow", - "btparse", - "color-backtrace", - "snafu", - "tracing-error", -] - [[package]] name = "n0-watcher" version = "0.5.0" @@ -1959,15 +1857,6 @@ dependencies = [ "syn", ] -[[package]] -name = "object" -version = "0.37.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff76201f031d8863c38aa7f905eca4f53abbfa15f609db4277d44cd8938f33fe" -dependencies = [ - "memchr", -] - [[package]] name = "once_cell" version = "1.21.3" @@ -2146,7 +2035,7 @@ dependencies = [ "futures-util", "hyper-util", "igd-next", - "iroh-metrics 0.37.0", + "iroh-metrics", "libc", "n0-error", "netwatch", @@ -2446,12 +2335,6 @@ dependencies = [ "windows-sys 0.52.0", ] -[[package]] -name = "rustc-demangle" -version = "0.1.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56f7d92ca342cea22a06f2121d944b4fd82af56988c270852495420f961d4ace" - [[package]] name = "rustc-hash" version = "2.1.1" @@ -2795,28 +2678,6 @@ version = "1.15.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03" -[[package]] -name = "snafu" -version = "0.8.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e84b3f4eacbf3a1ce05eac6763b4d629d60cbc94d632e4092c54ade71f1e1a2" -dependencies = [ - "backtrace", - "snafu-derive", -] - -[[package]] -name = "snafu-derive" -version = "0.8.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1c97747dbf44bb1ca44a561ece23508e99cb592e862f22222dcf42f51d1e451" -dependencies = [ - "heck", - "proc-macro2", - "quote", - "syn", -] - [[package]] name = "socket2" version = "0.5.10" @@ -2964,15 +2825,6 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7b2093cf4c8eb1e67749a6762251bc9cd836b6fc171623bd0a9d324d37af2417" -[[package]] -name = "termcolor" -version = "1.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06794f8f6c5c898b3275aebefa6b8a1cb24cd2c6c79397ab15774837a0bc5755" -dependencies = [ - "winapi-util", -] - [[package]] name = "thiserror" version = "1.0.69" @@ -3261,16 +3113,6 @@ dependencies = [ "valuable", ] -[[package]] -name = "tracing-error" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b1581020d7a273442f5b45074a6a57d5757ad0a47dac0e9f0bd57b81936f3db" -dependencies = [ - "tracing", - "tracing-subscriber", -] - [[package]] name = "tracing-log" version = "0.2.0" diff --git a/Cargo.toml b/Cargo.toml index ba28b1a..5272eee 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,12 +11,9 @@ rust-version = "1.85" [dependencies] anyhow = "1.0.98" -iroh = "0.94" -iroh-metrics = "0.36.0" -n0-snafu = "0.2.2" +iroh = "0.95" +iroh-metrics = "0.37.0" +n0-error = "0.1" [dev-dependencies] tokio = { version = "1", features = ["full"] } - -[patch.crates-io] -iroh = { git = "https://github.com/n0-computer/iroh.git", branch = "main" } diff --git a/src/lib.rs b/src/lib.rs index 919c2e7..162399e 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -84,11 +84,11 @@ impl ProtocolHandler for Ping { /// /// The returned future runs on a newly spawned tokio task, so it can run as long as /// the connection lasts. - async fn accept(&self, connection: Connection) -> n0_snafu::Result<(), AcceptError> { + async fn accept(&self, connection: Connection) -> n0_error::Result<(), AcceptError> { let metrics = self.metrics.clone(); // We can get the remote's node id from the connection. - let node_id = connection.remote_id()?; + let node_id = connection.remote_id(); println!("accepted connection from {node_id}"); // Our protocol is a simple request-response protocol, so we expect the From b61a58a33b9c1a45a81402eb291b6236fb4d0330 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Cramfox=E2=80=9D?= <“kasey@n0.computer”> Date: Wed, 5 Nov 2025 18:43:24 -0500 Subject: [PATCH 3/3] chore: fix deny --- deny.toml | 1 - 1 file changed, 1 deletion(-) diff --git a/deny.toml b/deny.toml index 0c28d12..d6f670f 100644 --- a/deny.toml +++ b/deny.toml @@ -40,4 +40,3 @@ hash = 3171872035 path = "LICENSE" [sources] -allow-git = ["https://github.com/n0-computer/iroh.git"]