From 5845f6411a46d1581d229fd6868ffab62bc7157e Mon Sep 17 00:00:00 2001 From: Ruediger Klaehn Date: Mon, 4 Nov 2024 17:50:16 +0200 Subject: [PATCH 01/10] try out the new simplified service mapping --- Cargo.lock | 52 +++++++++++++++++++++++++++++++++-- Cargo.toml | 2 +- src/rpc.rs | 21 ++++++-------- src/rpc/client/blobs.rs | 38 ++++++++++--------------- src/rpc/client/blobs/batch.rs | 29 ++++++++----------- src/rpc/client/tags.rs | 14 ++++------ 6 files changed, 92 insertions(+), 64 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 88bb1bc45..f42e19b14 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -245,6 +245,15 @@ version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "597bb81c80a54b6a4381b23faba8d7774b144c94cbd1d6fe3f1329bd776554ab" +[[package]] +name = "bincode" +version = "1.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1f45e9417d87227c7a56d22e471c6206462cba514c7590c09aff4cf6d1ddcad" +dependencies = [ + "serde", +] + [[package]] name = "bit-set" version = "0.5.3" @@ -1720,7 +1729,7 @@ dependencies = [ "portable-atomic", "postcard", "proptest", - "quic-rpc", + "quic-rpc 0.13.0 (git+https://github.com/n0-computer/quic-rpc.git?branch=map-transports-not-services)", "quic-rpc-derive", "rand", "range-collections", @@ -2950,6 +2959,30 @@ dependencies = [ "tracing", ] +[[package]] +name = "quic-rpc" +version = "0.13.0" +source = "git+https://github.com/n0-computer/quic-rpc.git?branch=map-transports-not-services#c30ba6a08c3ec0e1a05ff6f15a1681cd75ddcf0f" +dependencies = [ + "anyhow", + "bincode", + "derive_more", + "educe", + "flume", + "futures-lite 2.3.0", + "futures-sink", + "futures-util", + "hex", + "iroh-quinn", + "pin-project", + "serde", + "slab", + "tokio", + "tokio-serde", + "tokio-util", + "tracing", +] + [[package]] name = "quic-rpc-derive" version = "0.13.0" @@ -2957,7 +2990,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "94b91a3f7a42657cbfbd0c2499c1f037738eff45bb7f59c6ce3d3d9e890d141c" dependencies = [ "proc-macro2", - "quic-rpc", + "quic-rpc 0.13.0 (registry+https://github.com/rust-lang/crates.io-index)", "quote", "syn 1.0.109", ] @@ -4184,6 +4217,21 @@ dependencies = [ "tokio", ] +[[package]] +name = "tokio-serde" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "911a61637386b789af998ee23f50aa30d5fd7edcec8d6d3dedae5e5815205466" +dependencies = [ + "bincode", + "bytes", + "educe", + "futures-core", + "futures-sink", + "pin-project", + "serde", +] + [[package]] name = "tokio-stream" version = "0.1.15" diff --git a/Cargo.toml b/Cargo.toml index ea65a2da0..3f3871681 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -37,7 +37,7 @@ parking_lot = { version = "0.12.1", optional = true } pin-project = "1.1.5" portable-atomic = { version = "1", optional = true } postcard = { version = "1", default-features = false, features = ["alloc", "use-std", "experimental-derive"] } -quic-rpc = { version = "0.13.0", optional = true } +quic-rpc = { git = "https://github.com/n0-computer/quic-rpc.git", branch = "map-transports-not-services", optional = true } quic-rpc-derive = { version = "0.13.0", optional = true } quinn = { package = "iroh-quinn", version = "0.11", features = ["ring"] } rand = "0.8" diff --git a/src/rpc.rs b/src/rpc.rs index b764f948d..382e9a934 100644 --- a/src/rpc.rs +++ b/src/rpc.rs @@ -57,14 +57,13 @@ const RPC_BLOB_GET_CHANNEL_CAP: usize = 2; impl Blobs { /// Handle an RPC request - pub async fn handle_rpc_request( + pub async fn handle_rpc_request( self: Arc, msg: crate::rpc::proto::Request, - chan: RpcChannel, + chan: RpcChannel, ) -> std::result::Result<(), RpcServerError> where - S: quic_rpc::Service, - C: quic_rpc::ServiceEndpoint, + C: quic_rpc::ServiceEndpoint, { use crate::rpc::proto::Request::*; match msg { @@ -74,14 +73,13 @@ impl Blobs { } /// Handle a tags request - pub async fn handle_tags_request( + pub async fn handle_tags_request( self: Arc, msg: proto::tags::Request, - chan: RpcChannel, + chan: RpcChannel, ) -> std::result::Result<(), RpcServerError> where - S: quic_rpc::Service, - C: quic_rpc::ServiceEndpoint, + C: quic_rpc::ServiceEndpoint, { use proto::tags::Request::*; match msg { @@ -93,14 +91,13 @@ impl Blobs { } /// Handle a blobs request - pub async fn handle_blobs_request( + pub async fn handle_blobs_request( self: Arc, msg: proto::blobs::Request, - chan: RpcChannel, + chan: RpcChannel, ) -> std::result::Result<(), RpcServerError> where - Sv: quic_rpc::Service, - C: quic_rpc::ServiceEndpoint, + C: quic_rpc::ServiceEndpoint, { use proto::blobs::Request::*; match msg { diff --git a/src/rpc/client/blobs.rs b/src/rpc/client/blobs.rs index 21cd82d2e..9ec9d73a1 100644 --- a/src/rpc/client/blobs.rs +++ b/src/rpc/client/blobs.rs @@ -105,20 +105,16 @@ use crate::rpc::proto::blobs::{ /// Iroh blobs client. #[derive(Debug, Clone)] -pub struct Client< - C = BoxedServiceConnection, - S = crate::rpc::proto::RpcService, -> { - pub(super) rpc: RpcClient, +pub struct Client> { + pub(super) rpc: RpcClient, } -impl Client +impl Client where - S: quic_rpc::Service, - C: quic_rpc::ServiceConnection, + C: quic_rpc::ServiceConnection, { /// Create a new client - pub fn new(rpc: RpcClient) -> Self { + pub fn new(rpc: RpcClient) -> Self { Self { rpc } } @@ -147,7 +143,7 @@ where /// A batch is a context in which temp tags are created and data is added to the node. Temp tags /// are automatically deleted when the batch is dropped, leading to the data being garbage collected /// unless a permanent tag is created for it. - pub async fn batch(&self) -> Result> { + pub async fn batch(&self) -> Result> { let (updates, mut stream) = self.rpc.bidi(BatchCreateRequest).await?; let BatchCreateResponse::Id(batch) = stream.next().await.context("expected scope id")??; let rpc = self.rpc.clone(); @@ -457,15 +453,14 @@ where Ok(()) } - fn tags_client(&self) -> tags::Client { + fn tags_client(&self) -> tags::Client { tags::Client::new(self.rpc.clone()) } } -impl SimpleStore for Client +impl SimpleStore for Client where - S: quic_rpc::Service, - C: quic_rpc::ServiceConnection, + C: quic_rpc::ServiceConnection, { async fn load(&self, hash: Hash) -> anyhow::Result { self.read_to_bytes(hash).await @@ -882,26 +877,24 @@ impl Reader { } /// todo make private again - pub async fn from_rpc_read( - rpc: &RpcClient, + pub async fn from_rpc_read( + rpc: &RpcClient, hash: Hash, ) -> anyhow::Result where - C: quic_rpc::ServiceConnection, - S: quic_rpc::Service, + C: quic_rpc::ServiceConnection, { Self::from_rpc_read_at(rpc, hash, 0, ReadAtLen::All).await } - async fn from_rpc_read_at( - rpc: &RpcClient, + async fn from_rpc_read_at( + rpc: &RpcClient, hash: Hash, offset: u64, len: ReadAtLen, ) -> anyhow::Result where - C: quic_rpc::ServiceConnection, - S: quic_rpc::Service, + C: quic_rpc::ServiceConnection, { let stream = rpc .server_streaming(ReadAtRequest { hash, offset, len }) @@ -1011,7 +1004,6 @@ mod tests { type RpcClient = quic_rpc::RpcClient< crate::rpc::proto::RpcService, BoxedServiceConnection, - crate::rpc::proto::RpcService, >; /// An iroh node that just has the blobs transport diff --git a/src/rpc/client/blobs/batch.rs b/src/rpc/client/blobs/batch.rs index 6b08e9268..80e6c84ab 100644 --- a/src/rpc/client/blobs/batch.rs +++ b/src/rpc/client/blobs/batch.rs @@ -33,19 +33,17 @@ use crate::{ /// A scope in which blobs can be added. #[derive(derive_more::Debug)] -struct BatchInner +struct BatchInner where - C: quic_rpc::ServiceConnection, - S: quic_rpc::Service, + C: quic_rpc::ServiceConnection, { /// The id of the scope. batch: BatchId, /// The rpc client. - rpc: RpcClient, + rpc: RpcClient, /// The stream to send drop #[debug(skip)] - updates: - Mutex, BatchUpdate>>, + updates: Mutex, BatchUpdate>>, } /// A batch for write operations. @@ -55,15 +53,13 @@ where /// It is not a transaction, so things in a batch are not atomic. Also, there is /// no isolation between batches. #[derive(derive_more::Debug)] -pub struct Batch(Arc>) +pub struct Batch(Arc>) where - C: quic_rpc::ServiceConnection, - S: quic_rpc::Service; + C: quic_rpc::ServiceConnection; -impl TagDrop for BatchInner +impl TagDrop for BatchInner where - C: quic_rpc::ServiceConnection, - S: quic_rpc::Service, + C: quic_rpc::ServiceConnection, { fn on_drop(&self, content: &HashAndFormat) { let mut updates = self.updates.lock().unwrap(); @@ -131,15 +127,14 @@ impl Default for AddReaderOpts { } } -impl Batch +impl Batch where - C: quic_rpc::ServiceConnection, - S: quic_rpc::Service, + C: quic_rpc::ServiceConnection, { pub(super) fn new( batch: BatchId, - rpc: RpcClient, - updates: UpdateSink, + rpc: RpcClient, + updates: UpdateSink, buffer_size: usize, ) -> Self { let updates = updates.buffer(buffer_size); diff --git a/src/rpc/client/tags.rs b/src/rpc/client/tags.rs index 51825fd1c..ad39dae6a 100644 --- a/src/rpc/client/tags.rs +++ b/src/rpc/client/tags.rs @@ -23,20 +23,16 @@ use crate::{ /// Iroh tags client. #[derive(Debug, Clone)] #[repr(transparent)] -pub struct Client< - C = BoxedServiceConnection, - S = crate::rpc::proto::RpcService, -> { - pub(super) rpc: RpcClient, +pub struct Client> { + pub(super) rpc: RpcClient, } -impl Client +impl Client where - C: quic_rpc::ServiceConnection, - S: quic_rpc::Service, + C: quic_rpc::ServiceConnection, { /// Creates a new client - pub fn new(rpc: RpcClient) -> Self { + pub fn new(rpc: RpcClient) -> Self { Self { rpc } } From 932444cfac102ad9ea8cf7aae92c3e5a83dd409e Mon Sep 17 00:00:00 2001 From: Ruediger Klaehn Date: Mon, 4 Nov 2024 18:02:24 +0200 Subject: [PATCH 02/10] Simply bounds --- src/rpc.rs | 6 +++--- src/rpc/client/blobs.rs | 30 +++++++++++++++--------------- src/rpc/client/blobs/batch.rs | 15 ++++++++------- src/rpc/client/tags.rs | 15 +++++++++------ 4 files changed, 35 insertions(+), 31 deletions(-) diff --git a/src/rpc.rs b/src/rpc.rs index 382e9a934..bded6fdf0 100644 --- a/src/rpc.rs +++ b/src/rpc.rs @@ -30,7 +30,7 @@ use proto::{ CreateRequest as TagsCreateRequest, DeleteRequest as TagDeleteRequest, ListRequest as TagListRequest, SetRequest as TagsSetRequest, SyncMode, }, - RpcError, RpcResult, + RpcError, RpcResult, RpcService, }; use quic_rpc::server::{RpcChannel, RpcServerError}; @@ -60,10 +60,10 @@ impl Blobs { pub async fn handle_rpc_request( self: Arc, msg: crate::rpc::proto::Request, - chan: RpcChannel, + chan: RpcChannel, ) -> std::result::Result<(), RpcServerError> where - C: quic_rpc::ServiceEndpoint, + C: quic_rpc::ServiceEndpoint, { use crate::rpc::proto::Request::*; match msg { diff --git a/src/rpc/client/blobs.rs b/src/rpc/client/blobs.rs index 9ec9d73a1..e9f8314dd 100644 --- a/src/rpc/client/blobs.rs +++ b/src/rpc/client/blobs.rs @@ -74,7 +74,7 @@ use iroh_net::NodeAddr; use portable_atomic::{AtomicU64, Ordering}; use quic_rpc::{ client::{BoxStreamSync, BoxedServiceConnection}, - RpcClient, + RpcClient, ServiceConnection, }; use serde::{Deserialize, Serialize}; use tokio::io::{AsyncRead, AsyncReadExt, ReadBuf}; @@ -87,6 +87,7 @@ use crate::{ format::collection::{Collection, SimpleStore}, get::db::DownloadProgress as BytesDownloadProgress, net_protocol::BlobDownloadRequest, + rpc::proto::RpcService, store::{BaoBlobSize, ConsistencyCheckProgress, ExportFormat, ExportMode, ValidateProgress}, util::SetTagOption, BlobFormat, Hash, Tag, @@ -105,16 +106,16 @@ use crate::rpc::proto::blobs::{ /// Iroh blobs client. #[derive(Debug, Clone)] -pub struct Client> { - pub(super) rpc: RpcClient, +pub struct Client> { + pub(super) rpc: RpcClient, } impl Client where - C: quic_rpc::ServiceConnection, + C: ServiceConnection, { /// Create a new client - pub fn new(rpc: RpcClient) -> Self { + pub fn new(rpc: RpcClient) -> Self { Self { rpc } } @@ -460,7 +461,7 @@ where impl SimpleStore for Client where - C: quic_rpc::ServiceConnection, + C: ServiceConnection, { async fn load(&self, hash: Hash) -> anyhow::Result { self.read_to_bytes(hash).await @@ -878,23 +879,23 @@ impl Reader { /// todo make private again pub async fn from_rpc_read( - rpc: &RpcClient, + rpc: &RpcClient, hash: Hash, ) -> anyhow::Result where - C: quic_rpc::ServiceConnection, + C: ServiceConnection, { Self::from_rpc_read_at(rpc, hash, 0, ReadAtLen::All).await } async fn from_rpc_read_at( - rpc: &RpcClient, + rpc: &RpcClient, hash: Hash, offset: u64, len: ReadAtLen, ) -> anyhow::Result where - C: quic_rpc::ServiceConnection, + C: ServiceConnection, { let stream = rpc .server_streaming(ReadAtRequest { hash, offset, len }) @@ -1001,10 +1002,9 @@ mod tests { util::local_pool::LocalPool, }; - type RpcClient = quic_rpc::RpcClient< - crate::rpc::proto::RpcService, - BoxedServiceConnection, - >; + use super::RpcService; + + type RpcClient = quic_rpc::RpcClient; /// An iroh node that just has the blobs transport #[derive(Debug)] @@ -1122,7 +1122,7 @@ mod tests { // Setup RPC let (internal_rpc, controller) = - quic_rpc::transport::flume::service_connection::(32); + quic_rpc::transport::flume::service_connection::(32); let controller = quic_rpc::transport::boxed::Connection::new(controller); let internal_rpc = quic_rpc::transport::boxed::ServerEndpoint::new(internal_rpc); let internal_rpc = quic_rpc::RpcServer::new(internal_rpc); diff --git a/src/rpc/client/blobs/batch.rs b/src/rpc/client/blobs/batch.rs index 80e6c84ab..ba1631e33 100644 --- a/src/rpc/client/blobs/batch.rs +++ b/src/rpc/client/blobs/batch.rs @@ -9,7 +9,7 @@ use bytes::Bytes; use futures_buffered::BufferedStreamExt; use futures_lite::StreamExt; use futures_util::{sink::Buffer, FutureExt, SinkExt, Stream}; -use quic_rpc::{client::UpdateSink, RpcClient}; +use quic_rpc::{client::UpdateSink, RpcClient, ServiceConnection}; use tokio::io::AsyncRead; use tokio_util::io::ReaderStream; use tracing::{debug, warn}; @@ -25,6 +25,7 @@ use crate::{ BatchAddStreamUpdate, BatchCreateTempTagRequest, BatchUpdate, }, tags::{self, SyncMode}, + RpcService, }, store::ImportMode, util::{SetTagOption, TagDrop}, @@ -35,12 +36,12 @@ use crate::{ #[derive(derive_more::Debug)] struct BatchInner where - C: quic_rpc::ServiceConnection, + C: ServiceConnection, { /// The id of the scope. batch: BatchId, /// The rpc client. - rpc: RpcClient, + rpc: RpcClient, /// The stream to send drop #[debug(skip)] updates: Mutex, BatchUpdate>>, @@ -55,11 +56,11 @@ where #[derive(derive_more::Debug)] pub struct Batch(Arc>) where - C: quic_rpc::ServiceConnection; + C: ServiceConnection; impl TagDrop for BatchInner where - C: quic_rpc::ServiceConnection, + C: ServiceConnection, { fn on_drop(&self, content: &HashAndFormat) { let mut updates = self.updates.lock().unwrap(); @@ -129,11 +130,11 @@ impl Default for AddReaderOpts { impl Batch where - C: quic_rpc::ServiceConnection, + C: ServiceConnection, { pub(super) fn new( batch: BatchId, - rpc: RpcClient, + rpc: RpcClient, updates: UpdateSink, buffer_size: usize, ) -> Self { diff --git a/src/rpc/client/tags.rs b/src/rpc/client/tags.rs index ad39dae6a..d6b843522 100644 --- a/src/rpc/client/tags.rs +++ b/src/rpc/client/tags.rs @@ -12,27 +12,30 @@ //! [`Client::delete`] can be used to delete a tag. use anyhow::Result; use futures_lite::{Stream, StreamExt}; -use quic_rpc::{client::BoxedServiceConnection, RpcClient}; +use quic_rpc::{client::BoxedServiceConnection, RpcClient, ServiceConnection}; use serde::{Deserialize, Serialize}; use crate::{ - rpc::proto::tags::{DeleteRequest, ListRequest}, + rpc::proto::{ + tags::{DeleteRequest, ListRequest}, + RpcService, + }, BlobFormat, Hash, Tag, }; /// Iroh tags client. #[derive(Debug, Clone)] #[repr(transparent)] -pub struct Client> { - pub(super) rpc: RpcClient, +pub struct Client> { + pub(super) rpc: RpcClient, } impl Client where - C: quic_rpc::ServiceConnection, + C: ServiceConnection, { /// Creates a new client - pub fn new(rpc: RpcClient) -> Self { + pub fn new(rpc: RpcClient) -> Self { Self { rpc } } From a6043e49a03e9a1ab65df6e2fd9d45c0a4d25133 Mon Sep 17 00:00:00 2001 From: Ruediger Klaehn Date: Mon, 4 Nov 2024 18:07:06 +0200 Subject: [PATCH 03/10] unused import --- src/rpc/client/blobs.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/src/rpc/client/blobs.rs b/src/rpc/client/blobs.rs index e9f8314dd..a583e7ea9 100644 --- a/src/rpc/client/blobs.rs +++ b/src/rpc/client/blobs.rs @@ -993,7 +993,6 @@ mod tests { use std::{path::Path, sync::Arc}; use iroh_net::{NodeAddr, NodeId}; - use quic_rpc::client::BoxedServiceConnection; use tokio_util::task::AbortOnDropHandle; use crate::{ From de6ced0e125604822f989500245a668f1e309622 Mon Sep 17 00:00:00 2001 From: Ruediger Klaehn Date: Mon, 4 Nov 2024 18:16:27 +0200 Subject: [PATCH 04/10] wip --- src/rpc.rs | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/rpc.rs b/src/rpc.rs index bded6fdf0..c1d29265c 100644 --- a/src/rpc.rs +++ b/src/rpc.rs @@ -25,12 +25,10 @@ use proto::{ CreateCollectionRequest, CreateCollectionResponse, DeleteRequest, DownloadResponse, ExportRequest, ExportResponse, ListIncompleteRequest, ListRequest, ReadAtRequest, ReadAtResponse, ValidateRequest, - }, - tags::{ + }, tags::{ CreateRequest as TagsCreateRequest, DeleteRequest as TagDeleteRequest, ListRequest as TagListRequest, SetRequest as TagsSetRequest, SyncMode, - }, - RpcError, RpcResult, RpcService, + }, Request, RpcError, RpcResult, RpcService }; use quic_rpc::server::{RpcChannel, RpcServerError}; @@ -59,13 +57,13 @@ impl Blobs { /// Handle an RPC request pub async fn handle_rpc_request( self: Arc, - msg: crate::rpc::proto::Request, + msg: Request, chan: RpcChannel, ) -> std::result::Result<(), RpcServerError> where C: quic_rpc::ServiceEndpoint, { - use crate::rpc::proto::Request::*; + use Request::*; match msg { Blobs(msg) => self.handle_blobs_request(msg, chan).await, Tags(msg) => self.handle_tags_request(msg, chan).await, From ec5ca15eeaa32d256958caed3e1691443aa215ad Mon Sep 17 00:00:00 2001 From: Ruediger Klaehn Date: Mon, 4 Nov 2024 18:20:42 +0200 Subject: [PATCH 05/10] fmt --- src/rpc.rs | 6 ++++-- src/rpc/client/blobs.rs | 3 +-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/rpc.rs b/src/rpc.rs index c1d29265c..41eeaba83 100644 --- a/src/rpc.rs +++ b/src/rpc.rs @@ -25,10 +25,12 @@ use proto::{ CreateCollectionRequest, CreateCollectionResponse, DeleteRequest, DownloadResponse, ExportRequest, ExportResponse, ListIncompleteRequest, ListRequest, ReadAtRequest, ReadAtResponse, ValidateRequest, - }, tags::{ + }, + tags::{ CreateRequest as TagsCreateRequest, DeleteRequest as TagDeleteRequest, ListRequest as TagListRequest, SetRequest as TagsSetRequest, SyncMode, - }, Request, RpcError, RpcResult, RpcService + }, + Request, RpcError, RpcResult, RpcService, }; use quic_rpc::server::{RpcChannel, RpcServerError}; diff --git a/src/rpc/client/blobs.rs b/src/rpc/client/blobs.rs index a583e7ea9..76e44bad4 100644 --- a/src/rpc/client/blobs.rs +++ b/src/rpc/client/blobs.rs @@ -995,14 +995,13 @@ mod tests { use iroh_net::{NodeAddr, NodeId}; use tokio_util::task::AbortOnDropHandle; + use super::RpcService; use crate::{ provider::{CustomEventSender, EventSender}, rpc::client::{blobs, tags}, util::local_pool::LocalPool, }; - use super::RpcService; - type RpcClient = quic_rpc::RpcClient; /// An iroh node that just has the blobs transport From fc2ce39f1fe1d65fcbc8fb80311777214f9884ca Mon Sep 17 00:00:00 2001 From: Ruediger Klaehn Date: Tue, 5 Nov 2024 12:40:49 +0200 Subject: [PATCH 06/10] Relax constraints so we can use the various rpc fns with mapped channels. --- src/rpc.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/rpc.rs b/src/rpc.rs index 41eeaba83..dbeecdce2 100644 --- a/src/rpc.rs +++ b/src/rpc.rs @@ -63,7 +63,7 @@ impl Blobs { chan: RpcChannel, ) -> std::result::Result<(), RpcServerError> where - C: quic_rpc::ServiceEndpoint, + C: quic_rpc::ServiceChannel, { use Request::*; match msg { @@ -79,7 +79,7 @@ impl Blobs { chan: RpcChannel, ) -> std::result::Result<(), RpcServerError> where - C: quic_rpc::ServiceEndpoint, + C: quic_rpc::ServiceChannel, { use proto::tags::Request::*; match msg { @@ -97,7 +97,7 @@ impl Blobs { chan: RpcChannel, ) -> std::result::Result<(), RpcServerError> where - C: quic_rpc::ServiceEndpoint, + C: quic_rpc::ServiceChannel, { use proto::blobs::Request::*; match msg { From 62d09376e384b17c00d3b59aef08bd52209cd6c0 Mon Sep 17 00:00:00 2001 From: Ruediger Klaehn Date: Tue, 5 Nov 2024 15:28:39 +0200 Subject: [PATCH 07/10] apply naming bikeshedding --- Cargo.lock | 83 +++++++++++++++++++++++++++-------- Cargo.toml | 2 +- src/rpc.rs | 6 +-- src/rpc/client/blobs.rs | 19 ++++---- src/rpc/client/blobs/batch.rs | 10 ++--- src/rpc/client/tags.rs | 6 +-- 6 files changed, 86 insertions(+), 40 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index a4a2129f9..4714c3a3e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -350,9 +350,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.1.34" +version = "1.1.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67b9470d453346108f93a59222a9a1a5724db32d0a4727b7ab7ace4b4d822dc9" +checksum = "0f57c4b4da2a9d619dd035f27316d7a426305b75be93d09e92f2b9229c34feaf" dependencies = [ "shlex", ] @@ -1268,6 +1268,25 @@ dependencies = [ "subtle", ] +[[package]] +name = "h2" +version = "0.3.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81fe527a889e1532da5c525686d96d4c2e74cdd345badf8dfef9f6b39dd5f5e8" +dependencies = [ + "bytes", + "fnv", + "futures-core", + "futures-sink", + "futures-util", + "http 0.2.12", + "indexmap", + "slab", + "tokio", + "tokio-util", + "tracing", +] + [[package]] name = "h2" version = "0.4.6" @@ -1486,6 +1505,30 @@ version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" +[[package]] +name = "hyper" +version = "0.14.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c08302e8fa335b151b788c775ff56e7a03ae64ff85c548ee820fecb70356e85" +dependencies = [ + "bytes", + "futures-channel", + "futures-core", + "futures-util", + "h2 0.3.26", + "http 0.2.12", + "http-body 0.4.6", + "httparse", + "httpdate", + "itoa", + "pin-project-lite", + "socket2", + "tokio", + "tower-service", + "tracing", + "want", +] + [[package]] name = "hyper" version = "1.5.0" @@ -1495,7 +1538,7 @@ dependencies = [ "bytes", "futures-channel", "futures-util", - "h2", + "h2 0.4.6", "http 1.1.0", "http-body 1.0.1", "httparse", @@ -1515,7 +1558,7 @@ checksum = "08afdbb5c31130e3034af566421053ab03787c640246a446327f550d11bcb333" dependencies = [ "futures-util", "http 1.1.0", - "hyper", + "hyper 1.5.0", "hyper-util", "rustls", "rustls-pki-types", @@ -1536,7 +1579,7 @@ dependencies = [ "futures-util", "http 1.1.0", "http-body 1.0.1", - "hyper", + "hyper 1.5.0", "pin-project-lite", "socket2", "tokio", @@ -1728,7 +1771,7 @@ dependencies = [ "futures", "http 1.1.0", "http-body-util", - "hyper", + "hyper 1.5.0", "hyper-util", "log", "rand", @@ -1795,7 +1838,7 @@ checksum = "ddc24109865250148c2e0f3d25d4f0f479571723792d3802153c60922a4fb708" [[package]] name = "iroh-base" version = "0.28.0" -source = "git+https://github.com/n0-computer/iroh?branch=main#b17b1f20b4c5e584e1fa4219ce5e375b37e9dbf1" +source = "git+https://github.com/n0-computer/iroh?branch=main#0a7a534128bf1234a326fcfba134d878e796c377" dependencies = [ "aead", "anyhow", @@ -1864,7 +1907,7 @@ dependencies = [ "portable-atomic", "postcard", "proptest", - "quic-rpc 0.14.0 (git+https://github.com/n0-computer/quic-rpc.git?branch=map-transports-not-services)", + "quic-rpc 0.14.0 (git+https://github.com/n0-computer/quic-rpc.git?branch=naming-bikeshedding)", "quic-rpc-derive", "rand", "range-collections", @@ -1909,12 +1952,12 @@ dependencies = [ [[package]] name = "iroh-metrics" version = "0.28.0" -source = "git+https://github.com/n0-computer/iroh?branch=main#b17b1f20b4c5e584e1fa4219ce5e375b37e9dbf1" +source = "git+https://github.com/n0-computer/iroh?branch=main#0a7a534128bf1234a326fcfba134d878e796c377" dependencies = [ "anyhow", "erased_set", "http-body-util", - "hyper", + "hyper 1.5.0", "hyper-util", "once_cell", "prometheus-client", @@ -1929,7 +1972,7 @@ dependencies = [ [[package]] name = "iroh-net" version = "0.28.1" -source = "git+https://github.com/n0-computer/iroh?branch=main#b17b1f20b4c5e584e1fa4219ce5e375b37e9dbf1" +source = "git+https://github.com/n0-computer/iroh?branch=main#0a7a534128bf1234a326fcfba134d878e796c377" dependencies = [ "anyhow", "backoff", @@ -1951,7 +1994,7 @@ dependencies = [ "hostname", "http 1.1.0", "http-body-util", - "hyper", + "hyper 1.5.0", "hyper-util", "igd-next", "iroh-base", @@ -2056,7 +2099,7 @@ dependencies = [ [[package]] name = "iroh-router" version = "0.28.0" -source = "git+https://github.com/n0-computer/iroh?branch=main#b17b1f20b4c5e584e1fa4219ce5e375b37e9dbf1" +source = "git+https://github.com/n0-computer/iroh?branch=main#0a7a534128bf1234a326fcfba134d878e796c377" dependencies = [ "anyhow", "futures-buffered", @@ -2396,7 +2439,7 @@ dependencies = [ [[package]] name = "netwatch" version = "0.1.0" -source = "git+https://github.com/n0-computer/iroh?branch=main#b17b1f20b4c5e584e1fa4219ce5e375b37e9dbf1" +source = "git+https://github.com/n0-computer/iroh?branch=main#0a7a534128bf1234a326fcfba134d878e796c377" dependencies = [ "anyhow", "bytes", @@ -2915,7 +2958,7 @@ checksum = "cc9c68a3f6da06753e9335d63e27f6b9754dd1920d941135b7ea8224f141adb2" [[package]] name = "portmapper" version = "0.1.0" -source = "git+https://github.com/n0-computer/iroh?branch=main#b17b1f20b4c5e584e1fa4219ce5e375b37e9dbf1" +source = "git+https://github.com/n0-computer/iroh?branch=main#0a7a534128bf1234a326fcfba134d878e796c377" dependencies = [ "anyhow", "base64", @@ -3164,10 +3207,11 @@ dependencies = [ [[package]] name = "quic-rpc" version = "0.14.0" -source = "git+https://github.com/n0-computer/quic-rpc.git?branch=map-transports-not-services#03f97ab0bc5287f873970984d783320350ad3d8a" +source = "git+https://github.com/n0-computer/quic-rpc.git?branch=naming-bikeshedding#067ae4b04bad16036571225904cd6970decb040b" dependencies = [ "anyhow", "bincode", + "bytes", "derive_more", "educe", "flume", @@ -3175,6 +3219,7 @@ dependencies = [ "futures-sink", "futures-util", "hex", + "hyper 0.14.31", "iroh-quinn", "pin-project", "serde", @@ -3240,9 +3285,9 @@ dependencies = [ [[package]] name = "quinn-udp" -version = "0.5.6" +version = "0.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e346e016eacfff12233c243718197ca12f148c84e1e84268a896699b41c71780" +checksum = "7d5a626c6807713b15cac82a6acaccd6043c9a5408c24baae07611fec3f243da" dependencies = [ "cfg_aliases", "libc", @@ -3464,7 +3509,7 @@ dependencies = [ "http 1.1.0", "http-body 1.0.1", "http-body-util", - "hyper", + "hyper 1.5.0", "hyper-rustls", "hyper-util", "ipnet", diff --git a/Cargo.toml b/Cargo.toml index ca83f35ac..809920263 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -38,7 +38,7 @@ pin-project = "1.1.5" portable-atomic = { version = "1", optional = true } postcard = { version = "1", default-features = false, features = ["alloc", "use-std", "experimental-derive"] } quinn = { package = "iroh-quinn", version = "0.12", features = ["ring"] } -quic-rpc = { git = "https://github.com/n0-computer/quic-rpc.git", branch = "map-transports-not-services", optional = true } +quic-rpc = { git = "https://github.com/n0-computer/quic-rpc.git", branch = "naming-bikeshedding", optional = true } quic-rpc-derive = { version = "0.14", optional = true } rand = "0.8" range-collections = "0.4.0" diff --git a/src/rpc.rs b/src/rpc.rs index dbeecdce2..cc79f6a80 100644 --- a/src/rpc.rs +++ b/src/rpc.rs @@ -63,7 +63,7 @@ impl Blobs { chan: RpcChannel, ) -> std::result::Result<(), RpcServerError> where - C: quic_rpc::ServiceChannel, + C: quic_rpc::ListenerTypes, { use Request::*; match msg { @@ -79,7 +79,7 @@ impl Blobs { chan: RpcChannel, ) -> std::result::Result<(), RpcServerError> where - C: quic_rpc::ServiceChannel, + C: quic_rpc::ListenerTypes, { use proto::tags::Request::*; match msg { @@ -97,7 +97,7 @@ impl Blobs { chan: RpcChannel, ) -> std::result::Result<(), RpcServerError> where - C: quic_rpc::ServiceChannel, + C: quic_rpc::ListenerTypes, { use proto::blobs::Request::*; match msg { diff --git a/src/rpc/client/blobs.rs b/src/rpc/client/blobs.rs index 76e44bad4..fcfd44c6d 100644 --- a/src/rpc/client/blobs.rs +++ b/src/rpc/client/blobs.rs @@ -73,8 +73,8 @@ use genawaiter::sync::{Co, Gen}; use iroh_net::NodeAddr; use portable_atomic::{AtomicU64, Ordering}; use quic_rpc::{ - client::{BoxStreamSync, BoxedServiceConnection}, - RpcClient, ServiceConnection, + client::{BoxStreamSync, BoxedConnector}, + Connector, RpcClient, }; use serde::{Deserialize, Serialize}; use tokio::io::{AsyncRead, AsyncReadExt, ReadBuf}; @@ -106,13 +106,13 @@ use crate::rpc::proto::blobs::{ /// Iroh blobs client. #[derive(Debug, Clone)] -pub struct Client> { +pub struct Client> { pub(super) rpc: RpcClient, } impl Client where - C: ServiceConnection, + C: Connector, { /// Create a new client pub fn new(rpc: RpcClient) -> Self { @@ -461,7 +461,7 @@ where impl SimpleStore for Client where - C: ServiceConnection, + C: Connector, { async fn load(&self, hash: Hash) -> anyhow::Result { self.read_to_bytes(hash).await @@ -883,7 +883,7 @@ impl Reader { hash: Hash, ) -> anyhow::Result where - C: ServiceConnection, + C: Connector, { Self::from_rpc_read_at(rpc, hash, 0, ReadAtLen::All).await } @@ -895,7 +895,7 @@ impl Reader { len: ReadAtLen, ) -> anyhow::Result where - C: ServiceConnection, + C: Connector, { let stream = rpc .server_streaming(ReadAtRequest { hash, offset, len }) @@ -993,6 +993,7 @@ mod tests { use std::{path::Path, sync::Arc}; use iroh_net::{NodeAddr, NodeId}; + use quic_rpc::transport::{Connector, Listener}; use tokio_util::task::AbortOnDropHandle; use super::RpcService; @@ -1121,8 +1122,8 @@ mod tests { // Setup RPC let (internal_rpc, controller) = quic_rpc::transport::flume::service_connection::(32); - let controller = quic_rpc::transport::boxed::Connection::new(controller); - let internal_rpc = quic_rpc::transport::boxed::ServerEndpoint::new(internal_rpc); + let controller = controller.boxed(); + let internal_rpc = internal_rpc.boxed(); let internal_rpc = quic_rpc::RpcServer::new(internal_rpc); let rpc_server_task: tokio::task::JoinHandle<()> = tokio::task::spawn(async move { diff --git a/src/rpc/client/blobs/batch.rs b/src/rpc/client/blobs/batch.rs index ba1631e33..b82f17837 100644 --- a/src/rpc/client/blobs/batch.rs +++ b/src/rpc/client/blobs/batch.rs @@ -9,7 +9,7 @@ use bytes::Bytes; use futures_buffered::BufferedStreamExt; use futures_lite::StreamExt; use futures_util::{sink::Buffer, FutureExt, SinkExt, Stream}; -use quic_rpc::{client::UpdateSink, RpcClient, ServiceConnection}; +use quic_rpc::{client::UpdateSink, Connector, RpcClient}; use tokio::io::AsyncRead; use tokio_util::io::ReaderStream; use tracing::{debug, warn}; @@ -36,7 +36,7 @@ use crate::{ #[derive(derive_more::Debug)] struct BatchInner where - C: ServiceConnection, + C: Connector, { /// The id of the scope. batch: BatchId, @@ -56,11 +56,11 @@ where #[derive(derive_more::Debug)] pub struct Batch(Arc>) where - C: ServiceConnection; + C: Connector; impl TagDrop for BatchInner where - C: ServiceConnection, + C: Connector, { fn on_drop(&self, content: &HashAndFormat) { let mut updates = self.updates.lock().unwrap(); @@ -130,7 +130,7 @@ impl Default for AddReaderOpts { impl Batch where - C: ServiceConnection, + C: Connector, { pub(super) fn new( batch: BatchId, diff --git a/src/rpc/client/tags.rs b/src/rpc/client/tags.rs index d6b843522..2b7cbc04d 100644 --- a/src/rpc/client/tags.rs +++ b/src/rpc/client/tags.rs @@ -12,7 +12,7 @@ //! [`Client::delete`] can be used to delete a tag. use anyhow::Result; use futures_lite::{Stream, StreamExt}; -use quic_rpc::{client::BoxedServiceConnection, RpcClient, ServiceConnection}; +use quic_rpc::{client::BoxedConnector, Connector, RpcClient}; use serde::{Deserialize, Serialize}; use crate::{ @@ -26,13 +26,13 @@ use crate::{ /// Iroh tags client. #[derive(Debug, Clone)] #[repr(transparent)] -pub struct Client> { +pub struct Client> { pub(super) rpc: RpcClient, } impl Client where - C: ServiceConnection, + C: Connector, { /// Creates a new client pub fn new(rpc: RpcClient) -> Self { From d60fc215bb3602a0346afbffa8be2b0374b49110 Mon Sep 17 00:00:00 2001 From: Ruediger Klaehn Date: Tue, 5 Nov 2024 17:56:16 +0200 Subject: [PATCH 08/10] use merged naming-bikeshedding --- Cargo.lock | 121 +++++----------------------------------- Cargo.toml | 4 +- src/rpc.rs | 8 +-- src/rpc/client/blobs.rs | 3 +- 4 files changed, 20 insertions(+), 116 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 4714c3a3e..dbebb9aee 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -245,15 +245,6 @@ version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "597bb81c80a54b6a4381b23faba8d7774b144c94cbd1d6fe3f1329bd776554ab" -[[package]] -name = "bincode" -version = "1.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1f45e9417d87227c7a56d22e471c6206462cba514c7590c09aff4cf6d1ddcad" -dependencies = [ - "serde", -] - [[package]] name = "bit-set" version = "0.5.3" @@ -1268,25 +1259,6 @@ dependencies = [ "subtle", ] -[[package]] -name = "h2" -version = "0.3.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81fe527a889e1532da5c525686d96d4c2e74cdd345badf8dfef9f6b39dd5f5e8" -dependencies = [ - "bytes", - "fnv", - "futures-core", - "futures-sink", - "futures-util", - "http 0.2.12", - "indexmap", - "slab", - "tokio", - "tokio-util", - "tracing", -] - [[package]] name = "h2" version = "0.4.6" @@ -1505,30 +1477,6 @@ version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" -[[package]] -name = "hyper" -version = "0.14.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c08302e8fa335b151b788c775ff56e7a03ae64ff85c548ee820fecb70356e85" -dependencies = [ - "bytes", - "futures-channel", - "futures-core", - "futures-util", - "h2 0.3.26", - "http 0.2.12", - "http-body 0.4.6", - "httparse", - "httpdate", - "itoa", - "pin-project-lite", - "socket2", - "tokio", - "tower-service", - "tracing", - "want", -] - [[package]] name = "hyper" version = "1.5.0" @@ -1538,7 +1486,7 @@ dependencies = [ "bytes", "futures-channel", "futures-util", - "h2 0.4.6", + "h2", "http 1.1.0", "http-body 1.0.1", "httparse", @@ -1558,7 +1506,7 @@ checksum = "08afdbb5c31130e3034af566421053ab03787c640246a446327f550d11bcb333" dependencies = [ "futures-util", "http 1.1.0", - "hyper 1.5.0", + "hyper", "hyper-util", "rustls", "rustls-pki-types", @@ -1579,7 +1527,7 @@ dependencies = [ "futures-util", "http 1.1.0", "http-body 1.0.1", - "hyper 1.5.0", + "hyper", "pin-project-lite", "socket2", "tokio", @@ -1771,7 +1719,7 @@ dependencies = [ "futures", "http 1.1.0", "http-body-util", - "hyper 1.5.0", + "hyper", "hyper-util", "log", "rand", @@ -1907,7 +1855,7 @@ dependencies = [ "portable-atomic", "postcard", "proptest", - "quic-rpc 0.14.0 (git+https://github.com/n0-computer/quic-rpc.git?branch=naming-bikeshedding)", + "quic-rpc", "quic-rpc-derive", "rand", "range-collections", @@ -1957,7 +1905,7 @@ dependencies = [ "anyhow", "erased_set", "http-body-util", - "hyper 1.5.0", + "hyper", "hyper-util", "once_cell", "prometheus-client", @@ -1994,7 +1942,7 @@ dependencies = [ "hostname", "http 1.1.0", "http-body-util", - "hyper 1.5.0", + "hyper", "hyper-util", "igd-next", "iroh-base", @@ -3185,9 +3133,8 @@ dependencies = [ [[package]] name = "quic-rpc" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d8431b2e7c22929347b61a354d4936d71fe7ab1e6b0475dc50e98276970dfec" +version = "0.15.0" +source = "git+https://github.com/n0-computer/quic-rpc.git?branch=map-transports-not-services#16b7c4942365b96fc750627459261e52e1190f6c" dependencies = [ "anyhow", "derive_more", @@ -3204,40 +3151,13 @@ dependencies = [ "tracing", ] -[[package]] -name = "quic-rpc" -version = "0.14.0" -source = "git+https://github.com/n0-computer/quic-rpc.git?branch=naming-bikeshedding#067ae4b04bad16036571225904cd6970decb040b" -dependencies = [ - "anyhow", - "bincode", - "bytes", - "derive_more", - "educe", - "flume", - "futures-lite 2.4.0", - "futures-sink", - "futures-util", - "hex", - "hyper 0.14.31", - "iroh-quinn", - "pin-project", - "serde", - "slab", - "tokio", - "tokio-serde", - "tokio-util", - "tracing", -] - [[package]] name = "quic-rpc-derive" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "403bc8506c847468e00170dbbbfe2c54d13b090031bcbe474cd3faea021cbd9f" +version = "0.15.0" +source = "git+https://github.com/n0-computer/quic-rpc.git?branch=map-transports-not-services#16b7c4942365b96fc750627459261e52e1190f6c" dependencies = [ "proc-macro2", - "quic-rpc 0.14.0 (registry+https://github.com/rust-lang/crates.io-index)", + "quic-rpc", "quote", "syn 1.0.109", ] @@ -3509,7 +3429,7 @@ dependencies = [ "http 1.1.0", "http-body 1.0.1", "http-body-util", - "hyper 1.5.0", + "hyper", "hyper-rustls", "hyper-util", "ipnet", @@ -4472,21 +4392,6 @@ dependencies = [ "tokio", ] -[[package]] -name = "tokio-serde" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "911a61637386b789af998ee23f50aa30d5fd7edcec8d6d3dedae5e5815205466" -dependencies = [ - "bincode", - "bytes", - "educe", - "futures-core", - "futures-sink", - "pin-project", - "serde", -] - [[package]] name = "tokio-stream" version = "0.1.16" diff --git a/Cargo.toml b/Cargo.toml index 809920263..cefd5b756 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -38,8 +38,8 @@ pin-project = "1.1.5" portable-atomic = { version = "1", optional = true } postcard = { version = "1", default-features = false, features = ["alloc", "use-std", "experimental-derive"] } quinn = { package = "iroh-quinn", version = "0.12", features = ["ring"] } -quic-rpc = { git = "https://github.com/n0-computer/quic-rpc.git", branch = "naming-bikeshedding", optional = true } -quic-rpc-derive = { version = "0.14", optional = true } +quic-rpc = { git = "https://github.com/n0-computer/quic-rpc.git", branch = "map-transports-not-services", optional = true } +quic-rpc-derive = { git = "https://github.com/n0-computer/quic-rpc.git", branch = "map-transports-not-services", optional = true } rand = "0.8" range-collections = "0.4.0" redb = { version = "2.0.0", optional = true } diff --git a/src/rpc.rs b/src/rpc.rs index cc79f6a80..7264f8ac5 100644 --- a/src/rpc.rs +++ b/src/rpc.rs @@ -32,7 +32,7 @@ use proto::{ }, Request, RpcError, RpcResult, RpcService, }; -use quic_rpc::server::{RpcChannel, RpcServerError}; +use quic_rpc::server::{ChannelTypes, RpcChannel, RpcServerError}; use crate::{ export::ExportProgress, @@ -63,7 +63,7 @@ impl Blobs { chan: RpcChannel, ) -> std::result::Result<(), RpcServerError> where - C: quic_rpc::ListenerTypes, + C: ChannelTypes, { use Request::*; match msg { @@ -79,7 +79,7 @@ impl Blobs { chan: RpcChannel, ) -> std::result::Result<(), RpcServerError> where - C: quic_rpc::ListenerTypes, + C: ChannelTypes, { use proto::tags::Request::*; match msg { @@ -97,7 +97,7 @@ impl Blobs { chan: RpcChannel, ) -> std::result::Result<(), RpcServerError> where - C: quic_rpc::ListenerTypes, + C: ChannelTypes, { use proto::blobs::Request::*; match msg { diff --git a/src/rpc/client/blobs.rs b/src/rpc/client/blobs.rs index fcfd44c6d..1f7ce7646 100644 --- a/src/rpc/client/blobs.rs +++ b/src/rpc/client/blobs.rs @@ -1120,8 +1120,7 @@ mod tests { let router = router.spawn().await?; // Setup RPC - let (internal_rpc, controller) = - quic_rpc::transport::flume::service_connection::(32); + let (internal_rpc, controller) = quic_rpc::transport::flume::channel(32); let controller = controller.boxed(); let internal_rpc = internal_rpc.boxed(); let internal_rpc = quic_rpc::RpcServer::new(internal_rpc); From b1d0e6c02f7ab9608745970ad06b2e6f3368b149 Mon Sep 17 00:00:00 2001 From: Ruediger Klaehn Date: Wed, 6 Nov 2024 12:10:23 +0200 Subject: [PATCH 09/10] use published quic-rpc --- Cargo.lock | 6 ++++-- Cargo.toml | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index dbebb9aee..ca1acf205 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3134,7 +3134,8 @@ dependencies = [ [[package]] name = "quic-rpc" version = "0.15.0" -source = "git+https://github.com/n0-computer/quic-rpc.git?branch=map-transports-not-services#16b7c4942365b96fc750627459261e52e1190f6c" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61e131f594054d27d077162815db3b5e9ddd76a28fbb9091b68095971e75c286" dependencies = [ "anyhow", "derive_more", @@ -3154,7 +3155,8 @@ dependencies = [ [[package]] name = "quic-rpc-derive" version = "0.15.0" -source = "git+https://github.com/n0-computer/quic-rpc.git?branch=map-transports-not-services#16b7c4942365b96fc750627459261e52e1190f6c" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cbef4c942978f74ef296ae40d43d4375c9d730b65a582688a358108cfd5c0cf7" dependencies = [ "proc-macro2", "quic-rpc", diff --git a/Cargo.toml b/Cargo.toml index 3213afbf0..0d2753f49 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -37,8 +37,8 @@ parking_lot = { version = "0.12.1", optional = true } pin-project = "1.1.5" portable-atomic = { version = "1", optional = true } postcard = { version = "1", default-features = false, features = ["alloc", "use-std", "experimental-derive"] } -quic-rpc = { git = "https://github.com/n0-computer/quic-rpc.git", branch = "map-transports-not-services", optional = true } -quic-rpc-derive = { git = "https://github.com/n0-computer/quic-rpc.git", branch = "map-transports-not-services", optional = true } +quic-rpc = { version = "0.15.0", optional = true } +quic-rpc-derive = { version = "0.15.0", optional = true } quinn = { package = "iroh-quinn", version = "0.12", features = ["ring"] } rand = "0.8" range-collections = "0.4.0" From b7ea1da608e64f1172f00512ea10cd8f3bd99e04 Mon Sep 17 00:00:00 2001 From: Ruediger Klaehn Date: Wed, 6 Nov 2024 12:12:00 +0200 Subject: [PATCH 10/10] Add "Unicode-3.0" license --- deny.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/deny.toml b/deny.toml index 267ca7a65..f5669dbf3 100644 --- a/deny.toml +++ b/deny.toml @@ -21,6 +21,7 @@ allow = [ "Unicode-DFS-2016", "Zlib", "MPL-2.0", # https://fossa.com/blog/open-source-software-licenses-101-mozilla-public-license-2-0/ + "Unicode-3.0" ] [[licenses.clarify]]