Skip to content

Commit

Permalink
Address review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
slowli committed Oct 28, 2024
1 parent 1112918 commit 293a71e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
5 changes: 2 additions & 3 deletions core/lib/multivm/src/versions/vm_fast/evm_deploy_tracer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,8 @@ impl EvmDeployTracer {
impl Tracer for EvmDeployTracer {
#[inline(always)]
fn after_instruction<OP: OpcodeType, S: GlobalStateInterface>(&mut self, state: &mut S) {
if !matches!(OP::VALUE, Opcode::FarCall(CallingMode::Normal)) {
return;
if matches!(OP::VALUE, Opcode::FarCall(CallingMode::Normal)) {
self.handle_far_call(state);
}
self.handle_far_call(state);
}
}
7 changes: 3 additions & 4 deletions core/lib/multivm/src/versions/vm_fast/vm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -590,8 +590,8 @@ impl<S: ReadStorage, Tr: Tracer + Default + 'static> VmInterface for Vm<S, Tr> {
EvmDeployTracer::new(self.world.dynamic_bytecodes.clone()),
);
let result = self.run(execution_mode, &mut full_tracer, track_refunds);
let (full_tracer, _) = full_tracer;
*tracer = full_tracer.0; // place the tracer back
let ((external_tracer, circuits_tracer), _) = full_tracer;
*tracer = external_tracer; // place the tracer back

let ignore_world_diff =
matches!(execution_mode, VmExecutionMode::OneTx) && result.should_ignore_vm_logs();
Expand Down Expand Up @@ -662,7 +662,7 @@ impl<S: ReadStorage, Tr: Tracer + Default + 'static> VmInterface for Vm<S, Tr> {
gas_remaining,
computational_gas_used: gas_used, // since 1.5.0, this always has the same value as `gas_used`
pubdata_published: result.pubdata_published,
circuit_statistic: full_tracer.1.circuit_statistic(),
circuit_statistic: circuits_tracer.circuit_statistic(),
contracts_used: 0,
cycles_used: 0,
total_log_queries: 0,
Expand Down Expand Up @@ -888,7 +888,6 @@ impl<S: ReadStorage, T: Tracer> zksync_vm2::StorageInterface for World<S, T> {
/// - `decommit()` is called during far calls, which obtains address -> bytecode hash mapping beforehand.
///
/// Thus, if storage is reverted correctly, additional EVM bytecodes occupy the cache, but are unreachable.
// FIXME: can it be used for DoS?
impl<S: ReadStorage, T: Tracer> zksync_vm2::World<T> for World<S, T> {
fn decommit(&mut self, hash: U256) -> Program<T, Self> {
self.program_cache
Expand Down

0 comments on commit 293a71e

Please sign in to comment.