From eefb57f2c035be1a398f630dd8cfed8b4ccbe348 Mon Sep 17 00:00:00 2001 From: Kamen Mladenov Date: Wed, 30 Apr 2025 17:25:15 +0300 Subject: feat(zkvms_guest_io): Output proof size In each zkVM we'll write the size to /tmp/proof_size and then guest_io will read that value and place it inside our metrics output. This is not the most elegant, and in certain zkVMs the file output is a part of the benchmark timing, but it will have to do. --- zkvms/zkwasm/host/src/main.rs | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'zkvms/zkwasm') diff --git a/zkvms/zkwasm/host/src/main.rs b/zkvms/zkwasm/host/src/main.rs index 288c3a5..6a23504 100644 --- a/zkvms/zkwasm/host/src/main.rs +++ b/zkvms/zkwasm/host/src/main.rs @@ -5,6 +5,7 @@ use zkvms_host_io::{ PrivateInput, PublicInput, RunType::{Execute, Prove, Verify}, RunWith, + output_proof_size_raw, }; static PUBLIC_INPUT_PATH: &str = "public_input.bin"; @@ -94,6 +95,9 @@ fn main() { .arg("--public").arg(public_input.clone()) .arg("--private").arg(private_input.clone()) .arg("--output").arg(output.clone())); + + let proofSize = std::fs::metadata(output.clone() + "/prog.0.transcript.data").unwrap().len(); + output_proof_size_raw(proofSize as usize); }, Verify => { run(zkwasm_command("prove") @@ -104,6 +108,9 @@ fn main() { .arg("--output") .arg(output.clone())); + let proofSize = std::fs::metadata(output.clone() + "/prog.0.transcript.data").unwrap().len(); + output_proof_size_raw(proofSize as usize); + benchmarkable! { run(Command::new("zkwasm-cli") .arg("--params").arg(params.clone()) -- cgit v1.2.3