From aa9b54363b4a1ee6426086490191294a6a597cab Mon Sep 17 00:00:00 2001 From: mm-zk Date: Fri, 15 Sep 2023 18:19:59 +0200 Subject: [PATCH] syncing with newest version --- bootloader/test_infra/Cargo.lock | 348 ++---------------------------- bootloader/test_infra/src/hook.rs | 6 +- bootloader/test_infra/src/main.rs | 10 +- 3 files changed, 29 insertions(+), 335 deletions(-) diff --git a/bootloader/test_infra/Cargo.lock b/bootloader/test_infra/Cargo.lock index d4a4c5af..7c7b735b 100644 --- a/bootloader/test_infra/Cargo.lock +++ b/bootloader/test_infra/Cargo.lock @@ -169,28 +169,6 @@ version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" -[[package]] -name = "async-stream" -version = "0.3.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd56dd203fef61ac097dd65721a419ddccb106b2d2b70ba60a6b529f03961a51" -dependencies = [ - "async-stream-impl", - "futures-core", - "pin-project-lite", -] - -[[package]] -name = "async-stream-impl" -version = "0.3.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16e62a023e7c117e27523144c5d2459f4397fcc3cab0085af8e2224f643a0193" -dependencies = [ - "proc-macro2 1.0.66", - "quote 1.0.33", - "syn 2.0.31", -] - [[package]] name = "async-trait" version = "0.1.73" @@ -1374,12 +1352,6 @@ dependencies = [ "static_assertions", ] -[[package]] -name = "fixedbitset" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" - [[package]] name = "fnv" version = "1.0.7" @@ -1635,7 +1607,7 @@ dependencies = [ "indexmap 1.9.3", "slab", "tokio", - "tokio-util 0.7.8", + "tokio-util", "tracing", ] @@ -1774,15 +1746,6 @@ dependencies = [ "digest 0.10.7", ] -[[package]] -name = "home" -version = "0.5.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5444c27eef6923071f7ebcc33e3444508466a76f7a2b93da00ed6e19f30c1ddb" -dependencies = [ - "windows-sys", -] - [[package]] name = "hostname" version = "0.3.1" @@ -1872,18 +1835,6 @@ dependencies = [ "tokio-rustls", ] -[[package]] -name = "hyper-timeout" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbb958482e8c7be4bc3cf272a766a2b0bf1a6755e7a6ae777f017a31d11b13b1" -dependencies = [ - "hyper", - "pin-project-lite", - "tokio", - "tokio-io-timeout", -] - [[package]] name = "hyper-tls" version = "0.5.0" @@ -2311,12 +2262,6 @@ dependencies = [ "windows-sys", ] -[[package]] -name = "multimap" -version = "0.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5ce46fe64a9d73be07dcbe690a38ce1b293be448fd8ce1e6c1b8062c9f72c6a" - [[package]] name = "native-tls" version = "0.2.11" @@ -2605,68 +2550,6 @@ dependencies = [ "vcpkg", ] -[[package]] -name = "opentelemetry" -version = "0.17.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6105e89802af13fdf48c49d7646d3b533a70e536d818aae7e78ba0433d01acb8" -dependencies = [ - "async-trait", - "crossbeam-channel 0.5.8", - "futures-channel", - "futures-executor", - "futures-util", - "js-sys", - "lazy_static", - "percent-encoding", - "pin-project", - "rand 0.8.5", - "thiserror", -] - -[[package]] -name = "opentelemetry-http" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "449048140ee61e28f57abe6e9975eedc1f3a29855c7407bd6c12b18578863379" -dependencies = [ - "async-trait", - "bytes", - "http", - "opentelemetry", - "reqwest", -] - -[[package]] -name = "opentelemetry-otlp" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d1a6ca9de4c8b00aa7f1a153bd76cb263287155cec642680d79d98706f3d28a" -dependencies = [ - "async-trait", - "futures", - "futures-util", - "http", - "opentelemetry", - "opentelemetry-http", - "prost", - "prost-build", - "reqwest", - "thiserror", - "tokio", - "tonic", - "tonic-build", -] - -[[package]] -name = "opentelemetry-semantic-conventions" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "985cc35d832d412224b2cffe2f9194b1b89b6aa5d0bef76d080dce09d90e62bd" -dependencies = [ - "opentelemetry", -] - [[package]] name = "os_info" version = "3.7.0" @@ -2916,16 +2799,6 @@ dependencies = [ "sha2 0.10.6", ] -[[package]] -name = "petgraph" -version = "0.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1d3afd2628e69da2be385eb6f2fd57c8ac7977ceeff6dc166ff1657b0e386a9" -dependencies = [ - "fixedbitset", - "indexmap 2.0.0", -] - [[package]] name = "pin-project" version = "1.1.3" @@ -3089,59 +2962,6 @@ dependencies = [ "unicode-ident", ] -[[package]] -name = "prost" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "444879275cb4fd84958b1a1d5420d15e6fcf7c235fe47f053c9c2a80aceb6001" -dependencies = [ - "bytes", - "prost-derive", -] - -[[package]] -name = "prost-build" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62941722fb675d463659e49c4f3fe1fe792ff24fe5bbaa9c08cd3b98a1c354f5" -dependencies = [ - "bytes", - "heck 0.3.3", - "itertools", - "lazy_static", - "log", - "multimap", - "petgraph", - "prost", - "prost-types", - "regex", - "tempfile", - "which", -] - -[[package]] -name = "prost-derive" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9cc1a3263e07e0bf68e96268f37665207b49560d98739662cdfaae215c720fe" -dependencies = [ - "anyhow", - "itertools", - "proc-macro2 1.0.66", - "quote 1.0.33", - "syn 1.0.109", -] - -[[package]] -name = "prost-types" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "534b7a0e836e3c482d2693070f982e39e7611da9695d4d1f5a4b186b51faef0a" -dependencies = [ - "bytes", - "prost", -] - [[package]] name = "pulldown-cmark" version = "0.9.3" @@ -4602,16 +4422,6 @@ dependencies = [ "windows-sys", ] -[[package]] -name = "tokio-io-timeout" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30b74022ada614a1b4834de765f9bb43877f910cc8ce4be40e89042c9223a8bf" -dependencies = [ - "pin-project-lite", - "tokio", -] - [[package]] name = "tokio-macros" version = "2.1.0" @@ -4654,20 +4464,6 @@ dependencies = [ "tokio", ] -[[package]] -name = "tokio-util" -version = "0.6.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "36943ee01a6d67977dd3f84a5a1d2efeb4ada3a1ae771cadfaa535d9d9fc6507" -dependencies = [ - "bytes", - "futures-core", - "futures-sink", - "log", - "pin-project-lite", - "tokio", -] - [[package]] name = "tokio-util" version = "0.7.8" @@ -4699,75 +4495,6 @@ dependencies = [ "winnow", ] -[[package]] -name = "tonic" -version = "0.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff08f4649d10a70ffa3522ca559031285d8e421d727ac85c60825761818f5d0a" -dependencies = [ - "async-stream", - "async-trait", - "base64 0.13.1", - "bytes", - "futures-core", - "futures-util", - "h2", - "http", - "http-body", - "hyper", - "hyper-timeout", - "percent-encoding", - "pin-project", - "prost", - "prost-derive", - "tokio", - "tokio-stream", - "tokio-util 0.6.10", - "tower", - "tower-layer", - "tower-service", - "tracing", - "tracing-futures", -] - -[[package]] -name = "tonic-build" -version = "0.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9403f1bafde247186684b230dc6f38b5cd514584e8bec1dd32514be4745fa757" -dependencies = [ - "proc-macro2 1.0.66", - "prost-build", - "quote 1.0.33", - "syn 1.0.109", -] - -[[package]] -name = "tower" -version = "0.4.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8fa9be0de6cf49e536ce1851f987bd21a43b771b09473c3549a6c853db37c1c" -dependencies = [ - "futures-core", - "futures-util", - "indexmap 1.9.3", - "pin-project", - "pin-project-lite", - "rand 0.8.5", - "slab", - "tokio", - "tokio-util 0.7.8", - "tower-layer", - "tower-service", - "tracing", -] - -[[package]] -name = "tower-layer" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c20c8dbed6283a09604c3e69b4b7eeb54e298b8a600d4d5ecb5ad39de609f1d0" - [[package]] name = "tower-service" version = "0.3.2" @@ -4808,16 +4535,6 @@ dependencies = [ "valuable", ] -[[package]] -name = "tracing-futures" -version = "0.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97d095ae15e245a057c8e8451bab9b3ee1e1f68e9ba2b4fbc18d0ac5237835f2" -dependencies = [ - "pin-project", - "tracing", -] - [[package]] name = "tracing-log" version = "0.1.3" @@ -4829,20 +4546,6 @@ dependencies = [ "tracing-core", ] -[[package]] -name = "tracing-opentelemetry" -version = "0.17.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbbe89715c1dbbb790059e2565353978564924ee85017b5fff365c872ff6721f" -dependencies = [ - "once_cell", - "opentelemetry", - "tracing", - "tracing-core", - "tracing-log", - "tracing-subscriber", -] - [[package]] name = "tracing-serde" version = "0.1.3" @@ -5041,16 +4744,12 @@ checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" [[package]] name = "vlog" -version = "1.0.0" +version = "0.1.0" dependencies = [ "chrono", - "opentelemetry", - "opentelemetry-otlp", - "opentelemetry-semantic-conventions", "sentry", "serde_json", "tracing", - "tracing-opentelemetry", "tracing-subscriber", ] @@ -5064,7 +4763,7 @@ dependencies = [ "metrics", "once_cell", "thiserror", - "vlog", + "tracing", "zk_evm", "zksync_config", "zksync_contracts", @@ -5217,18 +4916,6 @@ version = "0.25.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "14247bb57be4f377dfb94c72830b8ce8fc6beac03cf4bf7b9732eadd414123fc" -[[package]] -name = "which" -version = "4.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87ba24419a2078cd2b0f2ede2691b6c66d8e47836da3b6db8265ebad47afbfc7" -dependencies = [ - "either", - "home", - "once_cell", - "rustix", -] - [[package]] name = "whoami" version = "1.4.1" @@ -5473,7 +5160,7 @@ dependencies = [ [[package]] name = "zksync_basic_types" -version = "1.0.0" +version = "0.1.0" dependencies = [ "serde", "web3", @@ -5481,7 +5168,7 @@ dependencies = [ [[package]] name = "zksync_config" -version = "1.0.0" +version = "0.1.0" dependencies = [ "bigdecimal", "envy", @@ -5498,7 +5185,7 @@ dependencies = [ [[package]] name = "zksync_contracts" -version = "1.0.0" +version = "0.1.0" dependencies = [ "envy", "ethabi", @@ -5511,7 +5198,7 @@ dependencies = [ [[package]] name = "zksync_crypto" -version = "1.0.0" +version = "0.1.0" dependencies = [ "base64 0.13.1", "blake2 0.10.6", @@ -5525,7 +5212,7 @@ dependencies = [ [[package]] name = "zksync_dal" -version = "1.0.0" +version = "0.1.0" dependencies = [ "anyhow", "bigdecimal", @@ -5541,7 +5228,7 @@ dependencies = [ "strum", "thiserror", "tokio", - "vlog", + "tracing", "zksync_config", "zksync_contracts", "zksync_health_check", @@ -5558,12 +5245,12 @@ dependencies = [ "serde", "serde_json", "tokio", - "vlog", + "tracing", ] [[package]] name = "zksync_mini_merkle_tree" -version = "1.0.0" +version = "0.1.0" dependencies = [ "once_cell", "zksync_basic_types", @@ -5572,12 +5259,12 @@ dependencies = [ [[package]] name = "zksync_state" -version = "1.0.0" +version = "0.1.0" dependencies = [ "metrics", "mini-moka", "tokio", - "vlog", + "tracing", "zksync_dal", "zksync_storage", "zksync_types", @@ -5586,17 +5273,17 @@ dependencies = [ [[package]] name = "zksync_storage" -version = "1.0.0" +version = "0.1.0" dependencies = [ "metrics", "num_cpus", "rocksdb", - "vlog", + "tracing", ] [[package]] name = "zksync_types" -version = "1.0.0" +version = "0.1.0" dependencies = [ "blake2 0.10.6", "chrono", @@ -5624,7 +5311,7 @@ dependencies = [ [[package]] name = "zksync_utils" -version = "1.0.0" +version = "0.1.0" dependencies = [ "anyhow", "bigdecimal", @@ -5638,6 +5325,7 @@ dependencies = [ "serde", "thiserror", "tokio", + "tracing", "vlog", "zk_evm", "zksync_basic_types", diff --git a/bootloader/test_infra/src/hook.rs b/bootloader/test_infra/src/hook.rs index 0500c421..e3152824 100644 --- a/bootloader/test_infra/src/hook.rs +++ b/bootloader/test_infra/src/hook.rs @@ -1,11 +1,11 @@ use vm::{ constants::{BOOTLOADER_HEAP_PAGE, VM_HOOK_PARAMS_START_POSITION}, - old_vm::utils::heap_page_from_base, HistoryMode, SimpleMemory, }; use zksync_types::{ zkevm_test_harness::zk_evm::{ + aux_structures::MemoryPage, tracing::{BeforeExecutionData, VmLocalStateData}, zkevm_opcode_defs::{FatPointer, Opcode, UMAOpcode}, }, @@ -65,6 +65,10 @@ fn test_hook_as_int_or_hex(hook_param: U256) -> String { } } +pub const fn heap_page_from_base(base: MemoryPage) -> MemoryPage { + MemoryPage(base.0 + 2) +} + impl TestVmHook { pub(crate) fn from_opcode_memory( state: &VmLocalStateData<'_>, diff --git a/bootloader/test_infra/src/main.rs b/bootloader/test_infra/src/main.rs index d9537268..a7a7821a 100644 --- a/bootloader/test_infra/src/main.rs +++ b/bootloader/test_infra/src/main.rs @@ -6,7 +6,10 @@ use std::{env, sync::Arc}; use tracing_subscriber::fmt; use tracing_subscriber::prelude::__tracing_subscriber_SubscriberExt; use tracing_subscriber::util::SubscriberInitExt; -use vm::{HistoryDisabled, L1BatchEnv, L2BlockEnv, SystemEnv, TxExecutionMode, Vm, VmTracer}; +use vm::{ + HistoryDisabled, L1BatchEnv, L2BlockEnv, SystemEnv, TxExecutionMode, Vm, VmExecutionMode, + VmTracer, +}; use zksync_contracts::{ read_sys_contract_bytecode, read_zbin_bytecode, BaseSystemContracts, ContractLanguage, SystemContractCode, @@ -94,7 +97,7 @@ fn execute_internal_bootloader_test() { // We're using a TestCountTracer (and passing 0 as fee account) - this should cause the bootloader // test framework to report number of tests via VM hook. - vm.inspect_the_rest_of_the_batch(custom_tracers); + vm.inspect(custom_tracers, VmExecutionMode::Bootloader); test_count.get().unwrap().clone() }; @@ -123,7 +126,7 @@ fn execute_internal_bootloader_test() { let custom_tracers = vec![Box::new(BootloaderTestTracer::new(test_result.clone())) as Box, HistoryDisabled>>]; - let result = vm.inspect_the_rest_of_the_batch(custom_tracers); + vm.inspect(custom_tracers, VmExecutionMode::Bootloader); let test_result = test_result.get().unwrap(); match &test_result.result { @@ -138,7 +141,6 @@ fn execute_internal_bootloader_test() { ) } } - vlog::debug!("Result: {:?}", result); } if tests_failed > 0 { println!("{}", format!("{} tests failed.", tests_failed).red());