Skip to content

Commit

Permalink
chore: return machine id list
Browse files Browse the repository at this point in the history
  • Loading branch information
eigmax committed Jul 31, 2024
1 parent fc2429f commit a021490
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions zkvm/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ fn generate_verifier<F: FieldElement>(
output_path: &str,
task: &str,
chunk_idx: usize,
) -> Result<()> {
) -> Result<Vec<usize>> {
let buf = Vec::new();
let mut vw = BufWriter::new(buf);
pipeline = pipeline.with_backend(
Expand All @@ -92,6 +92,7 @@ fn generate_verifier<F: FieldElement>(
let pils = split::split_pil((*full_pil).clone());

log::debug!("Generate verifier for each proof");
let mut ids = vec![];
for (idx, (vk, machine_proof)) in cvk
.verification_keys
.iter()
Expand Down Expand Up @@ -174,8 +175,9 @@ fn generate_verifier<F: FieldElement>(
.unwrap();
writer.write_fmt(format_args!("{}", str_ver))?;
}
ids.push(idx);
}
Ok(())
Ok(ids)
}

pub fn zkvm_execute_and_prove(task: &str, suite_json: String, output_path: &str) -> Result<()> {
Expand Down Expand Up @@ -303,7 +305,7 @@ pub fn zkvm_prove_only(
start_of_shutdown_routine: u64,
i: usize,
output_path: &str,
) -> Result<()> {
) -> Result<Vec<usize>> {
log::debug!("Compiling Rust...");
let asm_file_path = Path::new(output_path).join(format!("{}.asm", task));

Expand All @@ -327,15 +329,15 @@ pub fn zkvm_prove_only(
)
.unwrap();

generate_verifier(pipeline, output_path, task, i)?;
let ids = generate_verifier(pipeline, output_path, task, i)?;

let duration = start.elapsed();
log::debug!(
"Witness generation and proof computation took: {:?}",
duration
);

Ok(())
Ok(ids)
}

pub fn rust_continuation<F: FieldElement, PipelineCallback, E>(
Expand Down

0 comments on commit a021490

Please sign in to comment.