From 6a310e1ae93acb0cf8943406322b6d01249a4ae4 Mon Sep 17 00:00:00 2001 From: Kamen Mladenov Date: Mon, 10 Feb 2025 16:00:55 +0200 Subject: fix(zkvms/risc0): Revert changes to benchmark only the relevant function calls --- zkvms/risc0/host/src/main.rs | 44 ++++++++++++++++++++------------------------ 1 file changed, 20 insertions(+), 24 deletions(-) (limited to 'zkvms') diff --git a/zkvms/risc0/host/src/main.rs b/zkvms/risc0/host/src/main.rs index 6b255bd..c214c4e 100644 --- a/zkvms/risc0/host/src/main.rs +++ b/zkvms/risc0/host/src/main.rs @@ -35,42 +35,38 @@ fn main() { let run_info = read_args(); match run_info.run_type { - Execute => { + Execute => benchmarkable! { + // ExecutorEnv does not derive Clone let env = build_env(&run_info.input); let exec = default_executor(); - benchmarkable! { - let output = default_executor() - .execute(env, HELLO_GUEST_ELF) - .unwrap() - .receipt_claim - .unwrap() - .output - .value() - .unwrap(); - println!("{:#?}", output); - } + let output = default_executor() + .execute(env, HELLO_GUEST_ELF) + .unwrap() + .receipt_claim + .unwrap() + .output + .value() + .unwrap(); + println!("{:#?}", output); }, - Prove => { + Prove => benchmarkable! { + // ExecutorEnv does not derive Clone let env = build_env(&run_info.input); - - benchmarkable! { - let receipt = prove(env); - println!("Output from journal: {:?}", journal(receipt)); - } + let receipt = prove(env); + println!("Output from journal: {:?}", journal(receipt)); }, - Verify => { + Verify => benchmarkable!{ // https://github.com/risc0/risc0/blob/881e512732eca72849b2d0e263a1242aba3158af/risc0/build/src/lib.rs#L197-L199 let guest_id: Digest = Digest::from_hex(HELLO_GUEST_ID).unwrap(); + // ExecutorEnv does not derive Clone let env = build_env(&run_info.input); let receipt = prove(env); - benchmarkable! { - receipt.verify(guest_id).unwrap(); - println!("Output from verify: {:?}", journal(receipt)); - } + let receipt = receipt.clone(); + receipt.verify(guest_id.clone()).unwrap(); + println!("Output from verify: {:?}", journal(receipt)); }, } } - -- cgit v1.2.3