diff --git a/Cargo.lock b/Cargo.lock index ec5df1bd..ccafc184 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -296,16 +296,14 @@ dependencies = [ ] [[package]] -name = "backoff" -version = "0.4.0" +name = "backon" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b62ddb9cb1ec0a098ad4bbf9344d0713fa193ae1a80af55febcff2627b6a00c1" +checksum = "49fef586913a57ff189f25c9b3d034356a5bf6b3fa9a7f067588fe1698ba1f5d" dependencies = [ - "futures-core", - "getrandom 0.2.15", - "instant", - "pin-project-lite", - "rand 0.8.5", + "fastrand", + "gloo-timers", + "tokio", ] [[package]] @@ -824,6 +822,7 @@ checksum = "f55bf8e7b65898637379c1b74eb1551107c8294ed26d855ceb9fd1a09cfc9bc0" dependencies = [ "const-oid", "der_derive", + "pem-rfc7468", "zeroize", ] @@ -1439,6 +1438,18 @@ version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a8d1add55171497b4705a648c6b583acafb01d58050a51727785f0b2c8e0a2b2" +[[package]] +name = "gloo-timers" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbb143cf96099802033e0d4f4963b19fd2e0b728bcf076cd9cf7f6634f092994" +dependencies = [ + "futures-channel", + "futures-core", + "js-sys", + "wasm-bindgen", +] + [[package]] name = "governor" version = "0.7.0" @@ -1997,14 +2008,15 @@ checksum = "469fb0b9cefa57e3ef31275ee7cacb78f2fdca44e4765491884a2b119d4eb130" [[package]] name = "iroh" -version = "0.33.0" -source = "git+https://github.com/n0-computer/iroh.git?branch=main#0c7a1227cf1b9f640145c059c7581f2c502e6691" +version = "0.34.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6b7224d4eeec6c8b5b1a9b2347a4dff3588834a7fb17233044bff3e90e7b293d" dependencies = [ "aead", "anyhow", "atomic-waker", "axum", - "backoff", + "backon", "bytes", "cfg_aliases", "concurrent-queue", @@ -2027,7 +2039,7 @@ dependencies = [ "iroh-relay", "n0-future", "netdev", - "netwatch", + "netwatch 0.4.0", "pin-project", "pkarr", "portmapper", @@ -2056,8 +2068,9 @@ dependencies = [ [[package]] name = "iroh-base" -version = "0.33.0" -source = "git+https://github.com/n0-computer/iroh.git?branch=main#0c7a1227cf1b9f640145c059c7581f2c502e6691" +version = "0.34.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "02bf2374c0f1d01cde6e60de7505e42a604acda1a1bb3f7be19806e466055517" dependencies = [ "curve25519-dalek", "data-encoding", @@ -2085,8 +2098,9 @@ dependencies = [ [[package]] name = "iroh-blobs" -version = "0.33.0" -source = "git+https://github.com/n0-computer/iroh-blobs.git?branch=main#e35beb6b5007bdc9fae817fa711c9296c2e844a0" +version = "0.34.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8d7a6872c7ec4a2613d0386b4dc19b5f3cf4822d81361c5136a63fd56ba2372" dependencies = [ "anyhow", "async-channel", @@ -2193,8 +2207,9 @@ dependencies = [ [[package]] name = "iroh-gossip" -version = "0.33.0" -source = "git+https://github.com/n0-computer/iroh-gossip.git?branch=main#0a03543db6aaedb7ac403e38360d5a1afc88b3f4" +version = "0.34.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "46f02f4ab55d5f52a16253ad9d95fd6e89c1b1046a0f99a1afb14833f9b6e1a5" dependencies = [ "anyhow", "async-channel", @@ -2236,9 +2251,9 @@ dependencies = [ [[package]] name = "iroh-metrics" -version = "0.31.0" +version = "0.32.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "571d177e20f0848a643a2c0f662be0e08968f8743b0776941f83a2152b87a180" +checksum = "c0f7cd1ffe3b152a5f4f4c1880e01e07d96001f20e02cc143cb7842987c616b3" dependencies = [ "erased_set", "http-body-util", @@ -2255,8 +2270,9 @@ dependencies = [ [[package]] name = "iroh-net-report" -version = "0.33.0" -source = "git+https://github.com/n0-computer/iroh.git?branch=main#0c7a1227cf1b9f640145c059c7581f2c502e6691" +version = "0.34.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "63407d73331e8e38980be7e39b1db8e173fc28545b3ea0c48c9a718f95877b8e" dependencies = [ "anyhow", "bytes", @@ -2268,7 +2284,7 @@ dependencies = [ "iroh-quinn", "iroh-relay", "n0-future", - "netwatch", + "netwatch 0.4.0", "portmapper", "rand 0.8.5", "reqwest", @@ -2338,8 +2354,9 @@ dependencies = [ [[package]] name = "iroh-relay" -version = "0.33.0" -source = "git+https://github.com/n0-computer/iroh.git?branch=main#0c7a1227cf1b9f640145c059c7581f2c502e6691" +version = "0.34.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "21d282c04a71a83a90b8fe6872ba30ae341853255aa908375a3e6181f7215d7b" dependencies = [ "anyhow", "bytes", @@ -2792,6 +2809,39 @@ dependencies = [ "wmi", ] +[[package]] +name = "netwatch" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b7879c2cfdf30d92f2be89efa3169b3d78107e3ab7f7b9a37157782569314e1" +dependencies = [ + "atomic-waker", + "bytes", + "cfg_aliases", + "derive_more", + "iroh-quinn-udp", + "js-sys", + "libc", + "n0-future", + "netdev", + "netlink-packet-core", + "netlink-packet-route 0.19.0", + "netlink-sys", + "rtnetlink 0.13.1", + "rtnetlink 0.14.1", + "serde", + "socket2", + "thiserror 2.0.11", + "time", + "tokio", + "tokio-util", + "tracing", + "web-sys", + "windows 0.59.0", + "windows-result 0.3.0", + "wmi", +] + [[package]] name = "nix" version = "0.26.4" @@ -3296,11 +3346,10 @@ checksum = "280dc24453071f1b63954171985a0b0d30058d287960968b9b2aca264c8d4ee6" [[package]] name = "portmapper" -version = "0.3.1" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5469b29e6ce2a27bfc9382720b5f0768993afec9e53b133d8248c8b09406156a" +checksum = "b715da165f399be093fecb2ca774b00713a3b32f6b27e0752fbf255e3be622af" dependencies = [ - "anyhow", "base64", "bytes", "derive_more", @@ -3309,7 +3358,7 @@ dependencies = [ "igd-next", "iroh-metrics", "libc", - "netwatch", + "netwatch 0.3.0", "num_enum", "rand 0.8.5", "serde", @@ -3525,8 +3574,9 @@ dependencies = [ [[package]] name = "quic-rpc" -version = "0.18.2" -source = "git+https://github.com/n0-computer/quic-rpc.git?branch=main#ec27edbc1cba730d8bf54a61be06ffc62df3948e" +version = "0.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "89561e5343bcad1c9f84321d9d9bd1619128ad44293faad55a0001b0e52d312b" dependencies = [ "anyhow", "document-features", @@ -3546,9 +3596,9 @@ dependencies = [ [[package]] name = "quic-rpc-derive" -version = "0.18.1" +version = "0.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d94974ee26d4e97acfab1fd55df2a1ca676af24021a08354ed1c42b70a39e914" +checksum = "0a99f334af6f23b3de91f6df9ac17237e8b533b676f596c69dcb3b58c3cf8dea" dependencies = [ "proc-macro2", "quic-rpc", @@ -3941,9 +3991,9 @@ dependencies = [ [[package]] name = "ring" -version = "0.17.9" +version = "0.17.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e75ec5e92c4d8aede845126adc388046234541629e76029599ed35a003c7ed24" +checksum = "a4689e6c2294d81e88dc6261c768b63bc4fcdb852be6d1352498b114f61383b7" dependencies = [ "cc", "cfg-if", diff --git a/Cargo.toml b/Cargo.toml index b0e7c0fb..cb125555 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -35,11 +35,11 @@ futures-buffered = "0.2.4" futures-lite = "2.3.0" futures-util = { version = "0.3.25" } hex = "0.4" -iroh-base = { version = "0.33", features = ["ticket"] } -iroh-blobs = { version = "0.33" } -iroh-gossip = { version = "0.33", optional = true, features = ["net"] } -iroh-metrics = { version = "0.31", default-features = false } -iroh = { version = "0.33", optional = true } +iroh-base = { version = "0.34", features = ["ticket"] } +iroh-blobs = { version = "0.34" } +iroh-gossip = { version = "0.34", optional = true, features = ["net"] } +iroh-metrics = { version = "0.32", default-features = false } +iroh = { version = "0.34", optional = true } num_enum = "0.7" postcard = { version = "1", default-features = false, features = ["alloc", "use-std", "experimental-derive"] } rand = "0.8.5" @@ -58,8 +58,8 @@ tracing = "0.1" # rpc nested_enum_utils = { version = "0.1.0", optional = true } -quic-rpc = { version = "0.18", optional = true } -quic-rpc-derive = { version = "0.18", optional = true } +quic-rpc = { version = "0.19", optional = true } +quic-rpc-derive = { version = "0.19", optional = true } serde-error = { version = "0.1.3", optional = true } portable-atomic = { version = "1.9.0", optional = true } @@ -117,10 +117,3 @@ rpc = [ [package.metadata.docs.rs] all-features = true rustdoc-args = ["--cfg", "iroh_docsrs"] - -[patch.crates-io] -iroh = { git = "https://github.com/n0-computer/iroh.git", branch = "main" } -quic-rpc = { git = "https://github.com/n0-computer/quic-rpc.git", branch = "main" } -iroh-base = { git = "https://github.com/n0-computer/iroh.git", branch = "main" } -iroh-gossip = { git = "https://github.com/n0-computer/iroh-gossip.git", branch = "main" } -iroh-blobs = { git = "https://github.com/n0-computer/iroh-blobs.git", branch = "main" } diff --git a/deny.toml b/deny.toml index 5771dc50..24769dad 100644 --- a/deny.toml +++ b/deny.toml @@ -17,7 +17,6 @@ allow = [ "BSL-1.0", # BOSL license "ISC", "MIT", - "OpenSSL", "Zlib", "MPL-2.0", # https://fossa.com/blog/open-source-software-licenses-101-mozilla-public-license-2-0/ "Unicode-3.0" @@ -34,7 +33,8 @@ license-files = [ ignore = [ "RUSTSEC-2024-0370", # unmaintained, no upgrade available "RUSTSEC-2024-0384", # unmaintained, no upgrade available + "RUSTSEC-2024-0436", # paste ] [sources] -allow-git = ["https://github.com/n0-computer/iroh.git", "https://github.com/n0-computer/quic-rpc.git", "https://github.com/n0-computer/iroh-blobs.git", "https://github.com/n0-computer/iroh-gossip.git"] +allow-git = [] diff --git a/src/engine.rs b/src/engine.rs index 499bcd06..0b832638 100644 --- a/src/engine.rs +++ b/src/engine.rs @@ -227,7 +227,7 @@ impl Engine { } /// Handle an incoming iroh-docs connection. - pub async fn handle_connection(&self, conn: iroh::endpoint::Connecting) -> anyhow::Result<()> { + pub async fn handle_connection(&self, conn: iroh::endpoint::Connection) -> anyhow::Result<()> { self.to_live_actor .send(ToLiveActor::HandleConnection { conn }) .await?; diff --git a/src/engine/live.rs b/src/engine/live.rs index 2a5391cf..dd2bf9a3 100644 --- a/src/engine/live.rs +++ b/src/engine/live.rs @@ -86,7 +86,7 @@ pub enum ToLiveActor { reply: sync::oneshot::Sender>, }, HandleConnection { - conn: iroh::endpoint::Connecting, + conn: iroh::endpoint::Connection, }, AcceptSyncRequest { namespace: NamespaceId, @@ -759,7 +759,7 @@ impl LiveActor { } #[instrument("accept", skip_all)] - pub async fn handle_connection(&mut self, conn: iroh::endpoint::Connecting) { + pub async fn handle_connection(&mut self, conn: iroh::endpoint::Connection) { let to_actor_tx = self.sync_actor_tx.clone(); let accept_request_cb = move |namespace, peer| { let to_actor_tx = to_actor_tx.clone(); diff --git a/src/net.rs b/src/net.rs index fb9c7c4f..ac6020cd 100644 --- a/src/net.rs +++ b/src/net.rs @@ -106,7 +106,7 @@ pub enum AcceptOutcome { /// Handle an iroh-docs connection and sync all shared documents in the replica store. pub async fn handle_connection( sync: SyncHandle, - connecting: iroh::endpoint::Connecting, + connection: iroh::endpoint::Connection, accept_cb: F, ) -> Result where @@ -114,7 +114,6 @@ where Fut: Future, { let t_start = Instant::now(); - let connection = connecting.await.map_err(AcceptError::connect)?; let peer = connection.remote_node_id().map_err(AcceptError::connect)?; let (mut send_stream, mut recv_stream) = connection .accept_bi() diff --git a/src/protocol.rs b/src/protocol.rs index ba0e58e6..2604432d 100644 --- a/src/protocol.rs +++ b/src/protocol.rs @@ -4,7 +4,7 @@ use std::{path::PathBuf, sync::Arc}; use anyhow::Result; use futures_lite::future::Boxed as BoxedFuture; -use iroh::{endpoint::Connecting, protocol::ProtocolHandler}; +use iroh::{endpoint::Connection, protocol::ProtocolHandler}; use iroh_blobs::net_protocol::{Blobs, ProtectCb}; use iroh_gossip::net::Gossip; @@ -14,7 +14,7 @@ use crate::{ }; impl ProtocolHandler for Docs { - fn accept(&self, conn: Connecting) -> BoxedFuture> { + fn accept(&self, conn: Connection) -> BoxedFuture> { let this = self.engine.clone(); Box::pin(async move { this.handle_connection(conn).await }) }