From 4fd710c98d51cf3901395a54a719aea3f23c1aa9 Mon Sep 17 00:00:00 2001 From: Joonatan Saarhelo Date: Wed, 16 Oct 2024 16:59:08 +0200 Subject: [PATCH] feat: vm2 tracers can access storage --- Cargo.lock | 4 ++-- Cargo.toml | 2 +- core/lib/multivm/src/versions/vm_fast/circuits_tracer.rs | 6 +++++- core/tests/vm-benchmark/src/vm.rs | 1 + 4 files changed, 9 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 774471d3d6c3..79d00629a60e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -11322,7 +11322,7 @@ dependencies = [ [[package]] name = "zksync_vm2" version = "0.2.1" -source = "git+https://github.com/matter-labs/vm2.git?rev=a233d44bbe61dc6a758a754c3b78fe4f83e56699#a233d44bbe61dc6a758a754c3b78fe4f83e56699" +source = "git+https://github.com/matter-labs/vm2.git?rev=f27d9ff086032ab9c382e0baa7244bd247d10e49#f27d9ff086032ab9c382e0baa7244bd247d10e49" dependencies = [ "enum_dispatch", "primitive-types", @@ -11334,7 +11334,7 @@ dependencies = [ [[package]] name = "zksync_vm2_interface" version = "0.2.1" -source = "git+https://github.com/matter-labs/vm2.git?rev=a233d44bbe61dc6a758a754c3b78fe4f83e56699#a233d44bbe61dc6a758a754c3b78fe4f83e56699" +source = "git+https://github.com/matter-labs/vm2.git?rev=f27d9ff086032ab9c382e0baa7244bd247d10e49#f27d9ff086032ab9c382e0baa7244bd247d10e49" dependencies = [ "primitive-types", ] diff --git a/Cargo.toml b/Cargo.toml index 60b5628f4191..b78a430c8fa6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -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.5" } # New VM; pinned to a specific commit because of instability -zksync_vm2 = { git = "https://github.com/matter-labs/vm2.git", rev = "a233d44bbe61dc6a758a754c3b78fe4f83e56699" } +zksync_vm2 = { git = "https://github.com/matter-labs/vm2.git", rev = "f27d9ff086032ab9c382e0baa7244bd247d10e49" } # Consensus dependencies. zksync_concurrency = "=0.5.0" diff --git a/core/lib/multivm/src/versions/vm_fast/circuits_tracer.rs b/core/lib/multivm/src/versions/vm_fast/circuits_tracer.rs index b48ec7eacb0b..c52fe39a17a6 100644 --- a/core/lib/multivm/src/versions/vm_fast/circuits_tracer.rs +++ b/core/lib/multivm/src/versions/vm_fast/circuits_tracer.rs @@ -24,7 +24,11 @@ pub struct CircuitsTracer { } impl Tracer for CircuitsTracer { - fn after_instruction(&mut self, _state: &mut S) { + fn after_instruction( + &mut self, + _: &mut S, + _: &mut S::StorageInterface, + ) { self.main_vm_cycles += 1; match OP::VALUE { diff --git a/core/tests/vm-benchmark/src/vm.rs b/core/tests/vm-benchmark/src/vm.rs index 30e2321298fe..b1243770d8f3 100644 --- a/core/tests/vm-benchmark/src/vm.rs +++ b/core/tests/vm-benchmark/src/vm.rs @@ -107,6 +107,7 @@ impl BenchmarkingVmFactory for Fast >( &mut self, _: &mut S, + _: &mut S::StorageInterface, ) { self.0 += 1; }