Skip to content

Commit

Permalink
temporarily disable Sync proving services
Browse files Browse the repository at this point in the history
  • Loading branch information
omerfirmak committed Feb 3, 2025
1 parent 3331117 commit 7ed5b8a
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 35 deletions.
2 changes: 1 addition & 1 deletion examples/cloud.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ struct CloudProver {
api_key: String,
}

#[async_trait]
#[async_trait(?Send)]
impl ProvingService for CloudProver {
fn is_local(&self) -> bool {
false
Expand Down
2 changes: 1 addition & 1 deletion examples/local.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ impl LocalProverConfig {

struct LocalProver {}

#[async_trait]
#[async_trait(?Send)]
impl ProvingService for LocalProver {
fn is_local(&self) -> bool {
true
Expand Down
32 changes: 0 additions & 32 deletions src/prover/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,38 +60,6 @@ where
}
}

pub async fn run_with_n_workers(self)
where
Backend: ProvingService + Send + Sync + 'static,
{
assert!(self.n_workers == self.coordinator_clients.len());
if self.proof_types.contains(&ProofType::Chunk) {
assert!(self.l2geth_client.is_some());
}

self.test_coordinator_connection().await;

let app = Router::new().route("/", get(|| async { "OK" }));
let addr = SocketAddr::from_str(&self.health_listener_addr)
.expect("Failed to parse socket address");
let server = axum::Server::bind(&addr).serve(app.into_make_service());
let health_check_server_task = tokio::spawn(server);

let mut provers = JoinSet::new();
let self_arc = std::sync::Arc::new(self);
for i in 0..self_arc.n_workers {
let self_clone = std::sync::Arc::clone(&self_arc);
provers.spawn(async move {
self_clone.working_loop(i).await;
});
}

tokio::select! {
_ = health_check_server_task => {},
_ = async { while provers.join_next().await.is_some() {} } => {},
}
}

async fn test_coordinator_connection(&self) {
self.coordinator_clients[0]
.get_token(true)
Expand Down
2 changes: 1 addition & 1 deletion src/prover/proving_service.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use super::ProofType;
use async_trait::async_trait;

#[async_trait]
#[async_trait(?Send)]
pub trait ProvingService {
fn is_local(&self) -> bool;
async fn get_vks(&self, req: GetVkRequest) -> GetVkResponse;
Expand Down

0 comments on commit 7ed5b8a

Please sign in to comment.