From 3eb56b8f2c6b75533492e45534663d73689ebb4d Mon Sep 17 00:00:00 2001 From: Friedel Ziegelmayer Date: Wed, 4 Dec 2024 21:18:03 +0100 Subject: [PATCH] feat: upgrade to iroh 0.29 (#491) iroh-net is now called just `iroh`, more details in a blog post that is coming in the next days --- Cargo.lock | 866 ++++++++++++------ Cargo.toml | 2 +- framework_crates/bones_framework/Cargo.toml | 3 +- .../bones_framework/src/networking.rs | 17 +- .../bones_framework/src/networking/lan.rs | 2 +- .../bones_framework/src/networking/online.rs | 4 +- .../bones_framework/src/networking/socket.rs | 12 +- other_crates/bones_matchmaker/Cargo.toml | 3 +- .../examples/matchmaker_client.rs | 18 +- other_crates/bones_matchmaker/src/lib.rs | 44 +- other_crates/bones_matchmaker/src/lobbies.rs | 15 +- .../bones_matchmaker/src/matchmaker.rs | 103 ++- .../bones_matchmaker/src/matchmaking.rs | 12 +- .../bones_matchmaker_proto/Cargo.toml | 2 +- .../bones_matchmaker_proto/src/lib.rs | 2 +- 15 files changed, 733 insertions(+), 372 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index dad1b44b79..f7dd1cdb61 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -333,7 +333,7 @@ dependencies = [ "nom", "num-traits", "rusticata-macros", - "thiserror", + "thiserror 1.0.63", "time", ] @@ -345,7 +345,7 @@ checksum = "965c2d33e53cb6b267e148a4cb0760bc01f4904c1cd4bb4002a085bb016d1490" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.90", "synstructure", ] @@ -357,7 +357,7 @@ checksum = "7b18050c2cd6fe86c3a76584ef5e0baf286d038cda203eb6223df2cc413565f7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.90", ] [[package]] @@ -380,7 +380,7 @@ dependencies = [ "async-task", "concurrent-queue", "fastrand 2.1.1", - "futures-lite 2.3.0", + "futures-lite 2.5.0", "slab", ] @@ -392,7 +392,7 @@ checksum = "3b43422f69d8ff38f95f1b2bb76517c91589a924d1559a0e935d7c8ce0274c11" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.90", ] [[package]] @@ -409,7 +409,7 @@ checksum = "a27b8a3a6e1a44fa4c8baf1f653e4172e81486d4941f2237e20dc2d0cf4ddff1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.90", ] [[package]] @@ -559,7 +559,7 @@ dependencies = [ "js-sys", "parking_lot", "serde", - "thiserror", + "thiserror 1.0.63", "wasm-bindgen", "wasm-bindgen-futures", "web-sys", @@ -609,7 +609,7 @@ checksum = "a44e4e2784a81430199e4157e02903a987a32127c773985506f020e7d501b62e" dependencies = [ "bevy_macro_utils 0.11.3", "quote", - "syn 2.0.77", + "syn 2.0.90", ] [[package]] @@ -644,7 +644,7 @@ dependencies = [ "fixedbitset", "rustc-hash 1.1.0", "serde", - "thiserror", + "thiserror 1.0.63", "thread_local", ] @@ -665,7 +665,7 @@ dependencies = [ "fixedbitset", "rustc-hash 1.1.0", "serde", - "thiserror", + "thiserror 1.0.63", "thread_local", ] @@ -678,7 +678,7 @@ dependencies = [ "bevy_macro_utils 0.11.3", "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.90", ] [[package]] @@ -690,7 +690,7 @@ dependencies = [ "bevy_macro_utils 0.12.1", "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.90", ] [[package]] @@ -761,7 +761,7 @@ dependencies = [ "bevy_math", "bevy_reflect 0.11.3", "bevy_utils 0.11.3", - "thiserror", + "thiserror 1.0.63", ] [[package]] @@ -821,7 +821,7 @@ checksum = "23ddc18d489b4e57832d4958cde7cd2f349f0ad91e5892ac9e2f2ee16546b981" dependencies = [ "quote", "rustc-hash 1.1.0", - "syn 2.0.77", + "syn 2.0.90", "toml_edit 0.19.15", ] @@ -834,7 +834,7 @@ dependencies = [ "proc-macro2", "quote", "rustc-hash 1.1.0", - "syn 2.0.77", + "syn 2.0.90", "toml_edit 0.20.7", ] @@ -922,7 +922,7 @@ dependencies = [ "serde", "smallvec", "smol_str 0.2.2", - "thiserror", + "thiserror 1.0.63", ] [[package]] @@ -937,7 +937,7 @@ dependencies = [ "downcast-rs", "erased-serde 0.3.31", "serde", - "thiserror", + "thiserror 1.0.63", ] [[package]] @@ -950,7 +950,7 @@ dependencies = [ "bit-set", "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.90", "uuid", ] @@ -963,7 +963,7 @@ dependencies = [ "bevy_macro_utils 0.12.1", "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.90", "uuid", ] @@ -1007,7 +1007,7 @@ dependencies = [ "regex", "serde", "smallvec", - "thiserror", + "thiserror 1.0.63", "thread_local", "wasm-bindgen", "web-sys", @@ -1024,7 +1024,7 @@ dependencies = [ "bevy_macro_utils 0.11.3", "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.90", ] [[package]] @@ -1045,7 +1045,7 @@ dependencies = [ "bevy_utils 0.11.3", "ron", "serde", - "thiserror", + "thiserror 1.0.63", "uuid", ] @@ -1071,7 +1071,7 @@ dependencies = [ "fixedbitset", "guillotiere", "rectangle-pack", - "thiserror", + "thiserror 1.0.63", ] [[package]] @@ -1113,7 +1113,7 @@ dependencies = [ "bevy_reflect 0.11.3", "bevy_utils 0.11.3", "crossbeam-channel", - "thiserror", + "thiserror 1.0.63", ] [[package]] @@ -1141,7 +1141,7 @@ dependencies = [ "hashbrown 0.14.5", "instant", "petgraph", - "thiserror", + "thiserror 1.0.63", "tracing", "uuid", ] @@ -1159,7 +1159,7 @@ dependencies = [ "instant", "nonmax", "petgraph", - "thiserror", + "thiserror 1.0.63", "tracing", "uuid", ] @@ -1172,7 +1172,7 @@ checksum = "5391b242c36f556db01d5891444730c83aa9dd648b6a8fd2b755d22cb3bddb57" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.90", ] [[package]] @@ -1183,7 +1183,7 @@ checksum = "7aafecc952b6b8eb1a93c12590bd867d25df2f4ae1033a01dfdfc3c35ebccfff" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.90", ] [[package]] @@ -1252,7 +1252,7 @@ dependencies = [ "regex", "rustc-hash 1.1.0", "shlex", - "syn 2.0.77", + "syn 2.0.90", ] [[package]] @@ -1380,12 +1380,12 @@ dependencies = [ "bones_schema", "bones_utils", "bs58", - "dashmap", + "dashmap 5.5.3", "ehttp", "elsa", "erased-serde 0.4.5", "event-listener 4.0.3", - "futures-lite 2.3.0", + "futures-lite 2.5.0", "glam 0.24.2", "notify", "once_cell", @@ -1434,7 +1434,7 @@ dependencies = [ "once_map", "paste", "serde", - "thiserror", + "thiserror 1.0.63", ] [[package]] @@ -1455,7 +1455,7 @@ dependencies = [ "pretty_assertions", "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.90", ] [[package]] @@ -1480,7 +1480,7 @@ dependencies = [ "either", "fluent", "fluent-langneg", - "futures-lite 2.3.0", + "futures-lite 2.5.0", "ggrs", "gilrs", "glam 0.24.2", @@ -1488,8 +1488,7 @@ dependencies = [ "image 0.24.9", "instant", "intl-memoizer", - "iroh-net", - "iroh-quinn", + "iroh", "kira", "mdns-sd", "noise", @@ -1497,14 +1496,14 @@ dependencies = [ "once_cell", "ping-rs", "postcard", - "rcgen", + "rcgen 0.12.1", "rustls 0.21.12", "send_wrapper", "serde", "serde_yaml", "smallvec", "sys-locale", - "thiserror", + "thiserror 1.0.63", "tokio", "tracing", "tracing-appender", @@ -1536,12 +1535,11 @@ dependencies = [ "clap", "either", "futures", - "iroh-net", - "iroh-quinn", + "iroh", "once_cell", "postcard", "rand", - "rcgen", + "rcgen 0.12.1", "scc", "serde", "tokio", @@ -1553,7 +1551,7 @@ dependencies = [ name = "bones_matchmaker_proto" version = "0.4.0" dependencies = [ - "iroh-net", + "iroh", "serde", ] @@ -1595,7 +1593,7 @@ dependencies = [ "bevy_tasks 0.11.3", "bones_asset", "bones_lib", - "futures-lite 2.3.0", + "futures-lite 2.5.0", "gc-arena", "gc-arena-derive", "parking_lot", @@ -1671,7 +1669,7 @@ checksum = "0cc8b54b395f2fcfbb3d90c47b01c7f444d94d05bdeb775811dec868ac3bbc26" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.90", ] [[package]] @@ -1813,7 +1811,7 @@ dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.90", ] [[package]] @@ -1927,6 +1925,16 @@ dependencies = [ "const_soft_float", ] +[[package]] +name = "cordyceps" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec10f0a762d93c4498d2e97a333805cb6250d60bead623f71d8034f9a4152ba3" +dependencies = [ + "loom 0.5.6", + "tracing", +] + [[package]] name = "core-foundation" version = "0.9.4" @@ -2175,7 +2183,7 @@ checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.90", ] [[package]] @@ -2202,6 +2210,20 @@ dependencies = [ "parking_lot_core", ] +[[package]] +name = "dashmap" +version = "6.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5041cc499144891f3790297212f32a74fb938e5136a14943f338ef9e0ae276cf" +dependencies = [ + "cfg-if", + "crossbeam-utils", + "hashbrown 0.14.5", + "lock_api", + "once_cell", + "parking_lot_core", +] + [[package]] name = "dasp_sample" version = "0.11.0" @@ -2287,7 +2309,7 @@ checksum = "8034092389675178f570469e6c3b0465d3d30b4505c294a6550db47f3c17ad18" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.90", ] [[package]] @@ -2317,7 +2339,7 @@ checksum = "cb7330aeadfbe296029522e6c40f315320aba36fc43a5b3632f3795348f3bd22" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.90", "unicode-xid", ] @@ -2380,7 +2402,7 @@ checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.90", ] [[package]] @@ -2415,18 +2437,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" @@ -2580,7 +2590,7 @@ dependencies = [ "const_panic", "encase_derive", "glam 0.24.2", - "thiserror", + "thiserror 1.0.63", ] [[package]] @@ -2600,7 +2610,7 @@ checksum = "3fe2568f851fd6144a45fa91cfed8fe5ca8fc0b56ba6797bfc1ed2771b90e37c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.90", ] [[package]] @@ -2621,7 +2631,7 @@ dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.90", ] [[package]] @@ -2641,7 +2651,7 @@ checksum = "de0d48a183585823424a4ce1aa132d174a6a81bd540895822eb4c8373a8e49e8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.90", ] [[package]] @@ -2686,9 +2696,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" @@ -2859,7 +2869,7 @@ version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2a530c4694a6a8d528794ee9bbd8ba0122e779629ac908d15ad5a7ae7763a33d" dependencies = [ - "thiserror", + "thiserror 1.0.63", ] [[package]] @@ -2907,7 +2917,7 @@ checksum = "1a5c6c585bc94aaf2c7b51dd4c2ba22680844aba4c687be581871a6f518c5742" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.90", ] [[package]] @@ -2963,10 +2973,11 @@ dependencies = [ [[package]] name = "futures-buffered" -version = "0.2.8" +version = "0.2.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91fa130f3777d0d4b0993653c20bc433026d3290627693c4ed1b18dd237357ab" +checksum = "34acda8ae8b63fbe0b2195c998b180cff89a8212fb2622a78b572a9f1c6f7684" dependencies = [ + "cordyceps", "diatomic-waker", "futures-core", "pin-project-lite", @@ -3037,9 +3048,9 @@ dependencies = [ [[package]] name = "futures-lite" -version = "2.3.0" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52527eb5074e35e9339c6b4e8d12600c7128b68fb25dcb9fa9dec18f7c25f3a5" +checksum = "cef40d21ae2c515b51041df9ed313ed21e572df340ea58a922a0aefe7e8891a1" dependencies = [ "fastrand 2.1.1", "futures-core", @@ -3056,7 +3067,7 @@ checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.90", ] [[package]] @@ -3124,7 +3135,7 @@ checksum = "c612a69f5557a11046b77a7408d2836fe77077f842171cd211c5ef504bd3cddd" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.90", "synstructure", ] @@ -3159,6 +3170,19 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "generator" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5cc16584ff22b460a382b7feec54b23d2908d858152e5739a120b949293bd74e" +dependencies = [ + "cc", + "libc", + "log", + "rustversion", + "windows 0.48.0", +] + [[package]] name = "generator" version = "0.8.1" @@ -3311,14 +3335,15 @@ dependencies = [ [[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", + "dashmap 6.1.0", + "futures-sink", "futures-timer", + "futures-util", "no-std-compat", "nonzero_ext", "parking_lot", @@ -3356,7 +3381,7 @@ checksum = "ce95f9e2e11c2c6fadfce42b5af60005db06576f231f5c92550fdded43c423e8" dependencies = [ "backtrace", "log", - "thiserror", + "thiserror 1.0.63", "winapi", "windows 0.44.0", ] @@ -3457,7 +3482,7 @@ dependencies = [ "com-rs", "libc", "libloading 0.7.4", - "thiserror", + "thiserror 1.0.63", "widestring", "winapi", ] @@ -3527,7 +3552,7 @@ dependencies = [ "ipnet", "once_cell", "rand", - "thiserror", + "thiserror 1.0.63", "tinyvec", "tokio", "tracing", @@ -3552,7 +3577,7 @@ dependencies = [ "ipnet", "once_cell", "rand", - "thiserror", + "thiserror 1.0.63", "time", "tinyvec", "tokio", @@ -3576,7 +3601,7 @@ dependencies = [ "rand", "resolv-conf", "smallvec", - "thiserror", + "thiserror 1.0.63", "tokio", "tracing", ] @@ -3626,6 +3651,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" @@ -3976,11 +4012,93 @@ version = "2.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "187674a687eed5fe42285b40c6291f9a01517d415fad1c3cbc6a9f778af7fcd4" +[[package]] +name = "iroh" +version = "0.29.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "80b15215aea8d0367fefb9264521e4a251dc4e113896a3d765f530378518188f" +dependencies = [ + "anyhow", + "backoff", + "base64 0.22.1", + "bytes", + "der", + "derive_more", + "futures-buffered", + "futures-concurrency", + "futures-lite 2.5.0", + "futures-sink", + "futures-util", + "genawaiter", + "governor", + "hex", + "hickory-proto 0.25.0-alpha.2", + "hickory-resolver", + "hostname 0.4.0", + "http 1.1.0", + "http-body-util", + "hyper", + "hyper-util", + "igd-next", + "iroh-base", + "iroh-metrics", + "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", + "num_enum 0.7.3", + "once_cell", + "parking_lot", + "pin-project", + "pkarr", + "portmapper", + "postcard", + "rand", + "rcgen 0.13.1", + "reqwest", + "ring", + "rtnetlink 0.13.1", + "rtnetlink 0.14.1", + "rustls 0.23.12", + "rustls-webpki 0.102.7", + "serde", + "smallvec", + "socket2 0.5.7", + "strum", + "stun-rs", + "surge-ping", + "swarm-discovery", + "thiserror 2.0.4", + "time", + "tokio", + "tokio-rustls", + "tokio-stream", + "tokio-tungstenite 0.24.0", + "tokio-tungstenite-wasm", + "tokio-util", + "tracing", + "url", + "watchable", + "webpki-roots", + "windows 0.58.0", + "wmi", + "x509-parser", + "z32", +] + [[package]] name = "iroh-base" -version = "0.27.0" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28a777d7e0b3e2fdab4ad1b21b64be87a43ac3ceb2a2ccef905e480ad3317396" +checksum = "3fd98293ce8e85e6b4f0ce09af7c6bb860f2fece8fcf9238d6e628f1e163e27a" dependencies = [ "aead", "anyhow", @@ -3996,9 +4114,8 @@ dependencies = [ "rand", "rand_core", "serde", - "serde-error", "ssh-key", - "thiserror", + "thiserror 2.0.4", "ttl_cache", "url", "zeroize", @@ -4019,9 +4136,9 @@ dependencies = [ [[package]] name = "iroh-metrics" -version = "0.27.0" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c78cf30022e1c7a10fc0ae0a6ba83f131b7c3b92d4876f6c97aba93fe534be6" +checksum = "a242381d5da20bb4a6cc7482b5cc687a739da8371aff0ea8c12aaf499801886b" dependencies = [ "anyhow", "erased_set", @@ -4039,88 +4156,38 @@ dependencies = [ ] [[package]] -name = "iroh-net" -version = "0.27.0" +name = "iroh-net-report" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34192d8846fc59d6669fb80a485b430215ecc1bf3c2b9df4f8a92370fe37e13a" +checksum = "b82dc449d537176fc90749ae0711c6f81479053086928a2f2bb87cb52646ba74" dependencies = [ "anyhow", - "backoff", - "base64 0.22.1", "bytes", - "der", "derive_more", - "duct", "futures-buffered", - "futures-concurrency", - "futures-lite 2.3.0", - "futures-sink", - "futures-util", - "genawaiter", - "governor", - "hex", - "hickory-proto 0.25.0-alpha.2", + "futures-lite 2.5.0", "hickory-resolver", - "hostname", - "http 1.1.0", - "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", - "num_enum 0.7.3", - "once_cell", - "parking_lot", - "pin-project", - "pkarr", - "postcard", + "iroh-relay", + "netwatch", + "portmapper", "rand", - "rcgen", "reqwest", - "ring", - "rtnetlink", "rustls 0.23.12", - "rustls-webpki 0.102.7", - "serde", - "smallvec", - "socket2 0.5.7", - "strum", - "stun-rs", "surge-ping", - "swarm-discovery", - "thiserror", - "time", + "thiserror 1.0.63", "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]] name = "iroh-quinn" -version = "0.11.3" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fd590a39a14cfc168efa4d894de5039d65641e62d8da4a80733018ababe3c33" +checksum = "35ba75a5c57cff299d2d7ca1ddee053f66339d1756bd79ec637bcad5aa61100e" dependencies = [ "bytes", "iroh-quinn-proto", @@ -4129,16 +4196,16 @@ dependencies = [ "rustc-hash 2.0.0", "rustls 0.23.12", "socket2 0.5.7", - "thiserror", + "thiserror 1.0.63", "tokio", "tracing", ] [[package]] name = "iroh-quinn-proto" -version = "0.11.6" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5fd0538ff12efe3d61ea1deda2d7913f4270873a519d43e6995c6e87a1558538" +checksum = "e2c869ba52683d3d067c83ab4c00a2fda18eaf13b1434d4c1352f428674d4a5d" dependencies = [ "bytes", "rand", @@ -4147,16 +4214,16 @@ dependencies = [ "rustls 0.23.12", "rustls-platform-verifier", "slab", - "thiserror", + "thiserror 1.0.63", "tinyvec", "tracing", ] [[package]] name = "iroh-quinn-udp" -version = "0.5.4" +version = "0.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0619b59471fdd393ac8a6c047f640171119c1c8b41f7d2927db91776dcdbc5f" +checksum = "bfcfc0abc2fdf8cf18a6c72893b7cbebeac2274a3b1306c1760c48c0e10ac5e0" dependencies = [ "libc", "once_cell", @@ -4165,6 +4232,67 @@ dependencies = [ "windows-sys 0.59.0", ] +[[package]] +name = "iroh-relay" +version = "0.29.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28a0d0d7317795a01caa47ffdaeec84211d1b394530bdb31dbe15f642e58bcff" +dependencies = [ + "anyhow", + "base64 0.22.1", + "bytes", + "clap", + "derive_more", + "futures-buffered", + "futures-lite 2.5.0", + "futures-sink", + "futures-util", + "governor", + "hex", + "hickory-proto 0.25.0-alpha.2", + "hickory-resolver", + "hostname 0.4.0", + "http 1.1.0", + "http-body-util", + "hyper", + "hyper-util", + "iroh-base", + "iroh-metrics", + "iroh-quinn", + "iroh-quinn-proto", + "libc", + "num_enum 0.7.3", + "once_cell", + "parking_lot", + "pin-project", + "postcard", + "rand", + "rcgen 0.13.1", + "regex", + "reqwest", + "ring", + "rustls 0.23.12", + "rustls-pemfile", + "rustls-webpki 0.102.7", + "serde", + "smallvec", + "socket2 0.5.7", + "stun-rs", + "thiserror 2.0.4", + "time", + "tokio", + "tokio-rustls", + "tokio-rustls-acme", + "tokio-tungstenite 0.24.0", + "tokio-tungstenite-wasm", + "tokio-util", + "toml", + "tracing", + "tracing-subscriber", + "url", + "webpki-roots", +] + [[package]] name = "is_terminal_polyfill" version = "1.70.1" @@ -4196,7 +4324,7 @@ dependencies = [ "combine", "jni-sys", "log", - "thiserror", + "thiserror 1.0.63", "walkdir", ] @@ -4211,7 +4339,7 @@ dependencies = [ "combine", "jni-sys", "log", - "thiserror", + "thiserror 1.0.63", "walkdir", "windows-sys 0.45.0", ] @@ -4406,6 +4534,19 @@ version = "0.4.22" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" +[[package]] +name = "loom" +version = "0.5.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff50ecb28bb86013e935fb6683ab1f6d3a20016f123c76fd4c27470076ac30f5" +dependencies = [ + "cfg-if", + "generator 0.7.5", + "scoped-tls", + "tracing", + "tracing-subscriber", +] + [[package]] name = "loom" version = "0.7.2" @@ -4413,7 +4554,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "419e0dc8046cb947daa77eb95ae174acfbddb7673b4151f56d1eed8e93fbfaca" dependencies = [ "cfg-if", - "generator", + "generator 0.8.1", "scoped-tls", "tracing", "tracing-subscriber", @@ -4501,7 +4642,7 @@ dependencies = [ "serde_bencode", "serde_bytes", "sha1_smol", - "thiserror", + "thiserror 1.0.63", "tracing", ] @@ -4547,12 +4688,6 @@ dependencies = [ "socket2 0.5.7", ] -[[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.4" @@ -4651,7 +4786,7 @@ dependencies = [ "rustc-hash 1.1.0", "spirv", "termcolor", - "thiserror", + "thiserror 1.0.63", "unicode-xid", ] @@ -4670,7 +4805,7 @@ dependencies = [ "regex", "regex-syntax 0.6.29", "rustc-hash 1.1.0", - "thiserror", + "thiserror 1.0.63", "tracing", "unicode-ident", ] @@ -4695,7 +4830,7 @@ dependencies = [ "ndk-sys 0.4.1+23.1.7779620", "num_enum 0.5.11", "raw-window-handle", - "thiserror", + "thiserror 1.0.63", ] [[package]] @@ -4709,7 +4844,7 @@ dependencies = [ "log", "ndk-sys 0.5.0+25.2.9519653", "num_enum 0.7.3", - "thiserror", + "thiserror 1.0.63", ] [[package]] @@ -4738,15 +4873,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", @@ -4778,6 +4913,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" @@ -4787,7 +4951,7 @@ dependencies = [ "anyhow", "byteorder", "paste", - "thiserror", + "thiserror 1.0.63", ] [[package]] @@ -4801,7 +4965,7 @@ dependencies = [ "log", "netlink-packet-core", "netlink-sys", - "thiserror", + "thiserror 1.0.63", "tokio", ] @@ -4818,6 +4982,39 @@ dependencies = [ "tokio", ] +[[package]] +name = "netwatch" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +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 0.19.0", + "netlink-sys", + "once_cell", + "rtnetlink 0.13.1", + "rtnetlink 0.14.1", + "serde", + "socket2 0.5.7", + "thiserror 2.0.4", + "time", + "tokio", + "tokio-util", + "tracing", + "windows 0.58.0", + "wmi", +] + [[package]] name = "nix" version = "0.26.4" @@ -4829,6 +5026,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" @@ -4971,7 +5179,7 @@ checksum = "ed3955f1a9c7c0c15e092f9c887db08b1fc683305fdf6eb6684f22555355e202" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.90", ] [[package]] @@ -5052,7 +5260,7 @@ dependencies = [ "proc-macro-crate 1.3.1", "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.90", ] [[package]] @@ -5064,7 +5272,7 @@ dependencies = [ "proc-macro-crate 3.2.0", "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.90", ] [[package]] @@ -5303,16 +5511,6 @@ dependencies = [ "libredox 0.0.2", ] -[[package]] -name = "os_pipe" -version = "1.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ffd2b0a5634335b135d5728d84c5e0fd726954b87111f7506a61c502280d982" -dependencies = [ - "libc", - "windows-sys 0.59.0", -] - [[package]] name = "overload" version = "0.1.1" @@ -5451,7 +5649,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c73c26c01b8c87956cea613c907c9d6ecffd8d18a2a5908e5de0adfaa185cea" dependencies = [ "memchr", - "thiserror", + "thiserror 1.0.63", "ucd-trie", ] @@ -5475,7 +5673,7 @@ dependencies = [ "pest_meta", "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.90", ] [[package]] @@ -5529,7 +5727,7 @@ dependencies = [ "phf_shared", "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.90", ] [[package]] @@ -5553,7 +5751,7 @@ dependencies = [ "gc-arena", "hashbrown 0.14.5", "rand", - "thiserror", + "thiserror 1.0.63", ] [[package]] @@ -5573,7 +5771,7 @@ checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.90", ] [[package]] @@ -5618,7 +5816,7 @@ dependencies = [ "mainline", "self_cell 1.0.4", "simple-dns", - "thiserror", + "thiserror 1.0.63", "tracing", "ureq", "wasm-bindgen", @@ -5672,7 +5870,7 @@ dependencies = [ "proc-macro2", "quote", "regex", - "syn 2.0.77", + "syn 2.0.90", ] [[package]] @@ -5742,6 +5940,35 @@ version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "da544ee218f0d287a911e9c99a39a8c9bc8fcad3cb8db5959940044ecfc67265" +[[package]] +name = "portmapper" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68ea24e7552a28ee4a3478ae116c89080957d6816526d0a533bee6cd67048279" +dependencies = [ + "anyhow", + "base64 0.22.1", + "bytes", + "derive_more", + "futures-lite 2.5.0", + "futures-util", + "igd-next", + "iroh-metrics", + "libc", + "netwatch", + "num_enum 0.7.3", + "rand", + "serde", + "smallvec", + "socket2 0.5.7", + "thiserror 2.0.4", + "time", + "tokio", + "tokio-util", + "tracing", + "url", +] + [[package]] name = "postcard" version = "1.0.10" @@ -5897,9 +6124,9 @@ checksum = "dc375e1527247fe1a97d8b7156678dfe7c1af2fc075c9a4db3690ecd2a148068" [[package]] name = "proc-macro2" -version = "1.0.86" +version = "1.0.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" +checksum = "37d3544b3f2748c54e147655edb5025752e2303145b5aefb3c3ea2c78b973bb0" dependencies = [ "unicode-ident", ] @@ -5930,7 +6157,7 @@ checksum = "440f724eba9f6996b75d63681b0a92b06947f1457076d503a4d2e2c8f56442b8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.90", ] [[package]] @@ -5967,7 +6194,7 @@ dependencies = [ "rustc-hash 2.0.0", "rustls 0.23.12", "socket2 0.5.7", - "thiserror", + "thiserror 1.0.63", "tokio", "tracing", ] @@ -5984,7 +6211,7 @@ dependencies = [ "rustc-hash 2.0.0", "rustls 0.23.12", "slab", - "thiserror", + "thiserror 1.0.63", "tinyvec", "tracing", ] @@ -6105,6 +6332,19 @@ dependencies = [ "yasna", ] +[[package]] +name = "rcgen" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "54077e1872c46788540de1ea3d7f4ccb1983d12f9aa909b234468676c1a36779" +dependencies = [ + "pem", + "ring", + "rustls-pki-types", + "time", + "yasna", +] + [[package]] name = "rectangle-pack" version = "0.4.2" @@ -6146,7 +6386,7 @@ checksum = "ba009ff324d1fc1b900bd1fdb31564febe58a8ccc8a6fdbb93b543d33b13ca43" dependencies = [ "getrandom", "libredox 0.1.3", - "thiserror", + "thiserror 1.0.63", ] [[package]] @@ -6253,7 +6493,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", ] @@ -6333,12 +6573,30 @@ dependencies = [ "futures", "log", "netlink-packet-core", - "netlink-packet-route", + "netlink-packet-route 0.17.1", "netlink-packet-utils", "netlink-proto", "netlink-sys", "nix 0.26.4", - "thiserror", + "thiserror 1.0.63", + "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.63", "tokio", ] @@ -6639,15 +6897,6 @@ dependencies = [ "serde_derive", ] -[[package]] -name = "serde-error" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e988182713aeed6a619a88bca186f6d6407483485ffe44c869ee264f8eabd13f" -dependencies = [ - "serde", -] - [[package]] name = "serde_bencode" version = "0.2.4" @@ -6675,7 +6924,7 @@ checksum = "243902eda00fad750862fc144cea25caca5e20d615af0a81bee94ca738f1df1f" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.90", ] [[package]] @@ -6690,6 +6939,15 @@ dependencies = [ "serde", ] +[[package]] +name = "serde_spanned" +version = "0.6.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87607cb1398ed59d48732e575a4c28a7a8ebf2454b964fe3f224f2afc07909e1" +dependencies = [ + "serde", +] + [[package]] name = "serde_urlencoded" version = "0.7.1" @@ -6762,16 +7020,6 @@ dependencies = [ "lazy_static", ] -[[package]] -name = "shared_child" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09fa9338aed9a1df411814a5b2252f7cd206c55ae9bf2fa763f8de84603aa60c" -dependencies = [ - "libc", - "windows-sys 0.59.0", -] - [[package]] name = "shlex" version = "1.3.0" @@ -7004,7 +7252,7 @@ dependencies = [ "proc-macro2", "quote", "struct_iterable_internal", - "syn 2.0.77", + "syn 2.0.90", ] [[package]] @@ -7032,7 +7280,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.77", + "syn 2.0.90", ] [[package]] @@ -7076,7 +7324,7 @@ dependencies = [ "pnet_packet", "rand", "socket2 0.5.7", - "thiserror", + "thiserror 1.0.63", "tokio", "tracing", ] @@ -7245,9 +7493,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.77" +version = "2.0.90" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f35bcdf61fd8e7be6caf75f429fdca8beb3ed76584befb503b1569faee373ed" +checksum = "919d3b74a5dd0ccd15aeb8f93e7006bd9e14c295087c9896a110f490752bcf31" dependencies = [ "proc-macro2", "quote", @@ -7282,7 +7530,7 @@ checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.90", ] [[package]] @@ -7350,7 +7598,16 @@ version = "1.0.63" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c0342370b38b6a11b6cc11d6a805569958d54cfa061a29969c3b5ce2ea405724" dependencies = [ - "thiserror-impl", + "thiserror-impl 1.0.63", +] + +[[package]] +name = "thiserror" +version = "2.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2f49a1853cf82743e3b7950f77e0f4d622ca36cf4317cba00c767838bac8d490" +dependencies = [ + "thiserror-impl 2.0.4", ] [[package]] @@ -7361,7 +7618,18 @@ checksum = "a4558b58466b9ad7ca0f102865eccc95938dca1a74a856f2b57b6629050da261" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.90", +] + +[[package]] +name = "thiserror-impl" +version = "2.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8381894bb3efe0c4acac3ded651301ceee58a15d47c2e34885ed1908ad667061" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.90", ] [[package]] @@ -7465,7 +7733,7 @@ checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.90", ] [[package]] @@ -7479,6 +7747,34 @@ dependencies = [ "tokio", ] +[[package]] +name = "tokio-rustls-acme" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3184e8e292a828dd4bca5b2a60aba830ec5ed873a66c9ebb6e65038fa649e827" +dependencies = [ + "async-trait", + "base64 0.22.1", + "chrono", + "futures", + "log", + "num-bigint", + "pem", + "proc-macro2", + "rcgen 0.13.1", + "reqwest", + "ring", + "rustls 0.23.12", + "serde", + "serde_json", + "thiserror 2.0.4", + "time", + "tokio", + "tokio-rustls", + "webpki-roots", + "x509-parser", +] + [[package]] name = "tokio-stream" version = "0.1.16" @@ -7499,7 +7795,19 @@ dependencies = [ "futures-util", "log", "tokio", - "tungstenite", + "tungstenite 0.21.0", +] + +[[package]] +name = "tokio-tungstenite" +version = "0.24.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "edc5f74e248dc973e0dbb7b74c7e0d6fcc301c694ff50049504004ef4d0cdcd9" +dependencies = [ + "futures-util", + "log", + "tokio", + "tungstenite 0.24.0", ] [[package]] @@ -7513,9 +7821,9 @@ dependencies = [ "http 1.1.0", "httparse", "js-sys", - "thiserror", + "thiserror 1.0.63", "tokio", - "tokio-tungstenite", + "tokio-tungstenite 0.21.0", "wasm-bindgen", "web-sys", ] @@ -7535,11 +7843,26 @@ dependencies = [ "tokio", ] +[[package]] +name = "toml" +version = "0.8.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1ed1f98e3fdc28d6d910e6737ae6ab1a93bf1985935a1193e68f93eeb68d24e" +dependencies = [ + "serde", + "serde_spanned", + "toml_datetime", + "toml_edit 0.22.20", +] + [[package]] name = "toml_datetime" version = "0.6.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0dd7358ecb8fc2f8d014bf86f6f638ce72ba252a2c3a2572f2a795f1d23efb41" +dependencies = [ + "serde", +] [[package]] name = "toml_edit" @@ -7570,6 +7893,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "583c44c02ad26b0c3f3066fe629275e50627026c51ac2e595cca4c230ce1ce1d" dependencies = [ "indexmap 2.5.0", + "serde", + "serde_spanned", "toml_datetime", "winnow 0.6.18", ] @@ -7621,7 +7946,7 @@ checksum = "3566e8ce28cc0a3fe42519fc80e6b4c943cc4c8cef275620eb8dac2d3d4e06cf" dependencies = [ "crossbeam-channel", "parking_lot", - "thiserror", + "thiserror 1.0.63", "time", "tracing-subscriber", ] @@ -7634,7 +7959,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.90", ] [[package]] @@ -7715,7 +8040,7 @@ version = "0.17.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "373db47331c3407b343538df77eea2516884a0b126cdfb4b135acfd400015dd7" dependencies = [ - "loom", + "loom 0.7.2", "once_cell", "tracy-client-sys", ] @@ -7773,11 +8098,29 @@ dependencies = [ "log", "rand", "sha1", - "thiserror", + "thiserror 1.0.63", "url", "utf-8", ] +[[package]] +name = "tungstenite" +version = "0.24.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "18e5b8366ee7a95b16d32197d0b2604b43a0be89dc5fac9f8e96ccafbaedda8a" +dependencies = [ + "byteorder", + "bytes", + "data-encoding", + "http 1.1.0", + "httparse", + "log", + "rand", + "sha1", + "thiserror 1.0.63", + "utf-8", +] + [[package]] name = "turborand" version = "0.10.1" @@ -8076,7 +8419,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.90", "wasm-bindgen-shared", ] @@ -8110,7 +8453,7 @@ checksum = "afc340c74d9005395cf9dd098506f7f44e38f2b4a21c6aaacf9a105ea5e1e836" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.90", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -8130,7 +8473,7 @@ dependencies = [ "event-listener 4.0.3", "futures-util", "parking_lot", - "thiserror", + "thiserror 1.0.63", ] [[package]] @@ -8237,7 +8580,7 @@ dependencies = [ "raw-window-handle", "rustc-hash 1.1.0", "smallvec", - "thiserror", + "thiserror 1.0.63", "web-sys", "wgpu-hal", "wgpu-types", @@ -8278,7 +8621,7 @@ dependencies = [ "renderdoc-sys", "rustc-hash 1.1.0", "smallvec", - "thiserror", + "thiserror 1.0.63", "wasm-bindgen", "web-sys", "wgpu-types", @@ -8370,12 +8713,12 @@ dependencies = [ [[package]] name = "windows" -version = "0.51.1" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca229916c5ee38c2f2bc1e9d8f04df975b4bd93f9955dc69fabb5d91270045c9" +checksum = "e48a53791691ab099e5e2ad123536d0fff50652600abaf43bbf952894110d0be" dependencies = [ - "windows-core 0.51.1", - "windows-targets 0.48.5", + "windows-core 0.52.0", + "windows-targets 0.52.6", ] [[package]] @@ -8398,15 +8741,6 @@ dependencies = [ "windows-targets 0.52.6", ] -[[package]] -name = "windows-core" -version = "0.51.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1f8cf84f35d2db49a46868f947758c7a1138116f7fac3bc844f43ade1292e64" -dependencies = [ - "windows-targets 0.48.5", -] - [[package]] name = "windows-core" version = "0.52.0" @@ -8458,7 +8792,7 @@ checksum = "2bbd5b46c938e506ecbce286b6628a02171d56153ba733b6c741fc627ec9579b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.90", ] [[package]] @@ -8480,7 +8814,7 @@ checksum = "053c4c462dc91d3b1504c6fe5a726dd15e216ba718e84a0e46a88fbe5ded3515" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.90", ] [[package]] @@ -8796,15 +9130,15 @@ dependencies = [ [[package]] name = "wmi" -version = "0.13.4" +version = "0.14.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff00ac1309d4c462be86f03a55e409509e8bf4323ec296aeb4b381dd9aabe6ec" +checksum = "dc47c0776cc6c00d2f7a874a0c846d94d45535936e5a1187693a24f23b4dd701" dependencies = [ "chrono", "futures", "log", "serde", - "thiserror", + "thiserror 2.0.4", "windows 0.58.0", "windows-core 0.58.0", ] @@ -8859,7 +9193,7 @@ dependencies = [ "nom", "oid-registry", "rusticata-macros", - "thiserror", + "thiserror 1.0.63", "time", ] @@ -8917,7 +9251,7 @@ checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.90", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index 9f6a805e82..5babdd8cc1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -29,7 +29,7 @@ maybe-owned = "0.3" parking_lot = "0.12" smallvec = "1.11" ustr = "0.10" -iroh-net = "0.27" +iroh = "0.29" [profile.release] lto = true diff --git a/framework_crates/bones_framework/Cargo.toml b/framework_crates/bones_framework/Cargo.toml index 1ba48f2e53..9c50d09cfa 100644 --- a/framework_crates/bones_framework/Cargo.toml +++ b/framework_crates/bones_framework/Cargo.toml @@ -153,10 +153,9 @@ postcard = { version = "1.0", features = ["alloc"] } rcgen = "0.12" rustls = { version = "0.21", features = ["dangerous_configuration", "quic"] } smallvec = "1.10" -iroh-quinn = { version = "0.11" } tokio = { version = "1", features = ["rt-multi-thread", "macros"] } turborand = { version = "0.10.0", features = ["atomic"] } -iroh-net = { workspace = true, features = ["discovery-local-network"] } +iroh = { workspace = true, features = ["discovery-local-network"] } directories = "5.0" diff --git a/framework_crates/bones_framework/src/networking.rs b/framework_crates/bones_framework/src/networking.rs index 8f52b20191..6b5775b10d 100644 --- a/framework_crates/bones_framework/src/networking.rs +++ b/framework_crates/bones_framework/src/networking.rs @@ -110,26 +110,25 @@ impl ggrs::Config for GgrsConfig { } /// The network endpoint used for all network communications. -static NETWORK_ENDPOINT: tokio::sync::OnceCell = - tokio::sync::OnceCell::const_new(); +static NETWORK_ENDPOINT: tokio::sync::OnceCell = tokio::sync::OnceCell::const_new(); /// Get the network endpoint used for all communications. -pub async fn get_network_endpoint() -> &'static iroh_net::Endpoint { +pub async fn get_network_endpoint() -> &'static iroh::Endpoint { NETWORK_ENDPOINT .get_or_init(|| async move { - let secret_key = iroh_net::key::SecretKey::generate(); - iroh_net::Endpoint::builder() + let secret_key = iroh::key::SecretKey::generate(); + iroh::Endpoint::builder() .alpns(vec![MATCH_ALPN.to_vec(), PLAY_ALPN.to_vec()]) .discovery(Box::new( - iroh_net::discovery::ConcurrentDiscovery::from_services(vec![ + iroh::discovery::ConcurrentDiscovery::from_services(vec![ Box::new( - iroh_net::discovery::local_swarm_discovery::LocalSwarmDiscovery::new( + iroh::discovery::local_swarm_discovery::LocalSwarmDiscovery::new( secret_key.public(), ) .unwrap(), ), - Box::new(iroh_net::discovery::dns::DnsDiscovery::n0_dns()), - Box::new(iroh_net::discovery::pkarr::PkarrPublisher::n0_dns( + Box::new(iroh::discovery::dns::DnsDiscovery::n0_dns()), + Box::new(iroh::discovery::pkarr::PkarrPublisher::n0_dns( secret_key.clone(), )), ]), diff --git a/framework_crates/bones_framework/src/networking/lan.rs b/framework_crates/bones_framework/src/networking/lan.rs index f67039a380..7a1a3231f9 100644 --- a/framework_crates/bones_framework/src/networking/lan.rs +++ b/framework_crates/bones_framework/src/networking/lan.rs @@ -12,7 +12,7 @@ use std::{net::IpAddr, time::Duration}; -use iroh_net::{endpoint::get_remote_node_id, NodeAddr}; +use iroh::{endpoint::get_remote_node_id, NodeAddr}; use mdns_sd::{ServiceDaemon, ServiceInfo}; use smallvec::SmallVec; use tracing::warn; diff --git a/framework_crates/bones_framework/src/networking/online.rs b/framework_crates/bones_framework/src/networking/online.rs index ce807bc2bf..09781eeee4 100644 --- a/framework_crates/bones_framework/src/networking/online.rs +++ b/framework_crates/bones_framework/src/networking/online.rs @@ -9,9 +9,7 @@ use crate::{ pub use bones_matchmaker_proto::{ GameID, LobbyId, LobbyInfo, LobbyListItem, MatchInfo, PlayerIdxAssignment, MATCH_ALPN, }; -use iroh_net::Endpoint; -use iroh_net::NodeId; -use iroh_quinn::Connection; +use iroh::{endpoint::Connection, Endpoint, NodeId}; use once_cell::sync::Lazy; use tracing::{info, warn}; diff --git a/framework_crates/bones_framework/src/networking/socket.rs b/framework_crates/bones_framework/src/networking/socket.rs index 13f7def97e..4a578b9efb 100644 --- a/framework_crates/bones_framework/src/networking/socket.rs +++ b/framework_crates/bones_framework/src/networking/socket.rs @@ -3,7 +3,7 @@ use bones_matchmaker_proto::PLAY_ALPN; use bytes::Bytes; -use iroh_net::NodeAddr; +use iroh::NodeAddr; use tracing::{info, warn}; use crate::networking::get_network_endpoint; @@ -13,7 +13,7 @@ use super::{GameMessage, NetworkSocket, SocketTarget, RUNTIME}; /// The [`NetworkSocket`] implementation. #[derive(Debug, Clone)] pub struct Socket { - pub connections: Vec<(u32, iroh_quinn::Connection)>, + pub connections: Vec<(u32, iroh::endpoint::Connection)>, pub ggrs_receiver: async_channel::Receiver<(u32, GameMessage)>, pub reliable_receiver: async_channel::Receiver<(u32, Vec)>, pub player_idx: u32, @@ -23,7 +23,7 @@ pub struct Socket { } impl Socket { - pub fn new(player_idx: u32, connections: Vec<(u32, iroh_quinn::Connection)>) -> Self { + pub fn new(player_idx: u32, connections: Vec<(u32, iroh::endpoint::Connection)>) -> Self { let (ggrs_sender, ggrs_receiver) = async_channel::unbounded(); let (reliable_sender, reliable_receiver) = async_channel::unbounded(); @@ -129,7 +129,7 @@ impl Socket { } } - fn get_connection(&self, idx: u32) -> &iroh_quinn::Connection { + fn get_connection(&self, idx: u32) -> &iroh::endpoint::Connection { debug_assert!(idx < self.player_count); // TODO: if this is too slow, optimize storage self.connections @@ -217,8 +217,8 @@ pub(super) async fn establish_peer_connections( player_idx: u32, player_count: u32, peer_addrs: Vec<(u32, NodeAddr)>, - conn: Option, -) -> anyhow::Result> { + conn: Option, +) -> anyhow::Result> { let mut peer_connections = Vec::new(); let had_og_conn = conn.is_some(); if let Some(conn) = conn { diff --git a/other_crates/bones_matchmaker/Cargo.toml b/other_crates/bones_matchmaker/Cargo.toml index fb7328dff5..b64ea0aec4 100644 --- a/other_crates/bones_matchmaker/Cargo.toml +++ b/other_crates/bones_matchmaker/Cargo.toml @@ -23,6 +23,5 @@ postcard = { version = "1.0", default-features = false, features = serde = { version = "1.0", features = ["derive"] } tracing-subscriber = { version = "0.3", features = ["env-filter"] } tokio = { version = "1", features = ["rt-multi-thread", "macros"] } -iroh-net = { workspace = true, features = ["discovery-local-network"] } -quinn = { version = "0.11", package = "iroh-quinn" } +iroh = { workspace = true, features = ["discovery-local-network"] } blake3 = "1.5.3" diff --git a/other_crates/bones_matchmaker/examples/matchmaker_client.rs b/other_crates/bones_matchmaker/examples/matchmaker_client.rs index 8d27886d95..bfc5ff706b 100644 --- a/other_crates/bones_matchmaker/examples/matchmaker_client.rs +++ b/other_crates/bones_matchmaker/examples/matchmaker_client.rs @@ -23,18 +23,18 @@ async fn main() { } async fn client() -> anyhow::Result<()> { - let secret_key = iroh_net::key::SecretKey::generate(); - let endpoint = iroh_net::Endpoint::builder() + let secret_key = iroh::key::SecretKey::generate(); + let endpoint = iroh::Endpoint::builder() .alpns(vec![MATCH_ALPN.to_vec(), PLAY_ALPN.to_vec()]) .discovery(Box::new( - iroh_net::discovery::ConcurrentDiscovery::from_services(vec![ + iroh::discovery::ConcurrentDiscovery::from_services(vec![ Box::new( - iroh_net::discovery::local_swarm_discovery::LocalSwarmDiscovery::new( + iroh::discovery::local_swarm_discovery::LocalSwarmDiscovery::new( secret_key.public(), )?, ), - Box::new(iroh_net::discovery::dns::DnsDiscovery::n0_dns()), - Box::new(iroh_net::discovery::pkarr::PkarrPublisher::n0_dns( + Box::new(iroh::discovery::dns::DnsDiscovery::n0_dns()), + Box::new(iroh::discovery::pkarr::PkarrPublisher::n0_dns( secret_key.clone(), )), ]), @@ -48,8 +48,8 @@ async fn client() -> anyhow::Result<()> { let hello = Hello { i_am }; println!("o Opened client ID: {}. {hello:?}", endpoint.node_id()); - let server_id: iroh_net::NodeId = std::env::args().nth(3).expect("missing node id").parse()?; - let server_addr = iroh_net::NodeAddr::new(server_id); + let server_id: iroh::NodeId = std::env::args().nth(3).expect("missing node id").parse()?; + let server_addr = iroh::NodeAddr::new(server_id); // Connect to the server let conn = endpoint.connect(server_addr, MATCH_ALPN).await?; @@ -178,7 +178,7 @@ async fn client() -> anyhow::Result<()> { } // Shutdown the endpoint - endpoint.close(0u8.into(), b"done").await?; + endpoint.close().await?; Ok(()) } diff --git a/other_crates/bones_matchmaker/src/lib.rs b/other_crates/bones_matchmaker/src/lib.rs index 27de146a41..d53ac69bb0 100644 --- a/other_crates/bones_matchmaker/src/lib.rs +++ b/other_crates/bones_matchmaker/src/lib.rs @@ -6,9 +6,11 @@ extern crate tracing; use std::net::{Ipv4Addr, SocketAddr, SocketAddrV4}; +use std::sync::Arc; use bones_matchmaker_proto::MATCH_ALPN; -use iroh_net::key::SecretKey; +use iroh::key::SecretKey; +use matchmaker::Matchmaker; pub mod cli; mod helpers; @@ -27,7 +29,7 @@ struct Config { print_secret_key: bool, /// Use this secret key for the node #[clap(short, long, env = "BONES_MATCHMAKER_SECRET_KEY")] - secret_key: Option, + secret_key: Option, } async fn server(args: Config) -> anyhow::Result<()> { @@ -48,17 +50,17 @@ async fn server(args: Config) -> anyhow::Result<()> { println!("Secret Key: {}", secret_key); } - let endpoint = iroh_net::Endpoint::builder() + let endpoint = iroh::Endpoint::builder() .alpns(vec![MATCH_ALPN.to_vec()]) .discovery(Box::new( - iroh_net::discovery::ConcurrentDiscovery::from_services(vec![ + iroh::discovery::ConcurrentDiscovery::from_services(vec![ Box::new( - iroh_net::discovery::local_swarm_discovery::LocalSwarmDiscovery::new( + iroh::discovery::local_swarm_discovery::LocalSwarmDiscovery::new( secret_key.public(), )?, ), - Box::new(iroh_net::discovery::dns::DnsDiscovery::n0_dns()), - Box::new(iroh_net::discovery::pkarr::PkarrPublisher::n0_dns( + Box::new(iroh::discovery::dns::DnsDiscovery::n0_dns()), + Box::new(iroh::discovery::pkarr::PkarrPublisher::n0_dns( secret_key.clone(), )), ]), @@ -74,24 +76,16 @@ async fn server(args: Config) -> anyhow::Result<()> { println!("Node ID: {}", my_addr.node_id); - // Listen for incomming connections - while let Some(connecting) = endpoint.accept().await { - let connection = connecting.await; - - match connection { - Ok(conn) => { - info!( - connection_id = conn.stable_id(), - addr = ?conn.remote_address(), - "Accepted connection from client" - ); - - // Spawn a task to handle the new connection - tokio::task::spawn(matchmaker::handle_connection(endpoint.clone(), conn)); - } - Err(e) => error!("Error opening client connection: {e:?}"), - } - } + let matchmaker = Matchmaker::new(endpoint.clone()); + let router = iroh::protocol::Router::builder(endpoint) + .accept(MATCH_ALPN, Arc::new(matchmaker)) + .spawn() + .await?; + + // wait for shutdown + tokio::signal::ctrl_c().await?; + + router.shutdown().await?; info!("Server shutdown"); diff --git a/other_crates/bones_matchmaker/src/lobbies.rs b/other_crates/bones_matchmaker/src/lobbies.rs index 5aedd225e9..309af834d6 100644 --- a/other_crates/bones_matchmaker/src/lobbies.rs +++ b/other_crates/bones_matchmaker/src/lobbies.rs @@ -4,12 +4,14 @@ use anyhow::Result; use bones_matchmaker_proto::{ GameID, LobbyId, LobbyInfo, LobbyListItem, MatchInfo, MatchmakerResponse, }; -use iroh_net::Endpoint; -use quinn::Connection; +use iroh::{endpoint::Connection, Endpoint}; use std::collections::HashMap; /// Handles a request to list lobbies for a specific game -pub async fn handle_list_lobbies(game_id: GameID, send: &mut quinn::SendStream) -> Result<()> { +pub async fn handle_list_lobbies( + game_id: GameID, + send: &mut iroh::endpoint::SendStream, +) -> Result<()> { let state = MATCHMAKER_STATE.lock().await; // Retrieve and format lobby information for the specified game let lobbies = state @@ -51,7 +53,7 @@ pub async fn handle_list_lobbies(game_id: GameID, send: &mut quinn::SendStream) pub async fn handle_create_lobby( conn: Connection, lobby_info: LobbyInfo, - send: &mut quinn::SendStream, + send: &mut iroh::endpoint::SendStream, ) -> Result<()> { let lobby_id = LobbyId(generate_unique_id()); let mut state = MATCHMAKER_STATE.lock().await; @@ -86,12 +88,12 @@ pub async fn handle_create_lobby( /// Handles a request to join an existing lobby pub async fn handle_join_lobby( - ep: Endpoint, + ep: &Endpoint, conn: Connection, game_id: GameID, lobby_id: LobbyId, password: Option, - send: &mut quinn::SendStream, + send: &mut iroh::endpoint::SendStream, ) -> Result<()> { let mut state = MATCHMAKER_STATE.lock().await; @@ -167,6 +169,7 @@ pub async fn handle_join_lobby( { let members = connections.1; drop(state); + let ep = ep.clone(); tokio::spawn(async move { if let Err(e) = start_game(ep, members, &match_info).await { error!("Error starting match from full lobby: {:?}", e); diff --git a/other_crates/bones_matchmaker/src/matchmaker.rs b/other_crates/bones_matchmaker/src/matchmaker.rs index b31dc62617..979e5c720d 100644 --- a/other_crates/bones_matchmaker/src/matchmaker.rs +++ b/other_crates/bones_matchmaker/src/matchmaker.rs @@ -6,9 +6,9 @@ use bones_matchmaker_proto::{ GameID, LobbyId, LobbyInfo, MatchInfo, MatchmakerRequest, MatchmakerResponse, PlayerIdxAssignment, }; -use iroh_net::{Endpoint, NodeAddr}; +use futures::future::BoxFuture; +use iroh::{endpoint::Connection, Endpoint, NodeAddr}; use once_cell::sync::Lazy; -use quinn::Connection; use rand::{prelude::SliceRandom, SeedableRng}; use scc::HashMap as SccHashMap; use std::cmp::Ordering; @@ -35,38 +35,73 @@ pub struct State { pub static MATCHMAKER_STATE: Lazy>> = Lazy::new(|| Arc::new(Mutex::new(State::default()))); -/// Handles incoming connections and routes requests to appropriate handlers -pub async fn handle_connection(ep: Endpoint, conn: Connection) -> Result<()> { - let connection_id = conn.stable_id(); - loop { - tokio::select! { - _ = conn.closed() => { - info!("[{}] Client closed connection.", connection_id); - return Ok(()); +#[derive(Debug)] +pub struct Matchmaker { + endpoint: Endpoint, +} + +impl iroh::protocol::ProtocolHandler for Matchmaker { + fn accept(self: Arc, conn: iroh::endpoint::Connecting) -> BoxFuture<'static, Result<()>> { + Box::pin(async move { + let connection = conn.await; + + match connection { + Ok(conn) => { + info!( + connection_id = conn.stable_id(), + addr = ?conn.remote_address(), + "Accepted connection from client" + ); + + // Spawn a task to handle the new connection + self.handle_connection(conn).await?; + } + Err(e) => error!("Error opening client connection: {e:?}"), } - bi = conn.accept_bi() => { - let (mut send, mut recv) = bi?; - // Parse the incoming request - let request: MatchmakerRequest = postcard::from_bytes(&recv.read_to_end(256).await?)?; - - // Route the request to the appropriate handler - match request { - MatchmakerRequest::RequestMatchmaking(match_info) => { - handle_request_matchaking(ep.clone(), conn.clone(), match_info, &mut send).await?; - send.finish()?; - send.stopped().await?; - } - MatchmakerRequest::StopMatchmaking(match_info) => { - handle_stop_matchmaking(conn.clone(), match_info, &mut send).await?; - } - MatchmakerRequest::ListLobbies(game_id) => { - handle_list_lobbies(game_id, &mut send).await?; - } - MatchmakerRequest::CreateLobby(lobby_info) => { - handle_create_lobby(conn.clone(), lobby_info, &mut send).await?; - } - MatchmakerRequest::JoinLobby(game_id, lobby_id, password) => { - handle_join_lobby(ep.clone(), conn.clone(), game_id, lobby_id, password, &mut send).await?; + + Ok(()) + }) + } +} + +impl Matchmaker { + pub fn new(endpoint: Endpoint) -> Self { + Matchmaker { endpoint } + } + + /// Handles incoming connections and routes requests to appropriate handlers + async fn handle_connection(&self, conn: Connection) -> Result<()> { + let connection_id = conn.stable_id(); + loop { + tokio::select! { + _ = conn.closed() => { + info!("[{}] Client closed connection.", connection_id); + return Ok(()); + } + bi = conn.accept_bi() => { + let (mut send, mut recv) = bi?; + // Parse the incoming request + let request: MatchmakerRequest = postcard::from_bytes(&recv.read_to_end(256).await?)?; + + // Route the request to the appropriate handler + match request { + MatchmakerRequest::RequestMatchmaking(match_info) => { + handle_request_matchaking(&self.endpoint, conn.clone(), match_info, &mut send).await?; + send.finish()?; + send.stopped().await?; + } + MatchmakerRequest::StopMatchmaking(match_info) => { + handle_stop_matchmaking(conn.clone(), match_info, &mut send).await?; + } + MatchmakerRequest::ListLobbies(game_id) => { + handle_list_lobbies(game_id, &mut send).await?; + } + MatchmakerRequest::CreateLobby(lobby_info) => { + handle_create_lobby(conn.clone(), lobby_info, &mut send).await?; + } + MatchmakerRequest::JoinLobby(game_id, lobby_id, password) => { + handle_join_lobby(&self.endpoint, conn.clone(), game_id, lobby_id, password, &mut send).await?; + } } } } @@ -110,7 +145,7 @@ pub async fn start_game( // Collect player IDs and addresses for (conn_idx, conn) in members.iter().enumerate() { - let id = iroh_net::endpoint::get_remote_node_id(conn)?; + let id = iroh::endpoint::get_remote_node_id(conn)?; let mut addr = NodeAddr::new(id); if let Some(info) = ep.remote_info(id) { if let Some(relay_url) = info.relay_url { diff --git a/other_crates/bones_matchmaker/src/matchmaking.rs b/other_crates/bones_matchmaker/src/matchmaking.rs index 68128f6d6b..34253140c7 100644 --- a/other_crates/bones_matchmaker/src/matchmaking.rs +++ b/other_crates/bones_matchmaker/src/matchmaking.rs @@ -1,15 +1,14 @@ use super::matchmaker::{start_game, MATCHMAKER_STATE}; use anyhow::Result; use bones_matchmaker_proto::{MatchInfo, MatchmakerResponse}; -use iroh_net::Endpoint; -use quinn::Connection; +use iroh::{endpoint::Connection, Endpoint}; use tokio::time::{sleep, Duration}; /// Handles a stop matchmaking request from a client pub async fn handle_stop_matchmaking( conn: Connection, match_info: MatchInfo, - send: &mut quinn::SendStream, + send: &mut iroh::endpoint::SendStream, ) -> Result<()> { let stable_id = conn.stable_id(); info!("[{}] Handling stop matchmaking request", stable_id); @@ -68,10 +67,10 @@ pub async fn handle_stop_matchmaking( /// Handles a start matchmaking request from a client pub async fn handle_request_matchaking( - ep: Endpoint, + ep: &Endpoint, conn: Connection, match_info: MatchInfo, - send: &mut quinn::SendStream, + send: &mut iroh::endpoint::SendStream, ) -> Result<()> { let stable_id = conn.stable_id(); info!("[{}] Handling start matchmaking search request", stable_id); @@ -268,7 +267,7 @@ async fn send_matchmaking_updates( } /// Starts a matchmade game if the room is ready with sufficient players -async fn start_matchmaked_game_if_ready(ep: Endpoint, match_info: &MatchInfo) -> Result<()> { +async fn start_matchmaked_game_if_ready(ep: &Endpoint, match_info: &MatchInfo) -> Result<()> { let members = { let state = MATCHMAKER_STATE.lock().await; state @@ -280,6 +279,7 @@ async fn start_matchmaked_game_if_ready(ep: Endpoint, match_info: &MatchInfo) -> if let Some(members) = members { let cloned_match_info = match_info.clone(); let players_len = members.len(); + let ep = ep.clone(); tokio::spawn(async move { match start_game(ep, members, &cloned_match_info).await { Ok(_) => info!("Starting matchmaked game with {} players", players_len), diff --git a/other_crates/bones_matchmaker_proto/Cargo.toml b/other_crates/bones_matchmaker_proto/Cargo.toml index 12bdaa950e..dde6b39217 100644 --- a/other_crates/bones_matchmaker_proto/Cargo.toml +++ b/other_crates/bones_matchmaker_proto/Cargo.toml @@ -9,4 +9,4 @@ repository.workspace = true [dependencies] serde = { version = "1.0", features = ["derive"] } -iroh-net = { workspace = true } +iroh = { workspace = true } diff --git a/other_crates/bones_matchmaker_proto/src/lib.rs b/other_crates/bones_matchmaker_proto/src/lib.rs index de1f08b796..9a07630ac1 100644 --- a/other_crates/bones_matchmaker_proto/src/lib.rs +++ b/other_crates/bones_matchmaker_proto/src/lib.rs @@ -99,7 +99,7 @@ pub enum MatchmakerResponse { /// The number of connected clients in the match player_count: u32, /// The node ids of all players. - player_ids: Vec<(u32, iroh_net::NodeAddr)>, + player_ids: Vec<(u32, iroh::NodeAddr)>, }, /// Response that specifies updates about the current lobby (ie. player count updates) LobbyUpdate { player_count: u32 },