From 08449cd7bac19e36dad0a6dbfa737bc85478d1b8 Mon Sep 17 00:00:00 2001 From: Kevaundray Wedderburn Date: Sun, 11 May 2025 23:37:55 +0100 Subject: [PATCH] explicitly use cpu prover --- crates/ere-sp1/src/lib.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/crates/ere-sp1/src/lib.rs b/crates/ere-sp1/src/lib.rs index d24f63c..2408f26 100644 --- a/crates/ere-sp1/src/lib.rs +++ b/crates/ere-sp1/src/lib.rs @@ -1,7 +1,7 @@ #![cfg_attr(not(test), warn(unused_crate_dependencies))] use compile::compile_sp1_program; -use sp1_sdk::{ProverClient, SP1ProofWithPublicValues, SP1Stdin}; +use sp1_sdk::{Prover, ProverClient, SP1ProofWithPublicValues, SP1Stdin}; use thiserror::Error; use tracing::info; use zkvm_interface::{Compiler, ProgramExecutionReport, ProgramProvingReport, zkVM}; @@ -68,7 +68,7 @@ impl zkVM for EreSP1 { inputs: &zkvm_interface::Input, ) -> Result { // TODO: This is expensive, should move it out and make the struct stateful - let client = ProverClient::from_env(); + let client = ProverClient::builder().cpu().build(); let mut stdin = SP1Stdin::new(); for input in inputs.chunked_iter() { @@ -91,7 +91,9 @@ impl zkVM for EreSP1 { ) -> Result<(Vec, zkvm_interface::ProgramProvingReport), Self::Error> { info!("Generating proof…"); - let client = ProverClient::from_env(); + // TODO: This is expensive, should move it out and make the struct stateful + let client = ProverClient::builder().cpu().build(); + // TODO: This can also be cached let (pk, _vk) = client.setup(&program_bytes); let mut stdin = SP1Stdin::new();