diff --git a/fhevm-engine/Cargo.lock b/fhevm-engine/Cargo.lock index 43ac5a04..883b8b4f 100644 --- a/fhevm-engine/Cargo.lock +++ b/fhevm-engine/Cargo.lock @@ -1921,7 +1921,6 @@ dependencies = [ "clap", "daggy", "fhevm-engine-common", - "futures", "prost", "sha3", "tfhe", diff --git a/fhevm-engine/Cargo.toml b/fhevm-engine/Cargo.toml index e202c6d5..bbebd54f 100644 --- a/fhevm-engine/Cargo.toml +++ b/fhevm-engine/Cargo.toml @@ -11,7 +11,6 @@ bincode = "1.3.3" sha3 = "0.10.8" anyhow = "1.0.86" daggy = "0.8.0" -futures = "0.3.30" [profile.dev.package.tfhe] overflow-checks = false \ No newline at end of file diff --git a/fhevm-engine/executor/Cargo.toml b/fhevm-engine/executor/Cargo.toml index 5926c353..0752bd1e 100644 --- a/fhevm-engine/executor/Cargo.toml +++ b/fhevm-engine/executor/Cargo.toml @@ -17,7 +17,6 @@ bincode.workspace = true sha3.workspace = true anyhow.workspace = true daggy.workspace = true -futures.workspace = true fhevm-engine-common = { path = "../fhevm-engine-common" } [build-dependencies] diff --git a/fhevm-engine/executor/src/dfg/scheduler.rs b/fhevm-engine/executor/src/dfg/scheduler.rs index 7bd10148..d92e43bf 100644 --- a/fhevm-engine/executor/src/dfg/scheduler.rs +++ b/fhevm-engine/executor/src/dfg/scheduler.rs @@ -56,7 +56,7 @@ impl<'a, 'b> Scheduler<'a, 'b> { let output = result.map_err(|_| SyncComputeError::ComputationFailed)??; let index = output.0; let node_index = NodeIndex::new(index); - // Satisfy deps from the eecuted task + // Satisfy deps from the executed task for edge in self.edges.edges_directed(node_index, Direction::Outgoing) { let child_index = edge.target(); let child_node = self.graph.node_weight_mut(child_index).unwrap(); diff --git a/fhevm-engine/executor/src/dfg/types.rs b/fhevm-engine/executor/src/dfg/types.rs index e3f5fdc6..123a25e1 100644 --- a/fhevm-engine/executor/src/dfg/types.rs +++ b/fhevm-engine/executor/src/dfg/types.rs @@ -1,35 +1,11 @@ -use daggy::NodeIndex; -use futures::{future::BoxFuture, FutureExt}; -use std::{future::Future, task::Poll}; - use fhevm_engine_common::types::{Handle, SupportedFheCiphertexts}; -use crate::server::{InMemoryCiphertext, SyncComputeError}; +use crate::server::InMemoryCiphertext; pub type DFGTaskResult = Option; -#[allow(variant_size_differences)] #[derive(Clone)] pub enum DFGTaskInput { Val(SupportedFheCiphertexts), Handle(Handle), } - -pub struct SchedTask<'a> { - pub idx: NodeIndex, - pub fut: BoxFuture<'a, Result>, -} - -impl<'a> Future for SchedTask<'a> { - type Output = (NodeIndex, Result); - - fn poll( - mut self: std::pin::Pin<&mut Self>, - cx: &mut std::task::Context<'_>, - ) -> Poll { - match self.fut.poll_unpin(cx) { - Poll::Pending => Poll::Pending, - Poll::Ready(output) => Poll::Ready((self.idx, output)), - } - } -} diff --git a/fhevm-engine/executor/src/server.rs b/fhevm-engine/executor/src/server.rs index 95c648c7..629f1906 100644 --- a/fhevm-engine/executor/src/server.rs +++ b/fhevm-engine/executor/src/server.rs @@ -21,6 +21,7 @@ use tokio::task::spawn_blocking; use tonic::{transport::Server, Code, Request, Response, Status}; use crate::dfg::{scheduler::Scheduler, DFGraph}; + pub mod common { tonic::include_proto!("fhevm.common"); } @@ -104,7 +105,7 @@ impl FhevmExecutor for FhevmExecutorService { // Run the request's computations in an async block let handle = tokio::runtime::Handle::current(); let _ = handle.enter(); - let resp = futures::executor::block_on(async { + let resp = handle.block_on(async { // Build the dataflow graph for this request let mut graph = DFGraph::default(); if let Err(e) = graph.build_from_request(req, &state) {