Skip to content

Commit

Permalink
fix: remove SERVER_KEY thread local variable
Browse files Browse the repository at this point in the history
  • Loading branch information
david-zk committed Nov 22, 2024
1 parent 7f110a3 commit 9f93fc6
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions fhevm-engine/executor/src/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,11 @@ pub mod executor {
}

thread_local! {
pub static SERVER_KEY: Cell<Option<tfhe::ServerKey>> = const {Cell::new(None)};
pub static LOCAL_RAYON_THREADS: Cell<usize> = const {Cell::new(8)};
}

pub fn start(args: &crate::cli::Args) -> Result<()> {
let keys: FhevmKeys = SerializedFhevmKeys::load_from_disk(&args.fhe_keys_directory).into();
SERVER_KEY.set(Some(keys.server_key.clone()));
LOCAL_RAYON_THREADS.set(args.policy_fhe_compute_threads);
let executor = FhevmExecutorService::new(keys.clone());
let runtime = tokio::runtime::Builder::new_multi_thread()
Expand Down Expand Up @@ -114,7 +112,6 @@ impl FhevmExecutor for FhevmExecutorService {
let mut sched = Scheduler::new(&mut graph.graph, LOCAL_RAYON_THREADS.get());

let now = std::time::SystemTime::now();
SERVER_KEY.set(Some(sks.clone()));
if sched.schedule(sks).await.is_err() {
return Some(Resp::Error(SyncComputeError::ComputationFailed.into()));
}
Expand Down

0 comments on commit 9f93fc6

Please sign in to comment.