aboutsummaryrefslogtreecommitdiff
path: root/zkvms/risc0
diff options
context:
space:
mode:
authorKamen Mladenov <kamen@syndamia.com>2025-04-30 17:25:15 +0300
committerKamen Mladenov <kamen@syndamia.com>2025-05-02 15:32:54 +0300
commiteefb57f2c035be1a398f630dd8cfed8b4ccbe348 (patch)
tree598cc4a5d784addf59bad7323018260b977ed6c2 /zkvms/risc0
parent400c41f4f408aee6002489633914cd74ca888ff4 (diff)
downloadzkVMs-benchmarks-eefb57f2c035be1a398f630dd8cfed8b4ccbe348.tar
zkVMs-benchmarks-eefb57f2c035be1a398f630dd8cfed8b4ccbe348.tar.gz
zkVMs-benchmarks-eefb57f2c035be1a398f630dd8cfed8b4ccbe348.zip
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.
Diffstat (limited to 'zkvms/risc0')
-rw-r--r--zkvms/risc0/host/src/main.rs6
1 files changed, 6 insertions, 0 deletions
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));