Skip to content

Commit dc382dc

Browse files
b5ramfox
andauthored
Update v0.16.0 (#61)
* chore: update existim * update dumbpipe-web * update tauri todos example * funny handle_connection issue in iroh blobs * upgrade dumbpipe-web * upgrade content-discovery * upgrade extism example * upgrade automerge * upgrade iroh-gateway * upgrade iroh-pkarr-node-discovery * upgrade iroh-pkarr-naming-system * upgrade iroh-s3-bao-store * upgrade tauri --------- Co-authored-by: Kasey <[email protected]>
1 parent 259651b commit dc382dc

File tree

40 files changed

+2567
-1650
lines changed

40 files changed

+2567
-1650
lines changed

content-discovery/Cargo.lock

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

content-discovery/Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,6 @@ missing_debug_implementations = "warn"
2626
unused-async = "warn"
2727

2828
[workspace.dependencies]
29-
iroh-net = "0.15.0"
30-
iroh-bytes = "0.15.0"
31-
iroh-base = "0.15.0"
29+
iroh-net = "0.16"
30+
iroh-blobs = "0.16"
31+
iroh-base = "0.16"

content-discovery/iroh-mainline-content-discovery-cli/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ license = "MIT OR Apache-2.0"
99

1010
[dependencies]
1111
iroh-net = { workspace = true }
12-
iroh-bytes = { workspace = true }
12+
iroh-blobs = { workspace = true }
1313
iroh-base = { workspace = true }
1414
iroh-mainline-content-discovery = { path = "../iroh-mainline-content-discovery" }
1515
mainline = { version = "1.0.0" }

content-discovery/iroh-mainline-content-discovery-cli/src/args.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//! Command line arguments.
22
use clap::{Parser, Subcommand};
33
use iroh_base::ticket::BlobTicket;
4-
use iroh_bytes::{Hash, HashAndFormat};
4+
use iroh_blobs::{Hash, HashAndFormat};
55
use iroh_net::NodeId;
66
use std::{fmt::Display, net::SocketAddr, str::FromStr};
77

content-discovery/iroh-mainline-content-discovery/Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,15 @@ license = "MIT OR Apache-2.0"
1212
#
1313
# The protocol is using postcard, but we don't need a postcard dependency for just the type definitions
1414
iroh-net = { workspace = true }
15-
iroh-bytes = { workspace = true }
15+
iroh-blobs = { workspace = true }
1616
serde = { version = "1", features = ["derive"] }
1717
derive_more = { version = "1.0.0-beta.1", features = ["debug", "display", "from", "try_into"] }
1818
serde-big-array = "0.5.1"
1919
hex = "0.4.3"
2020

2121
# Optional features for the client functionality
2222
tracing = { version = "0.1", optional = true }
23-
quinn = { version = "0.10", optional = true }
23+
iroh-quinn = { version = "0.10.2", optional = true }
2424
iroh-pkarr-node-discovery = { path = "../../iroh-pkarr-node-discovery", optional = true }
2525
mainline = { version = "1.0.0", optional = true }
2626
anyhow = { version = "1", features = ["backtrace"], optional = true }
@@ -33,5 +33,5 @@ tokio = { version = "1.36.0", optional = true }
3333
flume = "0.11.0"
3434

3535
[features]
36-
client = ["iroh-pkarr-node-discovery", "mainline", "quinn", "tracing", "anyhow", "rcgen", "genawaiter", "rustls", "futures", "postcard", "tokio"]
36+
client = ["iroh-pkarr-node-discovery", "mainline", "iroh-quinn", "tracing", "anyhow", "rcgen", "genawaiter", "rustls", "futures", "postcard", "tokio"]
3737
default = ["client"]

content-discovery/iroh-mainline-content-discovery/src/client.rs

Lines changed: 26 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ use futures::{
1414
stream::FusedStream,
1515
FutureExt, Stream, StreamExt,
1616
};
17-
use iroh_bytes::HashAndFormat;
17+
use iroh_blobs::HashAndFormat;
1818
use iroh_net::{MagicEndpoint, NodeId};
1919
use iroh_pkarr_node_discovery::PkarrNodeDiscovery;
2020

@@ -31,7 +31,7 @@ use crate::protocol::{
3131
/// `content` is the content to announce.
3232
/// `kind` is the kind of the announcement. We can claim to have the complete data or only some of it.
3333
pub async fn announce(
34-
connection: quinn::Connection,
34+
connection: iroh_net::magic_endpoint::Connection,
3535
signed_announce: SignedAnnounce,
3636
) -> anyhow::Result<()> {
3737
let (mut send, mut recv) = connection.open_bi().await?;
@@ -92,14 +92,14 @@ async fn query_magic_one(
9292

9393
/// A connection provider that can be used to connect to a tracker.
9494
///
95-
/// This can either be a [`quinn::Endpoint`] where connections are created on demand,
95+
/// This can either be a [`iroh_quinn::Endpoint`] where connections are created on demand,
9696
/// or some sort of connection pool.
9797
pub trait QuinnConnectionProvider<Addr>: Clone {
98-
fn connect(&self, addr: Addr) -> BoxFuture<anyhow::Result<quinn::Connection>>;
98+
fn connect(&self, addr: Addr) -> BoxFuture<anyhow::Result<iroh_quinn::Connection>>;
9999
}
100100

101-
impl QuinnConnectionProvider<SocketAddr> for quinn::Endpoint {
102-
fn connect(&self, addr: SocketAddr) -> BoxFuture<anyhow::Result<quinn::Connection>> {
101+
impl QuinnConnectionProvider<SocketAddr> for iroh_quinn::Endpoint {
102+
fn connect(&self, addr: SocketAddr) -> BoxFuture<anyhow::Result<iroh_quinn::Connection>> {
103103
async move { Ok(self.connect(addr, "localhost")?.await?) }.boxed()
104104
}
105105
}
@@ -176,7 +176,10 @@ pub fn announce_dht(
176176
}
177177

178178
/// Assume an existing connection to a tracker and query it for peers for some content.
179-
pub async fn query(connection: quinn::Connection, args: Query) -> anyhow::Result<QueryResponse> {
179+
pub async fn query(
180+
connection: iroh_net::magic_endpoint::Connection,
181+
args: Query,
182+
) -> anyhow::Result<QueryResponse> {
180183
tracing::info!("connected to {:?}", connection.remote_address());
181184
let (mut send, mut recv) = connection.open_bi().await?;
182185
tracing::info!("opened bi stream");
@@ -197,13 +200,13 @@ pub fn create_quinn_client(
197200
bind_addr: SocketAddr,
198201
alpn_protocols: Vec<Vec<u8>>,
199202
keylog: bool,
200-
) -> anyhow::Result<quinn::Endpoint> {
203+
) -> anyhow::Result<iroh_quinn::Endpoint> {
201204
let secret_key = iroh_net::key::SecretKey::generate();
202205
let tls_client_config =
203206
iroh_net::tls::make_client_config(&secret_key, None, alpn_protocols, keylog)?;
204-
let mut client_config = quinn::ClientConfig::new(Arc::new(tls_client_config));
205-
let mut endpoint = quinn::Endpoint::client(bind_addr)?;
206-
let mut transport_config = quinn::TransportConfig::default();
207+
let mut client_config = iroh_quinn::ClientConfig::new(Arc::new(tls_client_config));
208+
let mut endpoint = iroh_quinn::Endpoint::client(bind_addr)?;
209+
let mut transport_config = iroh_quinn::TransportConfig::default();
207210
transport_config.keep_alive_interval(Some(Duration::from_secs(1)));
208211
client_config.transport_config(Arc::new(transport_config));
209212
endpoint.set_default_client_config(client_config);
@@ -267,7 +270,10 @@ impl std::str::FromStr for TrackerId {
267270
///
268271
/// Note that this is less efficient than using an existing endpoint when doing multiple requests.
269272
/// It is provided as a convenience function for short lived utilities.
270-
pub async fn connect(tracker: &TrackerId, local_port: u16) -> anyhow::Result<quinn::Connection> {
273+
pub async fn connect(
274+
tracker: &TrackerId,
275+
local_port: u16,
276+
) -> anyhow::Result<iroh_net::magic_endpoint::Connection> {
271277
match tracker {
272278
TrackerId::Quinn(tracker) => connect_socket(*tracker, local_port).await,
273279
TrackerId::Iroh(tracker) => connect_magic(tracker, local_port).await,
@@ -276,7 +282,10 @@ pub async fn connect(tracker: &TrackerId, local_port: u16) -> anyhow::Result<qui
276282
}
277283

278284
/// Create a magic endpoint and connect to a tracker using the [crate::protocol::ALPN] protocol.
279-
async fn connect_magic(tracker: &NodeId, local_port: u16) -> anyhow::Result<quinn::Connection> {
285+
async fn connect_magic(
286+
tracker: &NodeId,
287+
local_port: u16,
288+
) -> anyhow::Result<iroh_net::magic_endpoint::Connection> {
280289
// todo: uncomment once the connection problems are fixed
281290
// for now, a random node id is more reliable.
282291
// let key = load_secret_key(tracker_path(CLIENT_KEY)?).await?;
@@ -288,7 +297,10 @@ async fn connect_magic(tracker: &NodeId, local_port: u16) -> anyhow::Result<quin
288297
}
289298

290299
/// Create a quinn endpoint and connect to a tracker using the [crate::protocol::ALPN] protocol.
291-
async fn connect_socket(tracker: SocketAddr, local_port: u16) -> anyhow::Result<quinn::Connection> {
300+
async fn connect_socket(
301+
tracker: SocketAddr,
302+
local_port: u16,
303+
) -> anyhow::Result<iroh_net::magic_endpoint::Connection> {
292304
let bind_addr = SocketAddr::V4(SocketAddrV4::new(Ipv4Addr::UNSPECIFIED, local_port));
293305
let endpoint = create_quinn_client(bind_addr, vec![ALPN.to_vec()], false)?;
294306
tracing::info!("trying to connect to tracker at {:?}", tracker);

content-discovery/iroh-mainline-content-discovery/src/protocol.rs

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

7-
use iroh_bytes::HashAndFormat;
7+
use iroh_blobs::HashAndFormat;
88
use iroh_net::NodeId;
99
use serde::{Deserialize, Serialize};
1010
use serde_big_array::BigArray;

content-discovery/iroh-mainline-tracker/Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ license = "MIT OR Apache-2.0"
99

1010
[dependencies]
1111
anyhow = { version = "1", features = ["backtrace"] }
12-
# needs to keep updated with the dep of iroh-bytes
12+
# needs to keep updated with the dep of iroh-blobs
1313
bao-tree = { version = "0.13", features = ["tokio_fsm"], default-features = false }
1414
bytes = "1"
1515
derive_more = { version = "1.0.0-beta.1", features = ["debug", "display", "from", "try_into"] }
@@ -19,12 +19,12 @@ futures = "0.3.25"
1919
hex = "0.4.3"
2020
humantime = "2.1.0"
2121
iroh-net = { workspace = true }
22-
iroh-bytes = { workspace = true }
22+
iroh-blobs = { workspace = true }
2323
iroh-pkarr-node-discovery = { path = "../../iroh-pkarr-node-discovery", default-features = false }
2424
mainline = { version = "1.0.0", features = ["async"] }
2525
pkarr = { version = "1.0.1", features = ["async"] }
2626
postcard = { version = "1", default-features = false, features = ["alloc", "use-std"] }
27-
quinn = "0.10"
27+
iroh-quinn = "0.10.2"
2828
rand = "0.8"
2929
rcgen = "0.12.0"
3030
redb = "1.5.0"

content-discovery/iroh-mainline-tracker/src/io.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use std::{
88
};
99

1010
use anyhow::Context;
11-
use iroh_bytes::{get::Stats, HashAndFormat};
11+
use iroh_blobs::{get::Stats, HashAndFormat};
1212
use iroh_mainline_content_discovery::protocol::{AnnounceKind, SignedAnnounce};
1313
use iroh_net::NodeId;
1414
use serde::{de::DeserializeOwned, Deserialize, Serialize};
@@ -91,7 +91,7 @@ pub fn log_connection_attempt(
9191
path: &Option<PathBuf>,
9292
host: &NodeId,
9393
t0: Instant,
94-
outcome: &anyhow::Result<quinn::Connection>,
94+
outcome: &anyhow::Result<iroh_quinn::Connection>,
9595
) -> anyhow::Result<()> {
9696
if let Some(path) = path {
9797
let now = SystemTime::now()

content-discovery/iroh-mainline-tracker/src/iroh_bytes_util.rs renamed to content-discovery/iroh-mainline-tracker/src/iroh_blobs_util.rs

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
//! Utilities for advanced use of iroh::bytes.
1+
//! Utilities for advanced use of iroh::blobs.
22
use std::sync::Arc;
33

44
use bao_tree::{ChunkNum, ChunkRanges};
55
use bytes::Bytes;
6-
use iroh_bytes::{
6+
use iroh_blobs::{
77
get::{
88
fsm::{BlobContentNext, EndBlobNext},
99
Stats,
@@ -19,16 +19,16 @@ use rand::Rng;
1919
/// This is just reading the size header and then immediately closing the connection.
2020
/// It can be used to check if a peer has any data at all.
2121
pub async fn unverified_size(
22-
connection: &quinn::Connection,
22+
connection: &iroh_quinn::Connection,
2323
hash: &Hash,
2424
) -> anyhow::Result<(u64, Stats)> {
25-
let request = iroh_bytes::protocol::GetRequest::new(
25+
let request = iroh_blobs::protocol::GetRequest::new(
2626
*hash,
2727
RangeSpecSeq::from_ranges(vec![ChunkRanges::from(ChunkNum(u64::MAX)..)]),
2828
);
29-
let request = iroh_bytes::get::fsm::start(connection.clone(), request);
29+
let request = iroh_blobs::get::fsm::start(connection.clone(), request);
3030
let connected = request.next().await?;
31-
let iroh_bytes::get::fsm::ConnectedNext::StartRoot(start) = connected.next().await? else {
31+
let iroh_blobs::get::fsm::ConnectedNext::StartRoot(start) = connected.next().await? else {
3232
unreachable!("expected start root");
3333
};
3434
let at_blob_header = start.next();
@@ -42,17 +42,17 @@ pub async fn unverified_size(
4242
/// This asks for the last chunk of the blob and validates the response.
4343
/// Note that this does not validate that the peer has all the data.
4444
pub async fn verified_size(
45-
connection: &quinn::Connection,
45+
connection: &iroh_quinn::Connection,
4646
hash: &Hash,
4747
) -> anyhow::Result<(u64, Stats)> {
4848
tracing::debug!("Getting verified size of {}", hash.to_hex());
49-
let request = iroh_bytes::protocol::GetRequest::new(
49+
let request = iroh_blobs::protocol::GetRequest::new(
5050
*hash,
5151
RangeSpecSeq::from_ranges(vec![ChunkRanges::from(ChunkNum(u64::MAX)..)]),
5252
);
53-
let request = iroh_bytes::get::fsm::start(connection.clone(), request);
53+
let request = iroh_blobs::get::fsm::start(connection.clone(), request);
5454
let connected = request.next().await?;
55-
let iroh_bytes::get::fsm::ConnectedNext::StartRoot(start) = connected.next().await? else {
55+
let iroh_blobs::get::fsm::ConnectedNext::StartRoot(start) = connected.next().await? else {
5656
unreachable!("expected start root");
5757
};
5858
let header = start.next();
@@ -81,22 +81,22 @@ pub async fn verified_size(
8181
}
8282

8383
pub async fn get_hash_seq_and_sizes(
84-
connection: &quinn::Connection,
84+
connection: &iroh_quinn::Connection,
8585
hash: &Hash,
8686
max_size: u64,
8787
) -> anyhow::Result<(HashSeq, Arc<[u64]>)> {
8888
let content = HashAndFormat::hash_seq(*hash);
8989
tracing::debug!("Getting hash seq and children sizes of {}", content);
90-
let request = iroh_bytes::protocol::GetRequest::new(
90+
let request = iroh_blobs::protocol::GetRequest::new(
9191
*hash,
9292
RangeSpecSeq::from_ranges_infinite([
9393
ChunkRanges::all(),
9494
ChunkRanges::from(ChunkNum(u64::MAX)..),
9595
]),
9696
);
97-
let at_start = iroh_bytes::get::fsm::start(connection.clone(), request);
97+
let at_start = iroh_blobs::get::fsm::start(connection.clone(), request);
9898
let at_connected = at_start.next().await?;
99-
let iroh_bytes::get::fsm::ConnectedNext::StartRoot(start) = at_connected.next().await? else {
99+
let iroh_blobs::get::fsm::ConnectedNext::StartRoot(start) = at_connected.next().await? else {
100100
unreachable!("query includes root");
101101
};
102102
let at_start_root = start.next();
@@ -135,16 +135,16 @@ pub async fn get_hash_seq_and_sizes(
135135

136136
/// Probe for a single chunk of a blob.
137137
pub async fn chunk_probe(
138-
connection: &quinn::Connection,
138+
connection: &iroh_quinn::Connection,
139139
hash: &Hash,
140140
chunk: ChunkNum,
141141
) -> anyhow::Result<Stats> {
142142
let ranges = ChunkRanges::from(chunk..chunk + 1);
143143
let ranges = RangeSpecSeq::from_ranges([ranges]);
144144
let request = GetRequest::new(*hash, ranges);
145-
let request = iroh_bytes::get::fsm::start(connection.clone(), request);
145+
let request = iroh_blobs::get::fsm::start(connection.clone(), request);
146146
let connected = request.next().await?;
147-
let iroh_bytes::get::fsm::ConnectedNext::StartRoot(start) = connected.next().await? else {
147+
let iroh_blobs::get::fsm::ConnectedNext::StartRoot(start) = connected.next().await? else {
148148
unreachable!("query includes root");
149149
};
150150
let header = start.next();

0 commit comments

Comments
 (0)