Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Era vm integration bench #241

Open
wants to merge 7 commits into
base: era_vm_integration_v2
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions core/lib/multivm/src/versions/era_vm/hook.rs
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
#[derive(Debug)]
pub(crate) enum Hook {
AccountValidationEntered,
PaymasterValidationEntered,
AccountValidationExited,
ValidationStepEnded,
TxHasEnded,
DebugLog,
DebugReturnData,
NearCallCatch,
AskOperatorForRefund,
NotifyAboutRefund,
PostResult,
FinalBatchInfo,
PubdataRequested,
}

impl Hook {
Expand All @@ -18,15 +21,18 @@ impl Hook {
pub fn from_u32(hook: u32) -> Self {
match hook {
0 => Hook::AccountValidationEntered,
1 => Hook::PaymasterValidationEntered,
2 => Hook::AccountValidationExited,
3 => Hook::ValidationStepEnded,
4 => Hook::TxHasEnded,
5 => Hook::DebugLog,
6 => Hook::DebugReturnData,
7 => Hook::NearCallCatch,
8 => Hook::AskOperatorForRefund,
9 => Hook::NotifyAboutRefund,
10 => Hook::PostResult,
11 => Hook::FinalBatchInfo,
12 => Hook::PubdataRequested,
_ => panic!("Unknown hook {}", hook),
}
}
Expand Down
3 changes: 3 additions & 0 deletions core/lib/multivm/src/versions/era_vm/vm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,9 @@ impl<S: ReadStorage + 'static> Vm<S> {
Hook::ValidationStepEnded => {
// println!("VALIDATION STEP ENDED");
}
Hook::PaymasterValidationEntered => {}
Hook::PubdataRequested => {}
Hook::NearCallCatch => {}
Hook::AccountValidationExited => {
// println!("ACCOUNT VALIDATION EXITED");
}
Expand Down
10 changes: 5 additions & 5 deletions core/tests/vm-benchmark/benches/criterion.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,17 @@ use criterion::{
use zksync_types::Transaction;
use zksync_vm_benchmark_harness::{
cut_to_allowed_bytecode_size, get_deploy_tx, get_heavy_load_test_tx, get_load_test_deploy_tx,
get_load_test_tx, get_realistic_load_test_tx, BenchmarkingVm, BenchmarkingVmFactory, Fast, Lambda,
Legacy, LoadTestParams,
get_load_test_tx, get_realistic_load_test_tx, BenchmarkingVm, BenchmarkingVmFactory, Fast,
Lambda, Legacy, LoadTestParams,
};

const SAMPLE_SIZE: usize = 20;
const SAMPLE_SIZE: usize = 30;

fn benches_in_folder<VM: BenchmarkingVmFactory, const FULL: bool>(c: &mut Criterion) {
let mut group = c.benchmark_group(VM::LABEL.as_str());
group
.sample_size(SAMPLE_SIZE)
.measurement_time(Duration::from_secs(10));
.measurement_time(Duration::from_secs(12));

for path in std::fs::read_dir("deployment_benchmarks").unwrap() {
let path = path.unwrap().path();
Expand Down Expand Up @@ -51,7 +51,7 @@ fn bench_load_test<VM: BenchmarkingVmFactory>(c: &mut Criterion) {
let mut group = c.benchmark_group(VM::LABEL.as_str());
group
.sample_size(SAMPLE_SIZE)
.measurement_time(Duration::from_secs(10));
.measurement_time(Duration::from_secs(12));

// Nonce 0 is used for the deployment transaction
let tx = get_load_test_tx(1, 10_000_000, LoadTestParams::default());
Expand Down
Loading