diff --git a/crates/ursa-pod/Cargo.toml b/crates/ursa-pod/Cargo.toml index aba770f8..8fa5f0d0 100644 --- a/crates/ursa-pod/Cargo.toml +++ b/crates/ursa-pod/Cargo.toml @@ -27,11 +27,11 @@ tracing = { version = "0.1", optional = true } # Criterion benchmark dependencies hyper = { version = "1.0.0-rc.3", features = ["full"], optional = true } http-body-util = { version = "0.1.0-rc.2", optional = true } -quinn = { version = "0.9.3", optional = true } -rcgen = { version = "0.10.0", optional = true } -rustls = { version = "0.20.8", default-features = false, features = ["dangerous_configuration"], optional = true } -s2n-quic = { version = "1.18.0", default-features = false, features = ["provider-address-token-default", "provider-tls-rustls"] , optional = true } -zeroize_derive = { version = "<1.4", optional = true } +quinn = { version = "0.9.3" } +rcgen = { version = "0.10.0" } +rustls = { version = "0.20.8", default-features = false, features = ["dangerous_configuration"] } +s2n-quic = { version = "1.18.0", default-features = false, features = ["provider-address-token-default", "provider-tls-rustls"] } +zeroize_derive = { version = "<1.4" } # Binary benchmark dependencies serde = { version = "1.0", features = ["derive"], optional = true } @@ -52,8 +52,6 @@ client = ["tokio", "tokio-stream", "futures", "tracing"] server = ["tokio", "tokio-stream", "futures", "tracing"] bench-hyper = ["tokio", "hyper", "http-body-util"] benchmarks = ["serde", "serde_json", "rayon", "fnv", "clap", "gnuplot"] -bench-quinn = ["tokio", "quinn", "rcgen", "rustls"] -bench-s2n-quic = ["tokio", "s2n-quic", "zeroize_derive", "rcgen", "rustls"] [[bench]] name = "encrypt" diff --git a/crates/ursa-pod/benches/e2e.rs b/crates/ursa-pod/benches/e2e.rs index 76135c44..81bcacb9 100644 --- a/crates/ursa-pod/benches/e2e.rs +++ b/crates/ursa-pod/benches/e2e.rs @@ -94,7 +94,6 @@ fn protocol_benchmarks(c: &mut Criterion) { ("Content Size (Kilobyte)", KILOBYTE_FILES, 1024), ("Content Size (Megabyte)", MEGABYTE_FILES, 1024 * 1024), ] { - #[cfg(all(not(feature = "bench-quinn"), not(feature = "bench-s2n-quic")))] { let mut g = c.benchmark_group(format!("TCP UFDP/{range}")); g.sample_size(20); @@ -120,7 +119,6 @@ fn protocol_benchmarks(c: &mut Criterion) { ); } - #[cfg(feature = "bench-quinn")] { let mut g = c.benchmark_group(format!("QUINN UFDP/{range}")); g.sample_size(20); @@ -133,7 +131,6 @@ fn protocol_benchmarks(c: &mut Criterion) { ); } - #[cfg(feature = "bench-s2n-quic")] { let mut g = c.benchmark_group(format!("S2N-QUIC UFDP/{range}")); g.sample_size(20); @@ -184,12 +181,7 @@ mod tcp_ufdp { net::{TcpListener, TcpStream}, task, }; - use ursa_pod::{ - client::UfdpClient, - connection::consts::MAX_BLOCK_SIZE, - server::{Backend, UfdpHandler}, - types::{Blake3Cid, BlsSignature, Secp256k1PublicKey}, - }; + use ursa_pod::{client::UfdpClient, server::UfdpHandler, types::Blake3Cid}; const CLIENT_PUB_KEY: [u8; 48] = [3u8; 48]; const CID: Blake3Cid = Blake3Cid([3u8; 32]); @@ -298,17 +290,13 @@ mod http_hyper { } } -#[cfg(feature = "bench-quinn")] mod quinn_ufdp { use super::{ tls_utils::{client_config, server_config}, DummyBackend, }; use futures::future::join_all; - use quinn::{ - ConnectionError, Endpoint, RecvStream, SendStream, ServerConfig, TransportConfig, VarInt, - WriteError, - }; + use quinn::{ConnectionError, Endpoint, RecvStream, SendStream, ServerConfig}; use std::{ io::Error, pin::Pin, @@ -317,12 +305,7 @@ mod quinn_ufdp { }; use tokio::io::{AsyncRead, AsyncWrite, ReadBuf}; use tokio::task; - use ursa_pod::{ - client::UfdpClient, - connection::consts::MAX_BLOCK_SIZE, - server::{Backend, UfdpHandler}, - types::{Blake3Cid, BlsSignature, Secp256k1PublicKey}, - }; + use ursa_pod::{client::UfdpClient, server::UfdpHandler, types::Blake3Cid}; const CLIENT_PUB_KEY: [u8; 48] = [3u8; 48]; const CID: Blake3Cid = Blake3Cid([3u8; 32]); @@ -332,7 +315,7 @@ mod quinn_ufdp { content: &'static [u8], tx_started: tokio::sync::oneshot::Sender, ) { - let mut server_config = ServerConfig::with_crypto(Arc::new(server_config())); + let server_config = ServerConfig::with_crypto(Arc::new(server_config())); let server = Endpoint::server(server_config, addr.parse().unwrap()).unwrap(); let port = server.local_addr().unwrap().port(); @@ -347,7 +330,7 @@ mod quinn_ufdp { Ok((tx, rx)) => { task::spawn(async { let stream = BiStream { tx, rx }; - let mut handler = UfdpHandler::new( + let handler = UfdpHandler::new( stream, DummyBackend { content: content_clone, @@ -373,7 +356,7 @@ mod quinn_ufdp { pub async fn client_loop(addr: String, iterations: usize) { let mut tasks = vec![]; let mut endpoint = Endpoint::client("0.0.0.0:0".parse().unwrap()).unwrap(); - let mut client_config = quinn::ClientConfig::new(Arc::new(client_config())); + let client_config = quinn::ClientConfig::new(Arc::new(client_config())); endpoint.set_default_client_config(client_config); let stream = endpoint .connect(addr.parse().unwrap(), "localhost") @@ -432,7 +415,6 @@ mod quinn_ufdp { } } -#[cfg(feature = "bench-s2n-quic")] mod s2n_quic_ufdp { use super::{ tls_utils::{client_config, server_config}, @@ -442,12 +424,7 @@ mod s2n_quic_ufdp { use s2n_quic::{client::Connect, provider::tls, Client, Server}; use std::net::SocketAddr; use tokio::task; - use ursa_pod::{ - client::UfdpClient, - connection::consts::MAX_BLOCK_SIZE, - server::{Backend, UfdpHandler}, - types::{Blake3Cid, BlsSignature, Secp256k1PublicKey}, - }; + use ursa_pod::{client::UfdpClient, server::UfdpHandler, types::Blake3Cid}; const CLIENT_PUB_KEY: [u8; 48] = [3u8; 48]; const CID: Blake3Cid = Blake3Cid([3u8; 32]); @@ -539,7 +516,6 @@ mod s2n_quic_ufdp { } } -#[cfg(any(feature = "bench-quinn", feature = "bench-s2n-quic"))] mod tls_utils { use std::sync::Arc;