-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Mirrors branch jms-vm-version from private at 09453a34e8c66a8ea67f2f2…
…b459c7a6d8b3ecae8
- Loading branch information
Showing
130 changed files
with
10,373 additions
and
561 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,6 @@ name = "db_test_macro" | |
version = "0.1.0" | ||
authors = ["The Matter Labs Team <[email protected]>"] | ||
edition = "2018" | ||
license = "MIT OR Apache-2.0" | ||
|
||
[lib] | ||
proc-macro = true | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,43 +1,48 @@ | ||
use crate::glue::{GlueFrom, GlueInto}; | ||
|
||
pub trait HistoryMode: Default + GlueInto<Self::VmM6Mode> + GlueInto<Self::Vm1_3_2Mode> { | ||
pub trait HistoryMode: | ||
Default | ||
+ GlueInto<Self::VmM6Mode> | ||
+ GlueInto<Self::Vm1_3_2Mode> | ||
+ GlueInto<Self::VmVirtualBlocksMode> | ||
{ | ||
type VmM6Mode: vm_m6::HistoryMode; | ||
type Vm1_3_2Mode: vm_1_3_2::HistoryMode; | ||
type VmVirtualBlocksMode: vm_1_3_2::HistoryMode; | ||
type VmVirtualBlocksMode: vm_virtual_blocks::HistoryMode; | ||
} | ||
|
||
impl GlueFrom<vm_1_3_2::HistoryEnabled> for vm_m6::HistoryEnabled { | ||
fn glue_from(_: vm_1_3_2::HistoryEnabled) -> Self { | ||
impl GlueFrom<vm_virtual_blocks::HistoryEnabled> for vm_m6::HistoryEnabled { | ||
fn glue_from(_: vm_virtual_blocks::HistoryEnabled) -> Self { | ||
Self | ||
} | ||
} | ||
|
||
// impl GlueFrom<vm_1_3_2::HistoryEnabled> for vm_1_3_2::HistoryEnabled { | ||
// fn glue_from(_: vm_1_3_2::HistoryEnabled) -> Self { | ||
// Self | ||
// } | ||
// } | ||
impl GlueFrom<vm_virtual_blocks::HistoryEnabled> for vm_1_3_2::HistoryEnabled { | ||
fn glue_from(_: vm_virtual_blocks::HistoryEnabled) -> Self { | ||
Self | ||
} | ||
} | ||
|
||
impl GlueFrom<vm_1_3_2::HistoryDisabled> for vm_m6::HistoryDisabled { | ||
fn glue_from(_: vm_1_3_2::HistoryDisabled) -> Self { | ||
impl GlueFrom<vm_virtual_blocks::HistoryDisabled> for vm_m6::HistoryDisabled { | ||
fn glue_from(_: vm_virtual_blocks::HistoryDisabled) -> Self { | ||
Self | ||
} | ||
} | ||
|
||
// impl GlueFrom<vm_1_3_2::HistoryDisabled> for vm_1_3_2::HistoryDisabled { | ||
// fn glue_from(_: vm_1_3_2::HistoryDisabled) -> Self { | ||
// Self | ||
// } | ||
// } | ||
impl GlueFrom<vm_virtual_blocks::HistoryDisabled> for vm_1_3_2::HistoryDisabled { | ||
fn glue_from(_: vm_virtual_blocks::HistoryDisabled) -> Self { | ||
Self | ||
} | ||
} | ||
|
||
impl HistoryMode for vm_1_3_2::HistoryEnabled { | ||
impl HistoryMode for vm_virtual_blocks::HistoryEnabled { | ||
type VmM6Mode = vm_m6::HistoryEnabled; | ||
type Vm1_3_2Mode = vm_1_3_2::HistoryEnabled; | ||
type VmVirtualBlocksMode = vm_1_3_2::HistoryEnabled; | ||
type VmVirtualBlocksMode = vm_virtual_blocks::HistoryEnabled; | ||
} | ||
|
||
impl HistoryMode for vm_1_3_2::HistoryDisabled { | ||
impl HistoryMode for vm_virtual_blocks::HistoryDisabled { | ||
type VmM6Mode = vm_m6::HistoryDisabled; | ||
type Vm1_3_2Mode = vm_1_3_2::HistoryDisabled; | ||
type VmVirtualBlocksMode = vm_1_3_2::HistoryDisabled; | ||
type VmVirtualBlocksMode = vm_virtual_blocks::HistoryDisabled; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
use crate::glue::tracer::IntoVmVirtualBlocksTracer; | ||
use vm_latest::{CallTracer, StorageInvocations, ValidationTracer}; | ||
use zksync_state::WriteStorage; | ||
|
||
impl<S, H> IntoVmVirtualBlocksTracer<S, H> for StorageInvocations | ||
where | ||
H: vm_virtual_blocks::HistoryMode, | ||
S: WriteStorage, | ||
{ | ||
fn vm_virtual_blocks(&self) -> Box<dyn vm_virtual_blocks::VmTracer<S, H>> { | ||
Box::new(vm_virtual_blocks::StorageInvocations::new(self.limit)) | ||
} | ||
} | ||
|
||
impl<S, H> IntoVmVirtualBlocksTracer<S, H> for CallTracer | ||
where | ||
H: vm_virtual_blocks::HistoryMode + 'static, | ||
S: WriteStorage, | ||
{ | ||
fn vm_virtual_blocks(&self) -> Box<dyn vm_virtual_blocks::VmTracer<S, H>> { | ||
Box::new(vm_virtual_blocks::CallTracer::new( | ||
self.result.clone(), | ||
H::default(), | ||
)) | ||
} | ||
} | ||
|
||
impl<S, H> IntoVmVirtualBlocksTracer<S, H> for ValidationTracer | ||
where | ||
H: vm_virtual_blocks::HistoryMode + 'static, | ||
S: WriteStorage, | ||
{ | ||
fn vm_virtual_blocks(&self) -> Box<dyn vm_virtual_blocks::VmTracer<S, H>> { | ||
let params = self.params(); | ||
Box::new(vm_virtual_blocks::ValidationTracer::new( | ||
vm_virtual_blocks::ValidationTracerParams { | ||
user_address: params.user_address, | ||
paymaster_address: params.paymaster_address, | ||
trusted_slots: params.trusted_slots, | ||
trusted_addresses: params.trusted_addresses, | ||
trusted_address_slots: params.trusted_address_slots, | ||
computational_gas_limit: params.computational_gas_limit, | ||
}, | ||
self.result.clone(), | ||
)) | ||
} | ||
} |
Oops, something went wrong.