aboutsummaryrefslogtreecommitdiff
path: root/zkvms/risc0
diff options
context:
space:
mode:
Diffstat (limited to 'zkvms/risc0')
-rw-r--r--zkvms/risc0/host/src/main.rs44
1 files changed, 20 insertions, 24 deletions
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));
},
}
}
-