Skip to content

Commit bf66994

Browse files
committed
initial commit
1 parent 93ba138 commit bf66994

File tree

5 files changed

+10
-29
lines changed

5 files changed

+10
-29
lines changed

core/lib/multivm/src/versions/era_vm/bootloader_state/state.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -133,11 +133,6 @@ impl BootloaderState {
133133
pub(crate) fn last_l2_block(&self) -> &BootloaderL2Block {
134134
self.l2_blocks.last().unwrap()
135135
}
136-
pub(crate) fn get_pubdata_information(&self) -> &PubdataInput {
137-
self.pubdata_information
138-
.get()
139-
.expect("Pubdata information is not set")
140-
}
141136

142137
fn last_mut_l2_block(&mut self) -> &mut BootloaderL2Block {
143138
self.l2_blocks.last_mut().unwrap()

core/lib/multivm/src/versions/era_vm/tests/get_used_contracts.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
use std::collections::HashSet;
22

3-
use itertools::Itertools;
43
use zksync_state::ReadStorage;
54
use zksync_system_constants::CONTRACT_DEPLOYER_ADDRESS;
65
use zksync_test_account::Account;

core/lib/multivm/src/versions/era_vm/tests/tester/transaction_test_info.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use era_vm::{
55
store::StorageKey,
66
};
77
use zksync_state::ReadStorage;
8-
use zksync_types::{ExecuteTransactionCommon, Transaction, H160, U256};
8+
use zksync_types::{ExecuteTransactionCommon, Transaction, U256};
99

1010
use super::VmTester;
1111
use crate::{
@@ -213,11 +213,11 @@ impl<S: ReadStorage> Vm<S> {
213213
state: VmStateDump {
214214
storage_changes: self.inner.state.storage_changes().clone(),
215215
transient_storage: self.inner.state.transient_storage().clone(),
216-
l2_to_l1_logs: self.inner.state.l2_to_l1_logs().clone(),
217-
events: self.inner.state.events().clone(),
216+
l2_to_l1_logs: self.inner.state.l2_to_l1_logs().to_vec(),
217+
events: self.inner.state.events().to_vec(),
218218
pubdata: self.inner.state.pubdata().clone(),
219-
pubdata_costs: self.inner.state.pubdata_costs().clone(),
220-
refunds: self.inner.state.refunds().clone(),
219+
pubdata_costs: self.inner.state.pubdata_costs().to_vec(),
220+
refunds: self.inner.state.refunds().to_vec(),
221221
decommitted_hashes: self.inner.state.decommitted_hashes().clone(),
222222
},
223223
}

core/lib/multivm/src/versions/era_vm/tests/utils.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,6 @@ use crate::vm_latest::CurrentExecutionState;
1919
pub(crate) static BASE_SYSTEM_CONTRACTS: Lazy<BaseSystemContracts> =
2020
Lazy::new(BaseSystemContracts::load_from_disk);
2121

22-
pub fn lambda_storage_key_to_zk(key: StorageKey) -> ZKStorageKey {
23-
ZKStorageKey::new(AccountTreeId::new(key.address), u256_to_h256(key.key))
24-
}
25-
2622
pub fn zk_storage_key_to_lambda(key: &ZKStorageKey) -> StorageKey {
2723
StorageKey {
2824
address: key.address().clone(),

core/lib/multivm/src/versions/era_vm/vm.rs

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -352,15 +352,6 @@ impl<S: ReadStorage + 'static> Vm<S> {
352352
}
353353
}
354354

355-
fn get_vm_hook_params(&self, heap: &era_vm::execution::Heap) -> Vec<U256> {
356-
(get_vm_hook_start_position_latest()..get_vm_hook_start_position_latest() + 2)
357-
.map(|word| {
358-
let res = heap.read((word * 32) as u32);
359-
res
360-
})
361-
.collect()
362-
}
363-
364355
pub(crate) fn insert_bytecodes<'a>(&mut self, bytecodes: impl IntoIterator<Item = &'a [u8]>) {
365356
for code in bytecodes {
366357
let mut program_code = vec![];
@@ -634,16 +625,16 @@ impl<S: ReadStorage + 'static> VmInterface for Vm<S> {
634625
.map(|log| log.into_system_log())
635626
.collect(),
636627
user_l2_to_l1_logs,
637-
storage_refunds: state.refunds().clone(),
638-
pubdata_costs: state.pubdata_costs().clone(),
628+
storage_refunds: state.refunds().to_vec(),
629+
pubdata_costs: state.pubdata_costs().to_vec(),
639630
}
640631
}
641632

642633
fn inspect_transaction_with_bytecode_compression(
643634
&mut self,
644-
tracer: Self::TracerDispatcher,
645-
tx: zksync_types::Transaction,
646-
with_compression: bool,
635+
_tracer: Self::TracerDispatcher,
636+
_tx: zksync_types::Transaction,
637+
_with_compression: bool,
647638
) -> (
648639
Result<(), crate::interface::BytecodeCompressionError>,
649640
VmExecutionResultAndLogs,

0 commit comments

Comments
 (0)