Skip to content

Commit

Permalink
Bump zksync_vm2 revision
Browse files Browse the repository at this point in the history
  • Loading branch information
slowli committed Sep 10, 2024
1 parent fc2ee61 commit 29bb933
Show file tree
Hide file tree
Showing 12 changed files with 60 additions and 60 deletions.
42 changes: 21 additions & 21 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 @@ -215,7 +215,7 @@ zk_evm_1_4_1 = { package = "zk_evm", version = "0.141.0" }
zk_evm_1_5_0 = { package = "zk_evm", version = "=0.150.4" }

# New VM; pinned to a specific commit because of instability
vm2 = { git = "https://github.com/matter-labs/vm2.git", rev = "4ef15d46410ffc11744771a3a6c7c09dd9470c90" }
zksync_vm2 = { git = "https://github.com/matter-labs/vm2.git", rev = "bb5df560b3c063616dbe2ff30ef95ae48124d2f9" } # FIXME: use commit from main branch

# Consensus dependencies.
zksync_concurrency = "=0.1.0-rc.11"
Expand Down
2 changes: 1 addition & 1 deletion core/lib/multivm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ zk_evm_1_4_1.workspace = true
zk_evm_1_4_0.workspace = true
zk_evm_1_3_3.workspace = true
zk_evm_1_3_1.workspace = true
vm2.workspace = true
zksync_vm2.workspace = true

circuit_sequencer_api_1_3_3.workspace = true
circuit_sequencer_api_1_4_0.workspace = true
Expand Down
2 changes: 1 addition & 1 deletion core/lib/multivm/src/versions/vm_fast/circuits_tracer.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use circuit_sequencer_api_1_5_0::{geometry_config::get_geometry_config, toolset::GeometryConfig};
use vm2::{CycleStats, Opcode, OpcodeType, StateInterface, Tracer};
use zksync_vm2::{CycleStats, Opcode, OpcodeType, StateInterface, Tracer};
use zksync_vm_interface::CircuitStatistic;

use crate::vm_latest::tracers::circuits_capacity::*;
Expand Down
2 changes: 1 addition & 1 deletion core/lib/multivm/src/versions/vm_fast/events.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use vm2::Event;
use zksync_types::{L1BatchNumber, H256};
use zksync_utils::h256_to_account_address;
use zksync_vm2::Event;

use crate::interface::VmEvent;

Expand Down
6 changes: 3 additions & 3 deletions core/lib/multivm/src/versions/vm_fast/glue.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ use zksync_utils::u256_to_h256;

use crate::glue::GlueFrom;

impl GlueFrom<&vm2::L2ToL1Log> for SystemL2ToL1Log {
fn glue_from(value: &vm2::L2ToL1Log) -> Self {
let vm2::L2ToL1Log {
impl GlueFrom<&zksync_vm2::L2ToL1Log> for SystemL2ToL1Log {
fn glue_from(value: &zksync_vm2::L2ToL1Log) -> Self {
let zksync_vm2::L2ToL1Log {
key,
value,
is_service,
Expand Down
2 changes: 1 addition & 1 deletion core/lib/multivm/src/versions/vm_fast/tests/bootloader.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use assert_matches::assert_matches;
use vm2::HeapId;
use zksync_types::U256;
use zksync_vm2::HeapId;

use crate::{
interface::{ExecutionResult, Halt, TxExecutionMode, VmExecutionMode, VmInterfaceExt},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ impl TransactionTestInfo {
struct VmStateDump<S> {
state: S,
storage_writes: Vec<((H160, U256), U256)>,
events: Box<[vm2::Event]>,
events: Box<[zksync_vm2::Event]>,
}

impl<S: PartialEq> PartialEq for VmStateDump<S> {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
use std::{cell::RefCell, rc::Rc};

use vm2::WorldDiff;
use zksync_contracts::BaseSystemContracts;
use zksync_test_account::{Account, TxType};
use zksync_types::{
Expand All @@ -13,6 +12,7 @@ use zksync_types::{
StorageKey, U256,
};
use zksync_utils::{bytecode::hash_bytecode, u256_to_h256};
use zksync_vm2::WorldDiff;

use crate::{
interface::{
Expand Down
2 changes: 1 addition & 1 deletion core/lib/multivm/src/versions/vm_fast/tests/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ use std::collections::BTreeMap;

use ethabi::Contract;
use once_cell::sync::Lazy;
use vm2::{HeapId, StateInterface};
use zksync_contracts::{
load_contract, read_bytecode, read_zbin_bytecode, BaseSystemContracts, SystemContractCode,
};
Expand All @@ -11,6 +10,7 @@ use zksync_types::{
U256,
};
use zksync_utils::{bytecode::hash_bytecode, bytes_to_be_words, h256_to_u256, u256_to_h256};
use zksync_vm2::{HeapId, StateInterface};

use crate::interface::storage::ReadStorage;

Expand Down
14 changes: 7 additions & 7 deletions core/lib/multivm/src/versions/vm_fast/vm.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
use std::{collections::HashMap, fmt};

use vm2::{
decode::decode_program, CallframeInterface, ExecutionEnd, FatPointer, HeapId, Program,
Settings, StateInterface, Tracer, VirtualMachine,
};
use zk_evm_1_5_0::zkevm_opcode_defs::system_params::INITIAL_FRAME_FORMAL_EH_LOCATION;
use zksync_contracts::SystemContractCode;
use zksync_types::{
Expand All @@ -19,6 +15,10 @@ use zksync_types::{
L2_BASE_TOKEN_ADDRESS, U256,
};
use zksync_utils::{bytecode::hash_bytecode, h256_to_u256, u256_to_h256};
use zksync_vm2::{
decode::decode_program, CallframeInterface, ExecutionEnd, FatPointer, HeapId, Program,
Settings, StateInterface, Tracer, VirtualMachine,
};

use super::{
bootloader_state::{BootloaderState, BootloaderStateSnapshot},
Expand Down Expand Up @@ -655,7 +655,7 @@ impl<S: ReadStorage> VmInterface for Vm<S> {

#[derive(Debug)]
struct VmSnapshot {
vm_snapshot: vm2::Snapshot,
vm_snapshot: zksync_vm2::Snapshot,
bootloader_snapshot: BootloaderStateSnapshot,
gas_for_account_validation: u32,
}
Expand Down Expand Up @@ -765,7 +765,7 @@ impl<S: ReadStorage, T: Tracer> World<S, T> {
}
}

impl<S: ReadStorage, T: Tracer> vm2::StorageInterface for World<S, T> {
impl<S: ReadStorage, T: Tracer> zksync_vm2::StorageInterface for World<S, T> {
fn read_storage(&mut self, contract: H160, key: U256) -> Option<U256> {
let key = &StorageKey::new(AccountTreeId::new(contract), u256_to_h256(key));
if self.storage.is_write_initial(key) {
Expand Down Expand Up @@ -810,7 +810,7 @@ impl<S: ReadStorage, T: Tracer> vm2::StorageInterface for World<S, T> {
}
}

impl<S: ReadStorage, T: Tracer> vm2::World<T> for World<S, T> {
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
.entry(hash)
Expand Down
42 changes: 21 additions & 21 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 29bb933

Please sign in to comment.