Skip to content
This repository has been archived by the owner on Nov 29, 2023. It is now read-only.

Commit

Permalink
Remove feature flags
Browse files Browse the repository at this point in the history
  • Loading branch information
kckeiks committed Apr 20, 2023
1 parent e0edbcf commit 4e85da4
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 38 deletions.
12 changes: 5 additions & 7 deletions crates/ursa-pod/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
Expand All @@ -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"
Expand Down
38 changes: 7 additions & 31 deletions crates/ursa-pod/benches/e2e.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
Expand All @@ -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);
Expand Down Expand Up @@ -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]);
Expand Down Expand Up @@ -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,
Expand All @@ -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]);
Expand All @@ -332,7 +315,7 @@ mod quinn_ufdp {
content: &'static [u8],
tx_started: tokio::sync::oneshot::Sender<u16>,
) {
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();

Expand All @@ -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,
Expand All @@ -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")
Expand Down Expand Up @@ -432,7 +415,6 @@ mod quinn_ufdp {
}
}

#[cfg(feature = "bench-s2n-quic")]
mod s2n_quic_ufdp {
use super::{
tls_utils::{client_config, server_config},
Expand All @@ -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]);
Expand Down Expand Up @@ -539,7 +516,6 @@ mod s2n_quic_ufdp {
}
}

#[cfg(any(feature = "bench-quinn", feature = "bench-s2n-quic"))]
mod tls_utils {
use std::sync::Arc;

Expand Down

0 comments on commit 4e85da4

Please sign in to comment.