aboutsummaryrefslogtreecommitdiff
path: root/zkvms/sp1/host
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/sp1/host
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/sp1/host')
-rw-r--r--zkvms/sp1/host/src/main.rs8
1 files changed, 7 insertions, 1 deletions
diff --git a/zkvms/sp1/host/src/main.rs b/zkvms/sp1/host/src/main.rs
index 6d19000..a395247 100644
--- a/zkvms/sp1/host/src/main.rs
+++ b/zkvms/sp1/host/src/main.rs
@@ -2,6 +2,7 @@ use sp1_sdk::{EnvProver, ProverClient, SP1ProofWithPublicValues, SP1Stdin, SP1Ve
use zkvms_host_io::{
benchmarkable, foreach_input_field, read_args, Input,
RunType::{Execute, Prove, Verify},
+ output_proof_size,
};
/// The ELF (executable and linkable format) file for the Succinct RISC-V zkVM.
@@ -40,13 +41,18 @@ fn main() {
println!("Number of cycles: {}", report.total_instruction_count());
},
Prove => benchmarkable! {
- let _ = prove(&client, stdin.clone());
+ let (proof, _) = prove(&client, stdin.clone());
+
+ output_proof_size(&proof);
+
println!("Successfully generated proof!");
},
Verify => {
let (proof, vk) = prove(&client, stdin.clone());
println!("Successfully generated proof!");
+ output_proof_size(&proof);
+
benchmarkable! {
client.verify(&proof, &vk).expect("failed to verify proof");
println!("Successfully verified proof!");