Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into gprusak-autogen
Browse files Browse the repository at this point in the history
  • Loading branch information
pompon0 committed Jul 23, 2024
2 parents 77596e8 + 990676c commit 4edbbf6
Show file tree
Hide file tree
Showing 382 changed files with 1,131 additions and 312 deletions.
2 changes: 1 addition & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ contracts/.git
!etc/multivm_bootloaders
!cargo
!bellman-cuda
!prover/vk_setup_data_generator_server_fri/data/
!prover/crates/bin/vk_setup_data_generator_server_fri/data/
!.github/release-please/manifest.json

!etc/env/file_based
Expand Down
7 changes: 0 additions & 7 deletions .github/workflows/build-prover-fri-gpu-gar.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ jobs:
PROVER_IMAGE=${{ inputs.image_tag_suffix }}
push: true
tags: |
us-docker.pkg.dev/matterlabs-infra/matterlabs-docker/prover-fri-gpu-gar:2.0-${{ inputs.image_tag_suffix }}
us-docker.pkg.dev/matterlabs-infra/matterlabs-docker/prover-fri-gpu-gar:2.0-${{ inputs.protocol_version }}-${{ inputs.image_tag_suffix }}
- name: Login to Asia GAR
Expand All @@ -56,9 +55,6 @@ jobs:
- name: Build and push to Asia GAR
run: |
docker buildx imagetools create \
--tag asia-docker.pkg.dev/matterlabs-infra/matterlabs-docker/prover-fri-gpu-gar:2.0-${{ inputs.image_tag_suffix }} \
us-docker.pkg.dev/matterlabs-infra/matterlabs-docker/prover-fri-gpu-gar:2.0-${{ inputs.image_tag_suffix }}
docker buildx imagetools create \
--tag asia-docker.pkg.dev/matterlabs-infra/matterlabs-docker/prover-fri-gpu-gar:2.0-${{ inputs.protocol_version }}-${{ inputs.image_tag_suffix }} \
us-docker.pkg.dev/matterlabs-infra/matterlabs-docker/prover-fri-gpu-gar:2.0-${{ inputs.protocol_version }}-${{ inputs.image_tag_suffix }}
Expand All @@ -69,9 +65,6 @@ jobs:
- name: Build and push to Europe GAR
run: |
docker buildx imagetools create \
--tag europe-docker.pkg.dev/matterlabs-infra/matterlabs-docker/prover-fri-gpu-gar:2.0-${{ inputs.image_tag_suffix }} \
us-docker.pkg.dev/matterlabs-infra/matterlabs-docker/prover-fri-gpu-gar:2.0-${{ inputs.image_tag_suffix }}
docker buildx imagetools create \
--tag europe-docker.pkg.dev/matterlabs-infra/matterlabs-docker/prover-fri-gpu-gar:2.0-${{ inputs.protocol_version }}-${{ inputs.image_tag_suffix }} \
us-docker.pkg.dev/matterlabs-infra/matterlabs-docker/prover-fri-gpu-gar:2.0-${{ inputs.protocol_version }}-${{ inputs.image_tag_suffix }}
6 changes: 0 additions & 6 deletions .github/workflows/build-prover-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -199,19 +199,13 @@ jobs:
- name: Login and push to Asia GAR
run: |
gcloud auth print-access-token --lifetime=7200 --impersonate-service-account=gha-ci-runners@matterlabs-infra.iam.gserviceaccount.com | docker login -u oauth2accesstoken --password-stdin https://asia-docker.pkg.dev
docker buildx imagetools create \
--tag asia-docker.pkg.dev/matterlabs-infra/matterlabs-docker/${{ matrix.component }}:2.0-${{ inputs.image_tag_suffix }} \
us-docker.pkg.dev/matterlabs-infra/matterlabs-docker/${{ matrix.component }}:2.0-${{ inputs.image_tag_suffix }}
docker buildx imagetools create \
--tag asia-docker.pkg.dev/matterlabs-infra/matterlabs-docker/${{ matrix.component }}:2.0-${{ needs.build-images.outputs.protocol_version }}-${{ inputs.image_tag_suffix }} \
us-docker.pkg.dev/matterlabs-infra/matterlabs-docker/${{ matrix.component }}:2.0-${{ needs.build-images.outputs.protocol_version }}-${{ inputs.image_tag_suffix }}
- name: Login and push to Europe GAR
run: |
gcloud auth print-access-token --lifetime=7200 --impersonate-service-account=gha-ci-runners@matterlabs-infra.iam.gserviceaccount.com | docker login -u oauth2accesstoken --password-stdin https://europe-docker.pkg.dev
docker buildx imagetools create \
--tag europe-docker.pkg.dev/matterlabs-infra/matterlabs-docker/${{ matrix.component }}:2.0-${{ inputs.image_tag_suffix }} \
us-docker.pkg.dev/matterlabs-infra/matterlabs-docker/${{ matrix.component }}:2.0-${{ inputs.image_tag_suffix }}
docker buildx imagetools create \
--tag europe-docker.pkg.dev/matterlabs-infra/matterlabs-docker/${{ matrix.component }}:2.0-${{ needs.build-images.outputs.protocol_version }}-${{ inputs.image_tag_suffix }} \
us-docker.pkg.dev/matterlabs-infra/matterlabs-docker/${{ matrix.component }}:2.0-${{ needs.build-images.outputs.protocol_version }}-${{ inputs.image_tag_suffix }}
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ hyperchain-*.yml
/etc/hyperchains/artifacts

# Prover keys that should not be commited
prover/vk_setup_data_generator_server_fri/data/setup_*
prover/crates/bin/vk_setup_data_generator_server_fri/data/setup_*

# Zk Toolbox
chains/era/configs/*
Expand Down
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ members = [
"core/tests/vm-benchmark/harness",

# Parts of prover workspace that are needed for Core workspace
"prover/prover_dal"
"prover/crates/lib/prover_dal"
]
resolver = "2"

Expand Down Expand Up @@ -222,7 +222,7 @@ zksync_protobuf_build = "=0.1.0-rc.2"

# "Local" dependencies
zksync_multivm = { version = "0.1.0", path = "core/lib/multivm" }
zksync_prover_dal = { version = "0.1.0", path = "prover/prover_dal" }
zksync_prover_dal = { version = "0.1.0", path = "prover/crates/lib/prover_dal" }
zksync_vlog = { version = "0.1.0", path = "core/lib/vlog" }
zksync_vm_utils = { version = "0.1.0", path = "core/lib/vm_utils" }
zksync_vm_benchmark_harness = { version = "0.1.0", path = "core/tests/vm-benchmark/harness" }
Expand Down
30 changes: 17 additions & 13 deletions core/bin/zksync_server/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,12 +91,25 @@ fn main() -> anyhow::Result<()> {
let tmp_config = load_env_config()?;

let configs = match opt.config_path {
None => tmp_config.general(),
None => {
let mut configs = tmp_config.general();
configs.consensus_config =
config::read_consensus_config().context("read_consensus_config()")?;
configs
}
Some(path) => {
let yaml =
std::fs::read_to_string(&path).with_context(|| path.display().to_string())?;
decode_yaml_repr::<zksync_protobuf_config::proto::general::GeneralConfig>(&yaml)
.context("failed decoding general YAML config")?
let mut configs =
decode_yaml_repr::<zksync_protobuf_config::proto::general::GeneralConfig>(&yaml)
.context("failed decoding general YAML config")?;
// Fallback to the consensus_config.yaml file.
// TODO: remove once we move the consensus config to general config on stage
if configs.consensus_config.is_none() {
configs.consensus_config =
config::read_consensus_config().context("read_consensus_config()")?;
}
configs
}
};

Expand Down Expand Up @@ -154,8 +167,6 @@ fn main() -> anyhow::Result<()> {
},
};

let consensus = config::read_consensus_config().context("read_consensus_config()")?;

let contracts_config = match opt.contracts_config_path {
None => ContractsConfig::from_env().context("contracts_config")?,
Some(path) => {
Expand All @@ -176,14 +187,7 @@ fn main() -> anyhow::Result<()> {
}
};

let node = MainNodeBuilder::new(
configs,
wallets,
genesis,
contracts_config,
secrets,
consensus,
);
let node = MainNodeBuilder::new(configs, wallets, genesis, contracts_config, secrets);

if opt.genesis {
// If genesis is requested, we don't need to run the node.
Expand Down
9 changes: 2 additions & 7 deletions core/bin/zksync_server/src/node_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,7 @@
use anyhow::Context;
use zksync_config::{
configs::{
consensus::ConsensusConfig, eth_sender::PubdataSendingMode, wallets::Wallets,
GeneralConfig, Secrets,
},
configs::{eth_sender::PubdataSendingMode, wallets::Wallets, GeneralConfig, Secrets},
ContractsConfig, GenesisConfig,
};
use zksync_core_leftovers::Component;
Expand Down Expand Up @@ -86,7 +83,6 @@ pub struct MainNodeBuilder {
genesis_config: GenesisConfig,
contracts_config: ContractsConfig,
secrets: Secrets,
consensus_config: Option<ConsensusConfig>,
}

impl MainNodeBuilder {
Expand All @@ -96,7 +92,6 @@ impl MainNodeBuilder {
genesis_config: GenesisConfig,
contracts_config: ContractsConfig,
secrets: Secrets,
consensus_config: Option<ConsensusConfig>,
) -> Self {
Self {
node: ZkStackServiceBuilder::new(),
Expand All @@ -105,7 +100,6 @@ impl MainNodeBuilder {
genesis_config,
contracts_config,
secrets,
consensus_config,
}
}

Expand Down Expand Up @@ -456,6 +450,7 @@ impl MainNodeBuilder {
fn add_consensus_layer(mut self) -> anyhow::Result<Self> {
self.node.add_layer(MainNodeConsensusLayer {
config: self
.configs
.consensus_config
.clone()
.context("Consensus config has to be provided")?,
Expand Down
9 changes: 1 addition & 8 deletions core/lib/basic_types/src/prover_dal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@ use chrono::{DateTime, Duration, NaiveDateTime, NaiveTime, Utc};
use strum::{Display, EnumString};

use crate::{
basic_fri_types::{AggregationRound, Eip4844Blobs},
protocol_version::ProtocolVersionId,
L1BatchNumber,
basic_fri_types::AggregationRound, protocol_version::ProtocolVersionId, L1BatchNumber,
};

#[derive(Debug, Clone)]
Expand Down Expand Up @@ -255,7 +253,6 @@ pub struct ProverJobFriInfo {
pub created_at: NaiveDateTime,
pub updated_at: NaiveDateTime,
pub time_taken: Option<NaiveTime>,
pub is_blob_cleaned: Option<bool>,
pub depth: u32,
pub is_node_final_proof: bool,
pub proof_blob_url: Option<String>,
Expand All @@ -266,7 +263,6 @@ pub struct ProverJobFriInfo {
#[derive(Debug, Clone)]
pub struct BasicWitnessGeneratorJobInfo {
pub l1_batch_number: L1BatchNumber,
pub merkle_tree_paths_blob_url: Option<String>,
pub witness_inputs_blob_url: Option<String>,
pub attempts: u32,
pub status: WitnessJobStatus,
Expand All @@ -275,10 +271,8 @@ pub struct BasicWitnessGeneratorJobInfo {
pub updated_at: NaiveDateTime,
pub processing_started_at: Option<NaiveDateTime>,
pub time_taken: Option<NaiveTime>,
pub is_blob_cleaned: Option<bool>,
pub protocol_version: Option<i32>,
pub picked_by: Option<String>,
pub eip_4844_blobs: Option<Eip4844Blobs>,
}

#[derive(Debug, Clone)]
Expand All @@ -294,7 +288,6 @@ pub struct LeafWitnessGeneratorJobInfo {
pub updated_at: NaiveDateTime,
pub processing_started_at: Option<NaiveDateTime>,
pub time_taken: Option<NaiveTime>,
pub is_blob_cleaned: Option<bool>,
pub number_of_basic_circuits: Option<i32>,
pub protocol_version: Option<i32>,
pub picked_by: Option<String>,
Expand Down
4 changes: 3 additions & 1 deletion core/lib/config/src/configs/general.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ use crate::{
configs::{
base_token_adjuster::BaseTokenAdjusterConfig,
chain::{CircuitBreakerConfig, MempoolConfig, OperationsManagerConfig, StateKeeperConfig},
consensus::ConsensusConfig,
da_dispatcher::DADispatcherConfig,
fri_prover_group::FriProverGroupConfig,
house_keeper::HouseKeeperConfig,
Expand All @@ -17,7 +18,7 @@ use crate::{
SnapshotsCreatorConfig,
};

#[derive(Debug)]
#[derive(Debug, PartialEq)]
pub struct GeneralConfig {
pub postgres_config: Option<PostgresConfig>,
pub api_config: Option<ApiConfig>,
Expand Down Expand Up @@ -48,4 +49,5 @@ pub struct GeneralConfig {
pub core_object_store: Option<ObjectStoreConfig>,
pub base_token_adjuster: Option<BaseTokenAdjusterConfig>,
pub external_price_api_client_config: Option<ExternalPriceApiClientConfig>,
pub consensus_config: Option<ConsensusConfig>,
}
Loading

0 comments on commit 4edbbf6

Please sign in to comment.