diff --git a/sdk/src/lib.rs b/sdk/src/lib.rs index 489e18db14..94d0f2d4d5 100644 --- a/sdk/src/lib.rs +++ b/sdk/src/lib.rs @@ -100,6 +100,8 @@ impl ProverClient { } // Generate a proof remotely using the Succinct Network in an async context. + // Note: If the simulation of the runtime is expensive for user programs, we can add an optional + // flag to skip it. This shouldn't be the case for the vast majority of user programs. pub async fn prove_remote_async( &self, elf: &[u8], @@ -110,6 +112,12 @@ impl ProverClient { .as_ref() .ok_or_else(|| anyhow::anyhow!("Network client not initialized"))?; + // Execute the runtime before creating the proof request. + let mut runtime = Runtime::new(Program::from(elf)); + runtime.write_vecs(&stdin.buffer); + runtime.run(); + println!("Simulation complete."); + let proof_id = client.create_proof(elf, &stdin).await?; println!("proof_id: {:?}", proof_id);