From 5bde9b66d12fa13e7592f40e45adca191440a8e3 Mon Sep 17 00:00:00 2001 From: dignifiedquire Date: Tue, 28 Jan 2025 02:11:35 +0000 Subject: [PATCH] feat: upgrade to iroh@0.30.0 --- Cargo.lock | 1016 ++++++++++++++++++++++++------------------ Cargo.toml | 7 +- deny.toml | 46 +- src/imex/transfer.rs | 15 +- src/peer_channels.rs | 104 ++--- src/provider.rs | 8 +- src/qr.rs | 4 +- src/receive_imf.rs | 11 +- 8 files changed, 659 insertions(+), 552 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 510887e33..f5ddd1cbd 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -98,6 +98,12 @@ dependencies = [ "alloc-no-stdlib", ] +[[package]] +name = "allocator-api2" +version = "0.2.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "683d7910e743518b0e34f1186f92494becacb047c7b6bf616c96772180fef923" + [[package]] name = "android-tzdata" version = "0.1.1" @@ -1000,7 +1006,7 @@ version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec10f0a762d93c4498d2e97a333805cb6250d60bead623f71d8034f9a4152ba3" dependencies = [ - "loom", + "loom 0.5.6", "tracing", ] @@ -1097,6 +1103,15 @@ dependencies = [ "itertools", ] +[[package]] +name = "crossbeam-channel" +version = "0.5.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06ba6d68e24814cb8de6bb986db8222d3a027d15872cabc0d18817bc3c0e4471" +dependencies = [ + "crossbeam-utils", +] + [[package]] name = "crossbeam-deque" version = "0.8.5" @@ -1225,7 +1240,9 @@ dependencies = [ "curve25519-dalek-derive", "digest", "fiat-crypto 0.2.6", + "rand_core 0.6.4", "rustc_version", + "serde", "subtle", "zeroize", ] @@ -1278,11 +1295,12 @@ dependencies = [ [[package]] name = "dashmap" -version = "5.5.3" +version = "6.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "978747c1d849a7d2ee5e8adc0159961c48fb7e5db2f06af6723b80123bb53856" +checksum = "5041cc499144891f3790297212f32a74fb938e5136a14943f338ef9e0ae276cf" dependencies = [ "cfg-if", + "crossbeam-utils", "hashbrown", "lock_api", "once_cell", @@ -1321,6 +1339,7 @@ dependencies = [ "bytes", "chrono", "criterion", + "data-encoding", "deltachat-contact-tools", "deltachat-time", "deltachat_derive", @@ -1339,8 +1358,8 @@ dependencies = [ "hyper", "hyper-util", "image", + "iroh", "iroh-gossip", - "iroh-net", "kamadak-exif", "lettre_email", "libc", @@ -1538,7 +1557,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b42b6fa04a440b495c8b04d0e71b707c585f83cb9cb28cf8cd0d976c315e31b4" dependencies = [ "powerfmt", - "serde", ] [[package]] @@ -1700,18 +1718,6 @@ version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dcbb2bf8e87535c23f7a8a321e364ce21462d0ff10cb6407820e8e96dfff6653" -[[package]] -name = "duct" -version = "0.13.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e4ab5718d1224b63252cd0c6f74f6480f9ffeb117438a2e0f5cf6d9a4798929c" -dependencies = [ - "libc", - "once_cell", - "os_pipe", - "shared_child", -] - [[package]] name = "dyn-clone" version = "1.0.17" @@ -2022,9 +2028,9 @@ dependencies = [ [[package]] name = "erased_set" -version = "0.7.0" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76a5aa24577083f8190ad401e376b55887c7cd9083ae95d83ceec5d28ea78125" +checksum = "a02a5d186d7bf1cb21f1f95e1a9cfa5c1f2dcd803a47aad454423ceec13525c5" [[package]] name = "errno" @@ -2057,17 +2063,6 @@ version = "2.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" -[[package]] -name = "event-listener" -version = "4.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67b215c49b2b248c855fb73579eb1f4f26c38ffdc12973e20e07b91d78d5646e" -dependencies = [ - "concurrent-queue", - "parking", - "pin-project-lite", -] - [[package]] name = "event-listener" version = "5.2.0" @@ -2405,37 +2400,6 @@ dependencies = [ "slab", ] -[[package]] -name = "genawaiter" -version = "0.99.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c86bd0361bcbde39b13475e6e36cb24c329964aa2611be285289d1e4b751c1a0" -dependencies = [ - "futures-core", - "genawaiter-macro", - "genawaiter-proc-macro", - "proc-macro-hack", -] - -[[package]] -name = "genawaiter-macro" -version = "0.99.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b32dfe1fdfc0bbde1f22a5da25355514b5e450c33a6af6770884c8750aedfbc" - -[[package]] -name = "genawaiter-proc-macro" -version = "0.99.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "784f84eebc366e15251c4a8c3acee82a6a6f427949776ecb88377362a9621738" -dependencies = [ - "proc-macro-error", - "proc-macro-hack", - "proc-macro2", - "quote", - "syn 1.0.109", -] - [[package]] name = "generator" version = "0.7.5" @@ -2449,6 +2413,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" @@ -2518,14 +2495,15 @@ checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" [[package]] name = "governor" -version = "0.6.3" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68a7f542ee6b35af73b06abc0dad1c1bae89964e4e253bc4b587b91c9637867b" +checksum = "0746aa765db78b521451ef74221663b57ba595bf83f75d0ce23cc09447c8139f" dependencies = [ "cfg-if", "dashmap", - "futures", + "futures-sink", "futures-timer", + "futures-util", "no-std-compat", "nonzero_ext", "parking_lot", @@ -2583,6 +2561,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" dependencies = [ "ahash", + "allocator-api2", ] [[package]] @@ -2614,9 +2593,9 @@ checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" [[package]] name = "hickory-proto" -version = "0.25.0-alpha.2" +version = "0.25.0-alpha.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8270a1857fb962b9914aafd46a89a187a4e63d0eb4190c327e7c7b8256a2d055" +checksum = "d063c0692ee669aa6d261988aa19ca5510f1cc40e4f211024f50c888499a35d7" dependencies = [ "async-recursion", "async-trait", @@ -2626,12 +2605,11 @@ dependencies = [ "futures-channel", "futures-io", "futures-util", - "idna 0.5.0", + "idna", "ipnet", "once_cell", "rand 0.8.5", - "thiserror 1.0.69", - "time 0.3.36", + "thiserror 2.0.9", "tinyvec", "tokio", "tracing", @@ -2640,21 +2618,21 @@ dependencies = [ [[package]] name = "hickory-resolver" -version = "0.25.0-alpha.2" +version = "0.25.0-alpha.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46c110355b5703070d9e29c344d79818a7cde3de9c27fc35750defea6074b0ad" +checksum = "42bc352e4412fb657e795f79b4efcf2bd60b59ee5ca0187f3554194cd1107a27" dependencies = [ "cfg-if", "futures-util", "hickory-proto", "ipconfig", - "lru-cache", + "moka", "once_cell", "parking_lot", "rand 0.8.5", "resolv-conf", "smallvec", - "thiserror 1.0.69", + "thiserror 2.0.9", "tokio", "tracing", ] @@ -2713,6 +2691,17 @@ dependencies = [ "winapi", ] +[[package]] +name = "hostname" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f9c7c7c8ac16c798734b8a24560c1362120597c40d5e1459f09498f8f6c8f2ba" +dependencies = [ + "cfg-if", + "libc", + "windows 0.52.0", +] + [[package]] name = "hostname-validator" version = "1.1.1" @@ -3019,16 +3008,6 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" -[[package]] -name = "idna" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" -dependencies = [ - "unicode-bidi", - "unicode-normalization", -] - [[package]] name = "idna" version = "1.0.3" @@ -3144,40 +3123,111 @@ dependencies = [ "socket2", "widestring", "windows-sys 0.48.0", - "winreg 0.50.0", + "winreg", ] [[package]] name = "ipnet" -version = "2.9.0" +version = "2.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f518f335dce6725a761382244631d86cf0ccb2863413590b31338feb467f9c3" +checksum = "469fb0b9cefa57e3ef31275ee7cacb78f2fdca44e4765491884a2b119d4eb130" [[package]] -name = "iroh-base" -version = "0.28.0" +name = "iroh" +version = "0.30.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c21fd8eb71f166a172a9779c2244db992218e9a9bd929b9df6fc355d2b630c9" +checksum = "3a59352a43dc4199fc804e1a7f3729bd14baff496fd3efbba98763e204bc4af0" dependencies = [ "aead", "anyhow", + "backoff", + "base64 0.22.1", + "bytes", + "concurrent-queue", "crypto_box", "data-encoding", + "der", + "derive_more", + "ed25519-dalek", + "futures-buffered", + "futures-concurrency", + "futures-lite 2.5.0", + "futures-sink", + "futures-util", + "governor", + "hickory-resolver", + "hostname 0.4.0", + "http 1.1.0", + "http-body-util", + "hyper", + "hyper-util", + "igd-next", + "iroh-base", + "iroh-metrics 0.30.0", + "iroh-net-report", + "iroh-quinn", + "iroh-quinn-proto", + "iroh-quinn-udp", + "iroh-relay", + "libc", + "netdev", + "netlink-packet-core", + "netlink-packet-route 0.19.0", + "netlink-packet-route 0.21.0", + "netlink-sys", + "netwatch 0.2.0", + "num_enum", + "once_cell", + "pin-project", + "pkarr", + "portmapper", + "postcard", + "rand 0.8.5", + "rcgen", + "reqwest", + "ring", + "rtnetlink 0.13.1", + "rtnetlink 0.14.1", + "rustls", + "rustls-webpki", + "serde", + "smallvec", + "socket2", + "strum", + "stun-rs", + "surge-ping", + "thiserror 2.0.9", + "time 0.3.36", + "tokio", + "tokio-rustls", + "tokio-stream", + "tokio-tungstenite", + "tokio-tungstenite-wasm", + "tokio-util", + "tracing", + "url", + "webpki-roots", + "windows 0.58.0", + "wmi", + "x509-parser", + "z32", +] + +[[package]] +name = "iroh-base" +version = "0.30.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cdd4101e3f0732d901beb5461cb9bc415feeda8d21281ab5bf5c0c3458eebde2" +dependencies = [ + "curve25519-dalek", + "data-encoding", "derive_more", "ed25519-dalek", "getrandom 0.2.12", - "hex", - "iroh-blake3", - "once_cell", - "postcard", - "rand 0.8.5", "rand_core 0.6.4", "serde", - "ssh-key", - "thiserror 1.0.69", - "ttl_cache", + "thiserror 2.0.9", "url", - "zeroize", ] [[package]] @@ -3195,9 +3245,9 @@ dependencies = [ [[package]] name = "iroh-gossip" -version = "0.28.1" +version = "0.30.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c078057037f0e741c5ef285c67fd9cfdb928163dd046fb547089898bdb02990e" +checksum = "290342adf09382c1a446da805076036677d90556021f5dc427dd245404880d58" dependencies = [ "anyhow", "async-channel 2.3.1", @@ -3207,12 +3257,11 @@ dependencies = [ "futures-concurrency", "futures-lite 2.5.0", "futures-util", + "hex", "indexmap", - "iroh-base", + "iroh", "iroh-blake3", - "iroh-metrics", - "iroh-net", - "iroh-router", + "iroh-metrics 0.30.0", "postcard", "rand 0.8.5", "rand_core 0.6.4", @@ -3225,11 +3274,10 @@ dependencies = [ [[package]] name = "iroh-metrics" -version = "0.28.0" +version = "0.30.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0d40f2ee3997489d47403d204a06514ed65373d224b5b43a8ea133f543e5db1" +checksum = "d7efd9d7437db258f4d44852beea820cd872e4db976928ee0c2bc615b8c4fe5a" dependencies = [ - "anyhow", "erased_set", "http-body-util", "hyper", @@ -3239,88 +3287,57 @@ dependencies = [ "reqwest", "serde", "struct_iterable", - "time 0.3.36", + "thiserror 2.0.9", "tokio", "tracing", ] [[package]] -name = "iroh-net" -version = "0.28.1" +name = "iroh-metrics" +version = "0.31.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b40e1f1f9029e198c6d05bd232d3239814b0a66ac4668978729b709aeb6a44e2" +checksum = "571d177e20f0848a643a2c0f662be0e08968f8743b0776941f83a2152b87a180" dependencies = [ - "anyhow", - "backoff", - "base64 0.22.1", - "bytes", - "der", - "derive_more", - "duct", - "futures-buffered", - "futures-concurrency", - "futures-lite 2.5.0", - "futures-sink", - "futures-util", - "genawaiter", - "governor", - "hex", - "hickory-proto", - "hickory-resolver", - "hostname", - "http 1.1.0", + "erased_set", "http-body-util", "hyper", "hyper-util", - "igd-next", - "iroh-base", - "iroh-metrics", - "iroh-quinn", - "iroh-quinn-proto", - "iroh-quinn-udp", - "libc", - "netdev", - "netlink-packet-core", - "netlink-packet-route", - "netlink-sys", - "netwatch", - "num_enum", - "once_cell", - "parking_lot", - "pin-project", - "pkarr", - "portmapper", - "postcard", - "rand 0.8.5", - "rcgen", + "prometheus-client", "reqwest", - "ring", - "rtnetlink", - "rustls", - "rustls-webpki", "serde", - "smallvec", - "socket2", - "strum", - "stun-rs", + "struct_iterable", + "thiserror 2.0.9", + "tokio", + "tracing", +] + +[[package]] +name = "iroh-net-report" +version = "0.30.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ee04b3b957169e3833f08791802e6bd9878213655d1adbcd9191ea78b8d671a" +dependencies = [ + "anyhow", + "bytes", + "derive_more", + "futures-buffered", + "futures-lite 2.5.0", + "hickory-resolver", + "iroh-base", + "iroh-metrics 0.30.0", + "iroh-quinn", + "iroh-relay", + "netwatch 0.2.0", + "portmapper", + "rand 0.8.5", + "reqwest", + "rustls", "surge-ping", "thiserror 1.0.69", - "time 0.3.36", "tokio", - "tokio-rustls", - "tokio-stream", - "tokio-tungstenite", - "tokio-tungstenite-wasm", "tokio-util", "tracing", - "tungstenite", "url", - "watchable", - "webpki-roots", - "windows 0.51.1", - "wmi", - "x509-parser", - "z32", ] [[package]] @@ -3373,19 +3390,57 @@ dependencies = [ ] [[package]] -name = "iroh-router" -version = "0.28.0" +name = "iroh-relay" +version = "0.30.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1fd18ec6325dd3f01625f12c01acff50a4374ee1ab708e7b2078885fd63ad30" +checksum = "fa0080c8d0720009dc5fa109ef2ead96c5aeb8bb8e4534de8f13865520818207" dependencies = [ "anyhow", + "base64 0.22.1", + "bytes", + "data-encoding", + "derive_more", "futures-buffered", "futures-lite 2.5.0", + "futures-sink", "futures-util", - "iroh-net", + "governor", + "hickory-proto", + "hickory-resolver", + "hostname 0.4.0", + "http 1.1.0", + "http-body-util", + "hyper", + "hyper-util", + "iroh-base", + "iroh-metrics 0.30.0", + "iroh-quinn", + "iroh-quinn-proto", + "libc", + "lru", + "num_enum", + "once_cell", + "pin-project", + "postcard", + "rand 0.8.5", + "reqwest", + "ring", + "rustls", + "rustls-webpki", + "serde", + "smallvec", + "socket2", + "stun-rs", + "thiserror 2.0.9", + "time 0.3.36", "tokio", + "tokio-rustls", + "tokio-tungstenite", + "tokio-tungstenite-wasm", "tokio-util", "tracing", + "url", + "webpki-roots", ] [[package]] @@ -3549,12 +3604,6 @@ dependencies = [ "vcpkg", ] -[[package]] -name = "linked-hash-map" -version = "0.5.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f" - [[package]] name = "linux-raw-sys" version = "0.4.14" @@ -3596,7 +3645,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", @@ -3607,14 +3669,8 @@ name = "lru" version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d3262e75e648fce39813cb56ac41f3c3e3f65217ebf3844d818d1f9398cfb0dc" - -[[package]] -name = "lru-cache" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31e24f1ad8321ca0e8a1e0ac13f23cb668e6f5466c2c57319f6a5cf1cc8e3b1c" dependencies = [ - "linked-hash-map", + "hashbrown", ] [[package]] @@ -3634,26 +3690,6 @@ dependencies = [ "quoted_printable", ] -[[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 0.8.5", - "serde", - "serde_bencode", - "serde_bytes", - "sha1_smol", - "thiserror 1.0.69", - "tracing", -] - [[package]] name = "match_cfg" version = "0.1.0" @@ -3691,12 +3727,6 @@ version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "490cc448043f947bae3cbee9c203358d62dbee0db12107a74be5c30ccfd09771" -[[package]] -name = "memalloc" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df39d232f5c40b0891c10216992c2f250c054105cb1e56f0fc9032db6203ecc1" - [[package]] name = "memchr" version = "2.7.1" @@ -3737,6 +3767,25 @@ dependencies = [ "windows-sys 0.52.0", ] +[[package]] +name = "moka" +version = "0.12.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a9321642ca94a4282428e6ea4af8cc2ca4eac48ac7a6a4ea8f33f76d0ce70926" +dependencies = [ + "crossbeam-channel", + "crossbeam-epoch", + "crossbeam-utils", + "loom 0.7.2", + "parking_lot", + "portable-atomic", + "rustc_version", + "smallvec", + "tagptr", + "thiserror 1.0.69", + "uuid", +] + [[package]] name = "mutate_once" version = "0.1.1" @@ -3772,15 +3821,15 @@ dependencies = [ [[package]] name = "netdev" -version = "0.30.0" +version = "0.31.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7516ad2c46cc25da098ed7d6b9a0cbe9e1fbffbd04b1596148b95f2841179c83" +checksum = "f901362e84cd407be6f8cd9d3a46bccf09136b095792785401ea7d283c79b91d" dependencies = [ "dlopen2", + "ipnet", "libc", - "memalloc", "netlink-packet-core", - "netlink-packet-route", + "netlink-packet-route 0.17.1", "netlink-sys", "once_cell", "system-configuration", @@ -3812,6 +3861,35 @@ dependencies = [ "netlink-packet-utils", ] +[[package]] +name = "netlink-packet-route" +version = "0.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74c171cd77b4ee8c7708da746ce392440cb7bcf618d122ec9ecc607b12938bf4" +dependencies = [ + "anyhow", + "byteorder", + "libc", + "log", + "netlink-packet-core", + "netlink-packet-utils", +] + +[[package]] +name = "netlink-packet-route" +version = "0.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "483325d4bfef65699214858f097d504eb812c38ce7077d165f301ec406c3066e" +dependencies = [ + "anyhow", + "bitflags 2.6.0", + "byteorder", + "libc", + "log", + "netlink-packet-core", + "netlink-packet-utils", +] + [[package]] name = "netlink-packet-utils" version = "0.5.2" @@ -3841,9 +3919,9 @@ dependencies = [ [[package]] name = "netlink-sys" -version = "0.8.5" +version = "0.8.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6471bf08e7ac0135876a9581bf3217ef0333c191c128d34878079f42ee150411" +checksum = "16c903aa70590cb93691bf97a767c8d1d6122d2cc9070433deb3bbf36ce8bd23" dependencies = [ "bytes", "futures", @@ -3854,30 +3932,67 @@ dependencies = [ [[package]] name = "netwatch" -version = "0.1.0" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a639d52c0996ac640e2a7052a5265c8f71efdbdadc83188435ffc358b7ca931" +checksum = "304c0c1b348830b016039f2cb1c5ac8217084a78875262c5594925dd08aa77fc" dependencies = [ "anyhow", + "atomic-waker", "bytes", "derive_more", "futures-lite 2.5.0", "futures-sink", "futures-util", + "iroh-quinn-udp", "libc", "netdev", "netlink-packet-core", - "netlink-packet-route", + "netlink-packet-route 0.19.0", "netlink-sys", "once_cell", - "rtnetlink", + "rtnetlink 0.13.1", + "rtnetlink 0.14.1", "serde", "socket2", - "thiserror 1.0.69", + "thiserror 2.0.9", "time 0.3.36", "tokio", + "tokio-util", "tracing", - "windows 0.51.1", + "windows 0.58.0", + "wmi", +] + +[[package]] +name = "netwatch" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64da82edf903649e6cb6a77b5a6f7fe01387d8865065d411d139018510880302" +dependencies = [ + "anyhow", + "atomic-waker", + "bytes", + "derive_more", + "futures-lite 2.5.0", + "futures-sink", + "futures-util", + "iroh-quinn-udp", + "libc", + "netdev", + "netlink-packet-core", + "netlink-packet-route 0.19.0", + "netlink-sys", + "once_cell", + "rtnetlink 0.13.1", + "rtnetlink 0.14.1", + "serde", + "socket2", + "thiserror 2.0.9", + "time 0.3.36", + "tokio", + "tokio-util", + "tracing", + "windows 0.58.0", "wmi", ] @@ -3901,6 +4016,17 @@ dependencies = [ "libc", ] +[[package]] +name = "nix" +version = "0.27.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2eb04e9c688eff1c89d72b407f168cf79bb9e867a9d3323ed6c01519eb9cc053" +dependencies = [ + "bitflags 2.6.0", + "cfg-if", + "libc", +] + [[package]] name = "nix" version = "0.29.0" @@ -4185,16 +4311,6 @@ dependencies = [ "winapi", ] -[[package]] -name = "os_pipe" -version = "1.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57119c3b893986491ec9aa85056780d3a0f3cf4da7cc09dd3650dbd6c6738fb9" -dependencies = [ - "libc", - "windows-sys 0.52.0", -] - [[package]] name = "overload" version = "0.1.1" @@ -4462,13 +4578,11 @@ checksum = "89f9e12544b00f5561253bbd3cb72a85ff3bc398483dc1bf82bdf095c774136b" dependencies = [ "bytes", "document-features", - "dyn-clone", "ed25519-dalek", "flume", "futures", "js-sys", "lru", - "mainline", "self_cell", "simple-dns", "thiserror 1.0.69", @@ -4621,9 +4735,9 @@ checksum = "7170ef9988bc169ba16dd36a7fa041e5c4cbeb6a35b76d4c03daded371eae7c0" [[package]] name = "portmapper" -version = "0.1.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93d60045fdcfe8ff6b781cf1027fdbb08ed319d93aff7da4bedc018e3bc92226" +checksum = "5469b29e6ce2a27bfc9382720b5f0768993afec9e53b133d8248c8b09406156a" dependencies = [ "anyhow", "base64 0.22.1", @@ -4632,15 +4746,15 @@ dependencies = [ "futures-lite 2.5.0", "futures-util", "igd-next", - "iroh-metrics", + "iroh-metrics 0.31.0", "libc", - "netwatch", + "netwatch 0.3.0", "num_enum", "rand 0.8.5", "serde", "smallvec", "socket2", - "thiserror 1.0.69", + "thiserror 2.0.9", "time 0.3.36", "tokio", "tokio-util", @@ -4746,32 +4860,6 @@ dependencies = [ "toml_edit", ] -[[package]] -name = "proc-macro-error" -version = "0.4.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18f33027081eba0a6d8aba6d1b1c3a3be58cbb12106341c2d5759fcd9b5277e7" -dependencies = [ - "proc-macro-error-attr", - "proc-macro2", - "quote", - "syn 1.0.109", - "version_check", -] - -[[package]] -name = "proc-macro-error-attr" -version = "0.4.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a5b4b77fdb63c1eca72173d68d24501c54ab1269409f6b672c85deb18af69de" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", - "syn-mid", - "version_check", -] - [[package]] name = "proc-macro-error-attr2" version = "2.0.0" @@ -4794,12 +4882,6 @@ dependencies = [ "syn 2.0.94", ] -[[package]] -name = "proc-macro-hack" -version = "0.5.20+deprecated" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc375e1527247fe1a97d8b7156678dfe7c1af2fc075c9a4db3690ecd2a148068" - [[package]] name = "proc-macro2" version = "1.0.92" @@ -5103,12 +5185,13 @@ dependencies = [ [[package]] name = "rcgen" -version = "0.12.1" +version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48406db8ac1f3cbc7dcdb56ec355343817958a356ff430259bb07baf7607e1e1" +checksum = "75e669e5202259b5314d1ea5397316ad400819437857b90861765f24c4cf80a2" dependencies = [ "pem", "ring", + "rustls-pki-types", "time 0.3.36", "yasna", ] @@ -5194,9 +5277,9 @@ checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" [[package]] name = "reqwest" -version = "0.12.5" +version = "0.12.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7d6d2a27d57148378eb5e111173f4276ad26340ecc5c49a4a2152167a2d6a37" +checksum = "a77c62af46e79de0a562e1a9849205ffcb7fc1238876e9bd743357570e04046f" dependencies = [ "base64 0.22.1", "bytes", @@ -5231,7 +5314,7 @@ dependencies = [ "wasm-bindgen-futures", "web-sys", "webpki-roots", - "winreg 0.52.0", + "windows-registry", ] [[package]] @@ -5240,7 +5323,7 @@ version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "52e44394d2086d010551b14b53b1f24e31647570cd1deb0379e2c21b329aba00" dependencies = [ - "hostname", + "hostname 0.3.1", "quick-error 1.2.3", ] @@ -5311,7 +5394,6 @@ dependencies = [ "pkcs1", "pkcs8", "rand_core 0.6.4", - "sha2", "signature", "spki", "subtle", @@ -5327,7 +5409,7 @@ dependencies = [ "futures", "log", "netlink-packet-core", - "netlink-packet-route", + "netlink-packet-route 0.17.1", "netlink-packet-utils", "netlink-proto", "netlink-sys", @@ -5336,6 +5418,24 @@ dependencies = [ "tokio", ] +[[package]] +name = "rtnetlink" +version = "0.14.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b684475344d8df1859ddb2d395dd3dac4f8f3422a1aa0725993cb375fc5caba5" +dependencies = [ + "futures", + "log", + "netlink-packet-core", + "netlink-packet-route 0.19.0", + "netlink-packet-utils", + "netlink-proto", + "netlink-sys", + "nix 0.27.1", + "thiserror 1.0.69", + "tokio", +] + [[package]] name = "rusqlite" version = "0.32.1" @@ -5675,25 +5775,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" @@ -5802,12 +5883,6 @@ dependencies = [ "zeroize", ] -[[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" @@ -5893,16 +5968,6 @@ dependencies = [ "lazy_static", ] -[[package]] -name = "shared_child" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0d94659ad3c2137fef23ae75b03d5241d633f8acded53d672decfa0e6e0caef" -dependencies = [ - "libc", - "winapi", -] - [[package]] name = "shlex" version = "1.3.0" @@ -6002,48 +6067,6 @@ dependencies = [ "der", ] -[[package]] -name = "ssh-cipher" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "caac132742f0d33c3af65bfcde7f6aa8f62f0e991d80db99149eb9d44708784f" -dependencies = [ - "cipher", - "ssh-encoding", -] - -[[package]] -name = "ssh-encoding" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb9242b9ef4108a78e8cd1a2c98e193ef372437f8c22be363075233321dd4a15" -dependencies = [ - "base64ct", - "pem-rfc7468", - "sha2", -] - -[[package]] -name = "ssh-key" -version = "0.6.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca9b366a80cf18bb6406f4cf4d10aebfb46140a8c0c33f666a144c5c76ecbafc" -dependencies = [ - "ed25519-dalek", - "p256", - "p384", - "p521", - "rand_core 0.6.4", - "rsa", - "sec1", - "sha2", - "signature", - "ssh-cipher", - "ssh-encoding", - "subtle", - "zeroize", -] - [[package]] name = "stable_deref_trait" version = "1.2.0" @@ -6187,17 +6210,6 @@ dependencies = [ "unicode-ident", ] -[[package]] -name = "syn-mid" -version = "0.5.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fea305d57546cc8cd04feb14b62ec84bf17f50e3f7b12560d7bfa9265f39d9ed" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - [[package]] name = "sync_wrapper" version = "0.1.2" @@ -6209,6 +6221,9 @@ name = "sync_wrapper" version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "384595c11a4e2969895cad5a8c4029115f5ab956a9e5ef4de79d11a426e5f20c" +dependencies = [ + "futures-core", +] [[package]] name = "synstructure" @@ -6262,6 +6277,12 @@ version = "4.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "094c9f64d6de9a8506b1e49b63a29333b37ed9e821ee04be694d431b3264c3c5" +[[package]] +name = "tagptr" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b2093cf4c8eb1e67749a6762251bc9cd836b6fc171623bd0a9d324d37af2417" + [[package]] name = "tempfile" version = "3.14.0" @@ -6707,15 +6728,6 @@ version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" -[[package]] -name = "ttl_cache" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4189890526f0168710b6ee65ceaedf1460c48a14318ceec933cb26baa492096a" -dependencies = [ - "linked-hash-map", -] - [[package]] name = "tungstenite" version = "0.21.0" @@ -6795,12 +6807,6 @@ version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eaea85b334db583fe3274d12b4cd1880032beab409c0d774be044d4480ab9a94" -[[package]] -name = "unicode-bidi" -version = "0.3.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75" - [[package]] name = "unicode-ident" version = "1.0.12" @@ -6884,7 +6890,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "32f8b686cadd1473f4bd0117a5d28d36b1ade384ea9b5069a1c40aefed7fda60" dependencies = [ "form_urlencoded", - "idna 1.0.3", + "idna", "percent-encoding", "serde", ] @@ -7056,18 +7062,6 @@ version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96" -[[package]] -name = "watchable" -version = "1.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "45b42a2f611916b5965120a9cde2b60f2db4454826dd9ad5e6f47c24a5b3b259" -dependencies = [ - "event-listener 4.0.3", - "futures-util", - "parking_lot", - "thiserror 1.0.69", -] - [[package]] name = "web-sys" version = "0.3.69" @@ -7150,16 +7144,6 @@ dependencies = [ "windows-targets 0.48.5", ] -[[package]] -name = "windows" -version = "0.51.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca229916c5ee38c2f2bc1e9d8f04df975b4bd93f9955dc69fabb5d91270045c9" -dependencies = [ - "windows-core 0.51.1", - "windows-targets 0.48.5", -] - [[package]] name = "windows" version = "0.52.0" @@ -7167,18 +7151,27 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e48a53791691ab099e5e2ad123536d0fff50652600abaf43bbf952894110d0be" dependencies = [ "windows-core 0.52.0", - "windows-implement", - "windows-interface", "windows-targets 0.52.6", ] [[package]] -name = "windows-core" -version = "0.51.1" +name = "windows" +version = "0.58.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1f8cf84f35d2db49a46868f947758c7a1138116f7fac3bc844f43ade1292e64" +checksum = "dd04d41d93c4992d421894c18c8b43496aa748dd4c081bac0dc93eb0489272b6" dependencies = [ - "windows-targets 0.48.5", + "windows-core 0.58.0", + "windows-targets 0.52.6", +] + +[[package]] +name = "windows" +version = "0.59.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f919aee0a93304be7f62e8e5027811bbba96bcb1de84d6618be56e43f8a32a1" +dependencies = [ + "windows-core 0.59.0", + "windows-targets 0.53.0", ] [[package]] @@ -7191,10 +7184,47 @@ dependencies = [ ] [[package]] -name = "windows-implement" -version = "0.52.0" +name = "windows-core" +version = "0.58.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12168c33176773b86799be25e2a2ba07c7aab9968b37541f1094dbd7a60c8946" +checksum = "6ba6d44ec8c2591c134257ce647b7ea6b20335bf6379a27dac5f1641fcf59f99" +dependencies = [ + "windows-implement 0.58.0", + "windows-interface 0.58.0", + "windows-result 0.2.0", + "windows-strings 0.1.0", + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-core" +version = "0.59.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "810ce18ed2112484b0d4e15d022e5f598113e220c53e373fb31e67e21670c1ce" +dependencies = [ + "windows-implement 0.59.0", + "windows-interface 0.59.0", + "windows-result 0.3.0", + "windows-strings 0.3.0", + "windows-targets 0.53.0", +] + +[[package]] +name = "windows-implement" +version = "0.58.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2bbd5b46c938e506ecbce286b6628a02171d56153ba733b6c741fc627ec9579b" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.94", +] + +[[package]] +name = "windows-implement" +version = "0.59.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83577b051e2f49a058c308f17f273b570a6a758386fc291b5f6a934dd84e48c1" dependencies = [ "proc-macro2", "quote", @@ -7203,15 +7233,74 @@ dependencies = [ [[package]] name = "windows-interface" -version = "0.52.0" +version = "0.58.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d8dc32e0095a7eeccebd0e3f09e9509365ecb3fc6ac4d6f5f14a3f6392942d1" +checksum = "053c4c462dc91d3b1504c6fe5a726dd15e216ba718e84a0e46a88fbe5ded3515" dependencies = [ "proc-macro2", "quote", "syn 2.0.94", ] +[[package]] +name = "windows-interface" +version = "0.59.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb26fd936d991781ea39e87c3a27285081e3c0da5ca0fcbc02d368cc6f52ff01" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.94", +] + +[[package]] +name = "windows-registry" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e400001bb720a623c1c69032f8e3e4cf09984deec740f007dd2b03ec864804b0" +dependencies = [ + "windows-result 0.2.0", + "windows-strings 0.1.0", + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-result" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d1043d8214f791817bab27572aaa8af63732e11bf84aa21a45a78d6c317ae0e" +dependencies = [ + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-result" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d08106ce80268c4067c0571ca55a9b4e9516518eaa1a1fe9b37ca403ae1d1a34" +dependencies = [ + "windows-targets 0.53.0", +] + +[[package]] +name = "windows-strings" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4cd9b125c486025df0eabcb585e62173c6c9eddcec5d117d3b6e8c30e2ee4d10" +dependencies = [ + "windows-result 0.2.0", + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-strings" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b888f919960b42ea4e11c2f408fadb55f78a9f236d5eef084103c8ce52893491" +dependencies = [ + "windows-targets 0.53.0", +] + [[package]] name = "windows-sys" version = "0.48.0" @@ -7263,13 +7352,29 @@ dependencies = [ "windows_aarch64_gnullvm 0.52.6", "windows_aarch64_msvc 0.52.6", "windows_i686_gnu 0.52.6", - "windows_i686_gnullvm", + "windows_i686_gnullvm 0.52.6", "windows_i686_msvc 0.52.6", "windows_x86_64_gnu 0.52.6", "windows_x86_64_gnullvm 0.52.6", "windows_x86_64_msvc 0.52.6", ] +[[package]] +name = "windows-targets" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1e4c7e8ceaaf9cb7d7507c974735728ab453b67ef8f18febdd7c11fe59dca8b" +dependencies = [ + "windows_aarch64_gnullvm 0.53.0", + "windows_aarch64_msvc 0.53.0", + "windows_i686_gnu 0.53.0", + "windows_i686_gnullvm 0.53.0", + "windows_i686_msvc 0.53.0", + "windows_x86_64_gnu 0.53.0", + "windows_x86_64_gnullvm 0.53.0", + "windows_x86_64_msvc 0.53.0", +] + [[package]] name = "windows_aarch64_gnullvm" version = "0.48.5" @@ -7282,6 +7387,12 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "86b8d5f90ddd19cb4a147a5fa63ca848db3df085e25fee3cc10b39b6eebae764" + [[package]] name = "windows_aarch64_msvc" version = "0.48.5" @@ -7294,6 +7405,12 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" +[[package]] +name = "windows_aarch64_msvc" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c7651a1f62a11b8cbd5e0d42526e55f2c99886c77e007179efff86c2b137e66c" + [[package]] name = "windows_i686_gnu" version = "0.48.5" @@ -7306,12 +7423,24 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" +[[package]] +name = "windows_i686_gnu" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1dc67659d35f387f5f6c479dc4e28f1d4bb90ddd1a5d3da2e5d97b42d6272c3" + [[package]] name = "windows_i686_gnullvm" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" +[[package]] +name = "windows_i686_gnullvm" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ce6ccbdedbf6d6354471319e781c0dfef054c81fbc7cf83f338a4296c0cae11" + [[package]] name = "windows_i686_msvc" version = "0.48.5" @@ -7324,6 +7453,12 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" +[[package]] +name = "windows_i686_msvc" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "581fee95406bb13382d2f65cd4a908ca7b1e4c2f1917f143ba16efe98a589b5d" + [[package]] name = "windows_x86_64_gnu" version = "0.48.5" @@ -7336,6 +7471,12 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" +[[package]] +name = "windows_x86_64_gnu" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e55b5ac9ea33f2fc1716d1742db15574fd6fc8dadc51caab1c16a3d3b4190ba" + [[package]] name = "windows_x86_64_gnullvm" version = "0.48.5" @@ -7348,6 +7489,12 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0a6e035dd0599267ce1ee132e51c27dd29437f63325753051e71dd9e42406c57" + [[package]] name = "windows_x86_64_msvc" version = "0.48.5" @@ -7360,6 +7507,12 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" +[[package]] +name = "windows_x86_64_msvc" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "271414315aff87387382ec3d271b52d7ae78726f5d44ac98b4f4030c91880486" + [[package]] name = "winnow" version = "0.6.18" @@ -7379,28 +7532,19 @@ dependencies = [ "windows-sys 0.48.0", ] -[[package]] -name = "winreg" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a277a57398d4bfa075df44f501a17cfdf8542d224f0d36095a2adc7aee4ef0a5" -dependencies = [ - "cfg-if", - "windows-sys 0.48.0", -] - [[package]] name = "wmi" -version = "0.13.3" +version = "0.14.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc2f0a4062ca522aad4705a2948fd4061b3857537990202a8ddd5af21607f79a" +checksum = "a73f536e843f309e9f7f1036561f844c0d07cf735603cb0fc230ae76e6da9aff" dependencies = [ "chrono", "futures", "log", "serde", - "thiserror 1.0.69", - "windows 0.52.0", + "thiserror 2.0.9", + "windows 0.59.0", + "windows-core 0.59.0", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index 48ea310a7..d9c7bdb9d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -49,6 +49,7 @@ base64 = { workspace = true } brotli = { version = "7", default-features=false, features = ["std"] } bytes = "1" chrono = { workspace = true, features = ["alloc", "clock", "std"] } +data-encoding = "2.6.0" email = { git = "https://github.com/deltachat/rust-email", branch = "master" } encoded-words = "0.2" escaper = "0.1" @@ -57,14 +58,14 @@ fd-lock = "4" futures-lite = { workspace = true } futures = { workspace = true } hex = "0.4.0" -hickory-resolver = "=0.25.0-alpha.2" +hickory-resolver = "=0.25.0-alpha.4" http-body-util = "0.1.2" humansize = "2" hyper = "1" hyper-util = "0.1.10" image = { version = "0.25.5", default-features=false, features = ["gif", "jpeg", "ico", "png", "pnm", "webp", "bmp"] } -iroh-gossip = { version = "0.28.1", default-features = false, features = ["net"] } -iroh-net = { version = "0.28.1", default-features = false } +iroh-gossip = { version = "0.30", default-features = false, features = ["net"] } +iroh = { version = "0.30", default-features = false } kamadak-exif = "0.6.1" lettre_email = { git = "https://github.com/deltachat/lettre", branch = "master" } libc = { workspace = true } diff --git a/deny.toml b/deny.toml index f64a419fb..7f5e76550 100644 --- a/deny.toml +++ b/deny.toml @@ -12,15 +12,8 @@ ignore = [ # Unmaintained encoding "RUSTSEC-2021-0153", - # Unmaintained proc-macro-error - # - "RUSTSEC-2024-0370", - # Unmaintained instant "RUSTSEC-2024-0384", - - # idna 0.5.0 - "RUSTSEC-2024-0421", ] [bans] @@ -34,14 +27,20 @@ skip = [ { name = "base64", version = "0.21.7" }, { name = "bitflags", version = "1.3.2" }, { name = "event-listener", version = "2.5.3" }, - { name = "event-listener", version = "4.0.3" }, { name = "fastrand", version = "1.9.0" }, { name = "fiat-crypto", version = "0.1.20" }, { name = "futures-lite", version = "1.13.0" }, + { name = "generator", version = "0.7.5" }, { name = "getrandom", version = "<0.2" }, + { name = "hostname", version = "0.3.1" }, { name = "http", version = "0.2.12" }, - { name = "idna", version = "0.5.0" }, + { name = "iroh-metrics", version = "0.30.0" }, + { name = "loom", version = "0.5.6" }, + { name = "netlink-packet-route", version = "0.17.1" }, + { name = "netlink-packet-route", version = "0.21.0" }, + { name = "netwatch" }, { name = "nix", version = "0.26.4" }, + { name = "nix", version = "0.27.1" }, { name = "quick-error", version = "<2.0" }, { name = "rand_chacha", version = "<0.3" }, { name = "rand_core", version = "<0.6" }, @@ -49,6 +48,7 @@ skip = [ { name = "redox_syscall", version = "0.3.5" }, { name = "regex-automata", version = "0.1.10" }, { name = "regex-syntax", version = "0.6.29" }, + { name = "rtnetlink", version = "0.13.1" }, { name = "sync_wrapper", version = "0.1.2" }, { name = "syn", version = "1.0.109" }, { name = "thiserror-impl", version = "1.0.69" }, @@ -56,18 +56,22 @@ skip = [ { name = "time", version = "<0.3" }, { name = "unicode-width", version = "0.1.11" }, { name = "wasi", version = "<0.11" }, - { name = "windows_aarch64_gnullvm", version = "<0.52" }, - { name = "windows_aarch64_msvc", version = "<0.52" }, - { name = "windows-core", version = "<0.54.0" }, - { name = "windows_i686_gnu", version = "<0.52" }, - { name = "windows_i686_msvc", version = "<0.52" }, - { name = "windows-sys", version = "<0.59" }, - { name = "windows-targets", version = "<0.52" }, - { name = "windows", version = "<0.54.0" }, - { name = "windows_x86_64_gnullvm", version = "<0.52" }, - { name = "windows_x86_64_gnu", version = "<0.52" }, - { name = "windows_x86_64_msvc", version = "<0.52" }, - { name = "winreg", version = "0.50.0" }, + { name = "windows" }, + { name = "windows_aarch64_gnullvm" }, + { name = "windows_aarch64_msvc" }, + { name = "windows-core" }, + { name = "windows_i686_gnu" }, + { name = "windows_i686_gnullvm" }, + { name = "windows_i686_msvc" }, + { name = "windows-implement" }, + { name = "windows-interface" }, + { name = "windows-result" }, + { name = "windows-strings" }, + { name = "windows-sys" }, + { name = "windows-targets" }, + { name = "windows_x86_64_gnu" }, + { name = "windows_x86_64_gnullvm" }, + { name = "windows_x86_64_msvc" }, ] diff --git a/src/imex/transfer.rs b/src/imex/transfer.rs index 0496ea151..5295ced21 100644 --- a/src/imex/transfer.rs +++ b/src/imex/transfer.rs @@ -33,8 +33,7 @@ use std::task::Poll; use anyhow::{bail, format_err, Context as _, Result}; use futures_lite::FutureExt; -use iroh_net::relay::RelayMode; -use iroh_net::Endpoint; +use iroh::{Endpoint, RelayMode}; use tokio::fs; use tokio::task::JoinHandle; use tokio_util::sync::CancellationToken; @@ -65,11 +64,11 @@ const BACKUP_ALPN: &[u8] = b"/deltachat/backup"; /// task use the [`Context::stop_ongoing`] mechanism. #[derive(Debug)] pub struct BackupProvider { - /// iroh-net endpoint. + /// iroh endpoint. _endpoint: Endpoint, - /// iroh-net address. - node_addr: iroh_net::NodeAddr, + /// iroh address. + node_addr: iroh::NodeAddr, /// Authentication token that should be submitted /// to retrieve the backup. @@ -162,7 +161,7 @@ impl BackupProvider { async fn handle_connection( context: Context, - conn: iroh_net::endpoint::Connecting, + conn: iroh::endpoint::Connecting, auth_token: String, dbfile: Arc, ) -> Result<()> { @@ -292,7 +291,7 @@ impl Future for BackupProvider { pub async fn get_backup2( context: &Context, - node_addr: iroh_net::NodeAddr, + node_addr: iroh::NodeAddr, auth_token: String, ) -> Result<()> { let relay_mode = RelayMode::Disabled; @@ -342,7 +341,7 @@ pub async fn get_backup2( /// This is a long running operation which will return only when completed. /// /// Using [`Qr`] as argument is a bit odd as it only accepts specific variant of it. It -/// does avoid having [`iroh_net::NodeAddr`] in the primary API however, without +/// does avoid having [`iroh::NodeAddr`] in the primary API however, without /// having to revert to untyped bytes. pub async fn get_backup(context: &Context, qr: Qr) -> Result<()> { match qr { diff --git a/src/peer_channels.rs b/src/peer_channels.rs index 1fc1d832d..158f3785d 100644 --- a/src/peer_channels.rs +++ b/src/peer_channels.rs @@ -24,14 +24,12 @@ //! and `joinRealtimeChannel().send()` just like the other peers. use anyhow::{anyhow, bail, Context as _, Result}; +use data_encoding::BASE32_NOPAD; use email::Header; use futures_lite::StreamExt; +use iroh::{Endpoint, NodeAddr, NodeId, PublicKey, RelayMap, RelayMode, RelayUrl, SecretKey}; use iroh_gossip::net::{Event, Gossip, GossipEvent, JoinOptions, GOSSIP_ALPN}; use iroh_gossip::proto::TopicId; -use iroh_net::key::{PublicKey, SecretKey}; -use iroh_net::relay::{RelayMap, RelayUrl}; -use iroh_net::{relay::RelayMode, Endpoint}; -use iroh_net::{NodeAddr, NodeId}; use parking_lot::Mutex; use std::collections::{BTreeSet, HashMap}; use std::env; @@ -54,8 +52,8 @@ const PUBLIC_KEY_STUB: &[u8] = "static_string".as_bytes(); /// Store iroh peer channels for the context. #[derive(Debug)] pub struct Iroh { - /// [Endpoint] needed for iroh peer channels. - pub(crate) endpoint: Endpoint, + /// iroh router needed for iroh peer channels. + pub(crate) router: iroh::protocol::Router, /// [Gossip] needed for iroh peer channels. pub(crate) gossip: Gossip, @@ -75,15 +73,12 @@ pub struct Iroh { impl Iroh { /// Notify the endpoint that the network has changed. pub(crate) async fn network_change(&self) { - self.endpoint.network_change().await + self.router.endpoint().network_change().await } /// Closes the QUIC endpoint. pub(crate) async fn close(self) -> Result<()> { - self.endpoint - .close(0u32.into(), b"") - .await - .context("Closing iroh endpoint failed") + self.router.shutdown().await.context("Closing iroh failed") } /// Join a topic and create the subscriber loop for it. @@ -120,8 +115,8 @@ impl Iroh { // Inform iroh of potentially new node addresses for node_addr in &peers { - if !node_addr.info.is_empty() { - self.endpoint.add_node_addr(node_addr.clone())?; + if !node_addr.is_empty() { + self.router.endpoint().add_node_addr(node_addr.clone())?; } } @@ -129,7 +124,7 @@ impl Iroh { let (gossip_sender, gossip_receiver) = self .gossip - .join_with_opts(topic, JoinOptions::with_bootstrap(node_ids)) + .subscribe_with_opts(topic, JoinOptions::with_bootstrap(node_ids)) .split(); let ctx = ctx.clone(); @@ -148,10 +143,10 @@ impl Iroh { pub async fn maybe_add_gossip_peers(&self, topic: TopicId, peers: Vec) -> Result<()> { if self.iroh_channels.read().await.get(&topic).is_some() { for peer in &peers { - self.endpoint.add_node_addr(peer.clone())?; + self.router.endpoint().add_node_addr(peer.clone())?; } - self.gossip.join_with_opts( + self.gossip.subscribe_with_opts( topic, JoinOptions::with_bootstrap(peers.into_iter().map(|peer| peer.node_id)), ); @@ -198,8 +193,8 @@ impl Iroh { /// Get the iroh [NodeAddr] without direct IP addresses. pub(crate) async fn get_node_addr(&self) -> Result { - let mut addr = self.endpoint.node_addr().await?; - addr.info.direct_addresses = BTreeSet::new(); + let mut addr = self.router.endpoint().node_addr().await?; + addr.direct_addresses = BTreeSet::new(); Ok(addr) } @@ -242,7 +237,7 @@ impl Context { /// Create iroh endpoint and gossip. async fn init_peer_channels(&self) -> Result { info!(self, "Initializing peer channels."); - let secret_key = SecretKey::generate(); + let secret_key = SecretKey::generate(rand::rngs::OsRng); let public_key = secret_key.public(); let relay_mode = if let Some(relay_url) = self @@ -267,24 +262,22 @@ impl Context { .await?; // create gossip - let my_addr = endpoint.node_addr().await?; - let gossip_config = iroh_gossip::proto::topic::Config { - // Allow messages up to 128 KB in size. - // We set the limit to 128 KiB to account for internal overhead, - // but only guarantee 128 KB of payload to WebXDC developers. - max_message_size: 128 * 1024, - ..Default::default() - }; - let gossip = Gossip::from_endpoint(endpoint.clone(), gossip_config, &my_addr.info); + // Allow messages up to 128 KB in size. + // We set the limit to 128 KiB to account for internal overhead, + // but only guarantee 128 KB of payload to WebXDC developers. - // spawn endpoint loop that forwards incoming connections to the gossiper - let context = self.clone(); + let gossip = Gossip::builder() + .max_message_size(128 * 1024) + .spawn(endpoint.clone()) + .await?; - // Shuts down on deltachat shutdown - tokio::spawn(endpoint_loop(context, endpoint.clone(), gossip.clone())); + let router = iroh::protocol::Router::builder(endpoint) + .accept(GOSSIP_ALPN, gossip.clone()) + .spawn() + .await?; Ok(Iroh { - endpoint, + router, gossip, sequence_numbers: Mutex::new(HashMap::new()), iroh_channels: RwLock::new(HashMap::new()), @@ -506,54 +499,13 @@ fn create_random_topic() -> TopicId { pub(crate) async fn create_iroh_header(ctx: &Context, msg_id: MsgId) -> Result
{ let topic = create_random_topic(); insert_topic_stub(ctx, msg_id, topic).await?; + let topic_string = BASE32_NOPAD.encode(topic.as_bytes()).to_ascii_lowercase(); Ok(Header::new( HeaderDef::IrohGossipTopic.get_headername().to_string(), - topic.to_string(), + topic_string, )) } -async fn endpoint_loop(context: Context, endpoint: Endpoint, gossip: Gossip) { - while let Some(conn) = endpoint.accept().await { - let conn = match conn.accept() { - Ok(conn) => conn, - Err(err) => { - warn!(context, "Failed to accept iroh connection: {err:#}."); - continue; - } - }; - info!(context, "IROH_REALTIME: accepting iroh connection"); - let gossip = gossip.clone(); - let context = context.clone(); - tokio::spawn(async move { - if let Err(err) = handle_connection(&context, conn, gossip).await { - warn!(context, "IROH_REALTIME: iroh connection error: {err}"); - } - }); - } -} - -async fn handle_connection( - context: &Context, - mut conn: iroh_net::endpoint::Connecting, - gossip: Gossip, -) -> anyhow::Result<()> { - let alpn = conn.alpn().await?; - let conn = conn.await?; - let peer_id = iroh_net::endpoint::get_remote_node_id(&conn)?; - - match alpn.as_slice() { - GOSSIP_ALPN => gossip - .handle_connection(conn) - .await - .context(format!("Gossip connection to {peer_id} failed"))?, - _ => warn!( - context, - "Ignoring connection from {peer_id}: unsupported ALPN protocol" - ), - } - Ok(()) -} - async fn subscribe_loop( context: &Context, mut stream: iroh_gossip::net::GossipReceiver, diff --git a/src/provider.rs b/src/provider.rs index 78aade13c..e812ec54a 100644 --- a/src/provider.rs +++ b/src/provider.rs @@ -4,7 +4,7 @@ pub(crate) mod data; use anyhow::Result; use deltachat_contact_tools::EmailAddress; -use hickory_resolver::{config, AsyncResolver, TokioAsyncResolver}; +use hickory_resolver::{config, Resolver, TokioResolver}; use crate::config::Config; use crate::context::Context; @@ -165,11 +165,11 @@ impl ProviderOptions { /// We first try to read the system's resolver from `/etc/resolv.conf`. /// This does not work at least on some Androids, therefore we fallback /// to the default `ResolverConfig` which uses eg. to google's `8.8.8.8` or `8.8.4.4`. -fn get_resolver() -> Result { - if let Ok(resolver) = AsyncResolver::tokio_from_system_conf() { +fn get_resolver() -> Result { + if let Ok(resolver) = Resolver::tokio_from_system_conf() { return Ok(resolver); } - let resolver = AsyncResolver::tokio( + let resolver = Resolver::tokio( config::ResolverConfig::default(), config::ResolverOpts::default(), ); diff --git a/src/qr.rs b/src/qr.rs index 4d2ab4ea2..f9ef653e9 100644 --- a/src/qr.rs +++ b/src/qr.rs @@ -112,7 +112,7 @@ pub enum Qr { /// Provides a backup that can be retrieved using iroh-net based backup transfer protocol. Backup2 { /// Iroh node address. - node_addr: iroh_net::NodeAddr, + node_addr: iroh::NodeAddr, /// Authentication token. auth_token: String, @@ -644,7 +644,7 @@ fn decode_backup2(qr: &str) -> Result { .split_once('&') .context("Backup QR code has no separator")?; let auth_token = auth_token.to_string(); - let node_addr = serde_json::from_str::(node_addr) + let node_addr = serde_json::from_str::(node_addr) .context("Invalid node addr in backup QR code")?; Ok(Qr::Backup2 { diff --git a/src/receive_imf.rs b/src/receive_imf.rs index 3f2588233..4a4f70f91 100644 --- a/src/receive_imf.rs +++ b/src/receive_imf.rs @@ -2,9 +2,9 @@ use std::collections::HashSet; use std::iter; -use std::str::FromStr; use anyhow::{Context as _, Result}; +use data_encoding::BASE32_NOPAD; use deltachat_contact_tools::{addr_cmp, may_be_valid_addr, sanitize_single_line, ContactAddress}; use iroh_gossip::proto::TopicId; use mailparse::SingleInfo; @@ -1664,7 +1664,14 @@ RETURNING id // check if any part contains a webxdc topic id if part.typ == Viewtype::Webxdc { if let Some(topic) = mime_parser.get_header(HeaderDef::IrohGossipTopic) { - let topic = TopicId::from_str(topic).context("wrong gossip topic header")?; + // default encoding of topic ids is `hex`. + let mut topic_raw = [0u8; 32]; + BASE32_NOPAD + .decode_mut(topic.to_ascii_uppercase().as_bytes(), &mut topic_raw) + .map_err(|e| e.error) + .context("Wrong gossip topic header")?; + + let topic = TopicId::from_bytes(topic_raw); insert_topic_stub(context, *msg_id, topic).await?; } else { warn!(context, "webxdc doesn't have a gossip topic")