Skip to content

Commit

Permalink
Merge branch 'main' into matias-zk-toolbox-linter
Browse files Browse the repository at this point in the history
  • Loading branch information
matias-gonz authored Aug 13, 2024
2 parents b853f50 + 009cd97 commit 6156fb1
Show file tree
Hide file tree
Showing 233 changed files with 10,743 additions and 2,708 deletions.
13 changes: 10 additions & 3 deletions .github/workflows/ci-core-reusable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,10 @@ jobs:

loadtest:
runs-on: [matterlabs-ci-runner]
strategy:
fail-fast: false
matrix:
vm_mode: ["old", "new"]

steps:
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4
Expand All @@ -82,7 +86,8 @@ jobs:
- name: Loadtest configuration
run: |
echo EXPECTED_TX_COUNT="16000" >> .env
echo EXPECTED_TX_COUNT=${{ matrix.vm_mode == 'new' && 24000 || 18000 }} >> .env
echo ACCOUNTS_AMOUNT="150" >> .env
echo FAIL_FAST=true >> .env
echo IN_DOCKER=1 >> .env
echo DATABASE_MERKLE_TREE_MODE=lightweight >> .env
Expand All @@ -105,7 +110,9 @@ jobs:
# `sleep 60` because we need to wait until server added all the tokens
- name: Run server
run: |
ci_run zk server --uring --components api,tree,eth,state_keeper,housekeeper,commitment_generator,vm_runner_protective_reads &>server.log &
EXPERIMENTAL_VM_STATE_KEEPER_FAST_VM_MODE=${{ matrix.vm_mode }} \
PASSED_ENV_VARS="EXPERIMENTAL_VM_STATE_KEEPER_FAST_VM_MODE" \
ci_run zk server --uring --components api,tree,eth,state_keeper,housekeeper,commitment_generator,vm_runner_protective_reads &>server.log &
ci_run sleep 60
- name: Deploy legacy era contracts
Expand Down Expand Up @@ -135,7 +142,7 @@ jobs:
base_token: ["Eth", "Custom"]
deployment_mode: ["Rollup", "Validium"]
env:
SERVER_COMPONENTS: "api,tree,eth,state_keeper,housekeeper,commitment_generator,vm_runner_protective_reads,vm_runner_bwip,da_dispatcher${{ matrix.consensus && ',consensus' || '' }}${{ matrix.base_token == 'Custom' && ',base_token_ratio_persister' || '' }}"
SERVER_COMPONENTS: "api,tree,eth,state_keeper,housekeeper,commitment_generator,vm_runner_protective_reads,vm_runner_bwip,vm_playground,da_dispatcher${{ matrix.consensus && ',consensus' || '' }}${{ matrix.base_token == 'Custom' && ',base_token_ratio_persister' || '' }}"

runs-on: [matterlabs-ci-runner]
steps:
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/ci-zk-toolbox-reusable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,8 @@ jobs:
--server-db-name=zksync_server_localhost_era \
--prover-db-url=postgres://postgres:notsecurepassword@postgres:5432 \
--prover-db-name=zksync_prover_localhost_era \
--ignore-prerequisites --verbose
--ignore-prerequisites --verbose \
--observability=false
- name: Create and initialize chain
run: |
Expand Down
55 changes: 41 additions & 14 deletions Cargo.lock

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

7 changes: 5 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -205,16 +205,19 @@ circuit_sequencer_api_1_3_3 = { package = "circuit_sequencer_api", version = "0.
circuit_sequencer_api_1_4_0 = { package = "circuit_sequencer_api", version = "0.140" }
circuit_sequencer_api_1_4_1 = { package = "circuit_sequencer_api", version = "0.141" }
circuit_sequencer_api_1_4_2 = { package = "circuit_sequencer_api", version = "0.142" }
circuit_sequencer_api_1_5_0 = { package = "circuit_sequencer_api", version = "=0.150.2-rc.3" }
circuit_sequencer_api_1_5_0 = { package = "circuit_sequencer_api", version = "=0.150.2" }
crypto_codegen = { package = "zksync_solidity_vk_codegen", version = "=0.1.0" }
kzg = { package = "zksync_kzg", version = "=0.150.2-rc.3" }
kzg = { package = "zksync_kzg", version = "=0.150.2" }
zk_evm = { version = "=0.133.0" }
zk_evm_1_3_1 = { package = "zk_evm", version = "0.131.0-rc.2" }
zk_evm_1_3_3 = { package = "zk_evm", version = "0.133.0" }
zk_evm_1_4_0 = { package = "zk_evm", version = "0.140.0" }
zk_evm_1_4_1 = { package = "zk_evm", version = "0.141.0" }
zk_evm_1_5_0 = { package = "zk_evm", version = "=0.150.0" }

# New VM; pinned to a specific commit because of instability
vm2 = { git = "https://github.com/matter-labs/vm2.git", rev = "9a38900d7af9b1d72b47ce3be980e77c1239a61d" }

# Consensus dependencies.
zksync_concurrency = "=0.1.0-rc.9"
zksync_consensus_bft = "=0.1.0-rc.9"
Expand Down
4 changes: 2 additions & 2 deletions core/bin/block_reverter/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use tokio::{
};
use zksync_block_reverter::{
eth_client::{
clients::{Client, PKSigningClient},
clients::{Client, PKSigningClient, L1},
EthInterface,
},
BlockReverter, BlockReverterEthConfig, NodeRole,
Expand Down Expand Up @@ -251,7 +251,7 @@ async fn main() -> anyhow::Result<()> {
json,
operator_address,
} => {
let eth_client = Client::http(l1_secrets.l1_rpc_url.clone())
let eth_client = Client::<L1>::http(l1_secrets.l1_rpc_url.clone())
.context("Ethereum client")?
.build();

Expand Down
26 changes: 25 additions & 1 deletion core/bin/external_node/src/config/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,8 @@ pub(crate) struct RemoteENConfig {
pub bridgehub_proxy_addr: Option<Address>,
pub state_transition_proxy_addr: Option<Address>,
pub transparent_proxy_admin_addr: Option<Address>,
pub diamond_proxy_addr: Address,
/// Should not be accessed directly. Use [`ExternalNodeConfig::diamond_proxy_address`] instead.
diamond_proxy_addr: Address,
// While on L1 shared bridge and legacy bridge are different contracts with different addresses,
// the `l2_erc20_bridge_addr` and `l2_shared_bridge_addr` are basically the same contract, but with
// a different name, with names adapted only for consistency.
Expand Down Expand Up @@ -1310,6 +1311,19 @@ impl ExternalNodeConfig<()> {
let remote = RemoteENConfig::fetch(main_node_client)
.await
.context("Unable to fetch required config values from the main node")?;
let remote_diamond_proxy_addr = remote.diamond_proxy_addr;
if let Some(local_diamond_proxy_addr) = self.optional.contracts_diamond_proxy_addr {
anyhow::ensure!(
local_diamond_proxy_addr == remote_diamond_proxy_addr,
"Diamond proxy address {local_diamond_proxy_addr:?} specified in config doesn't match one returned \
by main node ({remote_diamond_proxy_addr:?})"
);
} else {
tracing::info!(
"Diamond proxy address is not specified in config; will use address \
returned by main node: {remote_diamond_proxy_addr:?}"
);
}
Ok(ExternalNodeConfig {
required: self.required,
postgres: self.postgres,
Expand Down Expand Up @@ -1341,6 +1355,16 @@ impl ExternalNodeConfig {
tree_component: TreeComponentConfig { api_port: None },
}
}

/// Returns a verified diamond proxy address.
/// If local configuration contains the address, it will be checked against the one returned by the main node.
/// Otherwise, the remote value will be used. However, using remote value has trust implications for the main
/// node so relying on it solely is not recommended.
pub fn diamond_proxy_address(&self) -> Address {
self.optional
.contracts_diamond_proxy_addr
.unwrap_or(self.remote.diamond_proxy_addr)
}
}

impl From<&ExternalNodeConfig> for InternalApiConfig {
Expand Down
Loading

0 comments on commit 6156fb1

Please sign in to comment.