Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/coprocessor-cargo-clippy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ jobs:
# For now, only specify the `bench latency throughput` features as the
# other ones require specific dependencies (e.g. GPU, etc.).
SQLX_OFFLINE=true cargo clippy -p host-listener --all-targets \
-- -W clippy::perf -W clippy::suspicious -W clippy::style -D warnings
-- -D warnings
SQLX_OFFLINE=true cargo clippy --all-targets --features "bench latency throughput" \
-- -W clippy::perf -W clippy::suspicious -W clippy::style -D warnings
-- -D warnings
working-directory: coprocessor/fhevm-engine
6 changes: 6 additions & 0 deletions coprocessor/fhevm-engine/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,12 @@ bytesize = "2.0.1"
http = "1.3.1"
chrono = { version = "0.4.41", features = ["serde"] }

[workspace.lints.clippy]
perf = "deny"
suspicious = "deny"
style = "deny"
redundant_clone = "deny"

[profile.dev.package.tfhe]
overflow-checks = false

Expand Down
3 changes: 3 additions & 0 deletions coprocessor/fhevm-engine/fhevm-engine-common/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,6 @@ tonic-build = { workspace = true }
[[bin]]
name = "generate-keys"
path = "src/bin/generate_keys.rs"

[lints]
workspace = true
7 changes: 5 additions & 2 deletions coprocessor/fhevm-engine/fhevm-engine-common/src/keys.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,9 @@ impl FhevmKeys {
let compact_public_key = CompactPublicKey::new(&client_key);
let crs = CompactPkeCrs::from_config(config, MAX_BITS_TO_PROVE).expect("CRS creation");
let compressed_server_key = CompressedServerKey::new(&client_key);
#[cfg(not(feature = "gpu"))]
let server_key = compressed_server_key.decompress();
#[cfg(feature = "gpu")]
let server_key = compressed_server_key.clone().decompress();
#[cfg(not(feature = "gpu"))]
let (
Expand Down Expand Up @@ -114,7 +117,7 @@ impl FhevmKeys {
server_key_without_ns,
client_key: Some(client_key),
compact_public_key,
public_params: Arc::new(crs.clone()),
public_params: Arc::new(crs),
#[cfg(feature = "gpu")]
compressed_server_key: compressed_server_key.clone(),
#[cfg(feature = "gpu")]
Expand Down Expand Up @@ -275,7 +278,7 @@ impl From<SerializedFhevmKeys> for FhevmKeys {
.expect("deserialize compressed server key");

FhevmKeys {
client_key: client_key.clone(),
client_key,
compact_public_key: safe_deserialize_key(&f.compact_public_key)
.expect("deserialize compact public key"),
public_params: Arc::new(
Expand Down
6 changes: 2 additions & 4 deletions coprocessor/fhevm-engine/fhevm-engine-common/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -140,16 +140,14 @@ pub struct DatabaseURL(String);

impl From<&str> for DatabaseURL {
fn from(s: &str) -> Self {
let url = s.to_owned();
let app_name = Self::default_app_name();
Self::new_with_app_name(&url, &app_name)
Self::new_with_app_name(s, &app_name)
}
}
impl From<String> for DatabaseURL {
fn from(s: String) -> Self {
let url = s.to_owned();
let app_name = Self::default_app_name();
Self::new_with_app_name(&url, &app_name)
Self::new_with_app_name(&s, &app_name)
}
}

Expand Down
3 changes: 3 additions & 0 deletions coprocessor/fhevm-engine/gw-listener/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,6 @@ test-harness = { path = "../test-harness" }
[dev-dependencies.gw-listener]
path = "."
features = ["test_bypass_key_extraction"]

[lints]
workspace = true
4 changes: 1 addition & 3 deletions coprocessor/fhevm-engine/gw-listener/src/aws_s3.rs
Original file line number Diff line number Diff line change
Expand Up @@ -142,9 +142,7 @@ fn split_url(s3_bucket_url: &String) -> anyhow::Result<(String, String)> {
let s3_bucket_url = if s3_bucket_url.contains("minio:9000") {
// TODO: replace by docker configuration
warn!(s3_bucket_url, "Using localhost for minio access");
s3_bucket_url
.replace("minio:9000", "172.17.0.1:9000")
.to_owned()
s3_bucket_url.replace("minio:9000", "172.17.0.1:9000")
} else {
s3_bucket_url.to_owned()
};
Expand Down
2 changes: 1 addition & 1 deletion coprocessor/fhevm-engine/gw-listener/src/gw_listener.rs
Original file line number Diff line number Diff line change
Expand Up @@ -854,7 +854,7 @@ pub fn to_key_prefix(val: KeyType) -> &'static str {
}

pub fn key_id_to_aws_key(key_id: KeyId) -> String {
format!("{:064x}", key_id).to_owned()
format!("{:064x}", key_id)
}

mod test {
Expand Down
3 changes: 3 additions & 0 deletions coprocessor/fhevm-engine/host-listener/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,6 @@ tracing-test = { workspace = true }
foundry-compilers = { workspace = true }
foundry-compilers-artifacts = "0.13"
semver = { workspace = true }

[lints]
workspace = true
3 changes: 3 additions & 0 deletions coprocessor/fhevm-engine/scheduler/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,6 @@ fhevm-engine-common = { path = "../fhevm-engine-common" }
[features]
nightly-avx512 = ["tfhe/nightly-avx512"]
gpu = ["tfhe/gpu"]

[lints]
workspace = true
6 changes: 3 additions & 3 deletions coprocessor/fhevm-engine/scheduler/src/dfg/scheduler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,10 @@ impl<'a> Scheduler<'a> {
graph,
edges,
#[cfg(not(feature = "gpu"))]
sks: sks.clone(),
cpk: cpk.clone(),
sks,
cpk,
#[cfg(feature = "gpu")]
csks: csks.clone(),
csks,
activity_heartbeat,
}
}
Expand Down
3 changes: 3 additions & 0 deletions coprocessor/fhevm-engine/sns-worker/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -62,3 +62,6 @@ test-harness = { path = "../test-harness" }
[dev-dependencies.sns-worker]
path = "."
features = ["test_decrypt_128", "test_s3_use_handle_as_key"]

[lints]
workspace = true
2 changes: 1 addition & 1 deletion coprocessor/fhevm-engine/sns-worker/src/executor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -495,7 +495,7 @@ pub async fn query_sns_tasks(
// (e.g., via gateway coordination) to keep ciphertext_digest consistent.
key_id_gw: key_id_gw.clone(),
host_chain_id,
handle: handle.clone(),
handle,
ct64_compressed: Arc::new(ciphertext),
ct128: Arc::new(BigCiphertext::default()), // to be computed
span: task_span,
Expand Down
5 changes: 1 addition & 4 deletions coprocessor/fhevm-engine/sns-worker/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -546,10 +546,7 @@ pub async fn run_all(
interval_secs = interval_secs,
"Starting gauge update routine"
);
spawn_gauge_update_routine(
Duration::from_secs(interval_secs.into()),
pg_mngr.pool().clone(),
);
spawn_gauge_update_routine(Duration::from_secs(interval_secs.into()), pg_mngr.pool());
}

// Spawns a task to handle S3 uploads
Expand Down
3 changes: 3 additions & 0 deletions coprocessor/fhevm-engine/stress-test-generator/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -69,3 +69,6 @@ path = "src/bin/stress_generator.rs"
[profile.release]
opt-level = 3
lto = "fat"

[lints]
workspace = true
3 changes: 3 additions & 0 deletions coprocessor/fhevm-engine/test-harness/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,6 @@ fhevm-engine-common = { path = "../fhevm-engine-common" }

[features]
gpu = []

[lints]
workspace = true
3 changes: 3 additions & 0 deletions coprocessor/fhevm-engine/tfhe-worker/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -77,3 +77,6 @@ harness = false
name = "dex"
path = "benches/dex.rs"
harness = false

[lints]
workspace = true
3 changes: 3 additions & 0 deletions coprocessor/fhevm-engine/transaction-sender/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,6 @@ rstest = "0.25.0"
serial_test = { workspace = true }
testcontainers = { workspace = true }
test-harness = { path = "../test-harness" }

[lints]
workspace = true
3 changes: 3 additions & 0 deletions coprocessor/fhevm-engine/zkproof-worker/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,6 @@ test-harness = { path = "../test-harness" }
[[bin]]
name = "zkproof_worker"
path = "src/bin/zkproof_worker.rs"

[lints]
workspace = true
Loading