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/risc0/host/src/main.rs | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'zkvms/risc0') diff --git a/zkvms/risc0/host/src/main.rs b/zkvms/risc0/host/src/main.rs index e61692b..78fd164 100644 --- a/zkvms/risc0/host/src/main.rs +++ b/zkvms/risc0/host/src/main.rs @@ -4,6 +4,7 @@ use risc0_zkvm::{default_executor, default_prover, ExecutorEnv, Receipt}; use zkvms_host_io::{ benchmarkable, foreach_input_field, read_args, Input, Output, RunType::{Execute, Prove, Verify}, + output_proof_size, }; // https://github.com/risc0/risc0/blob/881e512732eca72849b2d0e263a1242aba3158af/risc0/build/src/lib.rs#L280-L284 @@ -54,6 +55,9 @@ fn main() { // ExecutorEnv does not derive Clone let env = build_env(&run_info.input); let receipt = prove(env); + + output_proof_size(&receipt); + println!("Output from journal: {:?}", journal(receipt)); }, Verify => benchmarkable! { @@ -64,6 +68,8 @@ fn main() { let env = build_env(&run_info.input); let receipt = prove(env); + output_proof_size(&receipt); + let receipt = receipt.clone(); receipt.verify(guest_id.clone()).unwrap(); println!("Output from verify: {:?}", journal(receipt)); -- cgit v1.2.3