Skip to content

Commit

Permalink
chore: minor release 0.6.0 changes
Browse files Browse the repository at this point in the history
* change versions to 0.6.0 in Cargo.toml file
* correct images and versions in docker-compose.yml
* fix a circular dependency test failure
* remove unused imports and variables
* fix coprocessor tests compilation
* log worker polling messages in debug instead of info
  • Loading branch information
dartdart26 committed Dec 6, 2024
1 parent abfb330 commit b0ad273
Show file tree
Hide file tree
Showing 10 changed files with 21 additions and 45 deletions.
8 changes: 4 additions & 4 deletions fhevm-engine/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion fhevm-engine/coprocessor/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "coprocessor"
version = "0.1.2"
version = "0.6.0"
default-run = "coprocessor"
authors.workspace = true
edition.workspace = true
Expand Down
6 changes: 3 additions & 3 deletions fhevm-engine/coprocessor/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ services:

migration:
container_name: migration
image: ghcr.io/zama-ai/fhevm-db-migration:v1.1
image: ghcr.io/zama-ai/fhevm-db-migration:v0.6.0
environment:
DATABASE_URL: postgresql://postgres:postgres@db:5432/coprocessor
depends_on:
Expand All @@ -29,7 +29,7 @@ services:

coprocessor:
container_name: coprocessor
image: ghcr.io/zama-ai/fhevm-coprocessor:v0.1.0-3
image: ghcr.io/zama-ai/fhevm-coprocessor:v0.6.0
environment:
DATABASE_URL: postgresql://postgres:postgres@db:5432/coprocessor
ports:
Expand All @@ -47,7 +47,7 @@ services:

geth:
container_name: geth
image: ghcr.io/zama-ai/geth-coprocessor-devnode:v8
image: ghcr.io/zama-ai/go-ethereum-coprocessor-dev:v0.1.1
environment:
FHEVM_COPROCESSOR_API_KEY: a1503fb6-d79b-4e9e-826d-44cf262f3e05
FHEVM_COPROCESSOR_URL: coprocessor:50051
Expand Down
23 changes: 1 addition & 22 deletions fhevm-engine/coprocessor/src/tests/scheduling_bench.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,12 @@ use crate::server::common::FheOperation;
use crate::server::coprocessor::{async_computation_input::Input, AsyncComputationInput};
use crate::server::coprocessor::{
fhevm_coprocessor_client::FhevmCoprocessorClient, AsyncComputation, AsyncComputeRequest,
InputToUpload, InputUploadBatch, TrivialEncryptBatch, TrivialEncryptRequestSingle,
InputToUpload, InputUploadBatch,
};
use crate::tests::utils::{
decrypt_ciphertexts, default_api_key, default_tenant_id, random_handle, setup_test_app,
wait_until_all_ciphertexts_computed,
};
use alloy::primitives::keccak256;
use bigdecimal::num_bigint::BigInt;
use fhevm_engine_common::utils::safe_serialize;
use std::str::FromStr;
use std::time::SystemTime;
Expand All @@ -26,24 +24,6 @@ pub fn test_random_contract_address() -> String {
"0x76c222560Db6b8937B291196eAb4Dad8930043aE".to_string()
}

fn supported_bits_to_bit_type_in_db(inp: i32) -> i32 {
match inp {
1 => 0, // 1 bit - boolean
4 => 1,
8 => 2,
16 => 3,
32 => 4,
64 => 5,
128 => 6,
160 => 7,
256 => 8,
512 => 9,
1024 => 10,
2048 => 11,
other => panic!("unknown supported bits: {other}"),
}
}

#[tokio::test]
async fn schedule_multi_erc20() -> Result<(), Box<dyn std::error::Error>> {
let app = setup_test_app().await?;
Expand Down Expand Up @@ -87,7 +67,6 @@ async fn schedule_multi_erc20() -> Result<(), Box<dyn std::error::Error>> {
.unwrap();

let serialized = safe_serialize(&the_list);
let input_bytes = keccak256(&serialized);
println!("Encrypting inputs...");
let mut input_request = tonic::Request::new(InputUploadBatch {
input_ciphertexts: vec![InputToUpload {
Expand Down
1 change: 1 addition & 0 deletions fhevm-engine/coprocessor/src/tests/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ async fn setup_test_app_existing_db() -> Result<TestInstance, Box<dyn std::error
async fn start_coprocessor(rx: Receiver<bool>, app_port: u16, db_url: &str) {
let args: Args = Args {
run_bg_worker: true,
worker_polling_interval_ms: 1000,
run_server: true,
generate_fhe_keys: false,
server_maximum_ciphertexts_to_schedule: 5000,
Expand Down
4 changes: 2 additions & 2 deletions fhevm-engine/coprocessor/src/tfhe_worker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use std::{
collections::{BTreeSet, HashMap},
num::NonZeroUsize,
};
use tracing::{error, info};
use tracing::{debug, error, info};

lazy_static! {
static ref WORKER_ERRORS_COUNTER: IntCounter =
Expand Down Expand Up @@ -87,7 +87,7 @@ async fn tfhe_worker_cycle(
},
_ = tokio::time::sleep(tokio::time::Duration::from_millis(args.worker_polling_interval_ms)) => {
WORK_ITEMS_POLL_COUNTER.inc();
info!(target: "tfhe_worker", "Polling the database for more work on timer");
debug!(target: "tfhe_worker", "Polling the database for more work on timer");
},
};
}
Expand Down
2 changes: 1 addition & 1 deletion fhevm-engine/executor/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "executor"
version = "0.1.1"
version = "0.6.0"
authors.workspace = true
edition.workspace = true
license.workspace = true
Expand Down
16 changes: 6 additions & 10 deletions fhevm-engine/executor/src/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -148,9 +148,7 @@ impl FhevmExecutor for FhevmExecutorService {

impl FhevmExecutorService {
fn new(keys: FhevmKeys) -> Self {
FhevmExecutorService {
keys,
}
FhevmExecutorService { keys }
}

#[allow(dead_code)]
Expand Down Expand Up @@ -264,9 +262,7 @@ impl FhevmExecutorService {
let ct = state.ciphertexts.get(h).ok_or(FhevmError::BadInputs)?;
Ok(ct.expanded.clone())
}
Input::Scalar(s) => {
Ok(SupportedFheCiphertexts::Scalar(s.clone()))
}
Input::Scalar(s) => Ok(SupportedFheCiphertexts::Scalar(s.clone())),
},
None => Err(FhevmError::BadInputs.into()),
})
Expand Down Expand Up @@ -316,9 +312,9 @@ pub fn build_taskgraph_from_request(
Ok(DFGTaskInput::Dependence(None))
}
}
Input::Scalar(s) => Ok(DFGTaskInput::Value(
SupportedFheCiphertexts::Scalar(s.clone()),
)),
Input::Scalar(s) => Ok(DFGTaskInput::Value(SupportedFheCiphertexts::Scalar(
s.clone(),
))),
},
None => Err(SyncComputeError::BadInputs),
})
Expand Down Expand Up @@ -347,7 +343,7 @@ pub fn build_taskgraph_from_request(
if !state.ciphertexts.contains_key(input) {
if let Some(producer_index) = produced_handles.get(input) {
dfg.add_dependence(*producer_index, index, input_idx)
.or_else(|_| Err(SyncComputeError::ComputationFailed))?;
.or_else(|_| Err(SyncComputeError::UnsatisfiedDependence))?;
} else {
return Err(SyncComputeError::ComputationFailed);
}
Expand Down
2 changes: 1 addition & 1 deletion fhevm-engine/fhevm-engine-common/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "fhevm-engine-common"
version = "0.6.0-6"
version = "0.6.0"
authors.workspace = true
edition.workspace = true
license.workspace = true
Expand Down
2 changes: 1 addition & 1 deletion fhevm-engine/scheduler/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "scheduler"
version = "0.1.0"
version = "0.6.0"
edition = "2021"

[dependencies]
Expand Down

0 comments on commit b0ad273

Please sign in to comment.