Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into daniyar/pla-947-prote…
Browse files Browse the repository at this point in the history
…ctive-reads
  • Loading branch information
itegulov committed May 24, 2024
2 parents a281371 + e9038be commit 8005f0c
Show file tree
Hide file tree
Showing 162 changed files with 12,303 additions and 5,974 deletions.
2 changes: 1 addition & 1 deletion .github/release-please/manifest.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"core": "24.4.0",
"prover": "14.2.0"
"prover": "14.3.0"
}
25 changes: 22 additions & 3 deletions .github/workflows/ci-core-reusable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -217,12 +217,28 @@ jobs:
# We use `yarn` directly because the test launches `zk` commands in both server and EN envs.
# An empty topmost environment helps avoid a mess when redefining env vars shared between both envs
# (e.g., DATABASE_URL).
#
# Since `base_token` doesn't meaningfully influence the test, we use it as a flag for
# enabling / disabling tree during pruning.
run: |
if [[ "${{ matrix.deployment_mode }}" == "Validium" ]]; then
ci_run zk config compile ext-node-validium
ci_run zk config compile ext-node-validium-docker
fi
ENABLE_CONSENSUS=${{ matrix.consensus }} DEPLOYMENT_MODE=${{ matrix.deployment_mode }} PASSED_ENV_VARS="ENABLE_CONSENSUS,DEPLOYMENT_MODE" ci_run yarn snapshot-recovery-test snapshot-recovery-test
ENABLE_CONSENSUS=${{ matrix.consensus }} \
DEPLOYMENT_MODE=${{ matrix.deployment_mode }} \
DISABLE_TREE_DURING_PRUNING=${{ matrix.base_token == 'Eth' }} \
ETH_CLIENT_WEB3_URL="http://reth:8545" \
PASSED_ENV_VARS="ENABLE_CONSENSUS,DEPLOYMENT_MODE,DISABLE_TREE_DURING_PRUNING,ETH_CLIENT_WEB3_URL" \
ci_run yarn recovery-test snapshot-recovery-test
- name: Genesis recovery test
run: |
ENABLE_CONSENSUS=${{ matrix.consensus }} \
DEPLOYMENT_MODE=${{ matrix.deployment_mode }} \
ETH_CLIENT_WEB3_URL="http://reth:8545" \
PASSED_ENV_VARS="ENABLE_CONSENSUS,DEPLOYMENT_MODE,ETH_CLIENT_WEB3_URL" \
ci_run yarn recovery-test genesis-recovery-test
- name: Fee projection tests
run: ci_run zk test i fees
Expand Down Expand Up @@ -252,10 +268,13 @@ jobs:

- name: Show snapshot-creator.log logs
if: always()
run: ci_run cat core/tests/snapshot-recovery-test/snapshot-creator.log || true
run: ci_run cat core/tests/recovery-test/snapshot-creator.log || true
- name: Show snapshot-recovery.log logs
if: always()
run: ci_run cat core/tests/snapshot-recovery-test/snapshot-recovery.log || true
run: ci_run cat core/tests/recovery-test/snapshot-recovery.log || true
- name: Show genesis-recovery.log logs
if: always()
run: ci_run cat core/tests/recovery-test/genesis-recovery.log || true

- name: Show revert.log logs
if: always()
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
node_modules
*.log
target
a.out
a.out
.gitconfig
cobertura.xml
tags
Expand All @@ -30,6 +30,7 @@ Cargo.lock
!/Cargo.lock
!/infrastructure/zksync-crypto/Cargo.lock
!/prover/Cargo.lock
!/zk_toolbox/Cargo.lock

/etc/env/target/*
/etc/env/.current
Expand Down
23 changes: 16 additions & 7 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions checks-config/era.dic
Original file line number Diff line number Diff line change
Expand Up @@ -964,3 +964,6 @@ delegator
Bbellman
Sbellman
DCMAKE
preloaded
e2e
upcasting
14 changes: 7 additions & 7 deletions core/bin/contract-verifier/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ use std::{cell::RefCell, time::Duration};
use anyhow::Context as _;
use futures::{channel::mpsc, executor::block_on, SinkExt, StreamExt};
use prometheus_exporter::PrometheusExporterConfig;
use structopt::StructOpt;
use tokio::sync::watch;
use zksync_config::{
configs::{ObservabilityConfig, PrometheusConfig},
Expand All @@ -11,7 +12,7 @@ use zksync_config::{
use zksync_dal::{ConnectionPool, Core, CoreDal};
use zksync_env_config::FromEnv;
use zksync_queued_job_processor::JobProcessor;
use zksync_utils::wait_for_tasks::ManagedTasks;
use zksync_utils::{wait_for_tasks::ManagedTasks, workspace_dir_or_current_dir};

use crate::verifier::ContractVerifier;

Expand All @@ -25,9 +26,9 @@ async fn update_compiler_versions(connection_pool: &ConnectionPool<Core>) {
let mut storage = connection_pool.connection().await.unwrap();
let mut transaction = storage.start_transaction().await.unwrap();

let zksync_home = std::env::var("ZKSYNC_HOME").unwrap_or_else(|_| ".".into());
let zksync_home = workspace_dir_or_current_dir();

let zksolc_path = format!("{}/etc/zksolc-bin/", zksync_home);
let zksolc_path = zksync_home.join("etc/zksolc-bin/");
let zksolc_versions: Vec<String> = std::fs::read_dir(zksolc_path)
.unwrap()
.filter_map(|file| {
Expand All @@ -48,7 +49,7 @@ async fn update_compiler_versions(connection_pool: &ConnectionPool<Core>) {
.await
.unwrap();

let solc_path = format!("{}/etc/solc-bin/", zksync_home);
let solc_path = zksync_home.join("etc/solc-bin/");
let solc_versions: Vec<String> = std::fs::read_dir(solc_path)
.unwrap()
.filter_map(|file| {
Expand All @@ -69,7 +70,7 @@ async fn update_compiler_versions(connection_pool: &ConnectionPool<Core>) {
.await
.unwrap();

let zkvyper_path = format!("{}/etc/zkvyper-bin/", zksync_home);
let zkvyper_path = zksync_home.join("etc/zkvyper-bin/");
let zkvyper_versions: Vec<String> = std::fs::read_dir(zkvyper_path)
.unwrap()
.filter_map(|file| {
Expand All @@ -90,7 +91,7 @@ async fn update_compiler_versions(connection_pool: &ConnectionPool<Core>) {
.await
.unwrap();

let vyper_path = format!("{}/etc/vyper-bin/", zksync_home);
let vyper_path = zksync_home.join("etc/vyper-bin/");
let vyper_versions: Vec<String> = std::fs::read_dir(vyper_path)
.unwrap()
.filter_map(|file| {
Expand All @@ -115,7 +116,6 @@ async fn update_compiler_versions(connection_pool: &ConnectionPool<Core>) {
transaction.commit().await.unwrap();
}

use structopt::StructOpt;
use zksync_config::configs::DatabaseSecrets;

#[derive(StructOpt)]
Expand Down
16 changes: 9 additions & 7 deletions core/bin/contract-verifier/src/verifier.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
use std::{
collections::HashMap,
env,
path::Path,
time::{Duration, Instant},
};
Expand All @@ -22,6 +21,7 @@ use zksync_types::{
},
Address,
};
use zksync_utils::workspace_dir_or_current_dir;

use crate::{
error::ContractVerifierError,
Expand All @@ -34,6 +34,10 @@ lazy_static! {
static ref DEPLOYER_CONTRACT: Contract = zksync_contracts::deployer_contract();
}

fn home_path() -> &'static Path {
workspace_dir_or_current_dir()
}

#[derive(Debug)]
enum ConstructorArgs {
Check(Vec<u8>),
Expand Down Expand Up @@ -120,8 +124,7 @@ impl ContractVerifier {
};
let input = Self::build_zksolc_input(request.clone(), file_name.clone())?;

let zksync_home = env::var("ZKSYNC_HOME").unwrap_or_else(|_| ".".into());
let zksolc_path = Path::new(&zksync_home)
let zksolc_path = Path::new(&home_path())
.join("etc")
.join("zksolc-bin")
.join(request.req.compiler_versions.zk_compiler_version())
Expand All @@ -133,7 +136,7 @@ impl ContractVerifier {
));
}

let solc_path = Path::new(&zksync_home)
let solc_path = Path::new(&home_path())
.join("etc")
.join("solc-bin")
.join(request.req.compiler_versions.compiler_version())
Expand Down Expand Up @@ -219,8 +222,7 @@ impl ContractVerifier {
};
let input = Self::build_zkvyper_input(request.clone())?;

let zksync_home = env::var("ZKSYNC_HOME").unwrap_or_else(|_| ".".into());
let zkvyper_path = Path::new(&zksync_home)
let zkvyper_path = Path::new(&home_path())
.join("etc")
.join("zkvyper-bin")
.join(request.req.compiler_versions.zk_compiler_version())
Expand All @@ -232,7 +234,7 @@ impl ContractVerifier {
));
}

let vyper_path = Path::new(&zksync_home)
let vyper_path = Path::new(&home_path())
.join("etc")
.join("vyper-bin")
.join(request.req.compiler_versions.compiler_version())
Expand Down
6 changes: 6 additions & 0 deletions core/bin/external_node/src/config/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -745,6 +745,11 @@ pub(crate) struct ExperimentalENConfig {
/// Maximum number of files concurrently opened by state keeper cache RocksDB. Useful to fit into OS limits; can be used
/// as a rudimentary way to control RAM usage of the cache.
pub state_keeper_db_max_open_files: Option<NonZeroU32>,

// Commitment generator
/// Maximum degree of parallelism during commitment generation, i.e., the maximum number of L1 batches being processed in parallel.
/// If not specified, commitment generator will use a value roughly equal to the number of CPU cores with some clamping applied.
pub commitment_generator_max_parallelism: Option<NonZeroU32>,
}

impl ExperimentalENConfig {
Expand All @@ -758,6 +763,7 @@ impl ExperimentalENConfig {
state_keeper_db_block_cache_capacity_mb:
Self::default_state_keeper_db_block_cache_capacity_mb(),
state_keeper_db_max_open_files: None,
commitment_generator_max_parallelism: None,
}
}

Expand Down
Loading

0 comments on commit 8005f0c

Please sign in to comment.