Skip to content
This repository has been archived by the owner on Nov 26, 2024. It is now read-only.

Commit

Permalink
don't recover from error if over max steps
Browse files Browse the repository at this point in the history
  • Loading branch information
tsahee committed Mar 8, 2024
1 parent ee8ce48 commit ef1ca35
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions arbitrator/prover/src/machine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1772,14 +1772,16 @@ impl Machine {
}

if let ThreadState::CoThread(recovery_pc) = self.thread_state {
self.thread_state = ThreadState::Main;
self.pc = recovery_pc;
reset_refs!();
if self.debug_info {
println!("\n{}", "switching to main thread".grey());
println!("\n{} {:?}", "next opcode: ".grey(), func.code[self.pc.inst()]);
if self.steps < Self::MAX_STEPS {
self.thread_state = ThreadState::Main;
self.pc = recovery_pc;
reset_refs!();
if self.debug_info {
println!("\n{}", "switching to main thread".grey());
println!("\n{} {:?}", "next opcode: ".grey(), func.code[self.pc.inst()]);
}
continue;
}
continue;
}
self.status = MachineStatus::Errored;
module = &mut self.modules[self.pc.module()];
Expand All @@ -1790,7 +1792,7 @@ impl Machine {
for _ in 0..n {
self.steps += 1;
if self.steps == Self::MAX_STEPS {
error!(); // TODO: make this irrecoverable
error!();
}
let inst = func.code[self.pc.inst()];
self.pc.inst += 1;
Expand Down

0 comments on commit ef1ca35

Please sign in to comment.