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_guest_io/src/main.rs | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'zkvms_guest_io') diff --git a/zkvms_guest_io/src/main.rs b/zkvms_guest_io/src/main.rs index 0e0cd37..4d9b378 100644 --- a/zkvms_guest_io/src/main.rs +++ b/zkvms_guest_io/src/main.rs @@ -34,6 +34,7 @@ struct Cli { static COMMAND_LOG_PATH: &str = "/tmp/output.log"; static METRICS_TEMP_OUTPUT_PATH: &str = "/tmp/current_metrics"; +static PROOF_SIZE_FILE_PATH: &str = "/tmp/proof_size"; fn run_command(zkvm_guest_command: &str, operation: &str) -> Result { Command::new("runexec") @@ -196,6 +197,11 @@ fn main() { .unwrap(); run[operation] = json::parse(raw_data).unwrap(); run[operation]["memory"] = get_runexec_value(&stdout, "memory", 'B').parse::().unwrap().into(); + + let proofSize = &read_to_string(PROOF_SIZE_FILE_PATH) + .ok() + .unwrap(); + run[operation]["proofSize"] = proofSize.parse::().unwrap().into(); } runs["benchmarking"].push(run); -- cgit v1.2.3