Skip to content

Commit e6432d1

Browse files
authored
chore: update to latest iroh (#39)
## Description update `iroh-docs` to work with latest `iroh-blobs`, `iroh-gossip`, and `iroh`
1 parent 2f79a3f commit e6432d1

File tree

7 files changed

+100
-58
lines changed

7 files changed

+100
-58
lines changed

Cargo.lock

+85-35
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+7-14
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,11 @@ futures-buffered = "0.2.4"
3535
futures-lite = "2.3.0"
3636
futures-util = { version = "0.3.25" }
3737
hex = "0.4"
38-
iroh-base = { version = "0.33", features = ["ticket"] }
39-
iroh-blobs = { version = "0.33" }
40-
iroh-gossip = { version = "0.33", optional = true, features = ["net"] }
41-
iroh-metrics = { version = "0.31", default-features = false }
42-
iroh = { version = "0.33", optional = true }
38+
iroh-base = { version = "0.34", features = ["ticket"] }
39+
iroh-blobs = { version = "0.34" }
40+
iroh-gossip = { version = "0.34", optional = true, features = ["net"] }
41+
iroh-metrics = { version = "0.32", default-features = false }
42+
iroh = { version = "0.34", optional = true }
4343
num_enum = "0.7"
4444
postcard = { version = "1", default-features = false, features = ["alloc", "use-std", "experimental-derive"] }
4545
rand = "0.8.5"
@@ -58,8 +58,8 @@ tracing = "0.1"
5858

5959
# rpc
6060
nested_enum_utils = { version = "0.1.0", optional = true }
61-
quic-rpc = { version = "0.18", optional = true }
62-
quic-rpc-derive = { version = "0.18", optional = true }
61+
quic-rpc = { version = "0.19", optional = true }
62+
quic-rpc-derive = { version = "0.19", optional = true }
6363
serde-error = { version = "0.1.3", optional = true }
6464
portable-atomic = { version = "1.9.0", optional = true }
6565

@@ -117,10 +117,3 @@ rpc = [
117117
[package.metadata.docs.rs]
118118
all-features = true
119119
rustdoc-args = ["--cfg", "iroh_docsrs"]
120-
121-
[patch.crates-io]
122-
iroh = { git = "https://github.com/n0-computer/iroh.git", branch = "main" }
123-
quic-rpc = { git = "https://github.com/n0-computer/quic-rpc.git", branch = "main" }
124-
iroh-base = { git = "https://github.com/n0-computer/iroh.git", branch = "main" }
125-
iroh-gossip = { git = "https://github.com/n0-computer/iroh-gossip.git", branch = "main" }
126-
iroh-blobs = { git = "https://github.com/n0-computer/iroh-blobs.git", branch = "main" }

deny.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ allow = [
1717
"BSL-1.0", # BOSL license
1818
"ISC",
1919
"MIT",
20-
"OpenSSL",
2120
"Zlib",
2221
"MPL-2.0", # https://fossa.com/blog/open-source-software-licenses-101-mozilla-public-license-2-0/
2322
"Unicode-3.0"
@@ -34,7 +33,8 @@ license-files = [
3433
ignore = [
3534
"RUSTSEC-2024-0370", # unmaintained, no upgrade available
3635
"RUSTSEC-2024-0384", # unmaintained, no upgrade available
36+
"RUSTSEC-2024-0436", # paste
3737
]
3838

3939
[sources]
40-
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"]
40+
allow-git = []

src/engine.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ impl<D: iroh_blobs::store::Store> Engine<D> {
227227
}
228228

229229
/// Handle an incoming iroh-docs connection.
230-
pub async fn handle_connection(&self, conn: iroh::endpoint::Connecting) -> anyhow::Result<()> {
230+
pub async fn handle_connection(&self, conn: iroh::endpoint::Connection) -> anyhow::Result<()> {
231231
self.to_live_actor
232232
.send(ToLiveActor::HandleConnection { conn })
233233
.await?;

src/engine/live.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ pub enum ToLiveActor {
8686
reply: sync::oneshot::Sender<Result<()>>,
8787
},
8888
HandleConnection {
89-
conn: iroh::endpoint::Connecting,
89+
conn: iroh::endpoint::Connection,
9090
},
9191
AcceptSyncRequest {
9292
namespace: NamespaceId,
@@ -759,7 +759,7 @@ impl<B: iroh_blobs::store::Store> LiveActor<B> {
759759
}
760760

761761
#[instrument("accept", skip_all)]
762-
pub async fn handle_connection(&mut self, conn: iroh::endpoint::Connecting) {
762+
pub async fn handle_connection(&mut self, conn: iroh::endpoint::Connection) {
763763
let to_actor_tx = self.sync_actor_tx.clone();
764764
let accept_request_cb = move |namespace, peer| {
765765
let to_actor_tx = to_actor_tx.clone();

src/net.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -106,15 +106,14 @@ pub enum AcceptOutcome {
106106
/// Handle an iroh-docs connection and sync all shared documents in the replica store.
107107
pub async fn handle_connection<F, Fut>(
108108
sync: SyncHandle,
109-
connecting: iroh::endpoint::Connecting,
109+
connection: iroh::endpoint::Connection,
110110
accept_cb: F,
111111
) -> Result<SyncFinished, AcceptError>
112112
where
113113
F: Fn(NamespaceId, PublicKey) -> Fut,
114114
Fut: Future<Output = AcceptOutcome>,
115115
{
116116
let t_start = Instant::now();
117-
let connection = connecting.await.map_err(AcceptError::connect)?;
118117
let peer = connection.remote_node_id().map_err(AcceptError::connect)?;
119118
let (mut send_stream, mut recv_stream) = connection
120119
.accept_bi()

src/protocol.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use std::{path::PathBuf, sync::Arc};
44

55
use anyhow::Result;
66
use futures_lite::future::Boxed as BoxedFuture;
7-
use iroh::{endpoint::Connecting, protocol::ProtocolHandler};
7+
use iroh::{endpoint::Connection, protocol::ProtocolHandler};
88
use iroh_blobs::net_protocol::{Blobs, ProtectCb};
99
use iroh_gossip::net::Gossip;
1010

@@ -14,7 +14,7 @@ use crate::{
1414
};
1515

1616
impl<S: iroh_blobs::store::Store> ProtocolHandler for Docs<S> {
17-
fn accept(&self, conn: Connecting) -> BoxedFuture<Result<()>> {
17+
fn accept(&self, conn: Connection) -> BoxedFuture<Result<()>> {
1818
let this = self.engine.clone();
1919
Box::pin(async move { this.handle_connection(conn).await })
2020
}

0 commit comments

Comments
 (0)