Skip to content

Commit 3f96b3b

Browse files
author
“ramfox”
committed
chore: upgrade to latest iroh, iroh-base, iroh-tickets, and iroh-metrics
1 parent 1c854f3 commit 3f96b3b

File tree

10 files changed

+89
-67
lines changed

10 files changed

+89
-67
lines changed

Cargo.lock

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

Cargo.toml

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,16 @@ chrono = "0.4.39"
3535
nested_enum_utils = "0.2.1"
3636
ref-cast = "1.0.24"
3737
arrayvec = "0.7.6"
38-
iroh = { version = "0.94", default-features = false }
38+
iroh = { version = "0.95", default-features = false }
3939
self_cell = "1.1.0"
4040
genawaiter = { version = "0.99.1", features = ["futures03"] }
41-
iroh-base = "0.94"
42-
iroh-tickets = "0.1"
43-
irpc = { version = "0.10.0", features = ["spans", "stream", "derive", "varint-util"], default-features = false }
44-
iroh-metrics = { version = "0.36" }
41+
iroh-base = "0.95"
42+
iroh-tickets = "0.2"
43+
irpc = { version = "0.11.0", features = ["spans", "stream", "derive", "varint-util"], default-features = false }
44+
iroh-metrics = { version = "0.37" }
4545
redb = { version = "2.6.3", optional = true }
4646
reflink-copy = { version = "0.1.24", optional = true }
47+
n0-error = "0.1.0"
4748

4849
[dev-dependencies]
4950
clap = { version = "4.5.31", features = ["derive"] }
@@ -59,7 +60,7 @@ tracing-subscriber = { version = "0.3.20", features = ["fmt"] }
5960
tracing-test = "0.2.5"
6061
walkdir = "2.5.0"
6162
atomic_refcell = "0.1.13"
62-
iroh = { version = "0.94", features = ["discovery-local-network"]}
63+
iroh = { version = "0.95", features = ["discovery-local-network"]}
6364
async-compression = { version = "0.4.30", features = ["lz4", "tokio"] }
6465
concat_const = "0.2.0"
6566

@@ -80,6 +81,3 @@ required-features = ["fs-store"]
8081
[[example]]
8182
name = "random_store"
8283
required-features = ["fs-store"]
83-
84-
[patch.crates-io]
85-
irpc = { git = "https://github.com/n0-computer/irpc", branch = "main" }

examples/compression.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ impl<C: Compression> ProtocolHandler for CompressedBlobsProtocol<C> {
160160
.events
161161
.client_connected(|| ClientConnected {
162162
connection_id,
163-
endpoint_id: connection.remote_id().ok(),
163+
endpoint_id: Some(connection.remote_id()),
164164
})
165165
.await
166166
{

examples/custom-protocol.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ impl ProtocolHandler for BlobSearch {
177177
async fn accept(&self, connection: Connection) -> std::result::Result<(), AcceptError> {
178178
let this = self.clone();
179179
// We can get the remote's endpoint id from the connection.
180-
let node_id = connection.remote_id()?;
180+
let node_id = connection.remote_id();
181181
println!("accepted connection from {node_id}");
182182

183183
// Our protocol is a simple request-response protocol, so we expect the

src/api.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -123,12 +123,12 @@ impl From<ExportBaoError> for Error {
123123
impl From<irpc::Error> for ExportBaoError {
124124
fn from(e: irpc::Error) -> Self {
125125
match e {
126-
irpc::Error::MpscRecv(e) => MpscRecvSnafu.into_error(e),
127-
irpc::Error::OneshotRecv(e) => OneshotRecvSnafu.into_error(e),
128-
irpc::Error::Send(e) => SendSnafu.into_error(e),
129-
irpc::Error::Request(e) => RequestSnafu.into_error(e),
126+
irpc::Error::MpscRecv { source, .. } => MpscRecvSnafu.into_error(source),
127+
irpc::Error::OneshotRecv { source, .. } => OneshotRecvSnafu.into_error(source),
128+
irpc::Error::Send { source, .. } => SendSnafu.into_error(source),
129+
irpc::Error::Request { source, .. } => RequestSnafu.into_error(source),
130130
#[cfg(feature = "rpc")]
131-
irpc::Error::Write(e) => ExportBaoIoSnafu.into_error(e.into()),
131+
irpc::Error::Write { source, .. } => ExportBaoIoSnafu.into_error(source.into()),
132132
}
133133
}
134134
}

src/provider.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ pub async fn handle_connection(
292292
if let Err(cause) = progress
293293
.client_connected(|| ClientConnected {
294294
connection_id,
295-
endpoint_id: connection.remote_id().ok(),
295+
endpoint_id: Some(connection.remote_id()),
296296
})
297297
.await
298298
{

src/store/fs/bao_file.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -740,7 +740,7 @@ impl BaoFileStorageSubscriber {
740740
tokio::select! {
741741
_ = tx.closed() => {
742742
// the sender is closed, we are done
743-
Err(irpc::channel::SendError::ReceiverClosed.into())
743+
Err(n0_error::e!(irpc::channel::SendError::ReceiverClosed).into())
744744
}
745745
e = self.receiver.changed() => Ok(e?),
746746
}

0 commit comments

Comments
 (0)