diff --git a/Cargo.lock b/Cargo.lock index 66e165eb..2a2d7e74 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2578,7 +2578,6 @@ checksum = "2266fcb904c50fb17fda4c9a751a1715629ecf8b21f4c9d78b4890fb71525d71" [[package]] name = "vm2" version = "0.1.0" -source = "git+https://github.com/matter-labs/vm2#33d7d7a6775a20a7527d4822814237d6e61c761c" dependencies = [ "arbitrary", "enum_dispatch", diff --git a/Cargo.toml b/Cargo.toml index 7a574496..89bff361 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -7,3 +7,6 @@ members = [ "fuzzer" ] resolver = "2" + +[patch."https://github.com/matter-labs/vm2"] +vm2 = {path = "../vm2"} diff --git a/compiler_tester/src/vm/eravm/vm2_adapter.rs b/compiler_tester/src/vm/eravm/vm2_adapter.rs index d3305e52..d82c9561 100644 --- a/compiler_tester/src/vm/eravm/vm2_adapter.rs +++ b/compiler_tester/src/vm/eravm/vm2_adapter.rs @@ -109,7 +109,7 @@ pub fn run_vm( storage_changes = vm .world - .get_storage_changes() + .get_storage_state() .iter() .map(|(&(address, key), value)| { (StorageKey { address, key }, H256::from_uint(value)) @@ -117,7 +117,7 @@ pub fn run_vm( .collect::>(); deployed_contracts = vm .world - .get_storage_changes() + .get_storage_state() .iter() .filter_map(|((address, key), value)| { if *address == *zkevm_assembly::zkevm_opcode_defs::system_params::DEPLOYER_SYSTEM_CONTRACT_ADDRESS { @@ -211,6 +211,22 @@ impl World for TestWorld { .map(|h| h.into_uint()) .unwrap_or(U256::zero()) } + + fn cost_of_writing_storage( + &mut self, + contract: web3::types::H160, + key: U256, + new_value: U256, + ) -> u32 { + 0 + } + + fn is_free_storage_slot(&self, contract: &web3::types::H160, key: &U256) -> bool { + self.storage.contains_key(&StorageKey { + address: *contract, + key: *key, + }) + } } fn chunk_return_data(bytes: &[u8]) -> Vec {