From 5a4dcd23849d48937d9f710d05b10eefc93bd1b4 Mon Sep 17 00:00:00 2001 From: Ericson Soares Date: Thu, 14 Nov 2024 11:15:58 -0300 Subject: [PATCH 1/6] Introduce a .rustfmt.toml file with configs for automatic formatting --- .rustfmt.toml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 .rustfmt.toml diff --git a/.rustfmt.toml b/.rustfmt.toml new file mode 100644 index 0000000..a76859e --- /dev/null +++ b/.rustfmt.toml @@ -0,0 +1,15 @@ +edition = "2024" +unstable_features = true +imports_granularity = "Crate" +group_imports = "StdExternalCrate" +reorder_imports = true +format_code_in_doc_comments = true +force_explicit_abi = true +max_width = 100 +merge_derives = true +newline_style = "Unix" +remove_nested_parens = true +reorder_modules = true +use_field_init_shorthand = false +use_small_heuristics = "Default" +use_try_shorthand = false \ No newline at end of file From 05c2e773c57e59b3b48995818c59d034a036e1dd Mon Sep 17 00:00:00 2001 From: Ruediger Klaehn Date: Thu, 14 Nov 2024 16:28:13 +0200 Subject: [PATCH 2/6] Add a function to RpcServer that runs a complete accept loop --- src/server.rs | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 53 insertions(+), 1 deletion(-) diff --git a/src/server.rs b/src/server.rs index 76644b2..565157b 100644 --- a/src/server.rs +++ b/src/server.rs @@ -7,13 +7,15 @@ use std::{ marker::PhantomData, pin::Pin, result, + sync::Arc, task::{self, Poll}, }; use futures_lite::{Future, Stream, StreamExt}; use futures_util::{SinkExt, TryStreamExt}; use pin_project::pin_project; -use tokio::sync::oneshot; +use tokio::{sync::oneshot, task::JoinSet}; +use tracing::{error, warn}; use crate::{ transport::{ @@ -211,6 +213,56 @@ impl> RpcServer { pub fn into_inner(self) -> C { self.source } + + /// Run an accept loop for this server. + /// + /// Each request will be handled in a separate task. + /// + /// It is the caller's responsibility to poll the returned future to drive the server. + pub async fn accept_loop(self, handler: Fun) + where + S: Service, + C: Listener, + Fun: Fn(S::Req, RpcChannel) -> Fut + Send + Sync + 'static, + Fut: Future> + Send + 'static, + E: Into + 'static, + { + let handler = Arc::new(handler); + let mut tasks = JoinSet::new(); + loop { + tokio::select! { + Some(res) = tasks.join_next(), if !tasks.is_empty() => { + if let Err(e) = res { + if e.is_panic() { + error!("Panic handling RPC request: {e}"); + } + } + } + req = self.accept() => { + let req = match req { + Ok(req) => req, + Err(e) => { + warn!("Error accepting RPC request: {e}"); + continue; + } + }; + let handler = handler.clone(); + tasks.spawn(async move { + let (req, chan) = match req.read_first().await { + Ok((req, chan)) => (req, chan), + Err(e) => { + warn!("Error reading first message: {e}"); + return; + } + }; + if let Err(cause) = handler(req, chan).await { + warn!("Error handling RPC request: {}", cause.into()); + } + }); + } + } + } + } } impl> AsRef for RpcServer { From 6e17b6a97d94c0dd31a31e3470ca9f27b4c12f5d Mon Sep 17 00:00:00 2001 From: Ruediger Klaehn Date: Thu, 14 Nov 2024 17:50:20 +0200 Subject: [PATCH 3/6] Add another function that spawns an accept loop. It doesn't do much, but saves quite a bit of boilerplate at the call site, and also avoids having the task leaking by using AbortOnDropHandle. --- Cargo.toml | 9 +++++---- examples/modularize.rs | 21 ++++----------------- src/server.rs | 13 +++++++++++++ tests/flume.rs | 16 +++------------- tests/hyper.rs | 21 +++++---------------- tests/iroh-net.rs | 38 +++++++++++++++----------------------- tests/math.rs | 23 +++++++++-------------- tests/quinn.rs | 39 ++++++++++++++++++++------------------- 8 files changed, 74 insertions(+), 106 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 99da459..08e5691 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -27,7 +27,7 @@ quinn = { package = "iroh-quinn", version = "0.12", optional = true } serde = { version = "1.0.183", features = ["derive"] } tokio = { version = "1", default-features = false, features = ["macros", "sync"] } tokio-serde = { version = "0.8", features = ["bincode"], optional = true } -tokio-util = { version = "0.7", features = ["codec"], optional = true } +tokio-util = { version = "0.7", features = ["rt"] } tracing = "0.1" hex = "0.4.3" futures = { version = "0.3.30", optional = true } @@ -52,12 +52,13 @@ proc-macro2 = "1.0.66" futures-buffered = "0.2.4" testresult = "0.4.1" nested_enum_utils = "0.1.0" +tokio-util = { version = "0.7", features = ["rt"] } [features] -hyper-transport = ["dep:flume", "dep:hyper", "dep:bincode", "dep:bytes", "dep:tokio-serde", "dep:tokio-util"] -quinn-transport = ["dep:flume", "dep:quinn", "dep:bincode", "dep:tokio-serde", "dep:tokio-util"] +hyper-transport = ["dep:flume", "dep:hyper", "dep:bincode", "dep:bytes", "dep:tokio-serde", "tokio-util/codec"] +quinn-transport = ["dep:flume", "dep:quinn", "dep:bincode", "dep:tokio-serde", "tokio-util/codec"] flume-transport = ["dep:flume"] -iroh-net-transport = ["dep:iroh-net", "dep:flume", "dep:quinn", "dep:bincode", "dep:tokio-serde", "dep:tokio-util"] +iroh-net-transport = ["dep:iroh-net", "dep:flume", "dep:quinn", "dep:bincode", "dep:tokio-serde", "tokio-util/codec"] macros = [] default = ["flume-transport"] diff --git a/examples/modularize.rs b/examples/modularize.rs index 700fc93..4143b3e 100644 --- a/examples/modularize.rs +++ b/examples/modularize.rs @@ -12,7 +12,6 @@ use app::AppService; use futures_lite::StreamExt; use futures_util::SinkExt; use quic_rpc::{client::BoxedConnector, transport::flume, Listener, RpcClient, RpcServer}; -use tracing::warn; #[tokio::main] async fn main() -> Result<()> { @@ -32,23 +31,11 @@ async fn main() -> Result<()> { async fn run_server>(server_conn: C, handler: app::Handler) { let server = RpcServer::::new(server_conn); - loop { - let Ok(accepting) = server.accept().await else { - continue; - }; - match accepting.read_first().await { - Err(err) => warn!(?err, "server accept failed"), - Ok((req, chan)) => { - let handler = handler.clone(); - tokio::task::spawn(async move { - if let Err(err) = handler.handle_rpc_request(req, chan).await { - warn!(?err, "internal rpc error"); - } - }); - } - } - } + server + .accept_loop(move |req, chan| handler.clone().handle_rpc_request(req, chan)) + .await } + pub async fn client_demo(conn: BoxedConnector) -> Result<()> { let rpc_client = RpcClient::::new(conn); let client = app::Client::new(rpc_client.clone()); diff --git a/src/server.rs b/src/server.rs index 565157b..47d1f70 100644 --- a/src/server.rs +++ b/src/server.rs @@ -15,6 +15,7 @@ use futures_lite::{Future, Stream, StreamExt}; use futures_util::{SinkExt, TryStreamExt}; use pin_project::pin_project; use tokio::{sync::oneshot, task::JoinSet}; +use tokio_util::task::AbortOnDropHandle; use tracing::{error, warn}; use crate::{ @@ -263,6 +264,18 @@ impl> RpcServer { } } } + + /// Spawn an accept loop and return a handle to the task. + pub fn spawn_accept_loop(self, handler: Fun) -> AbortOnDropHandle<()> + where + S: Service, + C: Listener, + Fun: Fn(S::Req, RpcChannel) -> Fut + Send + Sync + 'static, + Fut: Future> + Send + 'static, + E: Into + 'static, + { + AbortOnDropHandle::new(tokio::spawn(self.accept_loop(handler))) + } } impl> AsRef for RpcServer { diff --git a/tests/flume.rs b/tests/flume.rs index d0b14c8..34fc900 100644 --- a/tests/flume.rs +++ b/tests/flume.rs @@ -7,6 +7,7 @@ use quic_rpc::{ transport::flume, RpcClient, RpcServer, Service, }; +use tokio_util::task::AbortOnDropHandle; #[tokio::test] async fn flume_channel_bench() -> anyhow::Result<()> { @@ -14,14 +15,9 @@ async fn flume_channel_bench() -> anyhow::Result<()> { let (server, client) = flume::channel(1); let server = RpcServer::::new(server); - let server_handle = tokio::task::spawn(ComputeService::server(server)); + let _server_handle = AbortOnDropHandle::new(tokio::spawn(ComputeService::server(server))); let client = RpcClient::::new(client); bench(client, 1000000).await?; - // dropping the client will cause the server to terminate - match server_handle.await? { - Err(RpcServerError::Accept(_)) => {} - e => panic!("unexpected termination result {e:?}"), - } Ok(()) } @@ -101,13 +97,7 @@ async fn flume_channel_smoke() -> anyhow::Result<()> { let (server, client) = flume::channel(1); let server = RpcServer::::new(server); - let server_handle = tokio::task::spawn(ComputeService::server(server)); + let _server_handle = AbortOnDropHandle::new(tokio::spawn(ComputeService::server(server))); smoke_test(client).await?; - - // dropping the client will cause the server to terminate - match server_handle.await? { - Err(RpcServerError::Accept(_)) => {} - e => panic!("unexpected termination result {e:?}"), - } Ok(()) } diff --git a/tests/hyper.rs b/tests/hyper.rs index 0e5766d..ab8fbc2 100644 --- a/tests/hyper.rs +++ b/tests/hyper.rs @@ -15,19 +15,13 @@ use tokio::task::JoinHandle; mod math; use math::*; +use tokio_util::task::AbortOnDropHandle; mod util; -fn run_server(addr: &SocketAddr) -> JoinHandle> { +fn run_server(addr: &SocketAddr) -> AbortOnDropHandle<()> { let channel = HyperListener::serve(addr).unwrap(); let server = RpcServer::new(channel); - tokio::spawn(async move { - loop { - let server = server.clone(); - ComputeService::server(server).await?; - } - #[allow(unreachable_code)] - anyhow::Ok(()) - }) + ComputeService::server(server) } #[derive(Debug, Serialize, Deserialize, From, TryInto)] @@ -133,13 +127,11 @@ impl TestService { async fn hyper_channel_bench() -> anyhow::Result<()> { let addr: SocketAddr = "127.0.0.1:3000".parse()?; let uri: Uri = "http://127.0.0.1:3000".parse()?; - let server_handle = run_server(&addr); + let _server_handle = run_server(&addr); let client = HyperConnector::new(uri); let client = RpcClient::new(client); bench(client, 50000).await?; println!("terminating server"); - server_handle.abort(); - let _ = server_handle.await; Ok(()) } @@ -147,11 +139,9 @@ async fn hyper_channel_bench() -> anyhow::Result<()> { async fn hyper_channel_smoke() -> anyhow::Result<()> { let addr: SocketAddr = "127.0.0.1:3001".parse()?; let uri: Uri = "http://127.0.0.1:3001".parse()?; - let server_handle = run_server(&addr); + let _server_handle = run_server(&addr); let client = HyperConnector::new(uri); smoke_test(client).await?; - server_handle.abort(); - let _ = server_handle.await; Ok(()) } @@ -302,6 +292,5 @@ async fn hyper_channel_errors() -> anyhow::Result<()> { println!("terminating server"); server_handle.abort(); - let _ = server_handle.await; Ok(()) } diff --git a/tests/iroh-net.rs b/tests/iroh-net.rs index c416c59..4d31ad6 100644 --- a/tests/iroh-net.rs +++ b/tests/iroh-net.rs @@ -2,10 +2,13 @@ use iroh_net::{key::SecretKey, NodeAddr}; use quic_rpc::{transport, RpcClient, RpcServer}; -use tokio::task::JoinHandle; +use testresult::TestResult; + +use crate::transport::iroh_net::{IrohNetConnector, IrohNetListener}; mod math; use math::*; +use tokio_util::task::AbortOnDropHandle; mod util; const ALPN: &[u8] = b"quic-rpc/iroh-net/test"; @@ -44,13 +47,10 @@ impl Endpoints { } } -fn run_server(server: iroh_net::Endpoint) -> JoinHandle> { - tokio::task::spawn(async move { - let connection = transport::iroh_net::IrohNetListener::new(server)?; - let server = RpcServer::new(connection); - ComputeService::server(server).await?; - anyhow::Ok(()) - }) +fn run_server(server: iroh_net::Endpoint) -> AbortOnDropHandle<()> { + let connection = IrohNetListener::new(server).unwrap(); + let server = RpcServer::new(connection); + ComputeService::server(server) } // #[tokio::test(flavor = "multi_thread", worker_threads = 2)] @@ -64,17 +64,12 @@ async fn iroh_net_channel_bench() -> anyhow::Result<()> { server_node_addr, } = Endpoints::new().await?; tracing::debug!("Starting server"); - let server_handle = run_server(server); + let _server_handle = run_server(server); tracing::debug!("Starting client"); - let client = RpcClient::new(transport::iroh_net::IrohNetConnector::new( - client, - server_node_addr, - ALPN.into(), - )); + let client = RpcClient::new(IrohNetConnector::new(client, server_node_addr, ALPN.into())); tracing::debug!("Starting benchmark"); bench(client, 50000).await?; - server_handle.abort(); Ok(()) } @@ -86,11 +81,9 @@ async fn iroh_net_channel_smoke() -> anyhow::Result<()> { server, server_node_addr, } = Endpoints::new().await?; - let server_handle = run_server(server); - let client_connection = - transport::iroh_net::IrohNetConnector::new(client, server_node_addr, ALPN.into()); + let _server_handle = run_server(server); + let client_connection = IrohNetConnector::new(client, server_node_addr, ALPN.into()); smoke_test(client_connection).await?; - server_handle.abort(); Ok(()) } @@ -99,7 +92,7 @@ async fn iroh_net_channel_smoke() -> anyhow::Result<()> { /// /// This is a regression test. #[tokio::test] -async fn server_away_and_back() -> anyhow::Result<()> { +async fn server_away_and_back() -> TestResult<()> { tracing_subscriber::fmt::try_init().ok(); tracing::info!("Creating endpoints"); @@ -128,7 +121,7 @@ async fn server_away_and_back() -> anyhow::Result<()> { // create the RPC Server let connection = transport::iroh_net::IrohNetListener::new(server_endpoint.clone())?; let server = RpcServer::new(connection); - let server_handle = tokio::task::spawn(ComputeService::server_bounded(server, 1)); + let server_handle = tokio::spawn(ComputeService::server_bounded(server, 1)); // wait a bit for connection due to Windows test failing on CI tokio::time::sleep(tokio::time::Duration::from_millis(300)).await; @@ -151,7 +144,7 @@ async fn server_away_and_back() -> anyhow::Result<()> { // make the server run again let connection = transport::iroh_net::IrohNetListener::new(server_endpoint.clone())?; let server = RpcServer::new(connection); - let server_handle = tokio::task::spawn(ComputeService::server_bounded(server, 5)); + let server_handle = tokio::spawn(ComputeService::server_bounded(server, 5)); // wait a bit for connection due to Windows test failing on CI tokio::time::sleep(tokio::time::Duration::from_millis(300)).await; @@ -163,7 +156,6 @@ async fn server_away_and_back() -> anyhow::Result<()> { // server is running, this should work let SqrResponse(response) = client.rpc(Sqr(3)).await?; assert_eq!(response, 9); - server_handle.abort(); Ok(()) } diff --git a/tests/math.rs b/tests/math.rs index fd85166..e79d95a 100644 --- a/tests/math.rs +++ b/tests/math.rs @@ -26,6 +26,7 @@ use quic_rpc::{ }; use serde::{Deserialize, Serialize}; use thousands::Separable; +use tokio_util::task::AbortOnDropHandle; /// compute the square of a number #[derive(Debug, Serialize, Deserialize)] @@ -163,20 +164,14 @@ impl ComputeService { } } - pub async fn server>( + pub fn server>( server: RpcServer, - ) -> result::Result<(), RpcServerError> { - let s = server; - let service = ComputeService; - loop { - let (req, chan) = s.accept().await?.read_first().await?; - let service = service.clone(); - tokio::spawn(async move { Self::handle_rpc_request(service, req, chan).await }); - } + ) -> AbortOnDropHandle<()> { + server.spawn_accept_loop(|req, chan| Self::handle_rpc_request(ComputeService, req, chan)) } pub async fn handle_rpc_request( - service: ComputeService, + self, req: ComputeRequest, chan: RpcChannel, ) -> Result<(), RpcServerError> @@ -186,10 +181,10 @@ impl ComputeService { use ComputeRequest::*; #[rustfmt::skip] match req { - Sqr(msg) => chan.rpc(msg, service, ComputeService::sqr).await, - Sum(msg) => chan.client_streaming(msg, service, ComputeService::sum).await, - Fibonacci(msg) => chan.server_streaming(msg, service, ComputeService::fibonacci).await, - Multiply(msg) => chan.bidi_streaming(msg, service, ComputeService::multiply).await, + Sqr(msg) => chan.rpc(msg, self, Self::sqr).await, + Sum(msg) => chan.client_streaming(msg, self, Self::sum).await, + Fibonacci(msg) => chan.server_streaming(msg, self, Self::fibonacci).await, + Multiply(msg) => chan.bidi_streaming(msg, self, Self::multiply).await, MultiplyUpdate(_) => Err(RpcServerError::UnexpectedStartMessage)?, SumUpdate(_) => Err(RpcServerError::UnexpectedStartMessage)?, }?; diff --git a/tests/quinn.rs b/tests/quinn.rs index be445b7..40c3e55 100644 --- a/tests/quinn.rs +++ b/tests/quinn.rs @@ -4,15 +4,22 @@ use std::{ sync::Arc, }; -use quic_rpc::{transport, RpcClient, RpcServer}; +use quic_rpc::{ + transport::{ + self, + quinn::{QuinnConnector, QuinnListener}, + }, + RpcClient, RpcServer, +}; use quinn::{ crypto::rustls::{QuicClientConfig, QuicServerConfig}, rustls, ClientConfig, Endpoint, ServerConfig, }; -use tokio::task::JoinHandle; mod math; use math::*; +use testresult::TestResult; +use tokio_util::task::AbortOnDropHandle; mod util; /// Constructs a QUIC endpoint configured for use a client only. @@ -112,13 +119,10 @@ pub fn make_endpoints(port: u16) -> anyhow::Result { }) } -fn run_server(server: quinn::Endpoint) -> JoinHandle> { - tokio::task::spawn(async move { - let connection = transport::quinn::QuinnListener::new(server)?; - let server = RpcServer::new(connection); - ComputeService::server(server).await?; - anyhow::Ok(()) - }) +fn run_server(server: quinn::Endpoint) -> AbortOnDropHandle<()> { + let listener = QuinnListener::new(server).unwrap(); + let listener = RpcServer::new(listener); + ComputeService::server(listener) } // #[tokio::test(flavor = "multi_thread", worker_threads = 2)] @@ -131,13 +135,12 @@ async fn quinn_channel_bench() -> anyhow::Result<()> { server_addr, } = make_endpoints(12345)?; tracing::debug!("Starting server"); - let server_handle = run_server(server); + let _server_handle = run_server(server); tracing::debug!("Starting client"); - let client = transport::quinn::QuinnConnector::new(client, server_addr, "localhost".into()); + let client = QuinnConnector::new(client, server_addr, "localhost".into()); let client = RpcClient::new(client); tracing::debug!("Starting benchmark"); bench(client, 50000).await?; - server_handle.abort(); Ok(()) } @@ -149,11 +152,10 @@ async fn quinn_channel_smoke() -> anyhow::Result<()> { server, server_addr, } = make_endpoints(12346)?; - let server_handle = run_server(server); + let _server_handle = run_server(server); let client_connection = transport::quinn::QuinnConnector::new(client, server_addr, "localhost".into()); smoke_test(client_connection).await?; - server_handle.abort(); Ok(()) } @@ -162,7 +164,7 @@ async fn quinn_channel_smoke() -> anyhow::Result<()> { /// /// This is a regression test. #[tokio::test] -async fn server_away_and_back() -> anyhow::Result<()> { +async fn server_away_and_back() -> TestResult<()> { tracing_subscriber::fmt::try_init().ok(); tracing::info!("Creating endpoints"); @@ -185,10 +187,10 @@ async fn server_away_and_back() -> anyhow::Result<()> { let server_handle = tokio::task::spawn(ComputeService::server_bounded(server, 1)); // send the first request and wait for the response to ensure everything works as expected - let SqrResponse(response) = client.rpc(Sqr(4)).await.unwrap(); + let SqrResponse(response) = client.rpc(Sqr(4)).await?; assert_eq!(response, 16); - let server = server_handle.await.unwrap().unwrap(); + let server = server_handle.await??; drop(server); // wait for drop to free the socket tokio::time::sleep(tokio::time::Duration::from_millis(300)).await; @@ -200,9 +202,8 @@ async fn server_away_and_back() -> anyhow::Result<()> { let server_handle = tokio::task::spawn(ComputeService::server_bounded(server, 5)); // server is running, this should work - let SqrResponse(response) = client.rpc(Sqr(3)).await.unwrap(); + let SqrResponse(response) = client.rpc(Sqr(3)).await?; assert_eq!(response, 9); - server_handle.abort(); Ok(()) } From 9ba53539b459419a27f1b348382688203c65b928 Mon Sep 17 00:00:00 2001 From: Ruediger Klaehn Date: Thu, 14 Nov 2024 18:30:33 +0200 Subject: [PATCH 4/6] increase version number --- Cargo.lock | 2 +- Cargo.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 4afd53d..1fca828 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2930,7 +2930,7 @@ dependencies = [ [[package]] name = "quic-rpc" -version = "0.15.0" +version = "0.15.1" dependencies = [ "anyhow", "async-stream", diff --git a/Cargo.toml b/Cargo.toml index 08e5691..2c12150 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "quic-rpc" -version = "0.15.0" +version = "0.15.1" edition = "2021" authors = ["RĂ¼diger Klaehn ", "n0 team"] keywords = ["api", "protocol", "network", "rpc"] From 27287e13fa125234898d9aabd7d9d640aba92a36 Mon Sep 17 00:00:00 2001 From: Ruediger Klaehn Date: Fri, 15 Nov 2024 17:19:19 +0200 Subject: [PATCH 5/6] chore: update rcgen inspired by /~https://github.com/n0-computer/iroh/pull/2934 --- Cargo.lock | 19 ++++++++++++++++--- Cargo.toml | 2 +- examples/split/server/Cargo.toml | 2 +- examples/split/server/src/main.rs | 9 ++++----- tests/quinn.rs | 9 ++++----- 5 files changed, 26 insertions(+), 15 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 1fca828..83ece12 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1841,7 +1841,7 @@ dependencies = [ "portmapper", "postcard", "rand", - "rcgen", + "rcgen 0.12.1", "reqwest", "ring", "rtnetlink", @@ -2951,7 +2951,7 @@ dependencies = [ "nested_enum_utils", "pin-project", "proc-macro2", - "rcgen", + "rcgen 0.13.1", "serde", "slab", "tempfile", @@ -3102,6 +3102,19 @@ dependencies = [ "yasna", ] +[[package]] +name = "rcgen" +version = "0.13.1" +source = "registry+/~https://github.com/rust-lang/crates.io-index" +checksum = "54077e1872c46788540de1ea3d7f4ccb1983d12f9aa909b234468676c1a36779" +dependencies = [ + "pem", + "ring", + "rustls-pki-types", + "time", + "yasna", +] + [[package]] name = "redox_syscall" version = "0.5.7" @@ -3593,7 +3606,7 @@ dependencies = [ "futures", "iroh-quinn", "quic-rpc", - "rcgen", + "rcgen 0.13.1", "rustls", "serde", "tokio", diff --git a/Cargo.toml b/Cargo.toml index 2c12150..13650f2 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -44,7 +44,7 @@ async-stream = "0.3.3" serde = { version = "1", features = ["derive"] } tokio = { version = "1", features = ["full"] } quinn = { package = "iroh-quinn", version = "0.12", features = ["ring"] } -rcgen = "0.12" +rcgen = "0.13" thousands = "0.2.0" tracing-subscriber = "0.3.16" tempfile = "3.5.0" diff --git a/examples/split/server/Cargo.toml b/examples/split/server/Cargo.toml index 646eb32..f5db77d 100644 --- a/examples/split/server/Cargo.toml +++ b/examples/split/server/Cargo.toml @@ -12,7 +12,7 @@ futures = "0.3.26" tracing-subscriber = "0.3.16" quic-rpc = { path = "../../..", features = ["quinn-transport", "macros"] } quinn = { package = "iroh-quinn", version = "0.12" } -rcgen = "0.12.0" +rcgen = "0.13" rustls = { version = "0.23", default-features = false, features = ["ring"] } serde = { version = "1", features = ["derive"] } tokio = { version = "1", features = ["full"] } diff --git a/examples/split/server/src/main.rs b/examples/split/server/src/main.rs index 1f1dd8a..045a9d2 100644 --- a/examples/split/server/src/main.rs +++ b/examples/split/server/src/main.rs @@ -80,15 +80,14 @@ fn make_server_endpoint(bind_addr: SocketAddr) -> anyhow::Result<(Endpoint, Vec< fn configure_server() -> anyhow::Result<(ServerConfig, Vec)> { let cert = rcgen::generate_simple_self_signed(vec!["localhost".into()])?; - let cert_der = cert.serialize_der()?; - let priv_key = cert.serialize_private_key_der(); - let priv_key = rustls::pki_types::PrivatePkcs8KeyDer::from(priv_key); - let cert_chain = vec![rustls::pki_types::CertificateDer::from(cert_der.clone())]; + let cert_der = cert.cert.der(); + let priv_key = rustls::pki_types::PrivatePkcs8KeyDer::from(cert.key_pair.serialize_der()); + let cert_chain = vec![cert_der.clone()]; let mut server_config = ServerConfig::with_single_cert(cert_chain, priv_key.into())?; Arc::get_mut(&mut server_config.transport) .unwrap() .max_concurrent_uni_streams(0_u8.into()); - Ok((server_config, cert_der)) + Ok((server_config, cert_der.to_vec())) } diff --git a/tests/quinn.rs b/tests/quinn.rs index 40c3e55..a152309 100644 --- a/tests/quinn.rs +++ b/tests/quinn.rs @@ -80,10 +80,9 @@ fn configure_client(server_certs: &[&[u8]]) -> anyhow::Result { #[allow(clippy::field_reassign_with_default)] // /~https://github.com/rust-lang/rust-clippy/issues/6527 fn configure_server() -> anyhow::Result<(ServerConfig, Vec)> { let cert = rcgen::generate_simple_self_signed(vec!["localhost".into()])?; - let cert_der = cert.serialize_der()?; - let priv_key = cert.serialize_private_key_der(); - let priv_key = rustls::pki_types::PrivatePkcs8KeyDer::from(priv_key); - let cert_chain = vec![rustls::pki_types::CertificateDer::from(cert_der.clone())]; + let cert_der = cert.cert.der(); + let priv_key = rustls::pki_types::PrivatePkcs8KeyDer::from(cert.key_pair.serialize_der()); + let cert_chain = vec![cert_der.clone()]; let crypto_server_config = rustls::ServerConfig::builder_with_provider(Arc::new( rustls::crypto::ring::default_provider(), @@ -99,7 +98,7 @@ fn configure_server() -> anyhow::Result<(ServerConfig, Vec)> { .unwrap() .max_concurrent_uni_streams(0_u8.into()); - Ok((server_config, cert_der)) + Ok((server_config, cert_der.to_vec())) } pub struct Endpoints { From dc75b951bcd6b3b2239ab7a71e2fedcd12152853 Mon Sep 17 00:00:00 2001 From: Asmir Avdicevic Date: Tue, 19 Nov 2024 13:27:02 +0100 Subject: [PATCH 6/6] chore: prune some deps (#119) --- Cargo.lock | 208 ++++++++++++++++++------------- Cargo.toml | 8 +- examples/split/client/Cargo.toml | 1 - examples/split/server/Cargo.toml | 1 - examples/split/types/Cargo.toml | 1 - 5 files changed, 128 insertions(+), 91 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 83ece12..8793461 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -82,7 +82,7 @@ dependencies = [ "nom", "num-traits", "rusticata-macros", - "thiserror", + "thiserror 1.0.69", "time", ] @@ -276,9 +276,9 @@ checksum = "9ac0150caa2ae65ca5bd83f25c7de183dea78d4d366469f148435e2acfbad0da" [[package]] name = "cc" -version = "1.1.36" +version = "1.1.31" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "baee610e9452a8f6f0a1b6194ec09ff9e2d85dea54432acdae41aa0761c95d70" +checksum = "c2e7962b54006dcfcc61cb72735f4d89bb97061dd6a7ed882ec6b8ee53714c6f" dependencies = [ "shlex", ] @@ -345,7 +345,6 @@ dependencies = [ "iroh-quinn", "quic-rpc", "rustls", - "serde", "tokio", "tracing-subscriber", "types", @@ -416,9 +415,9 @@ checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" [[package]] name = "cpufeatures" -version = "0.2.14" +version = "0.2.15" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "608697df725056feaccfa42cffdaeeec3fccc4ffc38358ecd19b243e716a78e0" +checksum = "0ca741a962e1b0bff6d724a1a0958b686406e853bb14061f218562e1896f95e6" dependencies = [ "libc", ] @@ -727,14 +726,14 @@ dependencies = [ [[package]] name = "educe" -version = "0.4.23" +version = "0.5.11" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "0f0042ff8246a363dbe77d2ceedb073339e85a804b9a47636c6e016a9a32c05f" +checksum = "e4bd92664bf78c4d3dba9b7cdafce6fa15b13ed3ed16175218196942e99168a8" dependencies = [ "enum-ordinalize", "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.87", ] [[package]] @@ -782,12 +781,19 @@ dependencies = [ [[package]] name = "enum-ordinalize" -version = "3.1.15" +version = "4.3.0" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "1bf1fa3f06bbff1ea5b1a9c7b14aa992a39657db60a2759457328d7e058f49ee" +checksum = "fea0dcfa4e54eeb516fe454635a95753ddd39acda650ce703031c6973e315dd5" +dependencies = [ + "enum-ordinalize-derive", +] + +[[package]] +name = "enum-ordinalize-derive" +version = "4.3.1" +source = "registry+/~https://github.com/rust-lang/crates.io-index" +checksum = "0d28318a75d4aead5c4db25382e8ef717932d0346600cacae6357eb5941bc5ff" dependencies = [ - "num-bigint", - "num-traits", "proc-macro2", "quote", "syn 2.0.87", @@ -872,9 +878,9 @@ dependencies = [ [[package]] name = "fastrand" -version = "2.1.1" +version = "2.2.0" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "e8c02a5121d4ea3eb16a80748c74f5549a5665e4c21333c6098f283870fbdea6" +checksum = "486f806e73c5707928240ddc295403b1b93c96a02038563881c4a2fd84b81ac4" [[package]] name = "ff" @@ -1017,11 +1023,11 @@ dependencies = [ [[package]] name = "futures-lite" -version = "2.4.0" +version = "2.5.0" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "3f1fa2f9765705486b33fd2acf1577f8ec449c2ba1f318ae5447697b7c08d210" +checksum = "cef40d21ae2c515b51041df9ed313ed21e572df340ea58a922a0aefe7e8891a1" dependencies = [ - "fastrand 2.1.1", + "fastrand 2.2.0", "futures-core", "futures-io", "parking", @@ -1272,7 +1278,7 @@ dependencies = [ "ipnet", "once_cell", "rand", - "thiserror", + "thiserror 1.0.69", "time", "tinyvec", "tokio", @@ -1296,7 +1302,7 @@ dependencies = [ "rand", "resolv-conf", "smallvec", - "thiserror", + "thiserror 1.0.69", "tokio", "tracing", ] @@ -1753,7 +1759,7 @@ dependencies = [ "rand_core", "serde", "ssh-key", - "thiserror", + "thiserror 1.0.69", "ttl_cache", "url", "zeroize", @@ -1808,7 +1814,7 @@ dependencies = [ "duct", "futures-buffered", "futures-concurrency", - "futures-lite 2.4.0", + "futures-lite 2.5.0", "futures-sink", "futures-util", "genawaiter", @@ -1853,7 +1859,7 @@ dependencies = [ "strum", "stun-rs", "surge-ping", - "thiserror", + "thiserror 1.0.69", "time", "tokio", "tokio-rustls", @@ -1885,7 +1891,7 @@ dependencies = [ "rustc-hash", "rustls", "socket2", - "thiserror", + "thiserror 1.0.69", "tokio", "tracing", ] @@ -1903,7 +1909,7 @@ dependencies = [ "rustls", "rustls-platform-verifier", "slab", - "thiserror", + "thiserror 1.0.69", "tinyvec", "tracing", ] @@ -1937,7 +1943,7 @@ dependencies = [ "combine", "jni-sys", "log", - "thiserror", + "thiserror 1.0.69", "walkdir", ] @@ -1967,9 +1973,9 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.161" +version = "0.2.164" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "8e9489c2807c139ffd9c1794f4af0ebe86a828db53ecdc7fea2111d0fed085d1" +checksum = "433bfe06b8c75da9b2e3fbea6e5329ff87748f0b144ef75306e674c3f6f7c13f" [[package]] name = "libm" @@ -2061,7 +2067,7 @@ dependencies = [ "serde_bencode", "serde_bytes", "sha1_smol", - "thiserror", + "thiserror 1.0.69", "tracing", ] @@ -2203,7 +2209,7 @@ dependencies = [ "anyhow", "byteorder", "paste", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -2217,7 +2223,7 @@ dependencies = [ "log", "netlink-packet-core", "netlink-sys", - "thiserror", + "thiserror 1.0.69", "tokio", ] @@ -2243,7 +2249,7 @@ dependencies = [ "anyhow", "bytes", "derive_more", - "futures-lite 2.4.0", + "futures-lite 2.5.0", "futures-sink", "futures-util", "libc", @@ -2255,7 +2261,7 @@ dependencies = [ "rtnetlink", "serde", "socket2", - "thiserror", + "thiserror 1.0.69", "time", "tokio", "tracing", @@ -2553,7 +2559,7 @@ source = "registry+/~https://github.com/rust-lang/crates.io-index" checksum = "879952a81a83930934cbf1786752d6dedc3b1f29e8f8fb2ad1d0a36f377cf442" dependencies = [ "memchr", - "thiserror", + "thiserror 1.0.69", "ucd-trie", ] @@ -2640,7 +2646,7 @@ dependencies = [ "mainline", "self_cell", "simple-dns", - "thiserror", + "thiserror 1.0.69", "tracing", "ureq", "wasm-bindgen", @@ -2739,7 +2745,7 @@ dependencies = [ "base64", "bytes", "derive_more", - "futures-lite 2.4.0", + "futures-lite 2.5.0", "futures-util", "igd-next", "iroh-metrics", @@ -2750,7 +2756,7 @@ dependencies = [ "serde", "smallvec", "socket2", - "thiserror", + "thiserror 1.0.69", "time", "tokio", "tokio-util", @@ -2936,15 +2942,14 @@ dependencies = [ "async-stream", "bincode", "bytes", + "cc", "derive_more", - "educe", "flume", "futures", "futures-buffered", - "futures-lite 2.4.0", + "futures-lite 2.5.0", "futures-sink", "futures-util", - "hex", "hyper 0.14.31", "iroh-net", "iroh-quinn", @@ -2957,6 +2962,7 @@ dependencies = [ "tempfile", "testresult", "thousands", + "time", "tokio", "tokio-serde", "tokio-util", @@ -2985,9 +2991,9 @@ checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" [[package]] name = "quinn" -version = "0.11.5" +version = "0.11.6" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "8c7c5fdde3cdae7203427dc4f0a68fe0ed09833edc525a03456b153b79828684" +checksum = "62e96808277ec6f97351a2380e6c25114bc9e67037775464979f3037c92d05ef" dependencies = [ "bytes", "pin-project-lite", @@ -2996,26 +3002,29 @@ dependencies = [ "rustc-hash", "rustls", "socket2", - "thiserror", + "thiserror 2.0.3", "tokio", "tracing", ] [[package]] name = "quinn-proto" -version = "0.11.8" +version = "0.11.9" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "fadfaed2cd7f389d0161bb73eeb07b7b78f8691047a6f3e73caaeae55310a4a6" +checksum = "a2fe5ef3495d7d2e377ff17b1a8ce2ee2ec2a18cde8b6ad6619d65d0701c135d" dependencies = [ "bytes", + "getrandom", "rand", "ring", "rustc-hash", "rustls", + "rustls-pki-types", "slab", - "thiserror", + "thiserror 2.0.3", "tinyvec", "tracing", + "web-time", ] [[package]] @@ -3132,7 +3141,7 @@ checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191" dependencies = [ "aho-corasick", "memchr", - "regex-automata 0.4.8", + "regex-automata 0.4.9", "regex-syntax 0.8.5", ] @@ -3147,9 +3156,9 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.8" +version = "0.4.9" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "368758f23274712b504848e9d5a6f010445cc8b87a7cdb4d7cbee666c1288da3" +checksum = "809e8dc61f6de73b46c85f4c96486310fe304c434cfa43669d7b40f711150908" dependencies = [ "aho-corasick", "memchr", @@ -3286,7 +3295,7 @@ dependencies = [ "netlink-proto", "netlink-sys", "nix", - "thiserror", + "thiserror 1.0.69", "tokio", ] @@ -3322,9 +3331,9 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.39" +version = "0.38.41" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "375116bee2be9ed569afe2154ea6a99dfdffd257f533f187498c2a8f5feaf4ee" +checksum = "d7f649912bc1495e167a6edee79151c84b1bad49748cb4f1f1167f459f6224f6" dependencies = [ "bitflags 2.6.0", "errno", @@ -3335,9 +3344,9 @@ dependencies = [ [[package]] name = "rustls" -version = "0.23.16" +version = "0.23.17" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "eee87ff5d9b36712a58574e12e9f0ea80f915a5b0ac518d322b24a465617925e" +checksum = "7f1a745511c54ba6d4465e8d5dfbd81b45791756de28d4981af70d6dca128f1e" dependencies = [ "log", "once_cell", @@ -3375,6 +3384,9 @@ name = "rustls-pki-types" version = "1.10.0" source = "registry+/~https://github.com/rust-lang/crates.io-index" checksum = "16f1201b3c9a7ee8039bcadc17b7e605e2945b27eee7631788c1bd2b0643674b" +dependencies = [ + "web-time", +] [[package]] name = "rustls-platform-verifier" @@ -3446,9 +3458,9 @@ dependencies = [ [[package]] name = "schannel" -version = "0.1.26" +version = "0.1.27" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "01227be5826fa0690321a2ba6c5cd57a19cf3f6a09e76973b58e61de6ab9d1c1" +checksum = "1f29ebaa345f945cec9fbbc532eb307f0fdad8161f281b6369539c8d84876b3d" dependencies = [ "windows-sys 0.59.0", ] @@ -3495,9 +3507,9 @@ dependencies = [ [[package]] name = "security-framework-sys" -version = "2.12.0" +version = "2.12.1" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "ea4a292869320c0272d7bc55a5a6aafaff59b4f63404a003887b679a2e05b4b6" +checksum = "fa39c7303dc58b5543c94d22c1766b0d31f2ee58306363ea622b10bbc075eaa2" dependencies = [ "core-foundation-sys", "libc", @@ -3517,9 +3529,9 @@ checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" [[package]] name = "serde" -version = "1.0.214" +version = "1.0.215" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "f55c3193aca71c12ad7890f1785d2b73e1b9f63a0bbc353c08ef26fe03fc56b5" +checksum = "6513c1ad0b11a9376da888e3e0baa0077f1aed55c17f50e7b2397136129fb88f" dependencies = [ "serde_derive", ] @@ -3545,9 +3557,9 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.214" +version = "1.0.215" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "de523f781f095e28fa605cdce0f8307e451cc0fd14e2eb4cd2e98a355b147766" +checksum = "ad1e866f866923f252f05c889987993144fb74e722403468a4ebd70c3cd756c0" dependencies = [ "proc-macro2", "quote", @@ -3556,9 +3568,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.132" +version = "1.0.133" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "d726bfaff4b320266d395898905d0eba0345aae23b54aee3a737e260fd46db03" +checksum = "c7fceb2473b9166b2294ef05efcb65a3db80803f0b03ef86a5fc88a2b85ee377" dependencies = [ "itoa", "memchr", @@ -3608,7 +3620,6 @@ dependencies = [ "quic-rpc", "rcgen 0.13.1", "rustls", - "serde", "tokio", "tracing-subscriber", "types", @@ -3888,7 +3899,7 @@ dependencies = [ "pnet_packet", "rand", "socket2", - "thiserror", + "thiserror 1.0.69", "tokio", "tracing", ] @@ -3975,12 +3986,12 @@ checksum = "42a4d50cdb458045afc8131fd91b64904da29548bcb63c7236e0844936c13078" [[package]] name = "tempfile" -version = "3.13.0" +version = "3.14.0" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "f0f2c9fc62d0beef6951ccffd757e241266a2c833136efbe35af6cd2567dca5b" +checksum = "28cce251fcbc87fac86a866eeb0d6c2d536fc16d06f184bb61aeae11aa4cee0c" dependencies = [ "cfg-if", - "fastrand 2.1.1", + "fastrand 2.2.0", "once_cell", "rustix", "windows-sys 0.59.0", @@ -4003,18 +4014,38 @@ checksum = "614b328ff036a4ef882c61570f72918f7e9c5bee1da33f8e7f91e01daee7e56c" [[package]] name = "thiserror" -version = "1.0.68" +version = "1.0.69" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "02dd99dc800bbb97186339685293e1cc5d9df1f8fae2d0aecd9ff1c77efea892" +checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" dependencies = [ - "thiserror-impl", + "thiserror-impl 1.0.69", +] + +[[package]] +name = "thiserror" +version = "2.0.3" +source = "registry+/~https://github.com/rust-lang/crates.io-index" +checksum = "c006c85c7651b3cf2ada4584faa36773bd07bac24acfb39f3c431b36d7e667aa" +dependencies = [ + "thiserror-impl 2.0.3", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.69" +source = "registry+/~https://github.com/rust-lang/crates.io-index" +checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", ] [[package]] name = "thiserror-impl" -version = "1.0.68" +version = "2.0.3" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "a7c61ec9a6f64d2793d8a45faba21efbe3ced62a886d44c36a009b2b519b4c7e" +checksum = "f077553d607adc1caf65430528a576c757a71ed73944b66ebb58ef2bbd243568" dependencies = [ "proc-macro2", "quote", @@ -4095,9 +4126,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.41.0" +version = "1.41.1" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "145f3413504347a2be84393cc8a7d2fb4d863b375909ea59f2158261aa258bbb" +checksum = "22cfb5bee7a6a52939ca9224d6ac897bb669134078daa8735560897f69de4d33" dependencies = [ "backtrace", "bytes", @@ -4135,9 +4166,9 @@ dependencies = [ [[package]] name = "tokio-serde" -version = "0.8.0" +version = "0.9.0" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "911a61637386b789af998ee23f50aa30d5fd7edcec8d6d3dedae5e5815205466" +checksum = "caf600e7036b17782571dd44fa0a5cea3c82f60db5137f774a325a76a0d6852b" dependencies = [ "bincode", "bytes", @@ -4182,7 +4213,7 @@ dependencies = [ "http 1.1.0", "httparse", "js-sys", - "thiserror", + "thiserror 1.0.69", "tokio", "tokio-tungstenite", "wasm-bindgen", @@ -4350,7 +4381,7 @@ dependencies = [ "log", "rand", "sha1", - "thiserror", + "thiserror 1.0.69", "url", "utf-8", ] @@ -4366,7 +4397,6 @@ name = "types" version = "0.1.0" dependencies = [ "derive_more", - "futures", "quic-rpc", "serde", ] @@ -4593,7 +4623,7 @@ dependencies = [ "event-listener", "futures-util", "parking_lot", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -4606,6 +4636,16 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "web-time" +version = "1.1.0" +source = "registry+/~https://github.com/rust-lang/crates.io-index" +checksum = "5a6580f308b1fad9207618087a65c04e7a10bc77e02c8e84e9b00dd4b12fa0bb" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + [[package]] name = "webpki-roots" version = "0.26.6" @@ -4941,7 +4981,7 @@ dependencies = [ "futures", "log", "serde", - "thiserror", + "thiserror 1.0.69", "windows 0.58.0", "windows-core 0.58.0", ] @@ -4971,7 +5011,7 @@ dependencies = [ "nom", "oid-registry", "rusticata-macros", - "thiserror", + "thiserror 1.0.69", "time", ] diff --git a/Cargo.toml b/Cargo.toml index 13650f2..5959609 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -13,6 +13,7 @@ description = "A streaming rpc system based on quic" rust-version = "1.76" [dependencies] +cc = "=1.1.31" # enforce cc version, because of /~https://github.com/rust-lang/cc-rs/issues/1278 bincode = { version = "1.3.3", optional = true } bytes = { version = "1", optional = true } derive_more = { version = "1.0.0-beta.6", features = ["from", "try_into", "display"] } @@ -24,18 +25,17 @@ hyper = { version = "0.14.16", features = ["full"], optional = true } iroh-net = { version = "0.28.1", optional = true } pin-project = "1" quinn = { package = "iroh-quinn", version = "0.12", optional = true } -serde = { version = "1.0.183", features = ["derive"] } +serde = { version = "1.0", features = ["derive"] } tokio = { version = "1", default-features = false, features = ["macros", "sync"] } -tokio-serde = { version = "0.8", features = ["bincode"], optional = true } +tokio-serde = { version = "0.9", features = ["bincode"], optional = true } tokio-util = { version = "0.7", features = ["rt"] } tracing = "0.1" -hex = "0.4.3" futures = { version = "0.3.30", optional = true } anyhow = "1.0.73" # Indirect dependencies, is needed to make the minimal crates versions work -educe = "0.4.20" # tokio-serde slab = "0.4.9" # iroh-quinn +time = "0.3.36" # serde [dev-dependencies] anyhow = "1.0.73" diff --git a/examples/split/client/Cargo.toml b/examples/split/client/Cargo.toml index 255f262..a4a12ab 100644 --- a/examples/split/client/Cargo.toml +++ b/examples/split/client/Cargo.toml @@ -12,6 +12,5 @@ quic-rpc = { path = "../../..", features = ["quinn-transport", "macros"] } quinn = { package = "iroh-quinn", version = "0.12" } rustls = { version = "0.23", default-features = false, features = ["ring"] } tracing-subscriber = "0.3.16" -serde = { version = "1", features = ["derive"] } tokio = { version = "1", features = ["full"] } types = { path = "../types" } diff --git a/examples/split/server/Cargo.toml b/examples/split/server/Cargo.toml index f5db77d..aca3b48 100644 --- a/examples/split/server/Cargo.toml +++ b/examples/split/server/Cargo.toml @@ -14,6 +14,5 @@ quic-rpc = { path = "../../..", features = ["quinn-transport", "macros"] } quinn = { package = "iroh-quinn", version = "0.12" } rcgen = "0.13" rustls = { version = "0.23", default-features = false, features = ["ring"] } -serde = { version = "1", features = ["derive"] } tokio = { version = "1", features = ["full"] } types = { path = "../types" } diff --git a/examples/split/types/Cargo.toml b/examples/split/types/Cargo.toml index 2adb90f..e5e7d5d 100644 --- a/examples/split/types/Cargo.toml +++ b/examples/split/types/Cargo.toml @@ -6,7 +6,6 @@ edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -futures = "0.3.26" quic-rpc = { path = "../../..", features = ["macros"] } serde = { version = "1", features = ["derive"] } derive_more = { version = "1.0.0-beta.6", features = ["from", "try_into"] }