Skip to content

Commit

Permalink
feat: update multivm::vm_virtual_blocks dependency to `multivim::vm…
Browse files Browse the repository at this point in the history
…_latest` (matter-labs#220)
  • Loading branch information
aon authored Nov 23, 2023
1 parent 1b2a48e commit 7efa571
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 16 deletions.
24 changes: 10 additions & 14 deletions src/bootloader_debug.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
use std::sync::Arc;

use multivm::vm_virtual_blocks::{
constants::BOOTLOADER_HEAP_PAGE, BootloaderState, DynTracer, ExecutionEndTracer,
ExecutionProcessing, HistoryMode, SimpleMemory, VmExecutionStopReason, VmTracer, ZkSyncVmState,
use multivm::vm_latest::{
constants::BOOTLOADER_HEAP_PAGE, BootloaderState, DynTracer, HistoryMode, SimpleMemory,
VmExecutionStopReason, VmTracer, ZkSyncVmState,
};
use once_cell::sync::OnceCell;
use zksync_basic_types::U256;
Expand Down Expand Up @@ -83,7 +83,13 @@ pub struct BootloaderDebugTracer {

impl<S, H: HistoryMode> DynTracer<S, H> for BootloaderDebugTracer {}

impl<S: WriteStorage, H: HistoryMode> ExecutionProcessing<S, H> for BootloaderDebugTracer {
fn load_debug_slot<H: HistoryMode>(memory: &SimpleMemory<H>, slot: usize) -> U256 {
memory
.read_slot(BOOTLOADER_HEAP_PAGE as usize, DEBUG_START_SLOT + slot)
.value
}

impl<S: WriteStorage, H: HistoryMode> VmTracer<S, H> for BootloaderDebugTracer {
fn after_vm_execution(
&mut self,
state: &mut ZkSyncVmState<S, H>,
Expand All @@ -96,16 +102,6 @@ impl<S: WriteStorage, H: HistoryMode> ExecutionProcessing<S, H> for BootloaderDe
}
}

fn load_debug_slot<H: HistoryMode>(memory: &SimpleMemory<H>, slot: usize) -> U256 {
memory
.read_slot(BOOTLOADER_HEAP_PAGE as usize, DEBUG_START_SLOT + slot)
.value
}

impl<H: HistoryMode> ExecutionEndTracer<H> for BootloaderDebugTracer {}

impl<S: WriteStorage, H: HistoryMode> VmTracer<S, H> for BootloaderDebugTracer {}

impl BootloaderDebug {
pub fn load_from_memory<H: HistoryMode>(
memory: &SimpleMemory<H>,
Expand Down
2 changes: 1 addition & 1 deletion src/node/in_memory.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ use multivm::interface::{
ExecutionResult, L1BatchEnv, L2BlockEnv, SystemEnv, TxExecutionMode, VmExecutionMode,
VmExecutionResultAndLogs,
};
use multivm::vm_virtual_blocks::{
use multivm::vm_latest::{
constants::{BLOCK_GAS_LIMIT, BLOCK_OVERHEAD_PUBDATA, MAX_PUBDATA_PER_BLOCK},
utils::{
fee::derive_base_fee_and_gas_per_pubdata,
Expand Down
2 changes: 1 addition & 1 deletion src/node/zks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -550,7 +550,7 @@ mod tests {

let result = node.estimate_fee(mock_request).await.unwrap();

assert_eq!(result.gas_limit, U256::from(1086383));
assert_eq!(result.gas_limit, U256::from(730662));
assert_eq!(result.max_fee_per_gas, U256::from(250000000));
assert_eq!(result.max_priority_fee_per_gas, U256::from(0));
assert_eq!(result.gas_per_pubdata_limit, U256::from(4080));
Expand Down

0 comments on commit 7efa571

Please sign in to comment.