Skip to content

Commit

Permalink
update to version that differentiates tracer stop
Browse files Browse the repository at this point in the history
  • Loading branch information
joonazan committed Oct 31, 2024
1 parent 1983bd1 commit c25c17a
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 8 deletions.
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ zk_evm_1_4_1 = { package = "zk_evm", version = "0.141" }
zk_evm_1_5_0 = { package = "zk_evm", version = "=0.150.7" }

# New VM; pinned to a specific commit because of instability
zksync_vm2 = { git = "https://github.com/matter-labs/vm2.git", rev = "fd27994d1d88ea4868d9ad74746bf274b97126d1" }
zksync_vm2 = { git = "https://github.com/matter-labs/vm2.git", rev = "edb7c4538414c7e587fad3dd73835fb536af2e56" }

# Consensus dependencies.
zksync_concurrency = "=0.5.0"
Expand Down
6 changes: 3 additions & 3 deletions core/lib/multivm/src/versions/vm_fast/circuits_tracer.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use circuit_sequencer_api_1_5_0::{geometry_config::get_geometry_config, toolset::GeometryConfig};
use zksync_vm2::interface::{
CycleStats, ExecutionStatus, GlobalStateInterface, Opcode, OpcodeType, Tracer,
CycleStats, GlobalStateInterface, Opcode, OpcodeType, ShouldStop, Tracer,
};
use zksync_vm_interface::CircuitStatistic;

Expand Down Expand Up @@ -29,7 +29,7 @@ impl Tracer for CircuitsTracer {
fn after_instruction<OP: OpcodeType, S: GlobalStateInterface>(
&mut self,
_: &mut S,
) -> ExecutionStatus {
) -> ShouldStop {
self.main_vm_cycles += 1;

match OP::VALUE {
Expand Down Expand Up @@ -116,7 +116,7 @@ impl Tracer for CircuitsTracer {
}
}

ExecutionStatus::Running
ShouldStop::Continue
}

fn on_extra_prover_cycles(&mut self, stats: CycleStats) {
Expand Down
10 changes: 10 additions & 0 deletions core/lib/multivm/src/versions/vm_fast/vm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,16 @@ impl<S: ReadStorage, Tr: Tracer + Default> Vm<S, Tr> {
};
break (ExecutionResult::Halt { reason }, true);
}
ExecutionEnd::StoppedByTracer => {
break (
ExecutionResult::Halt {
reason: Halt::TracerCustom(
"Unexpectedly stopped by tracer".to_string(),
),
},
false,
);
}
};

match Hook::from_u32(hook) {
Expand Down
4 changes: 2 additions & 2 deletions prover/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit c25c17a

Please sign in to comment.