Skip to content

Commit

Permalink
Merge branch 'main' into thomas/fix-missing-arg-in-init
Browse files Browse the repository at this point in the history
  • Loading branch information
thomas-nguy authored May 16, 2024
2 parents d5b822c + 25540d9 commit 250355e
Show file tree
Hide file tree
Showing 102 changed files with 1,787 additions and 751 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/build-contract-verifier-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ jobs:
matrix:
components:
- contract-verifier
- verified-sources-fetcher
platforms:
- linux/amd64

Expand Down Expand Up @@ -154,6 +155,8 @@ jobs:
component:
- name: contract-verifier
platform: linux/amd64
- name: verified-sources-fetcher
platform: linux/amd64
env:
IMAGE_TAG_SUFFIX: ${{ inputs.image_tag_suffix }}
steps:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/build-core-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ jobs:
platform: linux/amd64,linux/arm64
- name: snapshots-creator
platform: linux/amd64

env:
IMAGE_TAG_SUFFIX: ${{ inputs.image_tag_suffix }}${{ (inputs.en_alpha_release && matrix.component.name == 'external-node') && '-alpha' || '' }}
steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ jobs:
name: Github Status Check
runs-on: ubuntu-latest
if: always() && !cancelled()
needs: [ci-for-core-lint, ci-for-core, ci-for-prover, ci-for-docs, build-core-images, build-prover-images]
needs: [ci-for-core-lint, ci-for-core, ci-for-prover, ci-for-docs, build-core-images, build-contract-verifier, build-prover-images]
steps:
- name: Status
run: |
Expand Down
1 change: 0 additions & 1 deletion Cargo.lock

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

14 changes: 8 additions & 6 deletions core/bin/block_reverter/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use zksync_block_reverter::{
BlockReverter, BlockReverterEthConfig, NodeRole,
};
use zksync_config::{
configs::{chain::NetworkConfig, ObservabilityConfig},
configs::{chain::NetworkConfig, DatabaseSecrets, L1Secrets, ObservabilityConfig},
ContractsConfig, DBConfig, EthConfig, PostgresConfig,
};
use zksync_dal::{ConnectionPool, Core};
Expand Down Expand Up @@ -106,7 +106,9 @@ async fn main() -> anyhow::Result<()> {
.default_priority_fee_per_gas;
let contracts = ContractsConfig::from_env().context("ContractsConfig::from_env()")?;
let network = NetworkConfig::from_env().context("NetworkConfig::from_env()")?;
let postgres_config = PostgresConfig::from_env().context("PostgresConfig::from_env()")?;
let database_secrets = DatabaseSecrets::from_env().context("DatabaseSecrets::from_env()")?;
let l1_secrets = L1Secrets::from_env().context("L1Secrets::from_env()")?;
let postgress_config = PostgresConfig::from_env().context("PostgresConfig::from_env()")?;
let era_chain_id = env::var("CONTRACTS_ERA_CHAIN_ID")
.context("`CONTRACTS_ERA_CHAIN_ID` env variable is not set")?
.parse()
Expand All @@ -116,8 +118,8 @@ async fn main() -> anyhow::Result<()> {
let config = BlockReverterEthConfig::new(&eth_sender, &contracts, &network, era_chain_id)?;

let connection_pool = ConnectionPool::<Core>::builder(
postgres_config.master_url()?,
postgres_config.max_connections()?,
database_secrets.master_url()?,
postgress_config.max_connections()?,
)
.build()
.await
Expand All @@ -129,7 +131,7 @@ async fn main() -> anyhow::Result<()> {
json,
operator_address,
} => {
let eth_client = Client::http(eth_sender.web3_url.clone())
let eth_client = Client::http(l1_secrets.l1_rpc_url.clone())
.context("Ethereum client")?
.build();

Expand All @@ -147,7 +149,7 @@ async fn main() -> anyhow::Result<()> {
priority_fee_per_gas,
nonce,
} => {
let eth_client = Client::http(eth_sender.web3_url.clone())
let eth_client = Client::http(l1_secrets.l1_rpc_url.clone())
.context("Ethereum client")?
.build();
#[allow(deprecated)]
Expand Down
7 changes: 4 additions & 3 deletions core/bin/contract-verifier/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use prometheus_exporter::PrometheusExporterConfig;
use tokio::sync::watch;
use zksync_config::{
configs::{ObservabilityConfig, PrometheusConfig},
ApiConfig, ContractVerifierConfig, PostgresConfig,
ApiConfig, ContractVerifierConfig,
};
use zksync_dal::{ConnectionPool, Core, CoreDal};
use zksync_env_config::FromEnv;
Expand Down Expand Up @@ -116,6 +116,7 @@ async fn update_compiler_versions(connection_pool: &ConnectionPool<Core>) {
}

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

#[derive(StructOpt)]
#[structopt(name = "zkSync contract code verifier", author = "Matter Labs")]
Expand All @@ -134,9 +135,9 @@ async fn main() -> anyhow::Result<()> {
listener_port: verifier_config.prometheus_port,
..ApiConfig::from_env().context("ApiConfig")?.prometheus
};
let postgres_config = PostgresConfig::from_env().context("PostgresConfig")?;
let database_secrets = DatabaseSecrets::from_env().context("DatabaseSecrets")?;
let pool = ConnectionPool::<Core>::singleton(
postgres_config
database_secrets
.master_url()
.context("Master DB URL is absent")?,
)
Expand Down
Loading

0 comments on commit 250355e

Please sign in to comment.