Skip to content

Commit c146f7a

Browse files
feat: update to latest iroh
* feat: update to latest iroh * fix deny.toml
1 parent d4ab8db commit c146f7a

File tree

15 files changed

+457
-304
lines changed

15 files changed

+457
-304
lines changed

Cargo.lock

Lines changed: 420 additions & 257 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,7 @@ iroh-base = "0.28.0"
3939
iroh-blobs = { version = "0.28.0", optional = true, features = ["downloader"] }
4040
iroh-gossip = { version = "0.28.0", optional = true }
4141
iroh-metrics = { version = "0.28.0", default-features = false }
42-
iroh-net = { version = "0.28.0", optional = true }
43-
iroh-router = { version = "0.28.0", optional = true }
42+
iroh = { version = "0.28", optional = true }
4443
num_enum = "0.7"
4544
postcard = { version = "1", default-features = false, features = ["alloc", "use-std", "experimental-derive"] }
4645
rand = "0.8.5"
@@ -88,10 +87,10 @@ testdir = "0.9.1"
8887

8988
[features]
9089
default = ["net", "metrics", "engine", "rpc", "test-utils"]
91-
net = ["dep:iroh-net", "tokio/io-util", "dep:tokio-stream", "dep:tokio-util"]
92-
metrics = ["iroh-metrics/metrics"]
93-
engine = ["net", "dep:iroh-gossip", "dep:iroh-blobs", "dep:iroh-router"]
94-
test-utils = ["iroh-net/test-utils"]
90+
net = ["dep:iroh", "tokio/io-util", "dep:tokio-stream", "dep:tokio-util"]
91+
metrics = ["iroh-metrics/metrics", "iroh/metrics"]
92+
engine = ["net", "dep:iroh-gossip", "dep:iroh-blobs"]
93+
test-utils = ["iroh/test-utils"]
9594
cli = ["rpc", "dep:clap", "dep:indicatif", "dep:console", "dep:colored", "dep:dialoguer", "dep:shellexpand", "iroh-blobs/rpc"]
9695
rpc = [
9796
"engine",
@@ -107,9 +106,8 @@ all-features = true
107106
rustdoc-args = ["--cfg", "iroh_docsrs"]
108107

109108
[patch.crates-io]
110-
iroh-router = { git = "https://github.com/n0-computer/iroh", branch = "main" }
111-
iroh-net = { git = "https://github.com/n0-computer/iroh", branch = "main" }
112109
iroh-metrics = { git = "https://github.com/n0-computer/iroh", branch = "main" }
113110
iroh-base = { git = "https://github.com/n0-computer/iroh", branch = "main" }
111+
iroh = { git = "https://github.com/n0-computer/iroh", branch = "main" }
114112
iroh-blobs = { git = "https://github.com/n0-computer/iroh-blobs", branch = "main" }
115113
iroh-gossip = { git = "https://github.com/n0-computer/iroh-gossip", branch = "main" }

deny.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ allow = [
1818
"ISC",
1919
"MIT",
2020
"OpenSSL",
21-
"Unicode-DFS-2016",
2221
"Zlib",
2322
"MPL-2.0", # https://fossa.com/blog/open-source-software-licenses-101-mozilla-public-license-2-0/
2423
"Unicode-3.0"

src/engine.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@ use std::{
1111

1212
use anyhow::{bail, Context, Result};
1313
use futures_lite::{Stream, StreamExt};
14+
use iroh::{key::PublicKey, Endpoint, NodeAddr};
1415
use iroh_blobs::{
1516
downloader::Downloader, store::EntryStatus, util::local_pool::LocalPoolHandle, Hash,
1617
};
1718
use iroh_gossip::net::Gossip;
18-
use iroh_net::{key::PublicKey, Endpoint, NodeAddr};
1919
use serde::{Deserialize, Serialize};
2020
use tokio::sync::{mpsc, oneshot};
2121
use tokio_util::task::AbortOnDropHandle;
@@ -202,10 +202,7 @@ impl<D: iroh_blobs::store::Store> Engine<D> {
202202
}
203203

204204
/// Handle an incoming iroh-docs connection.
205-
pub async fn handle_connection(
206-
&self,
207-
conn: iroh_net::endpoint::Connecting,
208-
) -> anyhow::Result<()> {
205+
pub async fn handle_connection(&self, conn: iroh::endpoint::Connecting) -> anyhow::Result<()> {
209206
self.to_live_actor
210207
.send(ToLiveActor::HandleConnection { conn })
211208
.await?;

src/engine/gossip.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ use anyhow::{Context, Result};
44
use bytes::Bytes;
55
use futures_lite::StreamExt;
66
use futures_util::FutureExt;
7+
use iroh::NodeId;
78
use iroh_gossip::net::{Event, Gossip, GossipEvent, GossipReceiver, GossipSender, JoinOptions};
8-
use iroh_net::NodeId;
99
use tokio::{
1010
sync::mpsc,
1111
task::{AbortHandle, JoinSet},

src/engine/live.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ use std::{
77

88
use anyhow::{Context, Result};
99
use futures_lite::FutureExt;
10+
use iroh::{key::PublicKey, Endpoint, NodeAddr, NodeId};
1011
use iroh_blobs::{
1112
downloader::{DownloadError, DownloadRequest, Downloader},
1213
get::Stats,
@@ -15,7 +16,6 @@ use iroh_blobs::{
1516
};
1617
use iroh_gossip::net::Gossip;
1718
use iroh_metrics::inc;
18-
use iroh_net::{key::PublicKey, Endpoint, NodeAddr, NodeId};
1919
use serde::{Deserialize, Serialize};
2020
use tokio::{
2121
sync::{self, mpsc, oneshot},
@@ -86,7 +86,7 @@ pub enum ToLiveActor {
8686
reply: sync::oneshot::Sender<Result<()>>,
8787
},
8888
HandleConnection {
89-
conn: iroh_net::endpoint::Connecting,
89+
conn: iroh::endpoint::Connecting,
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_net::endpoint::Connecting) {
762+
pub async fn handle_connection(&mut self, conn: iroh::endpoint::Connecting) {
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/engine/state.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use std::{
44
};
55

66
use anyhow::Result;
7-
use iroh_net::NodeId;
7+
use iroh::NodeId;
88
use serde::{Deserialize, Serialize};
99
use tracing::{debug, warn};
1010

src/net.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ use std::{
55
time::{Duration, Instant},
66
};
77

8+
use iroh::{endpoint::get_remote_node_id, key::PublicKey, Endpoint, NodeAddr};
89
#[cfg(feature = "metrics")]
910
use iroh_metrics::inc;
10-
use iroh_net::{endpoint::get_remote_node_id, key::PublicKey, Endpoint, NodeAddr};
1111
use serde::{Deserialize, Serialize};
1212
use tracing::{debug, error_span, trace, Instrument};
1313

@@ -106,7 +106,7 @@ 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_net::endpoint::Connecting,
109+
connecting: iroh::endpoint::Connecting,
110110
accept_cb: F,
111111
) -> Result<SyncFinished, AcceptError>
112112
where

src/net/codec.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use std::future::Future;
33
use anyhow::{anyhow, ensure};
44
use bytes::{Buf, BufMut, BytesMut};
55
use futures_util::SinkExt;
6-
use iroh_net::key::PublicKey;
6+
use iroh::key::PublicKey;
77
use serde::{Deserialize, Serialize};
88
use tokio::io::{AsyncRead, AsyncWrite};
99
use tokio_stream::StreamExt;
@@ -294,8 +294,8 @@ impl BobState {
294294
#[cfg(test)]
295295
mod tests {
296296
use anyhow::Result;
297+
use iroh::key::SecretKey;
297298
use iroh_base::hash::Hash;
298-
use iroh_net::key::SecretKey;
299299
use rand_core::{CryptoRngCore, SeedableRng};
300300

301301
use super::*;

src/protocol.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@ use std::sync::Arc;
44

55
use anyhow::Result;
66
use futures_lite::future::Boxed as BoxedFuture;
7-
use iroh_net::endpoint::Connecting;
8-
use iroh_router::ProtocolHandler;
7+
use iroh::{endpoint::Connecting, protocol::ProtocolHandler};
98

109
use crate::engine::Engine;
1110

0 commit comments

Comments
 (0)