diff --git a/core/src/runtime/mod.rs b/core/src/runtime/mod.rs index d5e9363285..d7df282284 100644 --- a/core/src/runtime/mod.rs +++ b/core/src/runtime/mod.rs @@ -912,6 +912,11 @@ impl Runtime { while !self.execute() {} } + pub fn dry_run(&mut self) { + self.emit_events = false; + while !self.execute() {} + } + /// Executes up to `self.shard_batch_size` cycles of the program, returning whether the program has finished. fn execute(&mut self) -> bool { // If it's the first cycle, initialize the program. diff --git a/prover/src/utils.rs b/prover/src/utils.rs index 8daa6cb6c0..40807bd080 100644 --- a/prover/src/utils.rs +++ b/prover/src/utils.rs @@ -48,7 +48,7 @@ pub fn get_cycles(elf: &[u8], stdin: &SP1Stdin) -> u64 { let program = Program::from(elf); let mut runtime = Runtime::new(program); runtime.write_vecs(&stdin.buffer); - runtime.run(); + runtime.dry_run(); runtime.state.global_clk }