Skip to content

Commit

Permalink
feat: progagate tfhe events do database
Browse files Browse the repository at this point in the history
  • Loading branch information
rudy-6-4 committed Feb 18, 2025
1 parent aae9cb0 commit 43d7518
Show file tree
Hide file tree
Showing 16 changed files with 984 additions and 23 deletions.
3 changes: 3 additions & 0 deletions fhevm-engine/Cargo.lock

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

1 change: 1 addition & 0 deletions fhevm-engine/coprocessor/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ nightly-avx512 = ["tfhe/nightly-avx512"]

[dev-dependencies]
testcontainers = "0.21"
fhevm-listener = { path = "../fhevm-listener" }

[build-dependencies]
tonic-build = "0.12"
Expand Down
2 changes: 1 addition & 1 deletion fhevm-engine/coprocessor/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ pub mod server;
mod tests;
pub mod tfhe_worker;
pub mod tracing;
mod types;
pub mod types;
mod utils;

// separate function for testing
Expand Down
1 change: 1 addition & 0 deletions fhevm-engine/coprocessor/src/tests/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ use utils::{
mod errors;
mod inputs;
mod operators;
mod operators_from_events;
mod random;
mod scheduling_bench;
mod utils;
Expand Down
34 changes: 17 additions & 17 deletions fhevm-engine/coprocessor/src/tests/operators.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,23 +19,23 @@ use std::{ops::Not, str::FromStr};
use strum::IntoEnumIterator;
use tonic::metadata::MetadataValue;

struct BinaryOperatorTestCase {
bits: i32,
operand: i32,
input_types: i32,
expected_output_type: i32,
lhs: BigInt,
rhs: BigInt,
expected_output: BigInt,
is_scalar: bool,
pub struct BinaryOperatorTestCase {
pub bits: i32,
pub operand: i32,
pub input_types: i32,
pub expected_output_type: i32,
pub lhs: BigInt,
pub rhs: BigInt,
pub expected_output: BigInt,
pub is_scalar: bool,
}

struct UnaryOperatorTestCase {
bits: i32,
inp: BigInt,
operand: i32,
operand_types: i32,
expected_output: BigInt,
pub struct UnaryOperatorTestCase {
pub bits: i32,
pub inp: BigInt,
pub operand: i32,
pub operand_types: i32,
pub expected_output: BigInt,
}

fn supported_bits() -> &'static [i32] {
Expand Down Expand Up @@ -727,7 +727,7 @@ async fn test_fhe_if_then_else() -> Result<(), Box<dyn std::error::Error>> {
Ok(())
}

fn generate_binary_test_cases() -> Vec<BinaryOperatorTestCase> {
pub fn generate_binary_test_cases() -> Vec<BinaryOperatorTestCase> {
let mut cases = Vec::new();
let bit_shift_ops = [
SupportedFheOperations::FheShl,
Expand Down Expand Up @@ -836,7 +836,7 @@ fn generate_binary_test_cases() -> Vec<BinaryOperatorTestCase> {
cases
}

fn generate_unary_test_cases() -> Vec<UnaryOperatorTestCase> {
pub fn generate_unary_test_cases() -> Vec<UnaryOperatorTestCase> {
let mut cases = Vec::new();

for bits in supported_bits() {
Expand Down
Loading

0 comments on commit 43d7518

Please sign in to comment.