diff --git a/.github/workflows/build-prover-fri-gpu-gar.yml b/.github/workflows/build-prover-fri-gpu-gar.yml index b13fca82445a..c0ea060b07e9 100644 --- a/.github/workflows/build-prover-fri-gpu-gar.yml +++ b/.github/workflows/build-prover-fri-gpu-gar.yml @@ -34,13 +34,13 @@ jobs: 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://us-docker.pkg.dev - name: Set up QEMU - uses: docker/setup-qemu-action@v2 + uses: docker/setup-qemu-action@49b3bc8e6bdd4a60e6116a5414239cba5943d3cf # v3.2.0 - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 + uses: docker/setup-buildx-action@988b5a0280414f521da01fcc63a27aeeb4b104db # v3.6.1 - name: Build and push - uses: docker/build-push-action@v4 + uses: docker/build-push-action@5cd11c3a4ced054e52742c5fd54dca954e0edd85 # v6.7.0 with: context: docker/prover-gpu-fri-gar build-args: | diff --git a/.github/workflows/build-prover-template.yml b/.github/workflows/build-prover-template.yml index 84e1b4f0f5d0..4f3cad7f1d02 100644 --- a/.github/workflows/build-prover-template.yml +++ b/.github/workflows/build-prover-template.yml @@ -180,7 +180,7 @@ jobs: - witness-vector-generator steps: - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 + uses: docker/setup-buildx-action@988b5a0280414f521da01fcc63a27aeeb4b104db # v3.6.1 - name: Login to us-central1 GAR run: | diff --git a/.github/workflows/build-tee-prover-template.yml b/.github/workflows/build-tee-prover-template.yml index 21c7f9340ba0..0e5b80d2e3a2 100644 --- a/.github/workflows/build-tee-prover-template.yml +++ b/.github/workflows/build-tee-prover-template.yml @@ -28,15 +28,15 @@ jobs: IMAGE_TAG_SUFFIX: ${{ inputs.image_tag_suffix }} runs-on: [matterlabs-ci-runner-high-performance] steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4 if: ${{ github.event_name == 'workflow_dispatch' }} with: ref: ${{ github.event.inputs.target_branch }} - - uses: actions/checkout@v4 + - uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4 if: ${{ github.event_name != 'workflow_dispatch' }} - - uses: cachix/install-nix-action@v27 + - uses: cachix/install-nix-action@ba0dd844c9180cbf77aa72a116d6fbc515d0e87b # v27 with: extra_nix_config: | access-tokens = github.com=${{ github.token }} @@ -45,7 +45,7 @@ jobs: sandbox = true - name: Setup Attic cache - uses: ryanccn/attic-action@v0 + uses: ryanccn/attic-action@618a980988d704a7709daeea88526146acd1d45f # v0.2.1 with: endpoint: https://attic.teepot.org/ cache: tee-pot diff --git a/.github/workflows/ci-core-reusable.yml b/.github/workflows/ci-core-reusable.yml index 62bd76dd0efc..53bd1ab7a518 100644 --- a/.github/workflows/ci-core-reusable.yml +++ b/.github/workflows/ci-core-reusable.yml @@ -52,22 +52,19 @@ jobs: - name: Init run: | - ci_run zk ci_run run_retried rustup show - ci_run zk run yarn - ci_run zk db setup - ci_run zk compiler all - ci_run zk contract build + ci_run ./bin/zkt + ci_run zk_supervisor contracts - name: Contracts unit tests run: ci_run yarn l1-contracts test - name: Rust unit tests run: | - ci_run zk test rust + ci_run zk_supervisor test rust # Benchmarks are not tested by `cargo nextest` unless specified explicitly, and even then `criterion` harness is incompatible # with how `cargo nextest` runs tests. Thus, we run criterion-based benchmark tests manually. - ci_run zk f cargo test --release -p vm-benchmark --bench oneshot --bench batch + ci_run cargo test --release -p vm-benchmark --bench oneshot --bench batch loadtest: runs-on: [ matterlabs-ci-runner-high-performance ] @@ -90,8 +87,10 @@ jobs: - name: Loadtest configuration run: | - echo EXPECTED_TX_COUNT=${{ matrix.vm_mode == 'new' && 22000 || 16000 }} >> .env - echo ACCOUNTS_AMOUNT="150" >> .env + echo EXPECTED_TX_COUNT=${{ matrix.vm_mode == 'new' && 21000 || 16000 }} >> .env + echo ACCOUNTS_AMOUNT="100" >> .env + echo MAX_INFLIGHT_TXS="10" >> .env + echo SYNC_API_REQUESTS_LIMIT="15" >> .env echo FAIL_FAST=true >> .env echo IN_DOCKER=1 >> .env echo DATABASE_MERKLE_TREE_MODE=lightweight >> .env @@ -115,7 +114,8 @@ jobs: - name: Run server run: | EXPERIMENTAL_VM_STATE_KEEPER_FAST_VM_MODE=${{ matrix.vm_mode }} \ - PASSED_ENV_VARS="EXPERIMENTAL_VM_STATE_KEEPER_FAST_VM_MODE" \ + CHAIN_MEMPOOL_DELAY_INTERVAL=50 \ + PASSED_ENV_VARS="EXPERIMENTAL_VM_STATE_KEEPER_FAST_VM_MODE,CHAIN_MEMPOOL_DELAY_INTERVAL" \ ci_run zk server --uring --components api,tree,eth,state_keeper,housekeeper,commitment_generator,vm_runner_protective_reads &>server.log & ci_run sleep 60 diff --git a/.github/workflows/ci-zk-toolbox-reusable.yml b/.github/workflows/ci-zk-toolbox-reusable.yml index 21ffdc0523c9..5f82df646c13 100644 --- a/.github/workflows/ci-zk-toolbox-reusable.yml +++ b/.github/workflows/ci-zk-toolbox-reusable.yml @@ -249,7 +249,7 @@ jobs: - name: Upload logs - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0 if: always() with: name: logs diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bcafbfc0b6b1..53c169114915 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -31,7 +31,7 @@ jobs: - name: Get changed files id: changed-files - uses: tj-actions/changed-files@v39 + uses: tj-actions/changed-files@fea790cb660e33aef4bdf07304e28fedd77dfa13 # v39 with: files_yaml: | prover: diff --git a/.github/workflows/nodejs-license.yaml b/.github/workflows/nodejs-license.yaml index b776673e1298..642ded744021 100644 --- a/.github/workflows/nodejs-license.yaml +++ b/.github/workflows/nodejs-license.yaml @@ -47,7 +47,7 @@ jobs: uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4 - name: Use Node.js - uses: actions/setup-node@v3 + uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4.0.3 with: node-version: 18 diff --git a/.github/workflows/protobuf.yaml b/.github/workflows/protobuf.yaml index d2885f613aa0..9c2c34186701 100644 --- a/.github/workflows/protobuf.yaml +++ b/.github/workflows/protobuf.yaml @@ -33,7 +33,7 @@ jobs: compatibility: runs-on: [ubuntu-22.04-github-hosted-16core] steps: - - uses: mozilla-actions/sccache-action@v0.0.3 + - uses: mozilla-actions/sccache-action@89e9040de88b577a072e3760aaf59f585da083af # v0.0.5 # before - uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4 @@ -69,7 +69,7 @@ jobs: | xargs cat > ./after.binpb # compare - - uses: bufbuild/buf-setup-action@v1 + - uses: bufbuild/buf-setup-action@54abbed4fe8d8d45173eca4798b0c39a53a7b658 # v1.39.0 with: github_token: ${{ github.token }} - name: buf breaking diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml index 692a420eed81..4a8f527f45c6 100644 --- a/.github/workflows/release-please.yml +++ b/.github/workflows/release-please.yml @@ -15,7 +15,7 @@ jobs: steps: - name: Run release-please id: release - uses: google-github-actions/release-please-action@v4 + uses: google-github-actions/release-please-action@e4dc86ba9405554aeba3c6bb2d169500e7d3b4ee # v4.1.1 with: token: ${{ secrets.RELEASE_TOKEN }} config-file: .github/release-please/config.json diff --git a/.github/workflows/release-test-stage.yml b/.github/workflows/release-test-stage.yml index 9f921be78292..1da5aa9ac928 100644 --- a/.github/workflows/release-test-stage.yml +++ b/.github/workflows/release-test-stage.yml @@ -23,7 +23,7 @@ jobs: - name: Get all test, doc and src files that have changed id: changed-files-yaml - uses: tj-actions/changed-files@v37 + uses: tj-actions/changed-files@fea790cb660e33aef4bdf07304e28fedd77dfa13 # v39 with: files_yaml: | # TODO: make it more granular, as already implemented in CI workflow diff --git a/.github/workflows/vm-perf-comparison.yml b/.github/workflows/vm-perf-comparison.yml index db729cbadc07..cfcfff93037f 100644 --- a/.github/workflows/vm-perf-comparison.yml +++ b/.github/workflows/vm-perf-comparison.yml @@ -68,7 +68,7 @@ jobs: id: comparison - name: Comment on PR - uses: thollander/actions-comment-pull-request@v2 + uses: thollander/actions-comment-pull-request@fabd468d3a1a0b97feee5f6b9e499eab0dd903f6 # v2.5.0 with: message: | ${{ steps.comparison.outputs.speedup == '' && '## No performance difference detected (anymore)' || '## Detected VM performance changes' }} diff --git a/.github/workflows/zk-environment-publish.yml b/.github/workflows/zk-environment-publish.yml index 7e232475b148..5a08dff178c4 100644 --- a/.github/workflows/zk-environment-publish.yml +++ b/.github/workflows/zk-environment-publish.yml @@ -36,7 +36,7 @@ jobs: - name: Get changed files id: changed-files-yaml - uses: tj-actions/changed-files@v39 + uses: tj-actions/changed-files@fea790cb660e33aef4bdf07304e28fedd77dfa13 # v39 with: files_yaml: | zk_env: diff --git a/Cargo.lock b/Cargo.lock index 307a85e5abe7..09761d311ba7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1981,6 +1981,14 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" +[[package]] +name = "eravm-stable-interface" +version = "0.1.0" +source = "git+https://github.com/matter-labs/vm2.git?rev=4ef15d46410ffc11744771a3a6c7c09dd9470c90#4ef15d46410ffc11744771a3a6c7c09dd9470c90" +dependencies = [ + "primitive-types", +] + [[package]] name = "errno" version = "0.3.9" @@ -7307,9 +7315,10 @@ dependencies = [ [[package]] name = "vm2" version = "0.1.0" -source = "git+https://github.com/matter-labs/vm2.git?rev=2276b7b5af520fca0477bdafe43781b51896d235#2276b7b5af520fca0477bdafe43781b51896d235" +source = "git+https://github.com/matter-labs/vm2.git?rev=4ef15d46410ffc11744771a3a6c7c09dd9470c90#4ef15d46410ffc11744771a3a6c7c09dd9470c90" dependencies = [ "enum_dispatch", + "eravm-stable-interface", "primitive-types", "zk_evm_abstractions 0.150.4", "zkevm_opcode_defs 0.150.4", @@ -8819,7 +8828,6 @@ dependencies = [ "vise", "zksync_config", "zksync_dal", - "zksync_prover_dal", "zksync_shared_metrics", "zksync_types", ] @@ -9170,7 +9178,6 @@ dependencies = [ "zksync_object_store", "zksync_proof_data_handler", "zksync_protobuf_config", - "zksync_prover_dal", "zksync_queued_job_processor", "zksync_reorg_detector", "zksync_state", @@ -9391,16 +9398,6 @@ dependencies = [ "zksync_types", ] -[[package]] -name = "zksync_prover_dal" -version = "0.1.0" -dependencies = [ - "sqlx", - "strum", - "zksync_basic_types", - "zksync_db_connection", -] - [[package]] name = "zksync_prover_interface" version = "0.1.0" diff --git a/Cargo.toml b/Cargo.toml index 334c85870f27..d244d436b9f5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -79,8 +79,6 @@ members = [ "core/tests/test_account", "core/tests/loadnext", "core/tests/vm-benchmark", - # Parts of prover workspace that are needed for Core workspace - "prover/crates/lib/prover_dal", ] resolver = "2" @@ -217,7 +215,7 @@ zk_evm_1_4_1 = { package = "zk_evm", version = "0.141.0" } zk_evm_1_5_0 = { package = "zk_evm", version = "=0.150.4" } # New VM; pinned to a specific commit because of instability -vm2 = { git = "https://github.com/matter-labs/vm2.git", rev = "2276b7b5af520fca0477bdafe43781b51896d235" } +vm2 = { git = "https://github.com/matter-labs/vm2.git", rev = "4ef15d46410ffc11744771a3a6c7c09dd9470c90" } # Consensus dependencies. zksync_concurrency = "=0.1.0-rc.11" @@ -233,7 +231,6 @@ zksync_protobuf_build = "=0.1.0-rc.11" # "Local" dependencies zksync_multivm = { version = "0.1.0", path = "core/lib/multivm" } -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_interface = { version = "0.1.0", path = "core/lib/vm_interface" } zksync_vm_executor = { version = "0.1.0", path = "core/lib/vm_executor" } diff --git a/core/bin/zksync_server/src/node_builder.rs b/core/bin/zksync_server/src/node_builder.rs index 6b0315200651..36ee7d990cf9 100644 --- a/core/bin/zksync_server/src/node_builder.rs +++ b/core/bin/zksync_server/src/node_builder.rs @@ -122,7 +122,6 @@ impl MainNodeBuilder { let pools_layer = PoolsLayerBuilder::empty(config, secrets) .with_master(true) .with_replica(true) - .with_prover(true) // Used by house keeper. .build(); self.node.add_layer(pools_layer); Ok(self) @@ -446,18 +445,9 @@ impl MainNodeBuilder { fn add_house_keeper_layer(mut self) -> anyhow::Result { let house_keeper_config = try_load_config!(self.configs.house_keeper_config); - let fri_prover_config = try_load_config!(self.configs.prover_config); - let fri_witness_generator_config = try_load_config!(self.configs.witness_generator_config); - let fri_prover_group_config = try_load_config!(self.configs.prover_group_config); - let fri_proof_compressor_config = try_load_config!(self.configs.proof_compressor_config); - - self.node.add_layer(HouseKeeperLayer::new( - house_keeper_config, - fri_prover_config, - fri_witness_generator_config, - fri_prover_group_config, - fri_proof_compressor_config, - )); + + self.node + .add_layer(HouseKeeperLayer::new(house_keeper_config)); Ok(self) } diff --git a/core/lib/config/src/configs/house_keeper.rs b/core/lib/config/src/configs/house_keeper.rs index e1eb13375667..39e304562fa0 100644 --- a/core/lib/config/src/configs/house_keeper.rs +++ b/core/lib/config/src/configs/house_keeper.rs @@ -4,29 +4,4 @@ use serde::Deserialize; #[derive(Debug, Deserialize, Clone, PartialEq)] pub struct HouseKeeperConfig { pub l1_batch_metrics_reporting_interval_ms: u64, - pub gpu_prover_queue_reporting_interval_ms: u64, - pub prover_job_retrying_interval_ms: u64, - pub prover_stats_reporting_interval_ms: u64, - pub witness_job_moving_interval_ms: u64, - pub witness_generator_stats_reporting_interval_ms: u64, - pub witness_generator_job_retrying_interval_ms: u64, - pub prover_db_pool_size: u32, - pub proof_compressor_job_retrying_interval_ms: u64, - pub proof_compressor_stats_reporting_interval_ms: u64, - pub prover_job_archiver_archiving_interval_ms: Option, - pub prover_job_archiver_archive_after_secs: Option, - pub fri_gpu_prover_archiver_archiving_interval_ms: Option, - pub fri_gpu_prover_archiver_archive_after_secs: Option, -} - -impl HouseKeeperConfig { - pub fn prover_job_archiver_params(&self) -> Option<(u64, u64)> { - self.prover_job_archiver_archiving_interval_ms - .zip(self.prover_job_archiver_archive_after_secs) - } - - pub fn fri_gpu_prover_archiver_params(&self) -> Option<(u64, u64)> { - self.fri_gpu_prover_archiver_archiving_interval_ms - .zip(self.fri_gpu_prover_archiver_archive_after_secs) - } } diff --git a/core/lib/config/src/testonly.rs b/core/lib/config/src/testonly.rs index 4f3838b9acde..e578af2b695a 100644 --- a/core/lib/config/src/testonly.rs +++ b/core/lib/config/src/testonly.rs @@ -631,19 +631,6 @@ impl Distribution for EncodeDist { fn sample(&self, rng: &mut R) -> configs::house_keeper::HouseKeeperConfig { configs::house_keeper::HouseKeeperConfig { l1_batch_metrics_reporting_interval_ms: self.sample(rng), - gpu_prover_queue_reporting_interval_ms: self.sample(rng), - prover_job_retrying_interval_ms: self.sample(rng), - prover_stats_reporting_interval_ms: self.sample(rng), - witness_job_moving_interval_ms: self.sample(rng), - witness_generator_stats_reporting_interval_ms: self.sample(rng), - prover_db_pool_size: self.sample(rng), - witness_generator_job_retrying_interval_ms: self.sample(rng), - proof_compressor_job_retrying_interval_ms: self.sample(rng), - proof_compressor_stats_reporting_interval_ms: self.sample(rng), - prover_job_archiver_archiving_interval_ms: self.sample(rng), - prover_job_archiver_archive_after_secs: self.sample(rng), - fri_gpu_prover_archiver_archiving_interval_ms: self.sample(rng), - fri_gpu_prover_archiver_archive_after_secs: self.sample(rng), } } } diff --git a/core/lib/dal/src/models/mod.rs b/core/lib/dal/src/models/mod.rs index a9690dcb7993..479649f85092 100644 --- a/core/lib/dal/src/models/mod.rs +++ b/core/lib/dal/src/models/mod.rs @@ -15,7 +15,7 @@ pub mod storage_sync; pub mod storage_tee_proof; pub mod storage_transaction; pub mod storage_verification_request; -pub mod storage_witness_job_info; + #[cfg(test)] mod tests; diff --git a/core/lib/dal/src/models/storage_witness_job_info.rs b/core/lib/dal/src/models/storage_witness_job_info.rs deleted file mode 100644 index 03d1120b7170..000000000000 --- a/core/lib/dal/src/models/storage_witness_job_info.rs +++ /dev/null @@ -1,78 +0,0 @@ -use std::{convert::TryFrom, str::FromStr}; - -use sqlx::types::chrono::{DateTime, NaiveDateTime, NaiveTime, Utc}; -use zksync_types::{ - basic_fri_types::AggregationRound, - prover_dal::{ - JobPosition, WitnessJobInfo, WitnessJobStatus, WitnessJobStatusFailed, - WitnessJobStatusSuccessful, - }, - L1BatchNumber, -}; - -#[derive(sqlx::FromRow)] -pub struct StorageWitnessJobInfo { - pub aggregation_round: i32, - pub l1_batch_number: i64, - pub status: String, - pub error: Option, - pub created_at: NaiveDateTime, - pub updated_at: NaiveDateTime, - pub time_taken: Option, - pub processing_started_at: Option, - pub attempts: i32, -} - -impl From for WitnessJobInfo { - fn from(x: StorageWitnessJobInfo) -> Self { - fn nt2d(nt: NaiveDateTime) -> DateTime { - DateTime::from_naive_utc_and_offset(nt, Utc) - } - - let status = - match WitnessJobStatus::from_str(x.status.as_str()) - .unwrap_or_else(|_| panic!("Unknown value '{}' in witness job status db record.", x.status)) { - WitnessJobStatus::Successful(_) => WitnessJobStatus::Successful(WitnessJobStatusSuccessful { - started_at: - nt2d(x.processing_started_at - .unwrap_or_else(|| panic!( - "Witness job is successful but lacks processing timestamp. Batch:round {}:{} ", - x.l1_batch_number, - x.aggregation_round))), - time_taken: x.time_taken.unwrap() - NaiveTime::from_hms_opt(0,0,0).unwrap() - }), - WitnessJobStatus::Failed(_) => { - let batch = x.l1_batch_number; - let round = x.aggregation_round; - - WitnessJobStatus::Failed( - WitnessJobStatusFailed { - started_at: - nt2d(x.processing_started_at - .unwrap_or_else(|| panic!( - "Witness job is failed but lacks processing timestamp. Batch:round {}:{} ", - x.l1_batch_number, - x.aggregation_round))), - error: - x.error - .unwrap_or_else(|| panic!( - "Witness job failed but lacks error message. Batch:round {}:{}", - batch, - round)), - }) - }, - x => x - }; - - WitnessJobInfo { - block_number: L1BatchNumber(x.l1_batch_number as u32), - created_at: nt2d(x.created_at), - updated_at: nt2d(x.updated_at), - status, - position: JobPosition { - aggregation_round: AggregationRound::try_from(x.aggregation_round).unwrap(), - sequence_number: 1, // Witness job 1:1 aggregation round, per block - }, - } - } -} diff --git a/core/lib/env_config/src/house_keeper.rs b/core/lib/env_config/src/house_keeper.rs index 25eeda793937..1a1ff4d27de2 100644 --- a/core/lib/env_config/src/house_keeper.rs +++ b/core/lib/env_config/src/house_keeper.rs @@ -18,21 +18,6 @@ mod tests { fn expected_config() -> HouseKeeperConfig { HouseKeeperConfig { l1_batch_metrics_reporting_interval_ms: 10_000, - gpu_prover_queue_reporting_interval_ms: 10_000, - prover_job_retrying_interval_ms: 10000, - prover_stats_reporting_interval_ms: 5_000, - witness_job_moving_interval_ms: 30_000, - witness_generator_stats_reporting_interval_ms: 10_000, - witness_generator_job_retrying_interval_ms: 30_000, - prover_db_pool_size: 2, - proof_compressor_job_retrying_interval_ms: 30_000, - proof_compressor_stats_reporting_interval_ms: 10_000, - prover_job_archiver_archiving_interval_ms: Some(1_800_000), - prover_job_archiver_archive_after_secs: Some(172_800), - // 24 hours - fri_gpu_prover_archiver_archiving_interval_ms: Some(86_400_000), - // 48 hours - fri_gpu_prover_archiver_archive_after_secs: Some(172_800), } } @@ -41,22 +26,6 @@ mod tests { let mut lock = MUTEX.lock(); let config = r#" HOUSE_KEEPER_L1_BATCH_METRICS_REPORTING_INTERVAL_MS="10000" - HOUSE_KEEPER_GPU_PROVER_QUEUE_REPORTING_INTERVAL_MS="10000" - HOUSE_KEEPER_PROVER_JOB_RETRYING_INTERVAL_MS="10000" - HOUSE_KEEPER_WITNESS_JOB_MOVING_INTERVAL_MS="30000" - HOUSE_KEEPER_WITNESS_GENERATOR_STATS_REPORTING_INTERVAL_MS="10000" - HOUSE_KEEPER_WITNESS_GENERATOR_JOB_RETRYING_INTERVAL_MS="30000" - HOUSE_KEEPER_FRI_WITNESS_JOB_MOVING_INTERVAL_MS="40000" - HOUSE_KEEPER_FRI_PROVER_JOB_RETRYING_INTERVAL_MS="30000" - HOUSE_KEEPER_FRI_WITNESS_GENERATOR_JOB_RETRYING_INTERVAL_MS="30000" - HOUSE_KEEPER_PROVER_DB_POOL_SIZE="2" - HOUSE_KEEPER_PROVER_STATS_REPORTING_INTERVAL_MS="5000" - HOUSE_KEEPER_PROOF_COMPRESSOR_STATS_REPORTING_INTERVAL_MS="10000" - HOUSE_KEEPER_PROOF_COMPRESSOR_JOB_RETRYING_INTERVAL_MS="30000" - HOUSE_KEEPER_PROVER_JOB_ARCHIVER_ARCHIVING_INTERVAL_MS="1800000" - HOUSE_KEEPER_PROVER_JOB_ARCHIVER_ARCHIVE_AFTER_SECS="172800" - HOUSE_KEEPER_FRI_GPU_PROVER_ARCHIVER_ARCHIVING_INTERVAL_MS="86400000" - HOUSE_KEEPER_FRI_GPU_PROVER_ARCHIVER_ARCHIVE_AFTER_SECS="172800" "#; lock.set_env(config); diff --git a/core/lib/multivm/Cargo.toml b/core/lib/multivm/Cargo.toml index 6a8db7e8de60..28495da33021 100644 --- a/core/lib/multivm/Cargo.toml +++ b/core/lib/multivm/Cargo.toml @@ -39,6 +39,7 @@ pretty_assertions.workspace = true thiserror.workspace = true tracing.workspace = true vise.workspace = true +ethabi.workspace = true [dev-dependencies] assert_matches.workspace = true diff --git a/core/lib/multivm/src/glue/types/vm/vm_block_result.rs b/core/lib/multivm/src/glue/types/vm/vm_block_result.rs index ce928e652d76..6ef9b2947746 100644 --- a/core/lib/multivm/src/glue/types/vm/vm_block_result.rs +++ b/core/lib/multivm/src/glue/types/vm/vm_block_result.rs @@ -47,6 +47,7 @@ impl GlueFrom for crate::interface::Fi circuit_statistic: Default::default(), }, refunds: Refunds::default(), + new_known_factory_deps: Default::default(), }, final_execution_state: CurrentExecutionState { events: value.full_result.events, @@ -103,6 +104,7 @@ impl GlueFrom for crate::interface::Fi circuit_statistic: Default::default(), }, refunds: Refunds::default(), + new_known_factory_deps: Default::default(), }, final_execution_state: CurrentExecutionState { events: value.full_result.events, @@ -158,6 +160,7 @@ impl GlueFrom for crate::interface: circuit_statistic: Default::default(), }, refunds: Refunds::default(), + new_known_factory_deps: Default::default(), }, final_execution_state: CurrentExecutionState { events: value.full_result.events, @@ -227,6 +230,7 @@ impl GlueFrom circuit_statistic: Default::default(), }, refunds: Refunds::default(), + new_known_factory_deps: Default::default(), } } } @@ -259,6 +263,7 @@ impl GlueFrom circuit_statistic: Default::default(), }, refunds: Refunds::default(), + new_known_factory_deps: Default::default(), } } } @@ -307,6 +312,7 @@ impl GlueFrom circuit_statistic: Default::default(), }, refunds: Refunds::default(), + new_known_factory_deps: Default::default(), } } } diff --git a/core/lib/multivm/src/glue/types/vm/vm_partial_execution_result.rs b/core/lib/multivm/src/glue/types/vm/vm_partial_execution_result.rs index 3cb61b461a42..1891330b6d29 100644 --- a/core/lib/multivm/src/glue/types/vm/vm_partial_execution_result.rs +++ b/core/lib/multivm/src/glue/types/vm/vm_partial_execution_result.rs @@ -22,6 +22,7 @@ impl GlueFrom gas_refunded: 0, operator_suggested_refund: 0, }, + new_known_factory_deps: Default::default(), } } } @@ -48,6 +49,7 @@ impl GlueFrom gas_refunded: 0, operator_suggested_refund: 0, }, + new_known_factory_deps: Default::default(), } } } @@ -74,6 +76,7 @@ impl GlueFrom gas_refunded: 0, operator_suggested_refund: 0, }, + new_known_factory_deps: Default::default(), } } } diff --git a/core/lib/multivm/src/glue/types/vm/vm_tx_execution_result.rs b/core/lib/multivm/src/glue/types/vm/vm_tx_execution_result.rs index 2dc680ba77d9..2ea1e3984c47 100644 --- a/core/lib/multivm/src/glue/types/vm/vm_tx_execution_result.rs +++ b/core/lib/multivm/src/glue/types/vm/vm_tx_execution_result.rs @@ -66,12 +66,14 @@ impl GlueFrom VmExecutionResultAndLogs { result: ExecutionResult::Halt { reason: halt }, logs: Default::default(), statistics: Default::default(), refunds: Default::default(), + new_known_factory_deps: Default::default(), }, } } @@ -100,12 +102,14 @@ impl logs: Default::default(), statistics: Default::default(), refunds: Default::default(), + new_known_factory_deps: Default::default(), }, TxRevertReason::Halt(halt) => VmExecutionResultAndLogs { result: ExecutionResult::Halt { reason: halt }, logs: Default::default(), statistics: Default::default(), refunds: Default::default(), + new_known_factory_deps: Default::default(), }, } } @@ -129,6 +133,7 @@ impl GlueFrom { unreachable!("Halt is the only revert reason for VM 5") diff --git a/core/lib/multivm/src/versions/shadow.rs b/core/lib/multivm/src/versions/shadow.rs index 7394c4617509..871258f43b85 100644 --- a/core/lib/multivm/src/versions/shadow.rs +++ b/core/lib/multivm/src/versions/shadow.rs @@ -77,7 +77,7 @@ where tracer: Self::TracerDispatcher, tx: Transaction, with_compression: bool, - ) -> (BytecodeCompressionResult, VmExecutionResultAndLogs) { + ) -> (BytecodeCompressionResult<'_>, VmExecutionResultAndLogs) { let tx_hash = tx.hash(); let main_result = self.main.inspect_transaction_with_bytecode_compression( tracer, @@ -165,6 +165,11 @@ impl DivergenceErrors { let shadow_logs = UniqueStorageLogs::new(&shadow_result.logs.storage_logs); self.check_match("logs.storage_logs", &main_logs, &shadow_logs); self.check_match("refunds", &main_result.refunds, &shadow_result.refunds); + self.check_match( + "statistics.circuit_statistic", + &main_result.statistics.circuit_statistic, + &shadow_result.statistics.circuit_statistic, + ); self.check_match( "gas_remaining", &main_result.statistics.gas_remaining, diff --git a/core/lib/multivm/src/versions/vm_1_3_2/vm.rs b/core/lib/multivm/src/versions/vm_1_3_2/vm.rs index eb1ae45542db..8068e4847b83 100644 --- a/core/lib/multivm/src/versions/vm_1_3_2/vm.rs +++ b/core/lib/multivm/src/versions/vm_1_3_2/vm.rs @@ -83,7 +83,7 @@ impl VmInterface for Vm { tracer: Self::TracerDispatcher, tx: Transaction, with_compression: bool, - ) -> (BytecodeCompressionResult, VmExecutionResultAndLogs) { + ) -> (BytecodeCompressionResult<'_>, VmExecutionResultAndLogs) { if let Some(storage_invocations) = tracer.storage_invocations { self.vm .execution_mode @@ -156,7 +156,7 @@ impl VmInterface for Vm { result, ) } else { - (Ok(compressed_bytecodes), result) + (Ok(compressed_bytecodes.into()), result) } } diff --git a/core/lib/multivm/src/versions/vm_1_4_1/bootloader_state/state.rs b/core/lib/multivm/src/versions/vm_1_4_1/bootloader_state/state.rs index 22d7b2814cf6..241054ae0345 100644 --- a/core/lib/multivm/src/versions/vm_1_4_1/bootloader_state/state.rs +++ b/core/lib/multivm/src/versions/vm_1_4_1/bootloader_state/state.rs @@ -191,11 +191,11 @@ impl BootloaderState { l2_block.first_tx_index + l2_block.txs.len() } - pub(crate) fn get_last_tx_compressed_bytecodes(&self) -> Vec { + pub(crate) fn get_last_tx_compressed_bytecodes(&self) -> &[CompressedBytecodeInfo] { if let Some(tx) = self.last_l2_block().txs.last() { - tx.compressed_bytecodes.clone() + &tx.compressed_bytecodes } else { - vec![] + &[] } } diff --git a/core/lib/multivm/src/versions/vm_1_4_1/implementation/execution.rs b/core/lib/multivm/src/versions/vm_1_4_1/implementation/execution.rs index db5aaa783df5..61b99cb676ed 100644 --- a/core/lib/multivm/src/versions/vm_1_4_1/implementation/execution.rs +++ b/core/lib/multivm/src/versions/vm_1_4_1/implementation/execution.rs @@ -96,6 +96,7 @@ impl Vm { logs, statistics, refunds, + new_known_factory_deps: Default::default(), }; (stop_reason, result) diff --git a/core/lib/multivm/src/versions/vm_1_4_1/vm.rs b/core/lib/multivm/src/versions/vm_1_4_1/vm.rs index 8e63afd8e1ca..2c1a4ba5e36b 100644 --- a/core/lib/multivm/src/versions/vm_1_4_1/vm.rs +++ b/core/lib/multivm/src/versions/vm_1_4_1/vm.rs @@ -105,7 +105,7 @@ impl VmInterface for Vm { tracer: Self::TracerDispatcher, tx: Transaction, with_compression: bool, - ) -> (BytecodeCompressionResult, VmExecutionResultAndLogs) { + ) -> (BytecodeCompressionResult<'_>, VmExecutionResultAndLogs) { self.push_transaction_with_compression(tx, with_compression); let result = self.inspect_inner(tracer, VmExecutionMode::OneTx, None); if self.has_unpublished_bytecodes() { @@ -115,7 +115,10 @@ impl VmInterface for Vm { ) } else { ( - Ok(self.bootloader_state.get_last_tx_compressed_bytecodes()), + Ok(self + .bootloader_state + .get_last_tx_compressed_bytecodes() + .into()), result, ) } diff --git a/core/lib/multivm/src/versions/vm_1_4_2/bootloader_state/state.rs b/core/lib/multivm/src/versions/vm_1_4_2/bootloader_state/state.rs index e692c8a2640d..c0d94bd685c4 100644 --- a/core/lib/multivm/src/versions/vm_1_4_2/bootloader_state/state.rs +++ b/core/lib/multivm/src/versions/vm_1_4_2/bootloader_state/state.rs @@ -191,11 +191,11 @@ impl BootloaderState { l2_block.first_tx_index + l2_block.txs.len() } - pub(crate) fn get_last_tx_compressed_bytecodes(&self) -> Vec { + pub(crate) fn get_last_tx_compressed_bytecodes(&self) -> &[CompressedBytecodeInfo] { if let Some(tx) = self.last_l2_block().txs.last() { - tx.compressed_bytecodes.clone() + &tx.compressed_bytecodes } else { - vec![] + &[] } } diff --git a/core/lib/multivm/src/versions/vm_1_4_2/implementation/execution.rs b/core/lib/multivm/src/versions/vm_1_4_2/implementation/execution.rs index d42d18809331..f49eb10e26bc 100644 --- a/core/lib/multivm/src/versions/vm_1_4_2/implementation/execution.rs +++ b/core/lib/multivm/src/versions/vm_1_4_2/implementation/execution.rs @@ -96,6 +96,7 @@ impl Vm { logs, statistics, refunds, + new_known_factory_deps: Default::default(), }; (stop_reason, result) diff --git a/core/lib/multivm/src/versions/vm_1_4_2/vm.rs b/core/lib/multivm/src/versions/vm_1_4_2/vm.rs index e7a1f69fa424..71633dd3fca3 100644 --- a/core/lib/multivm/src/versions/vm_1_4_2/vm.rs +++ b/core/lib/multivm/src/versions/vm_1_4_2/vm.rs @@ -105,7 +105,7 @@ impl VmInterface for Vm { tracer: Self::TracerDispatcher, tx: Transaction, with_compression: bool, - ) -> (BytecodeCompressionResult, VmExecutionResultAndLogs) { + ) -> (BytecodeCompressionResult<'_>, VmExecutionResultAndLogs) { self.push_transaction_with_compression(tx, with_compression); let result = self.inspect_inner(tracer, VmExecutionMode::OneTx, None); if self.has_unpublished_bytecodes() { @@ -115,7 +115,10 @@ impl VmInterface for Vm { ) } else { ( - Ok(self.bootloader_state.get_last_tx_compressed_bytecodes()), + Ok(self + .bootloader_state + .get_last_tx_compressed_bytecodes() + .into()), result, ) } diff --git a/core/lib/multivm/src/versions/vm_boojum_integration/bootloader_state/state.rs b/core/lib/multivm/src/versions/vm_boojum_integration/bootloader_state/state.rs index 8a605978a1ed..830fe482320b 100644 --- a/core/lib/multivm/src/versions/vm_boojum_integration/bootloader_state/state.rs +++ b/core/lib/multivm/src/versions/vm_boojum_integration/bootloader_state/state.rs @@ -191,11 +191,11 @@ impl BootloaderState { l2_block.first_tx_index + l2_block.txs.len() } - pub(crate) fn get_last_tx_compressed_bytecodes(&self) -> Vec { + pub(crate) fn get_last_tx_compressed_bytecodes(&self) -> &[CompressedBytecodeInfo] { if let Some(tx) = self.last_l2_block().txs.last() { - tx.compressed_bytecodes.clone() + &tx.compressed_bytecodes } else { - vec![] + &[] } } diff --git a/core/lib/multivm/src/versions/vm_boojum_integration/implementation/execution.rs b/core/lib/multivm/src/versions/vm_boojum_integration/implementation/execution.rs index a7c790a4bc30..73f122c701dc 100644 --- a/core/lib/multivm/src/versions/vm_boojum_integration/implementation/execution.rs +++ b/core/lib/multivm/src/versions/vm_boojum_integration/implementation/execution.rs @@ -90,6 +90,7 @@ impl Vm { logs, statistics, refunds, + new_known_factory_deps: Default::default(), }; (stop_reason, result) diff --git a/core/lib/multivm/src/versions/vm_boojum_integration/vm.rs b/core/lib/multivm/src/versions/vm_boojum_integration/vm.rs index 4b6b6931dd22..c7b4a5537acb 100644 --- a/core/lib/multivm/src/versions/vm_boojum_integration/vm.rs +++ b/core/lib/multivm/src/versions/vm_boojum_integration/vm.rs @@ -106,7 +106,7 @@ impl VmInterface for Vm { tracer: Self::TracerDispatcher, tx: Transaction, with_compression: bool, - ) -> (BytecodeCompressionResult, VmExecutionResultAndLogs) { + ) -> (BytecodeCompressionResult<'_>, VmExecutionResultAndLogs) { self.push_transaction_with_compression(tx, with_compression); let result = self.inspect_inner(tracer, VmExecutionMode::OneTx); if self.has_unpublished_bytecodes() { @@ -116,7 +116,10 @@ impl VmInterface for Vm { ) } else { ( - Ok(self.bootloader_state.get_last_tx_compressed_bytecodes()), + Ok(self + .bootloader_state + .get_last_tx_compressed_bytecodes() + .into()), result, ) } diff --git a/core/lib/multivm/src/versions/vm_fast/bootloader_state/state.rs b/core/lib/multivm/src/versions/vm_fast/bootloader_state/state.rs index ce37636d2cda..15b4daf02a77 100644 --- a/core/lib/multivm/src/versions/vm_fast/bootloader_state/state.rs +++ b/core/lib/multivm/src/versions/vm_fast/bootloader_state/state.rs @@ -189,11 +189,11 @@ impl BootloaderState { l2_block.first_tx_index + l2_block.txs.len() } - pub(crate) fn get_last_tx_compressed_bytecodes(&self) -> Vec { + pub(crate) fn get_last_tx_compressed_bytecodes(&self) -> &[CompressedBytecodeInfo] { if let Some(tx) = self.last_l2_block().txs.last() { - tx.compressed_bytecodes.clone() + &tx.compressed_bytecodes } else { - vec![] + &[] } } diff --git a/core/lib/multivm/src/versions/vm_fast/circuits_tracer.rs b/core/lib/multivm/src/versions/vm_fast/circuits_tracer.rs new file mode 100644 index 000000000000..061d91be60b7 --- /dev/null +++ b/core/lib/multivm/src/versions/vm_fast/circuits_tracer.rs @@ -0,0 +1,157 @@ +use circuit_sequencer_api_1_5_0::{geometry_config::get_geometry_config, toolset::GeometryConfig}; +use vm2::{CycleStats, Opcode, OpcodeType, StateInterface, Tracer}; +use zksync_vm_interface::CircuitStatistic; + +use crate::vm_latest::tracers::circuits_capacity::*; + +#[derive(Debug, Default, Clone, PartialEq)] +pub(crate) struct CircuitsTracer { + main_vm_cycles: u32, + ram_permutation_cycles: u32, + storage_application_cycles: u32, + storage_sorter_cycles: u32, + code_decommitter_cycles: u32, + code_decommitter_sorter_cycles: u32, + log_demuxer_cycles: u32, + events_sorter_cycles: u32, + keccak256_cycles: u32, + ecrecover_cycles: u32, + sha256_cycles: u32, + secp256k1_verify_cycles: u32, + transient_storage_checker_cycles: u32, +} + +impl Tracer for CircuitsTracer { + fn after_instruction(&mut self, _state: &mut S) { + self.main_vm_cycles += 1; + + match OP::VALUE { + Opcode::Nop + | Opcode::Add + | Opcode::Sub + | Opcode::Mul + | Opcode::Div + | Opcode::Jump + | Opcode::Xor + | Opcode::And + | Opcode::Or + | Opcode::ShiftLeft + | Opcode::ShiftRight + | Opcode::RotateLeft + | Opcode::RotateRight + | Opcode::PointerAdd + | Opcode::PointerSub + | Opcode::PointerPack + | Opcode::PointerShrink => { + self.ram_permutation_cycles += RICH_ADDRESSING_OPCODE_RAM_CYCLES; + } + Opcode::This + | Opcode::Caller + | Opcode::CodeAddress + | Opcode::ContextMeta + | Opcode::ErgsLeft + | Opcode::SP + | Opcode::ContextU128 + | Opcode::SetContextU128 + | Opcode::AuxMutating0 + | Opcode::IncrementTxNumber + | Opcode::Ret(_) + | Opcode::NearCall => { + self.ram_permutation_cycles += AVERAGE_OPCODE_RAM_CYCLES; + } + Opcode::StorageRead => { + self.ram_permutation_cycles += STORAGE_READ_RAM_CYCLES; + self.log_demuxer_cycles += STORAGE_READ_LOG_DEMUXER_CYCLES; + self.storage_sorter_cycles += STORAGE_READ_STORAGE_SORTER_CYCLES; + } + Opcode::TransientStorageRead => { + self.ram_permutation_cycles += TRANSIENT_STORAGE_READ_RAM_CYCLES; + self.log_demuxer_cycles += TRANSIENT_STORAGE_READ_LOG_DEMUXER_CYCLES; + self.transient_storage_checker_cycles += + TRANSIENT_STORAGE_READ_TRANSIENT_STORAGE_CHECKER_CYCLES; + } + Opcode::StorageWrite => { + self.ram_permutation_cycles += STORAGE_WRITE_RAM_CYCLES; + self.log_demuxer_cycles += STORAGE_WRITE_LOG_DEMUXER_CYCLES; + self.storage_sorter_cycles += STORAGE_WRITE_STORAGE_SORTER_CYCLES; + } + Opcode::TransientStorageWrite => { + self.ram_permutation_cycles += TRANSIENT_STORAGE_WRITE_RAM_CYCLES; + self.log_demuxer_cycles += TRANSIENT_STORAGE_WRITE_LOG_DEMUXER_CYCLES; + self.transient_storage_checker_cycles += + TRANSIENT_STORAGE_WRITE_TRANSIENT_STORAGE_CHECKER_CYCLES; + } + Opcode::L2ToL1Message | Opcode::Event => { + self.ram_permutation_cycles += EVENT_RAM_CYCLES; + self.log_demuxer_cycles += EVENT_LOG_DEMUXER_CYCLES; + self.events_sorter_cycles += EVENT_EVENTS_SORTER_CYCLES; + } + Opcode::PrecompileCall => { + self.ram_permutation_cycles += PRECOMPILE_RAM_CYCLES; + self.log_demuxer_cycles += PRECOMPILE_LOG_DEMUXER_CYCLES; + } + Opcode::Decommit => { + // Note, that for decommit the log demuxer circuit is not used. + self.ram_permutation_cycles += LOG_DECOMMIT_RAM_CYCLES; + self.code_decommitter_sorter_cycles += LOG_DECOMMIT_DECOMMITTER_SORTER_CYCLES; + } + Opcode::FarCall(_) => { + self.ram_permutation_cycles += FAR_CALL_RAM_CYCLES; + self.code_decommitter_sorter_cycles += FAR_CALL_CODE_DECOMMITTER_SORTER_CYCLES; + self.storage_sorter_cycles += FAR_CALL_STORAGE_SORTER_CYCLES; + self.log_demuxer_cycles += FAR_CALL_LOG_DEMUXER_CYCLES; + } + Opcode::AuxHeapWrite | Opcode::HeapWrite /* StaticMemoryWrite */ => { + self.ram_permutation_cycles += UMA_WRITE_RAM_CYCLES; + } + Opcode::AuxHeapRead | Opcode::HeapRead | Opcode::PointerRead /* StaticMemoryRead */ => { + self.ram_permutation_cycles += UMA_READ_RAM_CYCLES; + } + } + } + + fn on_extra_prover_cycles(&mut self, stats: CycleStats) { + match stats { + CycleStats::Keccak256(cycles) => self.keccak256_cycles += cycles, + CycleStats::Sha256(cycles) => self.sha256_cycles += cycles, + CycleStats::EcRecover(cycles) => self.ecrecover_cycles += cycles, + CycleStats::Secp256k1Verify(cycles) => self.secp256k1_verify_cycles += cycles, + CycleStats::Decommit(cycles) => self.code_decommitter_cycles += cycles, + CycleStats::StorageRead => self.storage_application_cycles += 1, + CycleStats::StorageWrite => self.storage_application_cycles += 2, + } + } +} + +impl CircuitsTracer { + pub(crate) fn circuit_statistic(&self) -> CircuitStatistic { + CircuitStatistic { + main_vm: self.main_vm_cycles as f32 / GEOMETRY_CONFIG.cycles_per_vm_snapshot as f32, + ram_permutation: self.ram_permutation_cycles as f32 + / GEOMETRY_CONFIG.cycles_per_ram_permutation as f32, + storage_application: self.storage_application_cycles as f32 + / GEOMETRY_CONFIG.cycles_per_storage_application as f32, + storage_sorter: self.storage_sorter_cycles as f32 + / GEOMETRY_CONFIG.cycles_per_storage_sorter as f32, + code_decommitter: self.code_decommitter_cycles as f32 + / GEOMETRY_CONFIG.cycles_per_code_decommitter as f32, + code_decommitter_sorter: self.code_decommitter_sorter_cycles as f32 + / GEOMETRY_CONFIG.cycles_code_decommitter_sorter as f32, + log_demuxer: self.log_demuxer_cycles as f32 + / GEOMETRY_CONFIG.cycles_per_log_demuxer as f32, + events_sorter: self.events_sorter_cycles as f32 + / GEOMETRY_CONFIG.cycles_per_events_or_l1_messages_sorter as f32, + keccak256: self.keccak256_cycles as f32 + / GEOMETRY_CONFIG.cycles_per_keccak256_circuit as f32, + ecrecover: self.ecrecover_cycles as f32 + / GEOMETRY_CONFIG.cycles_per_ecrecover_circuit as f32, + sha256: self.sha256_cycles as f32 / GEOMETRY_CONFIG.cycles_per_sha256_circuit as f32, + secp256k1_verify: self.secp256k1_verify_cycles as f32 + / GEOMETRY_CONFIG.cycles_per_secp256r1_verify_circuit as f32, + transient_storage_checker: self.transient_storage_checker_cycles as f32 + / GEOMETRY_CONFIG.cycles_per_transient_storage_sorter as f32, + } + } +} + +const GEOMETRY_CONFIG: GeometryConfig = get_geometry_config(); diff --git a/core/lib/multivm/src/versions/vm_fast/mod.rs b/core/lib/multivm/src/versions/vm_fast/mod.rs index 4deb6b9dbf74..f0d8bafe69ec 100644 --- a/core/lib/multivm/src/versions/vm_fast/mod.rs +++ b/core/lib/multivm/src/versions/vm_fast/mod.rs @@ -2,6 +2,7 @@ pub use self::vm::Vm; mod bootloader_state; mod bytecode; +mod circuits_tracer; mod events; mod glue; mod hook; diff --git a/core/lib/multivm/src/versions/vm_fast/tests/block_tip.rs b/core/lib/multivm/src/versions/vm_fast/tests/block_tip.rs index 239d40947a67..15af9d868adc 100644 --- a/core/lib/multivm/src/versions/vm_fast/tests/block_tip.rs +++ b/core/lib/multivm/src/versions/vm_fast/tests/block_tip.rs @@ -10,22 +10,18 @@ use zksync_types::{ commitment::SerializeCommitment, fee_model::BatchFeeInput, get_code_key, l2_to_l1_log::L2ToL1Log, writes::StateDiffRecord, Address, Execute, H256, U256, }; -use zksync_utils::{bytecode::hash_bytecode, bytes_to_be_words, h256_to_u256, u256_to_h256}; +use zksync_utils::{bytecode::hash_bytecode, u256_to_h256}; -use super::utils::{get_complex_upgrade_abi, read_complex_upgrade}; -use crate::versions::vm_fast::tests::tester::{ - default_l1_batch, get_empty_storage, InMemoryStorageView, VmTesterBuilder, +use super::{ + tester::{default_l1_batch, get_empty_storage, VmTesterBuilder}, + utils::{get_complex_upgrade_abi, read_complex_upgrade}, }; use crate::{ - interface::{TxExecutionMode, VmExecutionMode, VmInterface}, - vm_latest::{ - constants::{ - BOOTLOADER_BATCH_TIP_CIRCUIT_STATISTICS_OVERHEAD, - BOOTLOADER_BATCH_TIP_METRICS_SIZE_OVERHEAD, BOOTLOADER_BATCH_TIP_OVERHEAD, - MAX_VM_PUBDATA_PER_BATCH, - }, - tracers::PubdataTracer, - L1BatchEnv, TracerDispatcher, + interface::{L1BatchEnv, TxExecutionMode, VmExecutionMode, VmInterface, VmInterfaceExt}, + vm_latest::constants::{ + BOOTLOADER_BATCH_TIP_CIRCUIT_STATISTICS_OVERHEAD, + BOOTLOADER_BATCH_TIP_METRICS_SIZE_OVERHEAD, BOOTLOADER_BATCH_TIP_OVERHEAD, + MAX_VM_PUBDATA_PER_BATCH, }, }; @@ -130,7 +126,6 @@ fn execute_test(test_data: L1MessengerTestData) -> TestStatistics { // We are measuring computational cost, so prices for pubdata don't matter, while they artificially dilute // the gas limit - let batch_env = L1BatchEnv { fee_input: BatchFeeInput::pubdata_independent(100_000, 100_000, 100_000), ..default_l1_batch(zksync_types::L1BatchNumber(1)) @@ -143,15 +138,7 @@ fn execute_test(test_data: L1MessengerTestData) -> TestStatistics { .with_l1_batch_env(batch_env) .build(); - let bytecodes = test_data - .bytecodes - .iter() - .map(|bytecode| { - let hash = hash_bytecode(bytecode); - let words = bytes_to_be_words(bytecode.clone()); - (h256_to_u256(hash), words) - }) - .collect(); + let bytecodes = test_data.bytecodes.iter().map(Vec::as_slice); vm.vm.insert_bytecodes(bytecodes); let txs_data = populate_mimic_calls(test_data.clone()); @@ -163,7 +150,7 @@ fn execute_test(test_data: L1MessengerTestData) -> TestStatistics { contract_address: CONTRACT_FORCE_DEPLOYER_ADDRESS, calldata: data, value: U256::zero(), - factory_deps: None, + factory_deps: vec![], }, None, ); @@ -173,44 +160,25 @@ fn execute_test(test_data: L1MessengerTestData) -> TestStatistics { let result = vm.vm.execute(VmExecutionMode::OneTx); assert!( !result.result.is_failed(), - "Transaction {i} wasn't successful for input: {:#?}", - test_data + "Transaction {i} wasn't successful for input: {test_data:#?}" ); } - // Now we count how much ergs were spent at the end of the batch + // Now we count how much gas was spent at the end of the batch // It is assumed that the top level frame is the bootloader + vm.vm.enforce_state_diffs(test_data.state_diffs.clone()); + let gas_before = vm.vm.gas_remaining(); - let ergs_before = vm.vm.gas_remaining(); - - // We ensure that indeed the provided state diffs are used - let pubdata_tracer = PubdataTracer::::new_with_forced_state_diffs( - vm.vm.batch_env.clone(), - VmExecutionMode::Batch, - test_data.state_diffs.clone(), - ); - - let result = vm.vm.inspect_inner( - TracerDispatcher::default(), - VmExecutionMode::Batch, - Some(pubdata_tracer), - ); - + let result = vm.vm.execute(VmExecutionMode::Batch); assert!( !result.result.is_failed(), - "Batch wasn't successful for input: {:?}", - test_data - ); - - let ergs_after = vm.vm.gas_remaining(); - - assert_eq!( - (ergs_before - ergs_after) as u64, - result.statistics.gas_used + "Batch wasn't successful for input: {test_data:?}" ); + let gas_after = vm.vm.gas_remaining(); + assert_eq!((gas_before - gas_after) as u64, result.statistics.gas_used); TestStatistics { - max_used_gas: ergs_before - ergs_after, + max_used_gas: gas_before - gas_after, circuit_statistics: result.statistics.circuit_statistic.total() as u64, execution_metrics_size: result.get_execution_metrics(None).size() as u64, } diff --git a/core/lib/multivm/src/versions/vm_fast/tests/circuits.rs b/core/lib/multivm/src/versions/vm_fast/tests/circuits.rs index c582bd28c882..0270ac35475b 100644 --- a/core/lib/multivm/src/versions/vm_fast/tests/circuits.rs +++ b/core/lib/multivm/src/versions/vm_fast/tests/circuits.rs @@ -1,17 +1,16 @@ use zksync_types::{Address, Execute, U256}; +use super::tester::VmTesterBuilder; use crate::{ interface::{TxExecutionMode, VmExecutionMode, VmInterface}, - vm_latest::{ - constants::BATCH_COMPUTATIONAL_GAS_LIMIT, tests::tester::VmTesterBuilder, HistoryEnabled, - }, + vm_latest::constants::BATCH_COMPUTATIONAL_GAS_LIMIT, }; // Checks that estimated number of circuits for simple transfer doesn't differ much // from hardcoded expected value. #[test] fn test_circuits() { - let mut vm = VmTesterBuilder::new(HistoryEnabled) + let mut vm = VmTesterBuilder::new() .with_empty_in_memory_storage() .with_random_rich_accounts(1) .with_deployer() @@ -25,12 +24,12 @@ fn test_circuits() { contract_address: Address::random(), calldata: Vec::new(), value: U256::from(1u8), - factory_deps: None, + factory_deps: vec![], }, None, ); vm.vm.push_transaction(tx); - let res = vm.vm.inspect(Default::default(), VmExecutionMode::OneTx); + let res = vm.vm.inspect((), VmExecutionMode::OneTx); let s = res.statistics.circuit_statistic; // Check `circuit_statistic`. diff --git a/core/lib/multivm/src/versions/vm_fast/tests/code_oracle.rs b/core/lib/multivm/src/versions/vm_fast/tests/code_oracle.rs index 11e454703bfa..f29684260051 100644 --- a/core/lib/multivm/src/versions/vm_fast/tests/code_oracle.rs +++ b/core/lib/multivm/src/versions/vm_fast/tests/code_oracle.rs @@ -6,9 +6,12 @@ use zksync_utils::{bytecode::hash_bytecode, h256_to_u256, u256_to_h256}; use crate::{ interface::{TxExecutionMode, VmExecutionMode, VmInterface, VmInterfaceExt}, - vm_fast::tests::{ - tester::{get_empty_storage, VmTesterBuilder}, - utils::{load_precompiles_contract, read_precompiles_contract, read_test_contract}, + vm_fast::{ + circuits_tracer::CircuitsTracer, + tests::{ + tester::{get_empty_storage, VmTesterBuilder}, + utils::{load_precompiles_contract, read_precompiles_contract, read_test_contract}, + }, }, }; @@ -207,11 +210,11 @@ fn refunds_in_code_oracle() { let account = &mut vm.rich_accounts[0]; if decommit { - let (_, is_fresh) = vm - .vm - .inner - .world_diff - .decommit_opcode(&mut vm.vm.world, h256_to_u256(normal_zkevm_bytecode_hash)); + let (_, is_fresh) = vm.vm.inner.world_diff.decommit_opcode( + &mut vm.vm.world, + &mut CircuitsTracer::default(), + h256_to_u256(normal_zkevm_bytecode_hash), + ); assert!(is_fresh); } diff --git a/core/lib/multivm/src/versions/vm_fast/tests/get_used_contracts.rs b/core/lib/multivm/src/versions/vm_fast/tests/get_used_contracts.rs index e5820dc8b428..fc493e292286 100644 --- a/core/lib/multivm/src/versions/vm_fast/tests/get_used_contracts.rs +++ b/core/lib/multivm/src/versions/vm_fast/tests/get_used_contracts.rs @@ -6,7 +6,7 @@ use itertools::Itertools; use zk_evm_1_3_1::zkevm_opcode_defs::decoding::{EncodingModeProduction, VmEncodingMode}; use zksync_system_constants::CONTRACT_DEPLOYER_ADDRESS; use zksync_test_account::Account; -use zksync_types::{Address, Execute, U256}; +use zksync_types::{AccountTreeId, Address, Execute, StorageKey, H256, U256}; use zksync_utils::{bytecode::hash_bytecode, h256_to_u256}; use crate::{ @@ -113,7 +113,13 @@ fn inflated_counter_bytecode() -> Vec { counter_bytecode } -fn execute_proxy_counter(gas: u32) -> (VmTester, U256, VmExecutionResultAndLogs) { +#[derive(Debug)] +struct ProxyCounterData { + proxy_counter_address: Address, + counter_bytecode_hash: U256, +} + +fn execute_proxy_counter(gas: u32) -> (VmTester, ProxyCounterData, VmExecutionResultAndLogs) { let counter_bytecode = inflated_counter_bytecode(); let counter_bytecode_hash = h256_to_u256(hash_bytecode(&counter_bytecode)); let counter_address = Address::repeat_byte(0x23); @@ -160,27 +166,69 @@ fn execute_proxy_counter(gas: u32) -> (VmTester, U256, VmExecutionResultAndLogs) .vm .execute_transaction_with_bytecode_compression(increment_tx, true); compression_result.unwrap(); - (vm, counter_bytecode_hash, exec_result) + let data = ProxyCounterData { + proxy_counter_address: deploy_tx.address, + counter_bytecode_hash, + }; + (vm, data, exec_result) } #[test] fn get_used_contracts_with_far_call() { - let (vm, counter_bytecode_hash, exec_result) = execute_proxy_counter(100_000); + let (vm, data, exec_result) = execute_proxy_counter(100_000); assert!(!exec_result.result.is_failed(), "{exec_result:#?}"); let decommitted_hashes = vm.vm.decommitted_hashes().collect::>(); assert!( - decommitted_hashes.contains(&counter_bytecode_hash), + decommitted_hashes.contains(&data.counter_bytecode_hash), "{decommitted_hashes:?}" ); } #[test] fn get_used_contracts_with_out_of_gas_far_call() { - let (vm, counter_bytecode_hash, exec_result) = execute_proxy_counter(10_000); + let (mut vm, data, exec_result) = execute_proxy_counter(10_000); assert_matches!(exec_result.result, ExecutionResult::Revert { .. }); let decommitted_hashes = vm.vm.decommitted_hashes().collect::>(); assert!( - decommitted_hashes.contains(&counter_bytecode_hash), + decommitted_hashes.contains(&data.counter_bytecode_hash), "{decommitted_hashes:?}" ); + + // Execute another transaction with a successful far call and check that it's still charged for decommitment. + let account = &mut vm.rich_accounts[0]; + let (_, proxy_counter_abi) = read_proxy_counter_contract(); + let increment = proxy_counter_abi.function("increment").unwrap(); + let increment_tx = account.get_l2_tx_for_execute( + Execute { + contract_address: data.proxy_counter_address, + calldata: increment + .encode_input(&[Token::Uint(1.into()), Token::Uint(u64::MAX.into())]) + .unwrap(), + value: 0.into(), + factory_deps: vec![], + }, + None, + ); + let (compression_result, exec_result) = vm + .vm + .execute_transaction_with_bytecode_compression(increment_tx, true); + compression_result.unwrap(); + assert!(!exec_result.result.is_failed(), "{exec_result:#?}"); + + let proxy_counter_cost_key = StorageKey::new( + AccountTreeId::new(data.proxy_counter_address), + H256::from_low_u64_be(1), + ); + let far_call_cost_log = exec_result + .logs + .storage_logs + .iter() + .find(|log| log.log.key == proxy_counter_cost_key) + .expect("no cost log"); + assert!( + far_call_cost_log.previous_value.is_zero(), + "{far_call_cost_log:?}" + ); + let far_call_cost = h256_to_u256(far_call_cost_log.log.value); + assert!(far_call_cost > 10_000.into(), "{far_call_cost}"); } diff --git a/core/lib/multivm/src/versions/vm_fast/tests/mod.rs b/core/lib/multivm/src/versions/vm_fast/tests/mod.rs index 9d5b229f23a9..730c573cdcf4 100644 --- a/core/lib/multivm/src/versions/vm_fast/tests/mod.rs +++ b/core/lib/multivm/src/versions/vm_fast/tests/mod.rs @@ -1,9 +1,9 @@ +mod block_tip; mod bootloader; -mod default_aa; -//mod block_tip; FIXME: requires vm metrics mod bytecode_publishing; +mod default_aa; // mod call_tracer; FIXME: requires tracers -// mod circuits; FIXME: requires tracers / circuit stats +mod circuits; mod code_oracle; mod gas_limit; mod get_used_contracts; @@ -11,7 +11,7 @@ mod is_write_initial; mod l1_tx_execution; mod l2_blocks; mod nonce_holder; -// mod precompiles; FIXME: requires tracers / circuit stats +mod precompiles; // mod prestate_tracer; FIXME: is pre-state tracer still relevant? mod refunds; mod require_eip712; diff --git a/core/lib/multivm/src/versions/vm_fast/tests/precompiles.rs b/core/lib/multivm/src/versions/vm_fast/tests/precompiles.rs index 5bdf0930d558..f77eeb4f126e 100644 --- a/core/lib/multivm/src/versions/vm_fast/tests/precompiles.rs +++ b/core/lib/multivm/src/versions/vm_fast/tests/precompiles.rs @@ -1,9 +1,9 @@ -use zk_evm_1_5_0::zk_evm_abstractions::precompiles::PrecompileAddress; +use circuit_sequencer_api_1_5_0::geometry_config::get_geometry_config; use zksync_types::{Address, Execute}; +use super::{tester::VmTesterBuilder, utils::read_precompiles_contract}; use crate::{ interface::{TxExecutionMode, VmExecutionMode, VmInterface}, - vm_fast::tests::{tester::VmTesterBuilder, utils::read_precompiles_contract}, vm_latest::constants::BATCH_COMPUTATIONAL_GAS_LIMIT, }; @@ -30,25 +30,18 @@ fn test_keccak() { Execute { contract_address: address, calldata: hex::decode(keccak1000_calldata).unwrap(), - value: Default::default(), - factory_deps: None, + value: 0.into(), + factory_deps: vec![], }, None, ); vm.vm.push_transaction(tx); - let _ = vm.vm.inspect(Default::default(), VmExecutionMode::OneTx); + let exec_result = vm.vm.inspect((), VmExecutionMode::OneTx); + assert!(!exec_result.result.is_failed(), "{exec_result:#?}"); - let keccak_count = vm - .vm - .state - .precompiles_processor - .precompile_cycles_history - .inner() - .iter() - .filter(|(precompile, _)| precompile == &PrecompileAddress::Keccak256) - .count(); - - assert!(keccak_count >= 1000); + let keccak_count = exec_result.statistics.circuit_statistic.keccak256 + * get_geometry_config().cycles_per_keccak256_circuit as f32; + assert!(keccak_count >= 1000.0, "{keccak_count}"); } #[test] @@ -74,25 +67,18 @@ fn test_sha256() { Execute { contract_address: address, calldata: hex::decode(sha1000_calldata).unwrap(), - value: Default::default(), - factory_deps: None, + value: 0.into(), + factory_deps: vec![], }, None, ); vm.vm.push_transaction(tx); - let _ = vm.vm.inspect(Default::default(), VmExecutionMode::OneTx); - - let sha_count = vm - .vm - .state - .precompiles_processor - .precompile_cycles_history - .inner() - .iter() - .filter(|(precompile, _)| precompile == &PrecompileAddress::SHA256) - .count(); + let exec_result = vm.vm.inspect((), VmExecutionMode::OneTx); + assert!(!exec_result.result.is_failed(), "{exec_result:#?}"); - assert!(sha_count >= 1000); + let sha_count = exec_result.statistics.circuit_statistic.sha256 + * get_geometry_config().cycles_per_sha256_circuit as f32; + assert!(sha_count >= 1000.0, "{sha_count}"); } #[test] @@ -110,24 +96,17 @@ fn test_ecrecover() { let tx = account.get_l2_tx_for_execute( Execute { contract_address: account.address, - calldata: Vec::new(), - value: Default::default(), - factory_deps: None, + calldata: vec![], + value: 0.into(), + factory_deps: vec![], }, None, ); vm.vm.push_transaction(tx); - let _ = vm.vm.inspect(Default::default(), VmExecutionMode::OneTx); - - let ecrecover_count = vm - .vm - .state - .precompiles_processor - .precompile_cycles_history - .inner() - .iter() - .filter(|(precompile, _)| precompile == &PrecompileAddress::Ecrecover) - .count(); + let exec_result = vm.vm.inspect((), VmExecutionMode::OneTx); + assert!(!exec_result.result.is_failed(), "{exec_result:#?}"); - assert_eq!(ecrecover_count, 1); + let ecrecover_count = exec_result.statistics.circuit_statistic.ecrecover + * get_geometry_config().cycles_per_ecrecover_circuit as f32; + assert!((ecrecover_count - 1.0).abs() < 1e-4, "{ecrecover_count}"); } diff --git a/core/lib/multivm/src/versions/vm_fast/tests/tester/transaction_test_info.rs b/core/lib/multivm/src/versions/vm_fast/tests/tester/transaction_test_info.rs index 7f20ab95eaef..b46fce5f0534 100644 --- a/core/lib/multivm/src/versions/vm_fast/tests/tester/transaction_test_info.rs +++ b/core/lib/multivm/src/versions/vm_fast/tests/tester/transaction_test_info.rs @@ -7,7 +7,7 @@ use crate::{ VmExecutionMode, VmExecutionResultAndLogs, VmInterface, VmInterfaceExt, VmInterfaceHistoryEnabled, VmRevertReason, }, - vm_fast::Vm, + vm_fast::{circuits_tracer::CircuitsTracer, vm::World, Vm}, }; #[derive(Debug, Clone)] @@ -175,15 +175,23 @@ impl TransactionTestInfo { } // TODO this doesn't include all the state of ModifiedWorld -#[derive(Debug, PartialEq)] -struct VmStateDump { - state: vm2::State, +#[derive(Debug)] +struct VmStateDump { + state: vm2::State>, storage_writes: Vec<((H160, U256), U256)>, events: Box<[vm2::Event]>, } +impl PartialEq for VmStateDump { + fn eq(&self, other: &Self) -> bool { + self.state == other.state + && self.storage_writes == other.storage_writes + && self.events == other.events + } +} + impl Vm { - fn dump_state(&self) -> VmStateDump { + fn dump_state(&self) -> VmStateDump { VmStateDump { state: self.inner.state.clone(), storage_writes: self diff --git a/core/lib/multivm/src/versions/vm_fast/tests/utils.rs b/core/lib/multivm/src/versions/vm_fast/tests/utils.rs index d696aa582d64..d75ae12c30c1 100644 --- a/core/lib/multivm/src/versions/vm_fast/tests/utils.rs +++ b/core/lib/multivm/src/versions/vm_fast/tests/utils.rs @@ -17,7 +17,10 @@ use crate::interface::storage::ReadStorage; pub(crate) static BASE_SYSTEM_CONTRACTS: Lazy = Lazy::new(BaseSystemContracts::load_from_disk); -pub(crate) fn verify_required_memory(state: &State, required_values: Vec<(U256, HeapId, u32)>) { +pub(crate) fn verify_required_memory( + state: &State, + required_values: Vec<(U256, HeapId, u32)>, +) { for (required_value, memory_page, cell) in required_values { let current_value = state.heaps[memory_page].read_u256(cell * 32); assert_eq!(current_value, required_value); diff --git a/core/lib/multivm/src/versions/vm_fast/vm.rs b/core/lib/multivm/src/versions/vm_fast/vm.rs index 48b84032845f..ea04e16e997c 100644 --- a/core/lib/multivm/src/versions/vm_fast/vm.rs +++ b/core/lib/multivm/src/versions/vm_fast/vm.rs @@ -2,7 +2,7 @@ use std::{collections::HashMap, fmt}; use vm2::{ decode::decode_program, fat_pointer::FatPointer, instruction_handlers::HeapInterface, - ExecutionEnd, Program, Settings, VirtualMachine, + ExecutionEnd, Program, Settings, Tracer, VirtualMachine, }; use zk_evm_1_5_0::zkevm_opcode_defs::system_params::INITIAL_FRAME_FORMAL_EH_LOCATION; use zksync_contracts::SystemContractCode; @@ -23,6 +23,7 @@ use zksync_utils::{bytecode::hash_bytecode, h256_to_u256, u256_to_h256}; use super::{ bootloader_state::{BootloaderState, BootloaderStateSnapshot}, bytecode::compress_bytecodes, + circuits_tracer::CircuitsTracer, hook::Hook, initial_bootloader_memory::bootloader_initial_memory, transaction_data::TransactionData, @@ -30,7 +31,7 @@ use super::{ use crate::{ glue::GlueInto, interface::{ - storage::ReadStorage, BytecodeCompressionError, CompressedBytecodeInfo, + storage::ReadStorage, BytecodeCompressionError, BytecodeCompressionResult, CurrentExecutionState, ExecutionResult, FinishedL1Batch, Halt, L1BatchEnv, L2BlockEnv, Refunds, SystemEnv, TxRevertReason, VmEvent, VmExecutionLogs, VmExecutionMode, VmExecutionResultAndLogs, VmExecutionStatistics, VmInterface, VmInterfaceHistoryEnabled, @@ -55,20 +56,22 @@ use crate::{ const VM_VERSION: MultiVMSubversion = MultiVMSubversion::IncreasedBootloaderMemory; pub struct Vm { - pub(crate) world: World, - pub(crate) inner: VirtualMachine, - suspended_at: u16, + pub(crate) world: World, + pub(crate) inner: VirtualMachine>, gas_for_account_validation: u32, pub(crate) bootloader_state: BootloaderState, pub(crate) batch_env: L1BatchEnv, pub(crate) system_env: SystemEnv, snapshot: Option, + #[cfg(test)] + enforced_state_diffs: Option>, } impl Vm { fn run( &mut self, execution_mode: VmExecutionMode, + tracer: &mut CircuitsTracer, track_refunds: bool, ) -> (ExecutionResult, Refunds) { let mut refunds = Refunds { @@ -79,14 +82,8 @@ impl Vm { let mut pubdata_before = self.inner.world_diff.pubdata() as u32; let result = loop { - let hook = match self.inner.resume_from(self.suspended_at, &mut self.world) { - ExecutionEnd::SuspendedOnHook { - hook, - pc_to_resume_from, - } => { - self.suspended_at = pc_to_resume_from; - hook - } + let hook = match self.inner.run(&mut self.world, tracer) { + ExecutionEnd::SuspendedOnHook(hook) => hook, ExecutionEnd::ProgramFinished(output) => break ExecutionResult::Success { output }, ExecutionEnd::Reverted(output) => { break match TxRevertReason::parse_error(&output) { @@ -96,7 +93,7 @@ impl Vm { } ExecutionEnd::Panicked => { break ExecutionResult::Halt { - reason: if self.gas_remaining() == 0 { + reason: if self.inner.state.current_frame.gas == 0 { Halt::BootloaderOutOfGas } else { Halt::VMPanic @@ -218,10 +215,7 @@ impl Vm { user_logs: extract_l2tol1logs_from_l1_messenger(&events), l2_to_l1_messages: VmEvent::extract_long_l2_to_l1_messages(&events), published_bytecodes, - state_diffs: self - .compute_state_diffs() - .filter(|diff| diff.address != L1_MESSENGER_ADDRESS) - .collect(), + state_diffs: self.compute_state_diffs(), }; // Save the pubdata for the future initial bootloader memory building @@ -236,7 +230,13 @@ impl Vm { } Hook::PaymasterValidationEntered | Hook::ValidationStepEnded => { /* unused */ } - Hook::DebugLog | Hook::DebugReturnData | Hook::NearCallCatch => { + Hook::DebugLog => { + let (log, log_arg) = self.get_debug_log(); + let last_tx = self.bootloader_state.last_l2_block().txs.last(); + let tx_hash = last_tx.map(|tx| tx.hash); + tracing::trace!(tx = ?tx_hash, "{log}: {log_arg}"); + } + Hook::DebugReturnData | Hook::NearCallCatch => { // These hooks are for debug purposes only } } @@ -254,6 +254,26 @@ impl Vm { .unwrap() } + fn get_debug_log(&self) -> (String, String) { + let hook_params = self.get_hook_params(); + let mut msg = u256_to_h256(hook_params[0]).as_bytes().to_vec(); + // Trim 0 byte padding at the end. + while msg.last() == Some(&0) { + msg.pop(); + } + + let data = hook_params[1]; + let msg = String::from_utf8(msg).expect("Invalid debug message"); + + // For long data, it is better to use hex-encoding for greater readability + let data_str = if data > U256::from(u64::MAX) { + format!("0x{data:x}") + } else { + data.to_string() + }; + (msg, data_str) + } + /// Should only be used when the bootloader is executing (e.g., when handling hooks). pub(crate) fn read_word_from_bootloader_heap(&self, word: usize) -> U256 { self.inner.state.heaps[vm2::FIRST_HEAP].read_u256(word as u32 * 32) @@ -319,10 +339,19 @@ impl Vm { self.write_to_bootloader_heap(memory); } - fn compute_state_diffs(&mut self) -> impl Iterator + '_ { - let storage = &mut self.world.storage; + #[cfg(test)] + pub(super) fn enforce_state_diffs(&mut self, diffs: Vec) { + self.enforced_state_diffs = Some(diffs); + } - self.inner.world_diff.get_storage_changes().map( + fn compute_state_diffs(&mut self) -> Vec { + #[cfg(test)] + if let Some(enforced_diffs) = self.enforced_state_diffs.take() { + return enforced_diffs; + } + + let storage = &mut self.world.storage; + let diffs = self.inner.world_diff.get_storage_changes().map( move |((address, key), (initial_value, final_value))| { let storage_key = StorageKey::new(AccountTreeId::new(address), u256_to_h256(key)); StateDiffRecord { @@ -339,14 +368,17 @@ impl Vm { final_value, } }, - ) + ); + diffs + .filter(|diff| diff.address != L1_MESSENGER_ADDRESS) + .collect() } pub(crate) fn decommitted_hashes(&self) -> impl Iterator + '_ { self.inner.world_diff.decommitted_hashes() } - fn gas_remaining(&self) -> u32 { + pub(super) fn gas_remaining(&self) -> u32 { self.inner.state.current_frame.gas } } @@ -367,13 +399,21 @@ impl Vm { .hash .into(); - let program_cache = HashMap::from([convert_system_contract_code( - &system_env.base_system_smart_contracts.default_aa, - false, - )]); + let program_cache = HashMap::from([ + World::convert_system_contract_code( + &system_env.base_system_smart_contracts.default_aa, + false, + ), + World::convert_system_contract_code( + &system_env.base_system_smart_contracts.evm_simulator, + false, + ), + ]); - let (_, bootloader) = - convert_system_contract_code(&system_env.base_system_smart_contracts.bootloader, true); + let (_, bootloader) = World::convert_system_contract_code( + &system_env.base_system_smart_contracts.bootloader, + true, + ); let bootloader_memory = bootloader_initial_memory(&batch_env); let mut inner = VirtualMachine::new( @@ -397,10 +437,9 @@ impl Vm { inner.state.current_frame.aux_heap_size = u32::MAX; inner.state.current_frame.exception_handler = INITIAL_FRAME_FORMAL_EH_LOCATION; - let mut me = Self { + let mut this = Self { world: World::new(storage, program_cache), inner, - suspended_at: 0, gas_for_account_validation: system_env.default_validation_computational_gas_limit, bootloader_state: BootloaderState::new( system_env.execution_mode, @@ -410,11 +449,11 @@ impl Vm { system_env, batch_env, snapshot: None, + #[cfg(test)] + enforced_state_diffs: None, }; - - me.write_to_bootloader_heap(bootloader_memory); - - me + this.write_to_bootloader_heap(bootloader_memory); + this } // visible for testing @@ -476,10 +515,12 @@ impl VmInterface for Vm { track_refunds = true; } + let mut tracer = CircuitsTracer::default(); let start = self.inner.world_diff.snapshot(); let pubdata_before = self.inner.world_diff.pubdata(); + let gas_before = self.gas_remaining(); - let (result, refunds) = self.run(execution_mode, track_refunds); + let (result, refunds) = self.run(execution_mode, &mut tracer, track_refunds); let ignore_world_diff = matches!(execution_mode, VmExecutionMode::OneTx) && matches!(result, ExecutionResult::Halt { .. }); @@ -531,6 +572,8 @@ impl VmInterface for Vm { }; let pubdata_after = self.inner.world_diff.pubdata(); + let circuit_statistic = tracer.circuit_statistic(); + let gas_remaining = self.gas_remaining(); VmExecutionResultAndLogs { result, logs, @@ -538,14 +581,15 @@ impl VmInterface for Vm { statistics: VmExecutionStatistics { contracts_used: 0, cycles_used: 0, - gas_used: 0, - gas_remaining: self.gas_remaining(), + gas_used: (gas_before - gas_remaining).into(), + gas_remaining, computational_gas_used: 0, total_log_queries: 0, pubdata_published: (pubdata_after - pubdata_before).max(0) as u32, - circuit_statistic: Default::default(), + circuit_statistic, }, refunds, + new_known_factory_deps: Default::default(), } } @@ -554,17 +598,17 @@ impl VmInterface for Vm { (): Self::TracerDispatcher, tx: zksync_types::Transaction, with_compression: bool, - ) -> ( - Result, BytecodeCompressionError>, - VmExecutionResultAndLogs, - ) { + ) -> (BytecodeCompressionResult<'_>, VmExecutionResultAndLogs) { self.push_transaction_inner(tx, 0, with_compression); let result = self.inspect((), VmExecutionMode::OneTx); let compression_result = if self.has_unpublished_bytecodes() { Err(BytecodeCompressionError::BytecodeCompressionFailed) } else { - Ok(self.bootloader_state.get_last_tx_compressed_bytecodes()) + Ok(self + .bootloader_state + .get_last_tx_compressed_bytecodes() + .into()) }; (compression_result, result) } @@ -605,7 +649,6 @@ impl VmInterface for Vm { struct VmSnapshot { vm_snapshot: vm2::Snapshot, bootloader_snapshot: BootloaderStateSnapshot, - suspended_at: u16, gas_for_account_validation: u32, } @@ -620,7 +663,6 @@ impl VmInterfaceHistoryEnabled for Vm { self.snapshot = Some(VmSnapshot { vm_snapshot: self.inner.snapshot(), bootloader_snapshot: self.bootloader_state.get_snapshot(), - suspended_at: self.suspended_at, gas_for_account_validation: self.gas_for_account_validation, }); } @@ -629,13 +671,11 @@ impl VmInterfaceHistoryEnabled for Vm { let VmSnapshot { vm_snapshot, bootloader_snapshot, - suspended_at, gas_for_account_validation, } = self.snapshot.take().expect("no snapshots to rollback to"); self.inner.rollback(vm_snapshot); self.bootloader_state.apply_snapshot(bootloader_snapshot); - self.suspended_at = suspended_at; self.gas_for_account_validation = gas_for_account_validation; self.delete_history_if_appropriate(); @@ -650,7 +690,6 @@ impl VmInterfaceHistoryEnabled for Vm { impl fmt::Debug for Vm { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { f.debug_struct("Vm") - .field("suspended_at", &self.suspended_at) .field( "gas_for_account_validation", &self.gas_for_account_validation, @@ -666,50 +705,59 @@ impl fmt::Debug for Vm { } #[derive(Debug)] -pub(crate) struct World { +pub(crate) struct World { pub(crate) storage: S, - // TODO (PLA-1008): Store `Program`s in an LRU cache - program_cache: HashMap, + program_cache: HashMap>, pub(crate) bytecode_cache: HashMap>, } -impl World { - fn new(storage: S, program_cache: HashMap) -> Self { +impl World { + fn new(storage: S, program_cache: HashMap>) -> Self { Self { storage, program_cache, bytecode_cache: Default::default(), } } -} -impl vm2::World for World { - fn decommit_code(&mut self, hash: U256) -> Vec { - self.decommit(hash) - .code_page() - .as_ref() - .iter() - .flat_map(|u| { - let mut buffer = [0u8; 32]; - u.to_big_endian(&mut buffer); - buffer - }) - .collect() + fn bytecode_to_program(bytecode: &[u8]) -> Program { + Program::new( + decode_program( + &bytecode + .chunks_exact(8) + .map(|chunk| u64::from_be_bytes(chunk.try_into().unwrap())) + .collect::>(), + false, + ), + bytecode + .chunks_exact(32) + .map(U256::from_big_endian) + .collect::>(), + ) } - fn decommit(&mut self, hash: U256) -> Program { - self.program_cache - .entry(hash) - .or_insert_with(|| { - bytecode_to_program(self.bytecode_cache.entry(hash).or_insert_with(|| { - self.storage - .load_factory_dep(u256_to_h256(hash)) - .expect("vm tried to decommit nonexistent bytecode") - })) - }) - .clone() + fn convert_system_contract_code( + code: &SystemContractCode, + is_bootloader: bool, + ) -> (U256, Program) { + ( + h256_to_u256(code.hash), + Program::new( + decode_program( + &code + .code + .iter() + .flat_map(|x| x.0.into_iter().rev()) + .collect::>(), + is_bootloader, + ), + code.code.clone(), + ), + ) } +} +impl vm2::StorageInterface for World { fn read_storage(&mut self, contract: H160, key: U256) -> Option { let key = &StorageKey::new(AccountTreeId::new(contract), u256_to_h256(key)); if self.storage.is_write_initial(key) { @@ -754,35 +802,30 @@ impl vm2::World for World { } } -fn bytecode_to_program(bytecode: &[u8]) -> Program { - Program::new( - decode_program( - &bytecode - .chunks_exact(8) - .map(|chunk| u64::from_be_bytes(chunk.try_into().unwrap())) - .collect::>(), - false, - ), - bytecode - .chunks_exact(32) - .map(U256::from_big_endian) - .collect::>(), - ) -} +impl vm2::World for World { + fn decommit(&mut self, hash: U256) -> Program { + self.program_cache + .entry(hash) + .or_insert_with(|| { + Self::bytecode_to_program(self.bytecode_cache.entry(hash).or_insert_with(|| { + self.storage + .load_factory_dep(u256_to_h256(hash)) + .expect("vm tried to decommit nonexistent bytecode") + })) + }) + .clone() + } -fn convert_system_contract_code(code: &SystemContractCode, is_bootloader: bool) -> (U256, Program) { - ( - h256_to_u256(code.hash), - Program::new( - decode_program( - &code - .code - .iter() - .flat_map(|x| x.0.into_iter().rev()) - .collect::>(), - is_bootloader, - ), - code.code.clone(), - ), - ) + fn decommit_code(&mut self, hash: U256) -> Vec { + self.decommit(hash) + .code_page() + .as_ref() + .iter() + .flat_map(|u| { + let mut buffer = [0u8; 32]; + u.to_big_endian(&mut buffer); + buffer + }) + .collect() + } } diff --git a/core/lib/multivm/src/versions/vm_latest/bootloader_state/state.rs b/core/lib/multivm/src/versions/vm_latest/bootloader_state/state.rs index f15199a74f84..4ba27b14bad6 100644 --- a/core/lib/multivm/src/versions/vm_latest/bootloader_state/state.rs +++ b/core/lib/multivm/src/versions/vm_latest/bootloader_state/state.rs @@ -191,11 +191,11 @@ impl BootloaderState { l2_block.first_tx_index + l2_block.txs.len() } - pub(crate) fn get_last_tx_compressed_bytecodes(&self) -> Vec { + pub(crate) fn get_last_tx_compressed_bytecodes(&self) -> &[CompressedBytecodeInfo] { if let Some(tx) = self.last_l2_block().txs.last() { - tx.compressed_bytecodes.clone() + &tx.compressed_bytecodes } else { - vec![] + &[] } } diff --git a/core/lib/multivm/src/versions/vm_latest/implementation/execution.rs b/core/lib/multivm/src/versions/vm_latest/implementation/execution.rs index 66fc1a8bfd71..8242041b98fb 100644 --- a/core/lib/multivm/src/versions/vm_latest/implementation/execution.rs +++ b/core/lib/multivm/src/versions/vm_latest/implementation/execution.rs @@ -12,6 +12,7 @@ use crate::{ circuits_capacity::circuit_statistic_from_cycles, dispatcher::TracerDispatcher, DefaultExecutionTracer, PubdataTracer, RefundsTracer, }, + utils::extract_bytecodes_marked_as_known, vm::Vm, }, HistoryMode, @@ -93,12 +94,19 @@ impl Vm { circuit_statistic_from_cycles(tx_tracer.circuits_tracer.statistics), ); let result = tx_tracer.result_tracer.into_result(); + let factory_deps_marked_as_known = extract_bytecodes_marked_as_known(&logs.events); + let preimages = self.ask_decommitter(factory_deps_marked_as_known.clone()); + let new_known_factory_deps = factory_deps_marked_as_known + .into_iter() + .zip(preimages) + .collect(); let result = VmExecutionResultAndLogs { result, logs, statistics, refunds, + new_known_factory_deps: Some(new_known_factory_deps), }; (stop_reason, result) diff --git a/core/lib/multivm/src/versions/vm_latest/tracers/utils.rs b/core/lib/multivm/src/versions/vm_latest/tracers/utils.rs index bad09617b8f0..1ecb75c28071 100644 --- a/core/lib/multivm/src/versions/vm_latest/tracers/utils.rs +++ b/core/lib/multivm/src/versions/vm_latest/tracers/utils.rs @@ -95,7 +95,10 @@ pub(crate) fn get_debug_log( .into_iter() .map(u256_to_h256) .collect(); - let msg = vm_hook_params[0].as_bytes().to_vec(); + let mut msg = vm_hook_params[0].as_bytes().to_vec(); + while msg.last() == Some(&0) { + msg.pop(); + } let data = vm_hook_params[1].as_bytes().to_vec(); let msg = String::from_utf8(msg).expect("Invalid debug message"); @@ -109,10 +112,8 @@ pub(crate) fn get_debug_log( } else { data.to_string() }; - let tx_id = state.vm_local_state.tx_number_in_block; - - format!("Bootloader transaction {}: {} {}", tx_id, msg, data_str) + format!("Bootloader transaction {tx_id}: {msg}: {data_str}") } /// Reads the memory slice represented by the fat pointer. @@ -167,8 +168,7 @@ pub(crate) fn print_debug_if_needed( VmHook::DebugReturnData => get_debug_returndata(memory, latest_returndata_ptr), _ => return, }; - - tracing::trace!("{}", log); + tracing::trace!("{log}"); } pub(crate) fn computational_gas_price( diff --git a/core/lib/multivm/src/versions/vm_latest/utils/mod.rs b/core/lib/multivm/src/versions/vm_latest/utils/mod.rs index 313947f048c2..0244622c1940 100644 --- a/core/lib/multivm/src/versions/vm_latest/utils/mod.rs +++ b/core/lib/multivm/src/versions/vm_latest/utils/mod.rs @@ -1,9 +1,12 @@ +use ethabi; +use once_cell::sync::Lazy; use zk_evm_1_4_1::sha2; use zk_evm_1_5_0::{ aux_structures::MemoryPage, zkevm_opcode_defs::{BlobSha256Format, VersionedHashLen32}, }; -use zksync_types::H256; +use zksync_types::{H256, KNOWN_CODES_STORAGE_ADDRESS}; +use zksync_vm_interface::VmEvent; /// Utility functions for the VM. pub mod fee; @@ -32,3 +35,24 @@ pub(crate) fn hash_evm_bytecode(bytecode: &[u8]) -> H256 { pub const fn heap_page_from_base(base: MemoryPage) -> MemoryPage { MemoryPage(base.0 + 2) } + +/// Extracts all bytecodes marked as known on the system contracts. +pub fn extract_bytecodes_marked_as_known(all_generated_events: &[VmEvent]) -> Vec { + static PUBLISHED_BYTECODE_SIGNATURE: Lazy = Lazy::new(|| { + ethabi::long_signature( + "MarkedAsKnown", + &[ethabi::ParamType::FixedBytes(32), ethabi::ParamType::Bool], + ) + }); + + all_generated_events + .iter() + .filter(|event| { + // Filter events from the deployer contract that match the expected signature. + event.address == KNOWN_CODES_STORAGE_ADDRESS + && event.indexed_topics.len() == 3 + && event.indexed_topics[0] == *PUBLISHED_BYTECODE_SIGNATURE + }) + .map(|event| event.indexed_topics[1]) + .collect() +} diff --git a/core/lib/multivm/src/versions/vm_latest/vm.rs b/core/lib/multivm/src/versions/vm_latest/vm.rs index c0c13669c2ef..76b7c18e2d7d 100644 --- a/core/lib/multivm/src/versions/vm_latest/vm.rs +++ b/core/lib/multivm/src/versions/vm_latest/vm.rs @@ -2,8 +2,9 @@ use circuit_sequencer_api_1_5_0::sort_storage_access::sort_storage_access_querie use zksync_types::{ l2_to_l1_log::{SystemL2ToL1Log, UserL2ToL1Log}, vm::VmVersion, - Transaction, + Transaction, H256, }; +use zksync_utils::{be_words_to_bytes, h256_to_u256}; use crate::{ glue::GlueInto, @@ -78,6 +79,29 @@ impl Vm { self.state.local_state.callstack.current.ergs_remaining } + pub(crate) fn ask_decommitter(&self, hashes: Vec) -> Vec> { + // let vm = if let VmInstance::Vm1_5_0(vm) = &self { + // vm + // } else { + // return vec![]; + // }; + + let mut result = vec![]; + for hash in hashes { + let bytecode = self + .state + .decommittment_processor + .known_bytecodes + .inner() + .get(&h256_to_u256(hash)) + .expect("Bytecode not found") + .clone(); + result.push(be_words_to_bytes(&bytecode)); + } + + result + } + // visible for testing pub(super) fn get_current_execution_state(&self) -> CurrentExecutionState { let (raw_events, l1_messages) = self.state.event_sink.flatten(); @@ -141,7 +165,7 @@ impl VmInterface for Vm { tracer: Self::TracerDispatcher, tx: Transaction, with_compression: bool, - ) -> (BytecodeCompressionResult, VmExecutionResultAndLogs) { + ) -> (BytecodeCompressionResult<'_>, VmExecutionResultAndLogs) { self.push_transaction_with_compression(tx, with_compression); let result = self.inspect_inner(tracer, VmExecutionMode::OneTx, None); if self.has_unpublished_bytecodes() { @@ -151,7 +175,10 @@ impl VmInterface for Vm { ) } else { ( - Ok(self.bootloader_state.get_last_tx_compressed_bytecodes()), + Ok(self + .bootloader_state + .get_last_tx_compressed_bytecodes() + .into()), result, ) } diff --git a/core/lib/multivm/src/versions/vm_m5/vm.rs b/core/lib/multivm/src/versions/vm_m5/vm.rs index 4282f3f0cf4a..df4baccaf156 100644 --- a/core/lib/multivm/src/versions/vm_m5/vm.rs +++ b/core/lib/multivm/src/versions/vm_m5/vm.rs @@ -93,14 +93,14 @@ impl VmInterface for Vm { _tracer: Self::TracerDispatcher, tx: Transaction, _with_compression: bool, - ) -> (BytecodeCompressionResult, VmExecutionResultAndLogs) { + ) -> (BytecodeCompressionResult<'_>, VmExecutionResultAndLogs) { crate::vm_m5::vm_with_bootloader::push_transaction_to_bootloader_memory( &mut self.vm, &tx, self.system_env.execution_mode.glue_into(), ); // Bytecode compression isn't supported - (Ok(vec![]), self.inspect((), VmExecutionMode::OneTx)) + (Ok(vec![].into()), self.inspect((), VmExecutionMode::OneTx)) } fn record_vm_memory_metrics(&self) -> VmMemoryMetrics { diff --git a/core/lib/multivm/src/versions/vm_m6/vm.rs b/core/lib/multivm/src/versions/vm_m6/vm.rs index 520abd930555..7e19076a5202 100644 --- a/core/lib/multivm/src/versions/vm_m6/vm.rs +++ b/core/lib/multivm/src/versions/vm_m6/vm.rs @@ -109,7 +109,7 @@ impl VmInterface for Vm { tracer: Self::TracerDispatcher, tx: Transaction, with_compression: bool, - ) -> (BytecodeCompressionResult, VmExecutionResultAndLogs) { + ) -> (BytecodeCompressionResult<'_>, VmExecutionResultAndLogs) { if let Some(storage_invocations) = tracer.storage_invocations { self.vm .execution_mode @@ -182,7 +182,7 @@ impl VmInterface for Vm { result, ) } else { - (Ok(compressed_bytecodes), result) + (Ok(compressed_bytecodes.into()), result) } } diff --git a/core/lib/multivm/src/versions/vm_refunds_enhancement/bootloader_state/state.rs b/core/lib/multivm/src/versions/vm_refunds_enhancement/bootloader_state/state.rs index 12aab3c7364c..b428851c9383 100644 --- a/core/lib/multivm/src/versions/vm_refunds_enhancement/bootloader_state/state.rs +++ b/core/lib/multivm/src/versions/vm_refunds_enhancement/bootloader_state/state.rs @@ -167,11 +167,11 @@ impl BootloaderState { l2_block.first_tx_index + l2_block.txs.len() } - pub(crate) fn get_last_tx_compressed_bytecodes(&self) -> Vec { + pub(crate) fn get_last_tx_compressed_bytecodes(&self) -> &[CompressedBytecodeInfo] { if let Some(tx) = self.last_l2_block().txs.last() { - tx.compressed_bytecodes.clone() + &tx.compressed_bytecodes } else { - vec![] + &[] } } diff --git a/core/lib/multivm/src/versions/vm_refunds_enhancement/implementation/execution.rs b/core/lib/multivm/src/versions/vm_refunds_enhancement/implementation/execution.rs index cadd183735e6..bb43dc3ffb61 100644 --- a/core/lib/multivm/src/versions/vm_refunds_enhancement/implementation/execution.rs +++ b/core/lib/multivm/src/versions/vm_refunds_enhancement/implementation/execution.rs @@ -87,6 +87,7 @@ impl Vm { logs, statistics, refunds, + new_known_factory_deps: Default::default(), }; (stop_reason, result) diff --git a/core/lib/multivm/src/versions/vm_refunds_enhancement/vm.rs b/core/lib/multivm/src/versions/vm_refunds_enhancement/vm.rs index 2aa3ba05e662..119abf052b9f 100644 --- a/core/lib/multivm/src/versions/vm_refunds_enhancement/vm.rs +++ b/core/lib/multivm/src/versions/vm_refunds_enhancement/vm.rs @@ -99,7 +99,7 @@ impl VmInterface for Vm { dispatcher: Self::TracerDispatcher, tx: Transaction, with_compression: bool, - ) -> (BytecodeCompressionResult, VmExecutionResultAndLogs) { + ) -> (BytecodeCompressionResult<'_>, VmExecutionResultAndLogs) { self.push_transaction_with_compression(tx, with_compression); let result = self.inspect(dispatcher, VmExecutionMode::OneTx); if self.has_unpublished_bytecodes() { @@ -109,7 +109,10 @@ impl VmInterface for Vm { ) } else { ( - Ok(self.bootloader_state.get_last_tx_compressed_bytecodes()), + Ok(self + .bootloader_state + .get_last_tx_compressed_bytecodes() + .into()), result, ) } diff --git a/core/lib/multivm/src/versions/vm_virtual_blocks/bootloader_state/state.rs b/core/lib/multivm/src/versions/vm_virtual_blocks/bootloader_state/state.rs index 562d74513710..7e9af0ed6b82 100644 --- a/core/lib/multivm/src/versions/vm_virtual_blocks/bootloader_state/state.rs +++ b/core/lib/multivm/src/versions/vm_virtual_blocks/bootloader_state/state.rs @@ -167,11 +167,11 @@ impl BootloaderState { l2_block.first_tx_index + l2_block.txs.len() } - pub(crate) fn get_last_tx_compressed_bytecodes(&self) -> Vec { + pub(crate) fn get_last_tx_compressed_bytecodes(&self) -> &[CompressedBytecodeInfo] { if let Some(tx) = self.last_l2_block().txs.last() { - tx.compressed_bytecodes.clone() + &tx.compressed_bytecodes } else { - vec![] + &[] } } diff --git a/core/lib/multivm/src/versions/vm_virtual_blocks/implementation/execution.rs b/core/lib/multivm/src/versions/vm_virtual_blocks/implementation/execution.rs index 42709c345ea6..8ad917353863 100644 --- a/core/lib/multivm/src/versions/vm_virtual_blocks/implementation/execution.rs +++ b/core/lib/multivm/src/versions/vm_virtual_blocks/implementation/execution.rs @@ -86,6 +86,7 @@ impl Vm { .refund_tracer .map(|r| r.get_refunds()) .unwrap_or_default(), + new_known_factory_deps: Default::default(), }; tx_tracer.dispatcher.save_results(&mut result); diff --git a/core/lib/multivm/src/versions/vm_virtual_blocks/vm.rs b/core/lib/multivm/src/versions/vm_virtual_blocks/vm.rs index 6080df2bf2f1..0ecdd6797f4b 100644 --- a/core/lib/multivm/src/versions/vm_virtual_blocks/vm.rs +++ b/core/lib/multivm/src/versions/vm_virtual_blocks/vm.rs @@ -99,7 +99,7 @@ impl VmInterface for Vm { tracer: TracerDispatcher, tx: Transaction, with_compression: bool, - ) -> (BytecodeCompressionResult, VmExecutionResultAndLogs) { + ) -> (BytecodeCompressionResult<'_>, VmExecutionResultAndLogs) { self.push_transaction_with_compression(tx, with_compression); let result = self.inspect_inner(tracer, VmExecutionMode::OneTx); if self.has_unpublished_bytecodes() { @@ -109,7 +109,10 @@ impl VmInterface for Vm { ) } else { ( - Ok(self.bootloader_state.get_last_tx_compressed_bytecodes()), + Ok(self + .bootloader_state + .get_last_tx_compressed_bytecodes() + .into()), result, ) } diff --git a/core/lib/multivm/src/vm_instance.rs b/core/lib/multivm/src/vm_instance.rs index e12bc9a55f87..cedb4bc8276d 100644 --- a/core/lib/multivm/src/vm_instance.rs +++ b/core/lib/multivm/src/vm_instance.rs @@ -1,8 +1,4 @@ -use zksync_types::{ - vm::{FastVmMode, VmVersion}, - H256, -}; -use zksync_utils::{be_words_to_bytes, h256_to_u256}; +use zksync_types::vm::{FastVmMode, VmVersion}; use crate::{ glue::history_mode::HistoryMode, @@ -78,7 +74,7 @@ impl VmInterface for VmInstance { dispatcher: Self::TracerDispatcher, tx: zksync_types::Transaction, with_compression: bool, - ) -> (BytecodeCompressionResult, VmExecutionResultAndLogs) { + ) -> (BytecodeCompressionResult<'_>, VmExecutionResultAndLogs) { dispatch_vm!(self.inspect_transaction_with_bytecode_compression( dispatcher.into(), tx, @@ -235,28 +231,4 @@ impl VmInstance { _ => Self::new(l1_batch_env, system_env, storage_view), } } - - // TOOD: this should be refactored to be returned as part of the execution result - pub fn ask_decommitter(&mut self, hashes: Vec) -> Vec> { - let vm = if let VmInstance::Vm1_5_0(vm) = &self { - vm - } else { - return vec![]; - }; - - let mut result = vec![]; - for hash in hashes { - let bytecode = vm - .state - .decommittment_processor - .known_bytecodes - .inner() - .get(&h256_to_u256(hash)) - .expect("Bytecode not found") - .clone(); - result.push(be_words_to_bytes(&bytecode)); - } - - result - } } diff --git a/core/lib/protobuf_config/src/house_keeper.rs b/core/lib/protobuf_config/src/house_keeper.rs index b6871de853fb..e40fd1b37dc7 100644 --- a/core/lib/protobuf_config/src/house_keeper.rs +++ b/core/lib/protobuf_config/src/house_keeper.rs @@ -12,43 +12,6 @@ impl ProtoRepr for proto::HouseKeeper { &self.l1_batch_metrics_reporting_interval_ms, ) .context("l1_batch_metrics_reporting_interval_ms")?, - gpu_prover_queue_reporting_interval_ms: *required( - &self.gpu_prover_queue_reporting_interval_ms, - ) - .context("gpu_prover_queue_reporting_interval_ms")?, - prover_job_retrying_interval_ms: *required(&self.prover_job_retrying_interval_ms) - .context("prover_job_retrying_interval_ms")?, - prover_stats_reporting_interval_ms: *required(&self.prover_stats_reporting_interval_ms) - .context("prover_stats_reporting_interval_ms")?, - witness_job_moving_interval_ms: *required(&self.witness_job_moving_interval_ms) - .context("witness_job_moving_interval_ms")?, - witness_generator_stats_reporting_interval_ms: *required( - &self.witness_generator_stats_reporting_interval_ms, - ) - .context("witness_generator_stats_reporting_interval_ms")?, - prover_db_pool_size: *required(&self.prover_db_pool_size) - .context("prover_db_pool_size")?, - proof_compressor_job_retrying_interval_ms: *required( - &self.proof_compressor_job_retrying_interval_ms, - ) - .context("proof_compressor_job_retrying_interval_ms")?, - witness_generator_job_retrying_interval_ms: *required( - &self.witness_generator_job_retrying_interval_ms, - ) - .context("witness_generator_job_retrying_interval_ms")?, - proof_compressor_stats_reporting_interval_ms: *required( - &self.proof_compressor_stats_reporting_interval_ms, - ) - .context("proof_compressor_stats_reporting_interval_ms")?, - - // TODO(PLA-862): Make these 2 variables required - prover_job_archiver_archiving_interval_ms: self - .prover_job_archiver_archiving_interval_ms, - prover_job_archiver_archive_after_secs: self.prover_job_archiver_archive_after_secs, - fri_gpu_prover_archiver_archiving_interval_ms: self - .fri_gpu_prover_archiver_archiving_interval_ms, - fri_gpu_prover_archiver_archive_after_secs: self - .fri_gpu_prover_archiver_archive_after_secs, }) } @@ -57,32 +20,6 @@ impl ProtoRepr for proto::HouseKeeper { l1_batch_metrics_reporting_interval_ms: Some( this.l1_batch_metrics_reporting_interval_ms, ), - gpu_prover_queue_reporting_interval_ms: Some( - this.gpu_prover_queue_reporting_interval_ms, - ), - prover_job_retrying_interval_ms: Some(this.prover_job_retrying_interval_ms), - prover_stats_reporting_interval_ms: Some(this.prover_stats_reporting_interval_ms), - witness_job_moving_interval_ms: Some(this.witness_job_moving_interval_ms), - witness_generator_stats_reporting_interval_ms: Some( - this.witness_generator_stats_reporting_interval_ms, - ), - witness_generator_job_retrying_interval_ms: Some( - this.witness_generator_job_retrying_interval_ms, - ), - prover_db_pool_size: Some(this.prover_db_pool_size), - proof_compressor_job_retrying_interval_ms: Some( - this.proof_compressor_job_retrying_interval_ms, - ), - proof_compressor_stats_reporting_interval_ms: Some( - this.proof_compressor_stats_reporting_interval_ms, - ), - prover_job_archiver_archiving_interval_ms: this - .prover_job_archiver_archiving_interval_ms, - prover_job_archiver_archive_after_secs: this.prover_job_archiver_archive_after_secs, - fri_gpu_prover_archiver_archiving_interval_ms: this - .fri_gpu_prover_archiver_archiving_interval_ms, - fri_gpu_prover_archiver_archive_after_secs: this - .fri_gpu_prover_archiver_archive_after_secs, } } } diff --git a/core/lib/protobuf_config/src/proto/config/house_keeper.proto b/core/lib/protobuf_config/src/proto/config/house_keeper.proto index dce4af95b809..c3a4ca8ad672 100644 --- a/core/lib/protobuf_config/src/proto/config/house_keeper.proto +++ b/core/lib/protobuf_config/src/proto/config/house_keeper.proto @@ -4,17 +4,17 @@ package zksync.config.house_keeper; message HouseKeeper { optional uint64 l1_batch_metrics_reporting_interval_ms = 1; // required; ms - optional uint64 gpu_prover_queue_reporting_interval_ms = 2; // required; ms - optional uint64 prover_job_retrying_interval_ms = 3; // required; ms - optional uint64 prover_stats_reporting_interval_ms = 4; // required ms - optional uint64 witness_job_moving_interval_ms = 5; // required; ms - optional uint64 witness_generator_stats_reporting_interval_ms = 6; // required; ms - optional uint64 witness_generator_job_retrying_interval_ms = 9; // required; ms - optional uint32 prover_db_pool_size = 10; // required - optional uint64 proof_compressor_job_retrying_interval_ms = 12; // required; ms - optional uint64 proof_compressor_stats_reporting_interval_ms = 13; // required; ms - optional uint64 prover_job_archiver_archiving_interval_ms = 14; // optional; ms - optional uint64 prover_job_archiver_archive_after_secs = 15; // optional; seconds - optional uint64 fri_gpu_prover_archiver_archiving_interval_ms = 16; // optional; ms - optional uint64 fri_gpu_prover_archiver_archive_after_secs = 17; // optional; seconds + reserved 2; reserved "gpu_prover_queue_reporting_interval_ms"; + reserved 3; reserved "prover_job_retrying_interval_ms"; + reserved 4; reserved "prover_stats_reporting_interval_ms"; + reserved 5; reserved "witness_job_moving_interval_ms"; + reserved 6; reserved "witness_generator_stats_reporting_interval_ms"; + reserved 9; reserved "witness_generator_job_retrying_interval_ms"; + reserved 10; reserved "prover_db_pool_size"; + reserved 12; reserved "proof_compressor_job_retrying_interval_ms"; + reserved 13; reserved "proof_compressor_stats_reporting_interval_ms"; + reserved 14; reserved "prover_job_archiver_archiving_interval_ms"; + reserved 15; reserved "prover_job_archiver_archive_after_secs"; + reserved 16; reserved "fri_gpu_prover_archiver_archiving_interval_ms"; + reserved 17; reserved "fri_gpu_prover_archiver_archive_after_secs"; } diff --git a/core/lib/vm_executor/src/batch/factory.rs b/core/lib/vm_executor/src/batch/factory.rs index bfd576b208ed..2de2c3856d75 100644 --- a/core/lib/vm_executor/src/batch/factory.rs +++ b/core/lib/vm_executor/src/batch/factory.rs @@ -1,20 +1,20 @@ use std::{marker::PhantomData, rc::Rc, sync::Arc}; use anyhow::Context as _; -use once_cell::sync::{Lazy, OnceCell}; +use once_cell::sync::OnceCell; use tokio::sync::mpsc; use zksync_multivm::{ interface::{ executor::{BatchExecutor, BatchExecutorFactory}, storage::{ReadStorage, StorageView}, BatchTransactionExecutionResult, ExecutionResult, FinishedL1Batch, Halt, L1BatchEnv, - L2BlockEnv, SystemEnv, VmEvent, VmInterface, VmInterfaceHistoryEnabled, + L2BlockEnv, SystemEnv, VmInterface, VmInterfaceHistoryEnabled, }, tracers::CallTracer, vm_latest::HistoryEnabled, MultiVMTracer, VmInstance, }; -use zksync_types::{ethabi, vm::FastVmMode, Transaction, H256, KNOWN_CODES_STORAGE_ADDRESS}; +use zksync_types::{vm::FastVmMode, Transaction}; use super::{ executor::{Command, MainBatchExecutor}, @@ -22,27 +22,6 @@ use super::{ }; use crate::batch::metrics::{InteractionType, EXECUTOR_METRICS}; -/// Extracts all bytecodes marked as known on the system contracts. -pub fn extract_bytecodes_marked_as_known(all_generated_events: &[VmEvent]) -> Vec { - static PUBLISHED_BYTECODE_SIGNATURE: Lazy = Lazy::new(|| { - ethabi::long_signature( - "MarkedAsKnown", - &[ethabi::ParamType::FixedBytes(32), ethabi::ParamType::Bool], - ) - }); - - all_generated_events - .iter() - .filter(|event| { - // Filter events from the deployer contract that match the expected signature. - event.address == KNOWN_CODES_STORAGE_ADDRESS - && event.indexed_topics.len() == 3 - && event.indexed_topics[0] == *PUBLISHED_BYTECODE_SIGNATURE - }) - .map(|event| event.indexed_topics[1]) - .collect() -} - /// The default implementation of [`BatchExecutorFactory`]. /// Creates real batch executors which maintain the VM (as opposed to the test factories which don't use the VM). #[derive(Debug, Clone)] @@ -266,22 +245,21 @@ impl CommandReceiver { if let (Ok(compressed_bytecodes), tx_result) = vm.inspect_transaction_with_bytecode_compression(tracer.into(), tx.clone(), true) { - let factory_deps_marked_as_known = - extract_bytecodes_marked_as_known(&tx_result.logs.events); - let preimages = vm.ask_decommitter(factory_deps_marked_as_known.clone()); - let new_known_factory_deps = factory_deps_marked_as_known - .into_iter() - .zip(preimages) - .collect(); + // let factory_deps_marked_as_known = + // extract_bytecodes_marked_as_known(&tx_result.logs.events); + // let preimages = vm.ask_decommitter(factory_deps_marked_as_known.clone()); + // let new_known_factory_deps = factory_deps_marked_as_known + // .into_iter() + // .zip(preimages) + // .collect(); let call_traces = Arc::try_unwrap(call_tracer_result) .map_err(|_| anyhow::anyhow!("failed extracting call traces"))? .take() .unwrap_or_default(); return Ok(BatchTransactionExecutionResult { tx_result: Box::new(tx_result), - compressed_bytecodes, + compressed_bytecodes: compressed_bytecodes.into_owned(), call_traces, - new_known_factory_deps, }); } @@ -297,18 +275,19 @@ impl CommandReceiver { vec![] }; - let (compression_result, mut tx_result) = + let (compression_result, tx_result) = vm.inspect_transaction_with_bytecode_compression(tracer.into(), tx.clone(), false); - let compressed_bytecodes = - compression_result.context("compression failed when it wasn't applied")?; - - let factory_deps_marked_as_known = - extract_bytecodes_marked_as_known(&tx_result.logs.events); - let preimages = vm.ask_decommitter(factory_deps_marked_as_known.clone()); - let new_known_factory_deps = factory_deps_marked_as_known - .into_iter() - .zip(preimages) - .collect(); + let compressed_bytecodes = compression_result + .context("compression failed when it wasn't applied")? + .into_owned(); + + // let factory_deps_marked_as_known = + // extract_bytecodes_marked_as_known(&tx_result.logs.events); + // let preimages = vm.ask_decommitter(factory_deps_marked_as_known.clone()); + // let new_known_factory_deps = factory_deps_marked_as_known + // .into_iter() + // .zip(preimages) + // .collect(); // TODO implement tracer manager which will be responsible // for collecting result from all tracers and save it to the database @@ -320,7 +299,6 @@ impl CommandReceiver { tx_result: Box::new(tx_result), compressed_bytecodes, call_traces, - new_known_factory_deps, }) } @@ -341,22 +319,21 @@ impl CommandReceiver { let (bytecodes_result, mut tx_result) = vm.inspect_transaction_with_bytecode_compression(tracer.into(), tx.clone(), true); if let Ok(compressed_bytecodes) = bytecodes_result { - let factory_deps_marked_as_known = - extract_bytecodes_marked_as_known(&tx_result.logs.events); - let preimages = vm.ask_decommitter(factory_deps_marked_as_known.clone()); - let new_known_factory_deps = factory_deps_marked_as_known - .into_iter() - .zip(preimages) - .collect(); + // let factory_deps_marked_as_known = + // extract_bytecodes_marked_as_known(&tx_result.logs.events); + // let preimages = vm.ask_decommitter(factory_deps_marked_as_known.clone()); + // let new_known_factory_deps = factory_deps_marked_as_known + // .into_iter() + // .zip(preimages) + // .collect(); let call_traces = Arc::try_unwrap(call_tracer_result) .map_err(|_| anyhow::anyhow!("failed extracting call traces"))? .take() .unwrap_or_default(); Ok(BatchTransactionExecutionResult { tx_result: Box::new(tx_result), - compressed_bytecodes, + compressed_bytecodes: compressed_bytecodes.into_owned(), call_traces, - new_known_factory_deps, }) } else { // Transaction failed to publish bytecodes, we reject it so initiator doesn't pay fee. @@ -367,7 +344,6 @@ impl CommandReceiver { tx_result: Box::new(tx_result), compressed_bytecodes: vec![], call_traces: vec![], - new_known_factory_deps: vec![], }) } } diff --git a/core/lib/vm_executor/src/batch/mod.rs b/core/lib/vm_executor/src/batch/mod.rs index 1be8a32006cf..2407d2daba2c 100644 --- a/core/lib/vm_executor/src/batch/mod.rs +++ b/core/lib/vm_executor/src/batch/mod.rs @@ -2,10 +2,7 @@ //! //! This implementation is used by various ZKsync components, like the state keeper and components based on the VM runner. -pub use self::{ - executor::MainBatchExecutor, - factory::{extract_bytecodes_marked_as_known, MainBatchExecutorFactory}, -}; +pub use self::{executor::MainBatchExecutor, factory::MainBatchExecutorFactory}; mod executor; mod factory; diff --git a/core/lib/vm_interface/src/storage/in_memory.rs b/core/lib/vm_interface/src/storage/in_memory.rs index 5dfb3ba156e1..27dd9c239444 100644 --- a/core/lib/vm_interface/src/storage/in_memory.rs +++ b/core/lib/vm_interface/src/storage/in_memory.rs @@ -14,7 +14,7 @@ use super::ReadStorage; pub const IN_MEMORY_STORAGE_DEFAULT_NETWORK_ID: u32 = 270; /// In-memory storage. -#[derive(Debug, Default, Clone)] +#[derive(Debug, Default, Clone, PartialEq)] pub struct InMemoryStorage { state: HashMap, factory_deps: HashMap>, diff --git a/core/lib/vm_interface/src/types/errors/bytecode_compression.rs b/core/lib/vm_interface/src/types/errors/bytecode_compression.rs index 1dd69dc7398d..c0c6e8737bbe 100644 --- a/core/lib/vm_interface/src/types/errors/bytecode_compression.rs +++ b/core/lib/vm_interface/src/types/errors/bytecode_compression.rs @@ -1,3 +1,5 @@ +use std::borrow::Cow; + use crate::CompressedBytecodeInfo; /// Errors related to bytecode compression. @@ -9,4 +11,5 @@ pub enum BytecodeCompressionError { } /// Result of compressing bytecodes used by a transaction. -pub type BytecodeCompressionResult = Result, BytecodeCompressionError>; +pub type BytecodeCompressionResult<'a> = + Result, BytecodeCompressionError>; diff --git a/core/lib/vm_interface/src/types/outputs/execution_result.rs b/core/lib/vm_interface/src/types/outputs/execution_result.rs index a942d477eac7..4fc7a85a27cf 100644 --- a/core/lib/vm_interface/src/types/outputs/execution_result.rs +++ b/core/lib/vm_interface/src/types/outputs/execution_result.rs @@ -117,6 +117,7 @@ pub struct VmExecutionResultAndLogs { pub logs: VmExecutionLogs, pub statistics: VmExecutionStatistics, pub refunds: Refunds, + pub new_known_factory_deps: Option)>>, } #[derive(Debug, Clone, PartialEq)] @@ -303,7 +304,6 @@ pub struct BatchTransactionExecutionResult { pub tx_result: Box, pub compressed_bytecodes: Vec, pub call_traces: Vec, - pub new_known_factory_deps: Vec<(H256, Vec)>, } impl BatchTransactionExecutionResult { diff --git a/core/lib/vm_interface/src/types/outputs/finished_l1batch.rs b/core/lib/vm_interface/src/types/outputs/finished_l1batch.rs index 27241c2c0fae..a71c9f8f7a5e 100644 --- a/core/lib/vm_interface/src/types/outputs/finished_l1batch.rs +++ b/core/lib/vm_interface/src/types/outputs/finished_l1batch.rs @@ -26,6 +26,7 @@ impl FinishedL1Batch { logs: VmExecutionLogs::default(), statistics: VmExecutionStatistics::default(), refunds: Refunds::default(), + new_known_factory_deps: Default::default(), }, final_execution_state: CurrentExecutionState { events: vec![], diff --git a/core/lib/vm_interface/src/vm.rs b/core/lib/vm_interface/src/vm.rs index b6be2c7581f7..f70be52bd86a 100644 --- a/core/lib/vm_interface/src/vm.rs +++ b/core/lib/vm_interface/src/vm.rs @@ -41,7 +41,7 @@ pub trait VmInterface { tracer: Self::TracerDispatcher, tx: Transaction, with_compression: bool, - ) -> (BytecodeCompressionResult, VmExecutionResultAndLogs); + ) -> (BytecodeCompressionResult<'_>, VmExecutionResultAndLogs); /// Record VM memory metrics. fn record_vm_memory_metrics(&self) -> VmMemoryMetrics; @@ -63,7 +63,7 @@ pub trait VmInterfaceExt: VmInterface { &mut self, tx: Transaction, with_compression: bool, - ) -> (BytecodeCompressionResult, VmExecutionResultAndLogs) { + ) -> (BytecodeCompressionResult<'_>, VmExecutionResultAndLogs) { self.inspect_transaction_with_bytecode_compression( Self::TracerDispatcher::default(), tx, diff --git a/core/lib/web3_decl/src/client/mod.rs b/core/lib/web3_decl/src/client/mod.rs index a8246216eca3..7f0de4f3bca9 100644 --- a/core/lib/web3_decl/src/client/mod.rs +++ b/core/lib/web3_decl/src/client/mod.rs @@ -318,6 +318,7 @@ pub struct ClientBuilder { client: C, url: SensitiveUrl, rate_limit: (usize, Duration), + report_config: bool, network: Net, } @@ -328,6 +329,7 @@ impl fmt::Debug for ClientBuilder { .field("client", &any::type_name::()) .field("url", &self.url) .field("rate_limit", &self.rate_limit) + .field("report_config", &self.report_config) .field("network", &self.network) .finish_non_exhaustive() } @@ -340,6 +342,7 @@ impl ClientBuilder { client, url, rate_limit: (1, Duration::ZERO), + report_config: true, network: Net::default(), } } @@ -366,16 +369,25 @@ impl ClientBuilder { self } + /// Allows switching off config reporting for this client in logs and metrics. This is useful if a client is a short-living one + /// and is not injected as a dependency. + pub fn report_config(mut self, report: bool) -> Self { + self.report_config = report; + self + } + /// Builds the client. pub fn build(self) -> Client { - tracing::info!( - "Creating JSON-RPC client for network {:?} with inner client: {:?} and rate limit: {:?}", - self.network, - self.client, - self.rate_limit - ); let rate_limit = SharedRateLimit::new(self.rate_limit.0, self.rate_limit.1); - METRICS.observe_config(self.network.metric_label(), &rate_limit); + if self.report_config { + tracing::info!( + "Creating JSON-RPC client for network {:?} with inner client: {:?} and rate limit: {:?}", + self.network, + self.client, + self.rate_limit + ); + METRICS.observe_config(self.network.metric_label(), &rate_limit); + } Client { inner: self.client, diff --git a/core/node/house_keeper/Cargo.toml b/core/node/house_keeper/Cargo.toml index ed86a713ea25..b2ed3c14c20f 100644 --- a/core/node/house_keeper/Cargo.toml +++ b/core/node/house_keeper/Cargo.toml @@ -14,7 +14,6 @@ categories.workspace = true vise.workspace = true zksync_dal.workspace = true zksync_shared_metrics.workspace = true -zksync_prover_dal.workspace = true zksync_types.workspace = true zksync_config.workspace = true diff --git a/core/node/house_keeper/src/blocks_state_reporter.rs b/core/node/house_keeper/src/blocks_state_reporter.rs index 5285390a2783..6f85aa0fbb09 100644 --- a/core/node/house_keeper/src/blocks_state_reporter.rs +++ b/core/node/house_keeper/src/blocks_state_reporter.rs @@ -4,7 +4,7 @@ use async_trait::async_trait; use zksync_dal::{ConnectionPool, Core, CoreDal}; use zksync_shared_metrics::{BlockL1Stage, BlockStage, L1StageLatencyLabel, APP_METRICS}; -use crate::periodic_job::PeriodicJob; +use crate::{metrics::FRI_PROVER_METRICS, periodic_job::PeriodicJob}; #[derive(Debug)] pub struct L1BatchMetricsReporter { @@ -88,6 +88,37 @@ impl L1BatchMetricsReporter { APP_METRICS.blocks_state_block_eth_stage_latency[&L1StageLatencyLabel::UnexecutedBlock] .set(now.saturating_sub(timestamp)); } + + // proof generation details metrics + let oldest_unpicked_batch = match conn + .proof_generation_dal() + .get_oldest_unpicked_batch() + .await? + { + Some(l1_batch_number) => l1_batch_number.0 as u64, + // if there is no unpicked batch in database, we use sealed batch number as a result + None => { + conn.blocks_dal() + .get_sealed_l1_batch_number() + .await + .unwrap() + .unwrap() + .0 as u64 + } + }; + FRI_PROVER_METRICS + .oldest_unpicked_batch + .set(oldest_unpicked_batch); + + if let Some(l1_batch_number) = conn + .proof_generation_dal() + .get_oldest_not_generated_batch() + .await? + { + FRI_PROVER_METRICS + .oldest_not_generated_batch + .set(l1_batch_number.0 as u64); + } Ok(()) } } diff --git a/core/node/house_keeper/src/lib.rs b/core/node/house_keeper/src/lib.rs index 68d4ad2f8ba4..4e0d1962fc02 100644 --- a/core/node/house_keeper/src/lib.rs +++ b/core/node/house_keeper/src/lib.rs @@ -1,3 +1,3 @@ pub mod blocks_state_reporter; +mod metrics; pub mod periodic_job; -pub mod prover; diff --git a/core/node/house_keeper/src/metrics.rs b/core/node/house_keeper/src/metrics.rs new file mode 100644 index 000000000000..cc1438e35963 --- /dev/null +++ b/core/node/house_keeper/src/metrics.rs @@ -0,0 +1,11 @@ +use vise::{Gauge, Metrics}; + +#[derive(Debug, Metrics)] +#[metrics(prefix = "fri_prover")] +pub(crate) struct FriProverMetrics { + pub oldest_unpicked_batch: Gauge, + pub oldest_not_generated_batch: Gauge, +} + +#[vise::register] +pub(crate) static FRI_PROVER_METRICS: vise::Global = vise::Global::new(); diff --git a/core/node/house_keeper/src/prover/archiver/fri_gpu_prover_archiver.rs b/core/node/house_keeper/src/prover/archiver/fri_gpu_prover_archiver.rs deleted file mode 100644 index b0f5ff23fe3f..000000000000 --- a/core/node/house_keeper/src/prover/archiver/fri_gpu_prover_archiver.rs +++ /dev/null @@ -1,55 +0,0 @@ -use std::time::Duration; - -use zksync_dal::ConnectionPool; -use zksync_prover_dal::{Prover, ProverDal}; - -use crate::{periodic_job::PeriodicJob, prover::metrics::HOUSE_KEEPER_METRICS}; - -/// `FriGpuProverArchiver` is a task that periodically archives old fri GPU prover records. -/// The task will archive the `dead` prover records that have not been updated for a certain amount of time. -/// Note: These components speed up provers, in their absence, queries would become sub optimal. -#[derive(Debug)] -pub struct FriGpuProverArchiver { - pool: ConnectionPool, - archiving_interval_ms: u64, - archive_prover_after_secs: u64, -} - -impl FriGpuProverArchiver { - pub fn new( - pool: ConnectionPool, - archiving_interval_ms: u64, - archive_prover_after_secs: u64, - ) -> Self { - Self { - pool, - archiving_interval_ms, - archive_prover_after_secs, - } - } -} - -#[async_trait::async_trait] -impl PeriodicJob for FriGpuProverArchiver { - const SERVICE_NAME: &'static str = "FriGpuProverArchiver"; - - async fn run_routine_task(&mut self) -> anyhow::Result<()> { - let archived_provers = self - .pool - .connection() - .await - .unwrap() - .fri_gpu_prover_queue_dal() - .archive_old_provers(Duration::from_secs(self.archive_prover_after_secs)) - .await; - tracing::info!("Archived {:?} fri gpu prover records", archived_provers); - HOUSE_KEEPER_METRICS - .gpu_prover_archived - .inc_by(archived_provers as u64); - Ok(()) - } - - fn polling_interval_ms(&self) -> u64 { - self.archiving_interval_ms - } -} diff --git a/core/node/house_keeper/src/prover/archiver/fri_prover_jobs_archiver.rs b/core/node/house_keeper/src/prover/archiver/fri_prover_jobs_archiver.rs deleted file mode 100644 index 684c955231cf..000000000000 --- a/core/node/house_keeper/src/prover/archiver/fri_prover_jobs_archiver.rs +++ /dev/null @@ -1,55 +0,0 @@ -use std::time::Duration; - -use zksync_dal::ConnectionPool; -use zksync_prover_dal::{Prover, ProverDal}; - -use crate::{periodic_job::PeriodicJob, prover::metrics::HOUSE_KEEPER_METRICS}; - -/// `FriProverJobsArchiver` is a task that periodically archives old finalized prover job. -/// The task will archive the `successful` prover jobs that have been done for a certain amount of time. -/// Note: These components speed up provers, in their absence, queries would become sub optimal. -#[derive(Debug)] -pub struct FriProverJobsArchiver { - pool: ConnectionPool, - reporting_interval_ms: u64, - archiving_interval_secs: u64, -} - -impl FriProverJobsArchiver { - pub fn new( - pool: ConnectionPool, - reporting_interval_ms: u64, - archiving_interval_secs: u64, - ) -> Self { - Self { - pool, - reporting_interval_ms, - archiving_interval_secs, - } - } -} - -#[async_trait::async_trait] -impl PeriodicJob for FriProverJobsArchiver { - const SERVICE_NAME: &'static str = "FriProverJobsArchiver"; - - async fn run_routine_task(&mut self) -> anyhow::Result<()> { - let archived_jobs = self - .pool - .connection() - .await - .unwrap() - .fri_prover_jobs_dal() - .archive_old_jobs(Duration::from_secs(self.archiving_interval_secs)) - .await; - tracing::info!("Archived {:?} fri prover jobs", archived_jobs); - HOUSE_KEEPER_METRICS - .prover_job_archived - .inc_by(archived_jobs as u64); - Ok(()) - } - - fn polling_interval_ms(&self) -> u64 { - self.reporting_interval_ms - } -} diff --git a/core/node/house_keeper/src/prover/archiver/mod.rs b/core/node/house_keeper/src/prover/archiver/mod.rs deleted file mode 100644 index 36b82a7735ce..000000000000 --- a/core/node/house_keeper/src/prover/archiver/mod.rs +++ /dev/null @@ -1,5 +0,0 @@ -mod fri_gpu_prover_archiver; -mod fri_prover_jobs_archiver; - -pub use fri_gpu_prover_archiver::FriGpuProverArchiver; -pub use fri_prover_jobs_archiver::FriProverJobsArchiver; diff --git a/core/node/house_keeper/src/prover/metrics.rs b/core/node/house_keeper/src/prover/metrics.rs deleted file mode 100644 index 7711c9c04a6b..000000000000 --- a/core/node/house_keeper/src/prover/metrics.rs +++ /dev/null @@ -1,123 +0,0 @@ -use vise::{Counter, EncodeLabelSet, EncodeLabelValue, Family, Gauge, LabeledFamily, Metrics}; -use zksync_types::protocol_version::ProtocolSemanticVersion; -#[derive(Debug, Metrics)] -#[metrics(prefix = "house_keeper")] -pub(crate) struct HouseKeeperMetrics { - pub prover_job_archived: Counter, - pub gpu_prover_archived: Counter, -} - -#[vise::register] -pub(crate) static HOUSE_KEEPER_METRICS: vise::Global = vise::Global::new(); - -#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, EncodeLabelValue)] -#[metrics(rename_all = "snake_case")] -#[allow(dead_code)] -pub enum JobStatus { - Queued, - InProgress, - Successful, - Failed, - SentToServer, - Skipped, -} - -#[derive(Debug, Metrics)] -#[metrics(prefix = "prover_fri")] -pub(crate) struct ProverFriMetrics { - pub proof_compressor_requeued_jobs: Counter, - #[metrics(labels = ["type", "protocol_version"])] - pub proof_compressor_jobs: LabeledFamily<(JobStatus, String), Gauge, 2>, - pub proof_compressor_oldest_uncompressed_batch: Gauge, -} - -#[vise::register] -pub(crate) static PROVER_FRI_METRICS: vise::Global = vise::Global::new(); - -#[derive(Debug, Clone, PartialEq, Eq, Hash, EncodeLabelSet)] -pub(crate) struct ProverJobsLabels { - pub r#type: &'static str, - pub circuit_id: String, - pub aggregation_round: String, - pub prover_group_id: String, - pub protocol_version: String, -} - -#[derive(Debug, Metrics)] -#[metrics(prefix = "fri_prover")] -pub(crate) struct FriProverMetrics { - pub prover_jobs: Family>, - #[metrics(labels = ["circuit_id", "aggregation_round"])] - pub block_number: LabeledFamily<(String, String), Gauge, 2>, - pub oldest_unpicked_batch: Gauge, - pub oldest_not_generated_batch: Gauge, - #[metrics(labels = ["round"])] - pub oldest_unprocessed_block_by_round: LabeledFamily>, -} - -impl FriProverMetrics { - pub fn report_prover_jobs( - &self, - r#type: &'static str, - circuit_id: u8, - aggregation_round: u8, - prover_group_id: u8, - protocol_version: ProtocolSemanticVersion, - amount: u64, - ) { - self.prover_jobs[&ProverJobsLabels { - r#type, - circuit_id: circuit_id.to_string(), - aggregation_round: aggregation_round.to_string(), - prover_group_id: prover_group_id.to_string(), - protocol_version: protocol_version.to_string(), - }] - .set(amount); - } -} - -#[vise::register] -pub(crate) static FRI_PROVER_METRICS: vise::Global = vise::Global::new(); - -#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, EncodeLabelValue, EncodeLabelSet)] -#[metrics(label = "type", rename_all = "snake_case")] -#[allow(clippy::enum_variant_names)] -pub(crate) enum WitnessType { - WitnessInputsFri, - LeafAggregationJobsFri, - NodeAggregationJobsFri, - RecursionTipJobsFri, - SchedulerJobsFri, -} - -impl From<&str> for WitnessType { - fn from(s: &str) -> Self { - match s { - "witness_inputs_fri" => Self::WitnessInputsFri, - "leaf_aggregations_jobs_fri" => Self::LeafAggregationJobsFri, - "node_aggregations_jobs_fri" => Self::NodeAggregationJobsFri, - "recursion_tip_jobs_fri" => Self::RecursionTipJobsFri, - "scheduler_jobs_fri" => Self::SchedulerJobsFri, - _ => panic!("Invalid witness type"), - } - } -} - -#[derive(Debug, Metrics)] -#[metrics(prefix = "server")] -pub(crate) struct ServerMetrics { - pub prover_fri_requeued_jobs: Counter, - pub requeued_jobs: Family>, - #[metrics(labels = ["type", "round", "protocol_version"])] - pub witness_generator_jobs_by_round: - LabeledFamily<(&'static str, String, String), Gauge, 3>, - #[metrics(labels = ["type", "protocol_version"])] - pub witness_generator_jobs: LabeledFamily<(&'static str, String), Gauge, 2>, - pub leaf_fri_witness_generator_waiting_to_queued_jobs_transitions: Counter, - pub node_fri_witness_generator_waiting_to_queued_jobs_transitions: Counter, - pub recursion_tip_witness_generator_waiting_to_queued_jobs_transitions: Counter, - pub scheduler_witness_generator_waiting_to_queued_jobs_transitions: Counter, -} - -#[vise::register] -pub(crate) static SERVER_METRICS: vise::Global = vise::Global::new(); diff --git a/core/node/house_keeper/src/prover/mod.rs b/core/node/house_keeper/src/prover/mod.rs deleted file mode 100644 index af315c53cb48..000000000000 --- a/core/node/house_keeper/src/prover/mod.rs +++ /dev/null @@ -1,14 +0,0 @@ -mod archiver; -mod metrics; -mod queue_reporter; -mod retry_manager; -mod waiting_to_queued_fri_witness_job_mover; - -pub use archiver::{FriGpuProverArchiver, FriProverJobsArchiver}; -pub use queue_reporter::{ - FriProofCompressorQueueReporter, FriProverQueueReporter, FriWitnessGeneratorQueueReporter, -}; -pub use retry_manager::{ - FriProofCompressorJobRetryManager, FriProverJobRetryManager, FriWitnessGeneratorJobRetryManager, -}; -pub use waiting_to_queued_fri_witness_job_mover::WaitingToQueuedFriWitnessJobMover; diff --git a/core/node/house_keeper/src/prover/queue_reporter/fri_proof_compressor_queue_reporter.rs b/core/node/house_keeper/src/prover/queue_reporter/fri_proof_compressor_queue_reporter.rs deleted file mode 100644 index c554bf4616d3..000000000000 --- a/core/node/house_keeper/src/prover/queue_reporter/fri_proof_compressor_queue_reporter.rs +++ /dev/null @@ -1,88 +0,0 @@ -use std::collections::HashMap; - -use async_trait::async_trait; -use zksync_dal::ConnectionPool; -use zksync_prover_dal::{Prover, ProverDal}; -use zksync_types::{protocol_version::ProtocolSemanticVersion, prover_dal::JobCountStatistics}; - -use crate::{ - periodic_job::PeriodicJob, - prover::metrics::{JobStatus, PROVER_FRI_METRICS}, -}; - -/// `FriProofCompressorQueueReporter` is a task that periodically reports compression jobs status. -/// Note: these values will be used for auto-scaling proof compressor -#[derive(Debug)] -pub struct FriProofCompressorQueueReporter { - reporting_interval_ms: u64, - pool: ConnectionPool, -} - -impl FriProofCompressorQueueReporter { - pub fn new(reporting_interval_ms: u64, pool: ConnectionPool) -> Self { - Self { - reporting_interval_ms, - pool, - } - } - - async fn get_job_statistics( - pool: &ConnectionPool, - ) -> HashMap { - pool.connection() - .await - .unwrap() - .fri_proof_compressor_dal() - .get_jobs_stats() - .await - } -} - -#[async_trait] -impl PeriodicJob for FriProofCompressorQueueReporter { - const SERVICE_NAME: &'static str = "FriProofCompressorQueueReporter"; - - async fn run_routine_task(&mut self) -> anyhow::Result<()> { - let stats = Self::get_job_statistics(&self.pool).await; - - for (protocol_version, stats) in &stats { - if stats.queued > 0 { - tracing::info!( - "Found {} free {} in progress proof compressor jobs for protocol version {}", - stats.queued, - stats.in_progress, - protocol_version - ); - } - - PROVER_FRI_METRICS.proof_compressor_jobs - [&(JobStatus::Queued, protocol_version.to_string())] - .set(stats.queued as u64); - - PROVER_FRI_METRICS.proof_compressor_jobs - [&(JobStatus::InProgress, protocol_version.to_string())] - .set(stats.in_progress as u64); - } - - let oldest_not_compressed_batch = self - .pool - .connection() - .await - .unwrap() - .fri_proof_compressor_dal() - .get_oldest_not_compressed_batch() - .await; - - if let Some(l1_batch_number) = oldest_not_compressed_batch { - PROVER_FRI_METRICS - .proof_compressor_oldest_uncompressed_batch - .set(l1_batch_number.0 as u64); - } - - Ok(()) - } - - fn polling_interval_ms(&self) -> u64 { - self.reporting_interval_ms - } -} diff --git a/core/node/house_keeper/src/prover/queue_reporter/fri_prover_queue_reporter.rs b/core/node/house_keeper/src/prover/queue_reporter/fri_prover_queue_reporter.rs deleted file mode 100644 index 12dfae86ab46..000000000000 --- a/core/node/house_keeper/src/prover/queue_reporter/fri_prover_queue_reporter.rs +++ /dev/null @@ -1,144 +0,0 @@ -use async_trait::async_trait; -use zksync_config::configs::fri_prover_group::FriProverGroupConfig; -use zksync_dal::{ConnectionPool, Core, CoreDal}; -use zksync_prover_dal::{Prover, ProverDal}; -use zksync_types::{basic_fri_types::CircuitIdRoundTuple, prover_dal::JobCountStatistics}; - -use crate::{periodic_job::PeriodicJob, prover::metrics::FRI_PROVER_METRICS}; -/// `FriProverQueueReporter` is a task that periodically reports prover jobs status. -/// Note: these values will be used for auto-scaling provers and Witness Vector Generators. -#[derive(Debug)] -pub struct FriProverQueueReporter { - reporting_interval_ms: u64, - prover_connection_pool: ConnectionPool, - db_connection_pool: ConnectionPool, - config: FriProverGroupConfig, -} - -impl FriProverQueueReporter { - pub fn new( - reporting_interval_ms: u64, - prover_connection_pool: ConnectionPool, - db_connection_pool: ConnectionPool, - config: FriProverGroupConfig, - ) -> Self { - Self { - reporting_interval_ms, - prover_connection_pool, - db_connection_pool, - config, - } - } -} - -#[async_trait] -impl PeriodicJob for FriProverQueueReporter { - const SERVICE_NAME: &'static str = "FriProverQueueReporter"; - - async fn run_routine_task(&mut self) -> anyhow::Result<()> { - let mut conn = self.prover_connection_pool.connection().await.unwrap(); - let stats = conn.fri_prover_jobs_dal().get_prover_jobs_stats().await; - - for (protocol_semantic_version, circuit_prover_stats) in stats { - for (tuple, stat) in circuit_prover_stats { - let CircuitIdRoundTuple { - circuit_id, - aggregation_round, - } = tuple; - let JobCountStatistics { - queued, - in_progress, - } = stat; - let group_id = self - .config - .get_group_id_for_circuit_id_and_aggregation_round( - circuit_id, - aggregation_round, - ) - .unwrap_or(u8::MAX); - - FRI_PROVER_METRICS.report_prover_jobs( - "queued", - circuit_id, - aggregation_round, - group_id, - protocol_semantic_version, - queued as u64, - ); - - FRI_PROVER_METRICS.report_prover_jobs( - "in_progress", - circuit_id, - aggregation_round, - group_id, - protocol_semantic_version, - in_progress as u64, - ); - } - } - - let lag_by_circuit_type = conn - .fri_prover_jobs_dal() - .min_unproved_l1_batch_number() - .await; - - for ((circuit_id, aggregation_round), l1_batch_number) in lag_by_circuit_type { - FRI_PROVER_METRICS.block_number - [&(circuit_id.to_string(), aggregation_round.to_string())] - .set(l1_batch_number.0 as u64); - } - - // FIXME: refactor metrics here - - let mut db_conn = self.db_connection_pool.connection().await.unwrap(); - - let oldest_unpicked_batch = match db_conn - .proof_generation_dal() - .get_oldest_unpicked_batch() - .await? - { - Some(l1_batch_number) => l1_batch_number.0 as u64, - // if there is no unpicked batch in database, we use sealed batch number as a result - None => { - db_conn - .blocks_dal() - .get_sealed_l1_batch_number() - .await - .unwrap() - .unwrap() - .0 as u64 - } - }; - FRI_PROVER_METRICS - .oldest_unpicked_batch - .set(oldest_unpicked_batch); - - if let Some(l1_batch_number) = db_conn - .proof_generation_dal() - .get_oldest_not_generated_batch() - .await? - { - FRI_PROVER_METRICS - .oldest_not_generated_batch - .set(l1_batch_number.0 as u64); - } - - for aggregation_round in 0..3 { - if let Some(l1_batch_number) = conn - .fri_prover_jobs_dal() - .min_unproved_l1_batch_number_for_aggregation_round(aggregation_round.into()) - .await - { - FRI_PROVER_METRICS.oldest_unprocessed_block_by_round - [&aggregation_round.to_string()] - .set(l1_batch_number.0 as u64); - } - } - - Ok(()) - } - - fn polling_interval_ms(&self) -> u64 { - self.reporting_interval_ms - } -} diff --git a/core/node/house_keeper/src/prover/queue_reporter/fri_witness_generator_queue_reporter.rs b/core/node/house_keeper/src/prover/queue_reporter/fri_witness_generator_queue_reporter.rs deleted file mode 100644 index cd124dffaf67..000000000000 --- a/core/node/house_keeper/src/prover/queue_reporter/fri_witness_generator_queue_reporter.rs +++ /dev/null @@ -1,131 +0,0 @@ -use std::collections::HashMap; - -use async_trait::async_trait; -use zksync_dal::ConnectionPool; -use zksync_prover_dal::{Prover, ProverDal}; -use zksync_types::{ - basic_fri_types::AggregationRound, protocol_version::ProtocolSemanticVersion, - prover_dal::JobCountStatistics, -}; - -use crate::{periodic_job::PeriodicJob, prover::metrics::SERVER_METRICS}; - -/// `FriWitnessGeneratorQueueReporter` is a task that periodically reports witness generator jobs status. -/// Note: these values will be used for auto-scaling witness generators (Basic, Leaf, Node, Recursion Tip and Scheduler). -#[derive(Debug)] -pub struct FriWitnessGeneratorQueueReporter { - reporting_interval_ms: u64, - pool: ConnectionPool, -} - -impl FriWitnessGeneratorQueueReporter { - pub fn new(pool: ConnectionPool, reporting_interval_ms: u64) -> Self { - Self { - reporting_interval_ms, - pool, - } - } - - async fn get_job_statistics( - &self, - ) -> HashMap<(AggregationRound, ProtocolSemanticVersion), JobCountStatistics> { - let mut conn = self.pool.connection().await.unwrap(); - let mut result = HashMap::new(); - result.extend( - conn.fri_witness_generator_dal() - .get_witness_jobs_stats(AggregationRound::BasicCircuits) - .await, - ); - result.extend( - conn.fri_witness_generator_dal() - .get_witness_jobs_stats(AggregationRound::LeafAggregation) - .await, - ); - result.extend( - conn.fri_witness_generator_dal() - .get_witness_jobs_stats(AggregationRound::NodeAggregation) - .await, - ); - result.extend( - conn.fri_witness_generator_dal() - .get_witness_jobs_stats(AggregationRound::RecursionTip) - .await, - ); - result.extend( - conn.fri_witness_generator_dal() - .get_witness_jobs_stats(AggregationRound::Scheduler) - .await, - ); - - result - } -} - -fn emit_metrics_for_round( - round: AggregationRound, - protocol_version: ProtocolSemanticVersion, - stats: &JobCountStatistics, -) { - if stats.queued > 0 || stats.in_progress > 0 { - tracing::trace!( - "Found {} free and {} in progress {:?} FRI witness generators jobs for protocol version {}", - stats.queued, - stats.in_progress, - round, - protocol_version - ); - } - - SERVER_METRICS.witness_generator_jobs_by_round[&( - "queued", - format!("{:?}", round), - protocol_version.to_string(), - )] - .set(stats.queued as u64); - SERVER_METRICS.witness_generator_jobs_by_round[&( - "in_progress", - format!("{:?}", round), - protocol_version.to_string(), - )] - .set(stats.in_progress as u64); -} - -#[async_trait] -impl PeriodicJob for FriWitnessGeneratorQueueReporter { - const SERVICE_NAME: &'static str = "FriWitnessGeneratorQueueReporter"; - - async fn run_routine_task(&mut self) -> anyhow::Result<()> { - let stats_for_all_rounds = self.get_job_statistics().await; - let mut aggregated = HashMap::::new(); - for ((round, protocol_version), stats) in stats_for_all_rounds { - emit_metrics_for_round(round, protocol_version, &stats); - - let entry = aggregated.entry(protocol_version).or_default(); - entry.queued += stats.queued; - entry.in_progress += stats.in_progress; - } - - for (protocol_version, stats) in &aggregated { - if stats.queued > 0 || stats.in_progress > 0 { - tracing::trace!( - "Found {} free {} in progress witness generators jobs for protocol version {}", - stats.queued, - stats.in_progress, - protocol_version - ); - } - - SERVER_METRICS.witness_generator_jobs[&("queued", protocol_version.to_string())] - .set(stats.queued as u64); - - SERVER_METRICS.witness_generator_jobs[&("in_progress", protocol_version.to_string())] - .set(stats.in_progress as u64); - } - - Ok(()) - } - - fn polling_interval_ms(&self) -> u64 { - self.reporting_interval_ms - } -} diff --git a/core/node/house_keeper/src/prover/queue_reporter/mod.rs b/core/node/house_keeper/src/prover/queue_reporter/mod.rs deleted file mode 100644 index 9eba45320988..000000000000 --- a/core/node/house_keeper/src/prover/queue_reporter/mod.rs +++ /dev/null @@ -1,7 +0,0 @@ -mod fri_proof_compressor_queue_reporter; -mod fri_prover_queue_reporter; -mod fri_witness_generator_queue_reporter; - -pub use fri_proof_compressor_queue_reporter::FriProofCompressorQueueReporter; -pub use fri_prover_queue_reporter::FriProverQueueReporter; -pub use fri_witness_generator_queue_reporter::FriWitnessGeneratorQueueReporter; diff --git a/core/node/house_keeper/src/prover/retry_manager/fri_proof_compressor_job_retry_manager.rs b/core/node/house_keeper/src/prover/retry_manager/fri_proof_compressor_job_retry_manager.rs deleted file mode 100644 index 4d4d8ceed75e..000000000000 --- a/core/node/house_keeper/src/prover/retry_manager/fri_proof_compressor_job_retry_manager.rs +++ /dev/null @@ -1,60 +0,0 @@ -use std::time::Duration; - -use async_trait::async_trait; -use zksync_dal::ConnectionPool; -use zksync_prover_dal::{Prover, ProverDal}; - -use crate::{periodic_job::PeriodicJob, prover::metrics::PROVER_FRI_METRICS}; - -/// `FriProofCompressorJobRetryManager` is a task that periodically queues stuck compressor jobs. -#[derive(Debug)] -pub struct FriProofCompressorJobRetryManager { - pool: ConnectionPool, - max_attempts: u32, - processing_timeout: Duration, - retry_interval_ms: u64, -} - -impl FriProofCompressorJobRetryManager { - pub fn new( - max_attempts: u32, - processing_timeout: Duration, - retry_interval_ms: u64, - pool: ConnectionPool, - ) -> Self { - Self { - max_attempts, - processing_timeout, - retry_interval_ms, - pool, - } - } -} - -#[async_trait] -impl PeriodicJob for FriProofCompressorJobRetryManager { - const SERVICE_NAME: &'static str = "FriProofCompressorJobRetryManager"; - - async fn run_routine_task(&mut self) -> anyhow::Result<()> { - let stuck_jobs = self - .pool - .connection() - .await - .unwrap() - .fri_proof_compressor_dal() - .requeue_stuck_jobs(self.processing_timeout, self.max_attempts) - .await; - let job_len = stuck_jobs.len(); - for stuck_job in stuck_jobs { - tracing::info!("re-queuing fri proof compressor job {:?}", stuck_job); - } - PROVER_FRI_METRICS - .proof_compressor_requeued_jobs - .inc_by(job_len as u64); - Ok(()) - } - - fn polling_interval_ms(&self) -> u64 { - self.retry_interval_ms - } -} diff --git a/core/node/house_keeper/src/prover/retry_manager/fri_prover_job_retry_manager.rs b/core/node/house_keeper/src/prover/retry_manager/fri_prover_job_retry_manager.rs deleted file mode 100644 index 755944d21634..000000000000 --- a/core/node/house_keeper/src/prover/retry_manager/fri_prover_job_retry_manager.rs +++ /dev/null @@ -1,60 +0,0 @@ -use std::time::Duration; - -use async_trait::async_trait; -use zksync_dal::ConnectionPool; -use zksync_prover_dal::{Prover, ProverDal}; - -use crate::{periodic_job::PeriodicJob, prover::metrics::SERVER_METRICS}; - -/// `FriProverJobRetryManager` is a task that periodically queues stuck prover jobs. -#[derive(Debug)] -pub struct FriProverJobRetryManager { - pool: ConnectionPool, - max_attempts: u32, - processing_timeout: Duration, - retry_interval_ms: u64, -} - -impl FriProverJobRetryManager { - pub fn new( - max_attempts: u32, - processing_timeout: Duration, - retry_interval_ms: u64, - pool: ConnectionPool, - ) -> Self { - Self { - max_attempts, - processing_timeout, - retry_interval_ms, - pool, - } - } -} - -#[async_trait] -impl PeriodicJob for FriProverJobRetryManager { - const SERVICE_NAME: &'static str = "FriProverJobRetryManager"; - - async fn run_routine_task(&mut self) -> anyhow::Result<()> { - let stuck_jobs = self - .pool - .connection() - .await - .unwrap() - .fri_prover_jobs_dal() - .requeue_stuck_jobs(self.processing_timeout, self.max_attempts) - .await; - let job_len = stuck_jobs.len(); - for stuck_job in stuck_jobs { - tracing::info!("re-queuing fri prover job {:?}", stuck_job); - } - SERVER_METRICS - .prover_fri_requeued_jobs - .inc_by(job_len as u64); - Ok(()) - } - - fn polling_interval_ms(&self) -> u64 { - self.retry_interval_ms - } -} diff --git a/core/node/house_keeper/src/prover/retry_manager/fri_witness_generator_jobs_retry_manager.rs b/core/node/house_keeper/src/prover/retry_manager/fri_witness_generator_jobs_retry_manager.rs deleted file mode 100644 index b3d990e2754f..000000000000 --- a/core/node/house_keeper/src/prover/retry_manager/fri_witness_generator_jobs_retry_manager.rs +++ /dev/null @@ -1,124 +0,0 @@ -use async_trait::async_trait; -use zksync_config::configs::fri_witness_generator::WitnessGenerationTimeouts; -use zksync_dal::ConnectionPool; -use zksync_prover_dal::{Prover, ProverDal}; -use zksync_types::prover_dal::StuckJobs; - -use crate::{ - periodic_job::PeriodicJob, - prover::metrics::{WitnessType, SERVER_METRICS}, -}; - -/// `FriWitnessGeneratorJobRetryManager` is a task that periodically queues stuck prover jobs. -#[derive(Debug)] -pub struct FriWitnessGeneratorJobRetryManager { - pool: ConnectionPool, - max_attempts: u32, - processing_timeouts: WitnessGenerationTimeouts, - retry_interval_ms: u64, -} - -impl FriWitnessGeneratorJobRetryManager { - pub fn new( - max_attempts: u32, - processing_timeouts: WitnessGenerationTimeouts, - retry_interval_ms: u64, - pool: ConnectionPool, - ) -> Self { - Self { - max_attempts, - processing_timeouts, - retry_interval_ms, - pool, - } - } - - pub fn emit_telemetry(&self, witness_type: &str, stuck_jobs: &Vec) { - for stuck_job in stuck_jobs { - tracing::info!("re-queuing {:?} {:?}", witness_type, stuck_job); - } - SERVER_METRICS.requeued_jobs[&WitnessType::from(witness_type)] - .inc_by(stuck_jobs.len() as u64); - } - - pub async fn requeue_stuck_witness_inputs_jobs(&mut self) { - let stuck_jobs = self - .pool - .connection() - .await - .unwrap() - .fri_witness_generator_dal() - .requeue_stuck_basic_jobs(self.processing_timeouts.basic(), self.max_attempts) - .await; - self.emit_telemetry("witness_inputs_fri", &stuck_jobs); - } - - pub async fn requeue_stuck_leaf_aggregations_jobs(&mut self) { - let stuck_jobs = self - .pool - .connection() - .await - .unwrap() - .fri_witness_generator_dal() - .requeue_stuck_leaf_jobs(self.processing_timeouts.leaf(), self.max_attempts) - .await; - self.emit_telemetry("leaf_aggregations_jobs_fri", &stuck_jobs); - } - - pub async fn requeue_stuck_node_aggregations_jobs(&mut self) { - let stuck_jobs = self - .pool - .connection() - .await - .unwrap() - .fri_witness_generator_dal() - .requeue_stuck_node_jobs(self.processing_timeouts.node(), self.max_attempts) - .await; - self.emit_telemetry("node_aggregations_jobs_fri", &stuck_jobs); - } - - pub async fn requeue_stuck_recursion_tip_jobs(&mut self) { - let stuck_jobs = self - .pool - .connection() - .await - .unwrap() - .fri_witness_generator_dal() - .requeue_stuck_recursion_tip_jobs( - self.processing_timeouts.recursion_tip(), - self.max_attempts, - ) - .await; - self.emit_telemetry("recursion_tip_jobs_fri", &stuck_jobs); - } - - pub async fn requeue_stuck_scheduler_jobs(&mut self) { - let stuck_jobs = self - .pool - .connection() - .await - .unwrap() - .fri_witness_generator_dal() - .requeue_stuck_scheduler_jobs(self.processing_timeouts.scheduler(), self.max_attempts) - .await; - self.emit_telemetry("scheduler_jobs_fri", &stuck_jobs); - } -} - -#[async_trait] -impl PeriodicJob for FriWitnessGeneratorJobRetryManager { - const SERVICE_NAME: &'static str = "FriWitnessGeneratorJobRetryManager"; - - async fn run_routine_task(&mut self) -> anyhow::Result<()> { - self.requeue_stuck_witness_inputs_jobs().await; - self.requeue_stuck_leaf_aggregations_jobs().await; - self.requeue_stuck_node_aggregations_jobs().await; - self.requeue_stuck_recursion_tip_jobs().await; - self.requeue_stuck_scheduler_jobs().await; - Ok(()) - } - - fn polling_interval_ms(&self) -> u64 { - self.retry_interval_ms - } -} diff --git a/core/node/house_keeper/src/prover/retry_manager/mod.rs b/core/node/house_keeper/src/prover/retry_manager/mod.rs deleted file mode 100644 index 3b4a8b584817..000000000000 --- a/core/node/house_keeper/src/prover/retry_manager/mod.rs +++ /dev/null @@ -1,7 +0,0 @@ -mod fri_proof_compressor_job_retry_manager; -mod fri_prover_job_retry_manager; -mod fri_witness_generator_jobs_retry_manager; - -pub use fri_proof_compressor_job_retry_manager::FriProofCompressorJobRetryManager; -pub use fri_prover_job_retry_manager::FriProverJobRetryManager; -pub use fri_witness_generator_jobs_retry_manager::FriWitnessGeneratorJobRetryManager; diff --git a/core/node/house_keeper/src/prover/waiting_to_queued_fri_witness_job_mover.rs b/core/node/house_keeper/src/prover/waiting_to_queued_fri_witness_job_mover.rs deleted file mode 100644 index d4d5edc78eb9..000000000000 --- a/core/node/house_keeper/src/prover/waiting_to_queued_fri_witness_job_mover.rs +++ /dev/null @@ -1,127 +0,0 @@ -use async_trait::async_trait; -use zksync_dal::ConnectionPool; -use zksync_prover_dal::{Prover, ProverDal}; - -use crate::{periodic_job::PeriodicJob, prover::metrics::SERVER_METRICS}; - -#[derive(Debug)] -pub struct WaitingToQueuedFriWitnessJobMover { - job_moving_interval_ms: u64, - pool: ConnectionPool, -} - -impl WaitingToQueuedFriWitnessJobMover { - pub fn new(job_mover_interval_ms: u64, pool: ConnectionPool) -> Self { - Self { - job_moving_interval_ms: job_mover_interval_ms, - pool, - } - } - - async fn move_leaf_aggregation_jobs(&mut self) { - let mut conn = self.pool.connection().await.unwrap(); - let l1_batch_numbers = conn - .fri_witness_generator_dal() - .move_leaf_aggregation_jobs_from_waiting_to_queued() - .await; - let len = l1_batch_numbers.len(); - for (l1_batch_number, circuit_id) in l1_batch_numbers { - tracing::info!( - "Marked fri leaf aggregation job for l1_batch {} and circuit_id {} as queued", - l1_batch_number, - circuit_id - ); - } - - SERVER_METRICS - .node_fri_witness_generator_waiting_to_queued_jobs_transitions - .inc_by(len as u64); - } - - async fn move_node_aggregation_jobs_from_waiting_to_queued(&mut self) -> Vec<(i64, u8, u16)> { - let mut conn = self.pool.connection().await.unwrap(); - let mut jobs = conn - .fri_witness_generator_dal() - .move_depth_zero_node_aggregation_jobs() - .await; - jobs.extend( - conn.fri_witness_generator_dal() - .move_depth_non_zero_node_aggregation_jobs() - .await, - ); - jobs - } - - async fn move_node_aggregation_jobs(&mut self) { - let l1_batch_numbers = self - .move_node_aggregation_jobs_from_waiting_to_queued() - .await; - let len = l1_batch_numbers.len(); - for (l1_batch_number, circuit_id, depth) in l1_batch_numbers { - tracing::info!( - "Marked fri node aggregation job for l1_batch {} and circuit_id {} depth {} as queued", - l1_batch_number, - circuit_id, - depth - ); - } - SERVER_METRICS - .leaf_fri_witness_generator_waiting_to_queued_jobs_transitions - .inc_by(len as u64); - } - - /// Marks recursion tip witness jobs as queued. - /// The trigger condition is all final node proving jobs for the batch have been completed. - async fn move_recursion_tip_jobs(&mut self) { - let mut conn = self.pool.connection().await.unwrap(); - let l1_batch_numbers = conn - .fri_witness_generator_dal() - .move_recursion_tip_jobs_from_waiting_to_queued() - .await; - for l1_batch_number in &l1_batch_numbers { - tracing::info!( - "Marked fri recursion tip witness job for l1_batch {} as queued", - l1_batch_number, - ); - } - SERVER_METRICS - .recursion_tip_witness_generator_waiting_to_queued_jobs_transitions - .inc_by(l1_batch_numbers.len() as u64); - } - - /// Marks scheduler witness jobs as queued. - /// The trigger condition is the recursion tip proving job for the batch has been completed. - async fn move_scheduler_jobs(&mut self) { - let mut conn = self.pool.connection().await.unwrap(); - let l1_batch_numbers = conn - .fri_witness_generator_dal() - .move_scheduler_jobs_from_waiting_to_queued() - .await; - for l1_batch_number in &l1_batch_numbers { - tracing::info!( - "Marked fri scheduler witness job for l1_batch {} as queued", - l1_batch_number, - ); - } - SERVER_METRICS - .scheduler_witness_generator_waiting_to_queued_jobs_transitions - .inc_by(l1_batch_numbers.len() as u64); - } -} - -#[async_trait] -impl PeriodicJob for WaitingToQueuedFriWitnessJobMover { - const SERVICE_NAME: &'static str = "WaitingToQueuedFriWitnessJobMover"; - - async fn run_routine_task(&mut self) -> anyhow::Result<()> { - self.move_leaf_aggregation_jobs().await; - self.move_node_aggregation_jobs().await; - self.move_recursion_tip_jobs().await; - self.move_scheduler_jobs().await; - Ok(()) - } - - fn polling_interval_ms(&self) -> u64 { - self.job_moving_interval_ms - } -} diff --git a/core/node/node_framework/Cargo.toml b/core/node/node_framework/Cargo.toml index f9efb22bd610..fe4889225675 100644 --- a/core/node/node_framework/Cargo.toml +++ b/core/node/node_framework/Cargo.toml @@ -16,7 +16,6 @@ zksync_vlog.workspace = true zksync_types.workspace = true zksync_health_check.workspace = true zksync_dal.workspace = true -zksync_prover_dal.workspace = true zksync_db_connection.workspace = true zksync_config.workspace = true zksync_protobuf_config.workspace = true diff --git a/core/node/node_framework/src/implementations/layers/house_keeper.rs b/core/node/node_framework/src/implementations/layers/house_keeper.rs index 74314320d815..1e2bc568d50f 100644 --- a/core/node/node_framework/src/implementations/layers/house_keeper.rs +++ b/core/node/node_framework/src/implementations/layers/house_keeper.rs @@ -1,20 +1,10 @@ -use zksync_config::configs::{ - fri_prover_group::FriProverGroupConfig, house_keeper::HouseKeeperConfig, - FriProofCompressorConfig, FriProverConfig, FriWitnessGeneratorConfig, -}; +use zksync_config::configs::house_keeper::HouseKeeperConfig; use zksync_house_keeper::{ - blocks_state_reporter::L1BatchMetricsReporter, - periodic_job::PeriodicJob, - prover::{ - FriGpuProverArchiver, FriProofCompressorJobRetryManager, FriProofCompressorQueueReporter, - FriProverJobRetryManager, FriProverJobsArchiver, FriProverQueueReporter, - FriWitnessGeneratorJobRetryManager, FriWitnessGeneratorQueueReporter, - WaitingToQueuedFriWitnessJobMover, - }, + blocks_state_reporter::L1BatchMetricsReporter, periodic_job::PeriodicJob, }; use crate::{ - implementations::resources::pools::{PoolResource, ProverPool, ReplicaPool}, + implementations::resources::pools::{PoolResource, ReplicaPool}, service::StopReceiver, task::{Task, TaskId}, wiring_layer::{WiringError, WiringLayer}, @@ -26,17 +16,12 @@ use crate::{ #[derive(Debug)] pub struct HouseKeeperLayer { house_keeper_config: HouseKeeperConfig, - fri_prover_config: FriProverConfig, - fri_witness_generator_config: FriWitnessGeneratorConfig, - fri_prover_group_config: FriProverGroupConfig, - fri_proof_compressor_config: FriProofCompressorConfig, } #[derive(Debug, FromContext)] #[context(crate = crate)] pub struct Input { pub replica_pool: PoolResource, - pub prover_pool: PoolResource, } #[derive(Debug, IntoContext)] @@ -44,40 +29,12 @@ pub struct Input { pub struct Output { #[context(task)] pub l1_batch_metrics_reporter: L1BatchMetricsReporter, - #[context(task)] - pub fri_prover_job_retry_manager: FriProverJobRetryManager, - #[context(task)] - pub fri_witness_generator_job_retry_manager: FriWitnessGeneratorJobRetryManager, - #[context(task)] - pub waiting_to_queued_fri_witness_job_mover: WaitingToQueuedFriWitnessJobMover, - #[context(task)] - pub fri_prover_job_archiver: Option, - #[context(task)] - pub fri_prover_gpu_archiver: Option, - #[context(task)] - pub fri_witness_generator_stats_reporter: FriWitnessGeneratorQueueReporter, - #[context(task)] - pub fri_prover_stats_reporter: FriProverQueueReporter, - #[context(task)] - pub fri_proof_compressor_stats_reporter: FriProofCompressorQueueReporter, - #[context(task)] - pub fri_proof_compressor_job_retry_manager: FriProofCompressorJobRetryManager, } impl HouseKeeperLayer { - pub fn new( - house_keeper_config: HouseKeeperConfig, - fri_prover_config: FriProverConfig, - fri_witness_generator_config: FriWitnessGeneratorConfig, - fri_prover_group_config: FriProverGroupConfig, - fri_proof_compressor_config: FriProofCompressorConfig, - ) -> Self { + pub fn new(house_keeper_config: HouseKeeperConfig) -> Self { Self { house_keeper_config, - fri_prover_config, - fri_witness_generator_config, - fri_prover_group_config, - fri_proof_compressor_config, } } } @@ -94,7 +51,6 @@ impl WiringLayer for HouseKeeperLayer { async fn wire(self, input: Self::Input) -> Result { // Initialize resources let replica_pool = input.replica_pool.get().await?; - let prover_pool = input.prover_pool.get().await?; // Initialize and add tasks let l1_batch_metrics_reporter = L1BatchMetricsReporter::new( @@ -103,78 +59,8 @@ impl WiringLayer for HouseKeeperLayer { replica_pool.clone(), ); - let fri_prover_job_retry_manager = FriProverJobRetryManager::new( - self.fri_prover_config.max_attempts, - self.fri_prover_config.proof_generation_timeout(), - self.house_keeper_config.prover_job_retrying_interval_ms, - prover_pool.clone(), - ); - - let fri_witness_gen_job_retry_manager = FriWitnessGeneratorJobRetryManager::new( - self.fri_witness_generator_config.max_attempts, - self.fri_witness_generator_config - .witness_generation_timeouts(), - self.house_keeper_config - .witness_generator_job_retrying_interval_ms, - prover_pool.clone(), - ); - - let waiting_to_queued_fri_witness_job_mover = WaitingToQueuedFriWitnessJobMover::new( - self.house_keeper_config.witness_job_moving_interval_ms, - prover_pool.clone(), - ); - - let fri_prover_job_archiver = self.house_keeper_config.prover_job_archiver_params().map( - |(archiving_interval, archive_after)| { - FriProverJobsArchiver::new(prover_pool.clone(), archiving_interval, archive_after) - }, - ); - - let fri_prover_gpu_archiver = self - .house_keeper_config - .fri_gpu_prover_archiver_params() - .map(|(archiving_interval, archive_after)| { - FriGpuProverArchiver::new(prover_pool.clone(), archiving_interval, archive_after) - }); - - let fri_witness_generator_stats_reporter = FriWitnessGeneratorQueueReporter::new( - prover_pool.clone(), - self.house_keeper_config - .witness_generator_stats_reporting_interval_ms, - ); - - let fri_prover_stats_reporter = FriProverQueueReporter::new( - self.house_keeper_config.prover_stats_reporting_interval_ms, - prover_pool.clone(), - replica_pool.clone(), - self.fri_prover_group_config, - ); - - let fri_proof_compressor_stats_reporter = FriProofCompressorQueueReporter::new( - self.house_keeper_config - .proof_compressor_stats_reporting_interval_ms, - prover_pool.clone(), - ); - - let fri_proof_compressor_retry_manager = FriProofCompressorJobRetryManager::new( - self.fri_proof_compressor_config.max_attempts, - self.fri_proof_compressor_config.generation_timeout(), - self.house_keeper_config - .proof_compressor_job_retrying_interval_ms, - prover_pool.clone(), - ); - Ok(Output { l1_batch_metrics_reporter, - fri_prover_job_retry_manager, - fri_witness_generator_job_retry_manager: fri_witness_gen_job_retry_manager, - waiting_to_queued_fri_witness_job_mover, - fri_prover_job_archiver, - fri_prover_gpu_archiver, - fri_witness_generator_stats_reporter, - fri_prover_stats_reporter, - fri_proof_compressor_stats_reporter, - fri_proof_compressor_job_retry_manager: fri_proof_compressor_retry_manager, }) } } @@ -189,102 +75,3 @@ impl Task for L1BatchMetricsReporter { (*self).run(stop_receiver.0).await } } - -#[async_trait::async_trait] -impl Task for FriProverJobRetryManager { - fn id(&self) -> TaskId { - "fri_prover_job_retry_manager".into() - } - - async fn run(self: Box, stop_receiver: StopReceiver) -> anyhow::Result<()> { - (*self).run(stop_receiver.0).await - } -} - -#[async_trait::async_trait] -impl Task for FriWitnessGeneratorJobRetryManager { - fn id(&self) -> TaskId { - "fri_witness_generator_job_retry_manager".into() - } - - async fn run(self: Box, stop_receiver: StopReceiver) -> anyhow::Result<()> { - (*self).run(stop_receiver.0).await - } -} - -#[async_trait::async_trait] -impl Task for WaitingToQueuedFriWitnessJobMover { - fn id(&self) -> TaskId { - "waiting_to_queued_fri_witness_job_mover".into() - } - - async fn run(self: Box, stop_receiver: StopReceiver) -> anyhow::Result<()> { - (*self).run(stop_receiver.0).await - } -} - -#[async_trait::async_trait] -impl Task for FriWitnessGeneratorQueueReporter { - fn id(&self) -> TaskId { - "fri_witness_generator_queue_reporter".into() - } - - async fn run(self: Box, stop_receiver: StopReceiver) -> anyhow::Result<()> { - (*self).run(stop_receiver.0).await - } -} - -#[async_trait::async_trait] -impl Task for FriProverQueueReporter { - fn id(&self) -> TaskId { - "fri_prover_queue_reporter".into() - } - - async fn run(self: Box, stop_receiver: StopReceiver) -> anyhow::Result<()> { - (*self).run(stop_receiver.0).await - } -} - -#[async_trait::async_trait] -impl Task for FriProofCompressorQueueReporter { - fn id(&self) -> TaskId { - "fri_proof_compressor_queue_reporter".into() - } - - async fn run(self: Box, stop_receiver: StopReceiver) -> anyhow::Result<()> { - (*self).run(stop_receiver.0).await - } -} - -#[async_trait::async_trait] -impl Task for FriProofCompressorJobRetryManager { - fn id(&self) -> TaskId { - "fri_proof_compressor_job_retry_manager".into() - } - - async fn run(self: Box, stop_receiver: StopReceiver) -> anyhow::Result<()> { - (*self).run(stop_receiver.0).await - } -} - -#[async_trait::async_trait] -impl Task for FriProverJobsArchiver { - fn id(&self) -> TaskId { - "fri_prover_jobs_archiver".into() - } - - async fn run(self: Box, stop_receiver: StopReceiver) -> anyhow::Result<()> { - (*self).run(stop_receiver.0).await - } -} - -#[async_trait::async_trait] -impl Task for FriGpuProverArchiver { - fn id(&self) -> TaskId { - "fri_gpu_prover_archiver".into() - } - - async fn run(self: Box, stop_receiver: StopReceiver) -> anyhow::Result<()> { - (*self).run(stop_receiver.0).await - } -} diff --git a/core/node/node_framework/src/implementations/layers/pools_layer.rs b/core/node/node_framework/src/implementations/layers/pools_layer.rs index 734f6f0ccf69..e03cf40ce12d 100644 --- a/core/node/node_framework/src/implementations/layers/pools_layer.rs +++ b/core/node/node_framework/src/implementations/layers/pools_layer.rs @@ -2,7 +2,7 @@ use zksync_config::configs::{DatabaseSecrets, PostgresConfig}; use zksync_dal::{ConnectionPool, Core}; use crate::{ - implementations::resources::pools::{MasterPool, PoolResource, ProverPool, ReplicaPool}, + implementations::resources::pools::{MasterPool, PoolResource, ReplicaPool}, wiring_layer::{WiringError, WiringLayer}, IntoContext, }; @@ -13,7 +13,6 @@ pub struct PoolsLayerBuilder { config: PostgresConfig, with_master: bool, with_replica: bool, - with_prover: bool, secrets: DatabaseSecrets, } @@ -25,7 +24,6 @@ impl PoolsLayerBuilder { config, with_master: false, with_replica: false, - with_prover: false, secrets: database_secrets, } } @@ -42,12 +40,6 @@ impl PoolsLayerBuilder { self } - /// Allows to enable the prover pool. - pub fn with_prover(mut self, with_prover: bool) -> Self { - self.with_prover = with_prover; - self - } - /// Builds the [`PoolsLayer`] with the provided configuration. pub fn build(self) -> PoolsLayer { PoolsLayer { @@ -55,7 +47,6 @@ impl PoolsLayerBuilder { secrets: self.secrets, with_master: self.with_master, with_replica: self.with_replica, - with_prover: self.with_prover, } } } @@ -67,14 +58,12 @@ impl PoolsLayerBuilder { /// /// - `PoolResource::` (if master pool is enabled) /// - `PoolResource::` (if replica pool is enabled) -/// - `PoolResource::` (if prover pool is enabled) #[derive(Debug)] pub struct PoolsLayer { config: PostgresConfig, secrets: DatabaseSecrets, with_master: bool, with_replica: bool, - with_prover: bool, } #[derive(Debug, IntoContext)] @@ -82,7 +71,6 @@ pub struct PoolsLayer { pub struct Output { pub master_pool: Option>, pub replica_pool: Option>, - pub prover_pool: Option>, } #[async_trait::async_trait] @@ -95,7 +83,7 @@ impl WiringLayer for PoolsLayer { } async fn wire(self, _input: Self::Input) -> Result { - if !self.with_master && !self.with_replica && !self.with_prover { + if !self.with_master && !self.with_replica { return Err(WiringError::Configuration( "At least one pool should be enabled".to_string(), )); @@ -137,21 +125,9 @@ impl WiringLayer for PoolsLayer { None }; - let prover_pool = if self.with_prover { - Some(PoolResource::::new( - self.secrets.prover_url()?, - self.config.max_connections()?, - None, - None, - )) - } else { - None - }; - Ok(Output { master_pool, replica_pool, - prover_pool, }) } } diff --git a/core/node/node_framework/src/implementations/resources/pools.rs b/core/node/node_framework/src/implementations/resources/pools.rs index 75f5d22e3570..3c4d1d4712be 100644 --- a/core/node/node_framework/src/implementations/resources/pools.rs +++ b/core/node/node_framework/src/implementations/resources/pools.rs @@ -9,7 +9,6 @@ use std::{ use tokio::sync::Mutex; use zksync_dal::{ConnectionPool, Core}; use zksync_db_connection::connection_pool::ConnectionPoolBuilder; -use zksync_prover_dal::Prover; use zksync_types::url::SensitiveUrl; use crate::resource::Resource; @@ -122,10 +121,6 @@ pub struct MasterPool {} #[non_exhaustive] pub struct ReplicaPool {} -#[derive(Debug, Clone)] -#[non_exhaustive] -pub struct ProverPool {} - pub trait PoolKind: Clone + Sync + Send + 'static { type DbMarker: zksync_db_connection::connection::DbMarker; @@ -147,11 +142,3 @@ impl PoolKind for ReplicaPool { "replica" } } - -impl PoolKind for ProverPool { - type DbMarker = Prover; - - fn kind_str() -> &'static str { - "prover" - } -} diff --git a/core/node/state_keeper/src/executor/mod.rs b/core/node/state_keeper/src/executor/mod.rs index 31f5d56ac769..903dae2f1cad 100644 --- a/core/node/state_keeper/src/executor/mod.rs +++ b/core/node/state_keeper/src/executor/mod.rs @@ -2,7 +2,7 @@ use zksync_multivm::interface::{ BatchTransactionExecutionResult, Call, CompressedBytecodeInfo, ExecutionResult, Halt, VmExecutionResultAndLogs, }; -use zksync_types::{Transaction, H256}; +use zksync_types::Transaction; pub use zksync_vm_executor::batch::MainBatchExecutorFactory; use crate::ExecutionMetricsForCriteria; @@ -23,7 +23,6 @@ pub enum TxExecutionResult { compressed_bytecodes: Vec, call_tracer_result: Vec, gas_remaining: u32, - new_known_factory_deps: Vec<(H256, Vec)>, }, /// The VM rejected the tx for some reason. RejectedByVm { reason: Halt }, @@ -41,10 +40,9 @@ impl TxExecutionResult { _ => Self::Success { tx_metrics: Box::new(ExecutionMetricsForCriteria::new(Some(tx), &res.tx_result)), gas_remaining: res.tx_result.statistics.gas_remaining, - tx_result: res.tx_result, + tx_result: res.tx_result.clone(), compressed_bytecodes: res.compressed_bytecodes, call_tracer_result: res.call_traces, - new_known_factory_deps: res.new_known_factory_deps, }, } } diff --git a/core/node/state_keeper/src/executor/tests/mod.rs b/core/node/state_keeper/src/executor/tests/mod.rs index 90ce236a38f8..6fa4522d43fd 100644 --- a/core/node/state_keeper/src/executor/tests/mod.rs +++ b/core/node/state_keeper/src/executor/tests/mod.rs @@ -2,6 +2,7 @@ use assert_matches::assert_matches; use test_casing::{test_casing, Product}; +use tester::AccountFailedCall; use zksync_dal::{ConnectionPool, Core}; use zksync_multivm::interface::{BatchTransactionExecutionResult, ExecutionResult, Halt}; use zksync_test_account::Account; @@ -300,6 +301,27 @@ async fn deploy_and_call_loadtest(vm_mode: FastVmMode) { executor.finish_batch().await.unwrap(); } +#[test_casing(3, FAST_VM_MODES)] +#[tokio::test] +async fn deploy_failedcall(vm_mode: FastVmMode) { + let connection_pool = ConnectionPool::::constrained_test_pool(1).await; + let mut alice = Account::random(); + + let mut tester = Tester::new(connection_pool, vm_mode); + tester.genesis().await; + tester.fund(&[alice.address()]).await; + let mut executor = tester + .create_batch_executor(StorageType::AsyncRocksdbCache) + .await; + + let tx = alice.deploy_failedcall_tx(); + + let execute_tx = executor.execute_tx(tx.tx).await.unwrap(); + assert_executed(&execute_tx); + + executor.finish_batch().await.unwrap(); +} + /// Checks that a tx that is reverted by the VM still can be included into a batch. #[test_casing(3, FAST_VM_MODES)] #[tokio::test] diff --git a/core/node/state_keeper/src/executor/tests/tester.rs b/core/node/state_keeper/src/executor/tests/tester.rs index 48c4344779b5..d524d1a20dd7 100644 --- a/core/node/state_keeper/src/executor/tests/tester.rs +++ b/core/node/state_keeper/src/executor/tests/tester.rs @@ -6,7 +6,10 @@ use std::{collections::HashMap, fmt::Debug, sync::Arc}; use tempfile::TempDir; use tokio::{sync::watch, task::JoinHandle}; use zksync_config::configs::chain::StateKeeperConfig; -use zksync_contracts::{get_loadnext_contract, test_contracts::LoadnextContractExecutionParams}; +use zksync_contracts::{ + get_loadnext_contract, load_contract, read_bytecode, + test_contracts::LoadnextContractExecutionParams, TestContract, +}; use zksync_dal::{ConnectionPool, Core, CoreDal}; use zksync_multivm::{ interface::{ @@ -262,9 +265,8 @@ impl Tester { /// Adds funds for specified account list. /// Expects genesis to be performed (i.e. `setup_storage` called beforehand). pub(super) async fn fund(&self, addresses: &[Address]) { - let mut storage = self.pool.connection_tagged("state_keeper").await.unwrap(); - let eth_amount = U256::from(10u32).pow(U256::from(32)); //10^32 wei + let mut storage = self.pool.connection_tagged("state_keeper").await.unwrap(); for address in addresses { let key = storage_key_for_standard_token_balance( @@ -336,6 +338,24 @@ pub trait AccountLoadNextExecutable { ) -> Transaction; } +pub trait AccountFailedCall { + fn deploy_failedcall_tx(&mut self) -> DeployContractsTx; +} + +impl AccountFailedCall for Account { + fn deploy_failedcall_tx(&mut self) -> DeployContractsTx { + let bytecode = read_bytecode( + "etc/contracts-test-data/artifacts-zk/contracts/failed-call/failed_call.sol/FailedCall.json"); + let failedcall_contract = TestContract { + bytecode, + contract: load_contract("etc/contracts-test-data/artifacts-zk/contracts/failed-call/failed_call.sol/FailedCall.json"), + factory_deps: vec![], + }; + + self.get_deploy_tx(&failedcall_contract.bytecode, None, TxType::L2) + } +} + impl AccountLoadNextExecutable for Account { fn deploy_loadnext_tx(&mut self) -> DeployContractsTx { let loadnext_contract = get_loadnext_contract(); diff --git a/core/node/state_keeper/src/keeper.rs b/core/node/state_keeper/src/keeper.rs index 622836409884..19035946973a 100644 --- a/core/node/state_keeper/src/keeper.rs +++ b/core/node/state_keeper/src/keeper.rs @@ -468,7 +468,6 @@ impl ZkSyncStateKeeper { tx_metrics, compressed_bytecodes, call_tracer_result, - new_known_factory_deps, .. } = result else { @@ -495,9 +494,9 @@ impl ZkSyncStateKeeper { updates_manager.extend_from_executed_transaction( tx, - *tx_result, + *tx_result.clone(), compressed_bytecodes, - new_known_factory_deps, + tx_result.new_known_factory_deps.unwrap_or_default(), tx_l1_gas_this_tx, tx_execution_metrics, call_tracer_result, @@ -609,7 +608,6 @@ impl ZkSyncStateKeeper { tx_metrics, call_tracer_result, compressed_bytecodes, - new_known_factory_deps, .. } = exec_result else { @@ -623,9 +621,9 @@ impl ZkSyncStateKeeper { } = *tx_metrics; updates_manager.extend_from_executed_transaction( tx, - *tx_result, + *tx_result.clone(), compressed_bytecodes, - new_known_factory_deps, + tx_result.new_known_factory_deps.unwrap_or_default(), tx_l1_gas_this_tx, tx_execution_metrics, call_tracer_result, @@ -685,7 +683,6 @@ impl ZkSyncStateKeeper { tx_result, tx_metrics, compressed_bytecodes, - new_known_factory_deps, .. } = exec_result else { @@ -705,9 +702,9 @@ impl ZkSyncStateKeeper { } = *tx_metrics; updates_manager.extend_from_executed_transaction( tx, - *tx_result, + *tx_result.clone(), compressed_bytecodes, - new_known_factory_deps, + tx_result.new_known_factory_deps.unwrap_or_default(), tx_l1_gas_this_tx, tx_execution_metrics, vec![], diff --git a/core/node/state_keeper/src/testonly/mod.rs b/core/node/state_keeper/src/testonly/mod.rs index 638d7cb70ccd..957a872ca73d 100644 --- a/core/node/state_keeper/src/testonly/mod.rs +++ b/core/node/state_keeper/src/testonly/mod.rs @@ -33,10 +33,10 @@ pub(crate) fn successful_exec() -> BatchTransactionExecutionResult { logs: Default::default(), statistics: Default::default(), refunds: Default::default(), + new_known_factory_deps: Default::default(), }), compressed_bytecodes: vec![], call_traces: vec![], - new_known_factory_deps: Default::default(), } } diff --git a/core/node/state_keeper/src/testonly/test_batch_executor.rs b/core/node/state_keeper/src/testonly/test_batch_executor.rs index 1f2cbe024916..2a883bb011b3 100644 --- a/core/node/state_keeper/src/testonly/test_batch_executor.rs +++ b/core/node/state_keeper/src/testonly/test_batch_executor.rs @@ -264,10 +264,10 @@ pub(crate) fn successful_exec_with_log() -> BatchTransactionExecutionResult { }, statistics: Default::default(), refunds: Default::default(), + new_known_factory_deps: Default::default(), }), compressed_bytecodes: vec![], call_traces: vec![], - new_known_factory_deps: Default::default(), } } @@ -279,10 +279,10 @@ pub(crate) fn rejected_exec(reason: Halt) -> BatchTransactionExecutionResult { logs: Default::default(), statistics: Default::default(), refunds: Default::default(), + new_known_factory_deps: Default::default(), }), compressed_bytecodes: vec![], call_traces: vec![], - new_known_factory_deps: Default::default(), } } diff --git a/core/node/state_keeper/src/updates/l2_block_updates.rs b/core/node/state_keeper/src/updates/l2_block_updates.rs index 28305553d07d..0f7c0319ff62 100644 --- a/core/node/state_keeper/src/updates/l2_block_updates.rs +++ b/core/node/state_keeper/src/updates/l2_block_updates.rs @@ -1,22 +1,18 @@ use std::collections::HashMap; -use once_cell::sync::Lazy; use zksync_multivm::{ interface::{ Call, CompressedBytecodeInfo, ExecutionResult, L2BlockEnv, TransactionExecutionResult, TxExecutionStatus, VmEvent, VmExecutionMetrics, VmExecutionResultAndLogs, }, - vm_latest::TransactionVmExt, + vm_latest::{utils::extract_bytecodes_marked_as_known, TransactionVmExt}, }; -use zksync_system_constants::KNOWN_CODES_STORAGE_ADDRESS; use zksync_types::{ block::{BlockGasCount, L2BlockHasher}, - ethabi, l2_to_l1_log::{SystemL2ToL1Log, UserL2ToL1Log}, L2BlockNumber, ProtocolVersionId, StorageLogWithPreviousValue, Transaction, H256, }; use zksync_utils::bytecode::hash_bytecode; -use zksync_vm_executor::batch::extract_bytecodes_marked_as_known; use crate::metrics::KEEPER_METRICS; diff --git a/core/tests/loadnext/src/account/mod.rs b/core/tests/loadnext/src/account/mod.rs index 5dcd5167165e..0f418bf12676 100644 --- a/core/tests/loadnext/src/account/mod.rs +++ b/core/tests/loadnext/src/account/mod.rs @@ -5,6 +5,7 @@ use std::{ }; use futures::{channel::mpsc, SinkExt}; +use rand::Rng; use tokio::sync::RwLock; use zksync_contracts::test_contracts::LoadnextContractExecutionParams; use zksync_types::{api::TransactionReceipt, Address, Nonce, H256, U256, U64}; @@ -75,6 +76,8 @@ pub struct AccountLifespan { inflight_txs: VecDeque, /// Current account nonce, it is None at the beginning and will be set after the first transaction current_nonce: Option, + /// Randomly assigned polling interval. + polling_interval: Duration, } impl AccountLifespan { @@ -82,11 +85,12 @@ impl AccountLifespan { config: &LoadtestConfig, contract_execution_params: LoadnextContractExecutionParams, addresses: AddressPool, - test_account: TestWallet, + mut test_account: TestWallet, report_sink: mpsc::Sender, main_l2_token: Address, paymaster_address: Address, ) -> Self { + let polling_interval = test_account.rng.gen_range(POLLING_INTERVAL); Self { wallet: test_account, config: config.clone(), @@ -99,6 +103,7 @@ impl AccountLifespan { report_sink, inflight_txs: Default::default(), current_nonce: None, + polling_interval, } } @@ -132,7 +137,7 @@ impl AccountLifespan { self.execute_command(deploy_command.clone()).await?; self.wait_for_all_inflight_tx().await?; - let mut timer = tokio::time::interval(POLLING_INTERVAL); + let mut timer = tokio::time::interval(self.polling_interval); let mut l1_tx_count = 0; loop { let command = self.generate_command(); @@ -157,7 +162,7 @@ impl AccountLifespan { } async fn wait_for_all_inflight_tx(&mut self) -> Result<(), Aborted> { - let mut timer = tokio::time::interval(POLLING_INTERVAL); + let mut timer = tokio::time::interval(self.polling_interval); while !self.inflight_txs.is_empty() { timer.tick().await; self.check_inflight_txs().await?; diff --git a/core/tests/loadnext/src/account_pool.rs b/core/tests/loadnext/src/account_pool.rs index 7b5e277e139b..3fa3141553cd 100644 --- a/core/tests/loadnext/src/account_pool.rs +++ b/core/tests/loadnext/src/account_pool.rs @@ -101,7 +101,9 @@ impl AccountPool { .context("invalid L2 RPC URL")?, )? .for_network(l2_chain_id.into()) + .report_config(false) .build(); + // Perform a health check: check whether ZKsync server is alive. let mut server_alive = false; for _ in 0usize..3 { diff --git a/core/tests/loadnext/src/constants.rs b/core/tests/loadnext/src/constants.rs index 7ac66ab7e1e7..6b989b16feb1 100644 --- a/core/tests/loadnext/src/constants.rs +++ b/core/tests/loadnext/src/constants.rs @@ -1,4 +1,4 @@ -use std::time::Duration; +use std::{ops, time::Duration}; /// Normally, block is committed on Ethereum every 15 seconds; however there are no guarantees that our transaction /// will be included in the next block right after sending. @@ -14,7 +14,7 @@ pub const ETH_POLLING_INTERVAL: Duration = Duration::from_secs(10); pub const COMMIT_TIMEOUT: Duration = Duration::from_secs(600); /// We don't want to overload the server with too many requests; given the fact that blocks are expected to be created /// every couple of seconds, chosen value seems to be adequate to provide the result in one or two calls at average. -pub const POLLING_INTERVAL: Duration = Duration::from_secs(3); +pub const POLLING_INTERVAL: ops::Range = Duration::from_secs(2)..Duration::from_secs(3); pub const MAX_OUTSTANDING_NONCE: usize = 20; diff --git a/core/tests/loadnext/src/executor.rs b/core/tests/loadnext/src/executor.rs index a573583ed318..43a1be164b64 100644 --- a/core/tests/loadnext/src/executor.rs +++ b/core/tests/loadnext/src/executor.rs @@ -244,7 +244,7 @@ impl Executor { }); priority_op_handle - .polling_interval(POLLING_INTERVAL) + .polling_interval(POLLING_INTERVAL.end) .unwrap(); priority_op_handle .commit_timeout(COMMIT_TIMEOUT) @@ -313,7 +313,7 @@ impl Executor { }); priority_op_handle - .polling_interval(POLLING_INTERVAL) + .polling_interval(POLLING_INTERVAL.end) .unwrap(); priority_op_handle .commit_timeout(COMMIT_TIMEOUT) @@ -463,7 +463,7 @@ impl Executor { // Wait for transactions to be committed, if at least one of them fails, // return error. for mut handle in handles { - handle.polling_interval(POLLING_INTERVAL).unwrap(); + handle.polling_interval(POLLING_INTERVAL.end).unwrap(); let result = handle .commit_timeout(COMMIT_TIMEOUT) diff --git a/core/tests/loadnext/src/sdk/ethereum/mod.rs b/core/tests/loadnext/src/sdk/ethereum/mod.rs index 4b7bb00a3080..4557c2c43200 100644 --- a/core/tests/loadnext/src/sdk/ethereum/mod.rs +++ b/core/tests/loadnext/src/sdk/ethereum/mod.rs @@ -102,6 +102,7 @@ impl EthereumProvider { let query_client = Client::http(eth_web3_url) .map_err(|err| ClientError::NetworkError(err.to_string()))? .for_network(sl_chain_id.into()) + .report_config(false) .build(); let query_client: Box> = Box::new(query_client); let eth_client = SigningClient::new( diff --git a/core/tests/loadnext/src/sdk/wallet.rs b/core/tests/loadnext/src/sdk/wallet.rs index 9d3bd73a9bf2..551d0d8e385f 100644 --- a/core/tests/loadnext/src/sdk/wallet.rs +++ b/core/tests/loadnext/src/sdk/wallet.rs @@ -45,6 +45,7 @@ where let client = Client::http(rpc_address) .map_err(|err| ClientError::NetworkError(err.to_string()))? .for_network(signer.chain_id.into()) + .report_config(false) .build(); Ok(Wallet { diff --git a/core/tests/test_account/src/lib.rs b/core/tests/test_account/src/lib.rs index bd49f5c092c0..d0c97abab729 100644 --- a/core/tests/test_account/src/lib.rs +++ b/core/tests/test_account/src/lib.rs @@ -89,7 +89,7 @@ impl Account { pub fn default_fee() -> Fee { Fee { - gas_limit: U256::from(2000000000u32), + gas_limit: U256::from(2_000_000_000u32), max_fee_per_gas: U256::from(BASE_FEE), max_priority_fee_per_gas: U256::from(100), gas_per_pubdata_limit: U256::from(DEFAULT_L2_TX_GAS_PER_PUBDATA_BYTE), diff --git a/docs/guides/external-node/07_snapshots_recovery.md b/docs/guides/external-node/07_snapshots_recovery.md index 99de05ff2c11..dfbc7a5366c5 100644 --- a/docs/guides/external-node/07_snapshots_recovery.md +++ b/docs/guides/external-node/07_snapshots_recovery.md @@ -16,7 +16,10 @@ Recovery from a snapshot consists of several parts. to take about 1 hour on the mainnet. - **Merkle tree** recovery starts once Postgres is fully recovered. Merkle tree recovery can take about 3 hours on the mainnet. Ordinarily, Merkle tree recovery is a blocker for node synchronization; i.e., the node will not process - blocks newer than the snapshot block until the Merkle tree is recovered. + blocks newer than the snapshot block until the Merkle tree is recovered. If the [treeless mode](10_treeless_mode.md) + is enabled, tree recovery is not performed, and the node will start catching up blocks immediately after Postgres + recovery. This is still true if the tree data fetcher is enabled _together_ with a Merkle tree; tree recovery is + asynchronous in this case. - Recovering RocksDB-based **VM state cache** is concurrent with Merkle tree recovery and also depends on Postgres recovery. It takes about 1 hour on the mainnet. Unlike Merkle tree recovery, VM state cache is not necessary for node operation (the node will get the state from Postgres is if it is absent), although it considerably speeds up VM @@ -24,7 +27,8 @@ Recovery from a snapshot consists of several parts. After Postgres recovery is completed, the node becomes operational, providing Web3 API etc. It still needs some time to catch up executing blocks after the snapshot (i.e, roughly several hours worth of blocks / transactions). This may take -order of 1–2 hours on the mainnet. In total, recovery process and catch-up thus should take roughly 5–6 hours. +order of 1–2 hours on the mainnet. In total, recovery process and catch-up thus should take roughly 5–6 hours with a +Merkle tree, or 3–4 hours in the treeless mode / with a tree data fetcher. ## Current limitations diff --git a/etc/contracts-test-data/contracts/counter/proxy_counter.sol b/etc/contracts-test-data/contracts/counter/proxy_counter.sol index 1c1883cd4c9d..b3bbf9dda93c 100644 --- a/etc/contracts-test-data/contracts/counter/proxy_counter.sol +++ b/etc/contracts-test-data/contracts/counter/proxy_counter.sol @@ -13,10 +13,14 @@ contract ProxyCounter { counter = _counter; } + uint256 lastFarCallCost; + function increment(uint256 x, uint gasToPass) public { while (gasleft() > gasToPass) { // Burn gas so that there's about `gasToPass` left before the external call. } + uint256 gasBefore = gasleft(); counter.increment(x); + lastFarCallCost = gasBefore - gasleft(); } } diff --git a/etc/contracts-test-data/contracts/failed-call/failed_call.sol b/etc/contracts-test-data/contracts/failed-call/failed_call.sol new file mode 100644 index 000000000000..7a8f43fbd895 --- /dev/null +++ b/etc/contracts-test-data/contracts/failed-call/failed_call.sol @@ -0,0 +1,24 @@ +// SPDX-License-Identifier: MIT OR Apache-2.0 + +pragma solidity ^0.8.0; + +contract FailedCall { + bool public success; + bytes1 public data_first_byte; + + constructor() { + address MSG_VALUE_SIMULATOR = 0x0000000000000000000000000000000000008009; + + while (gasleft() > 20000) { + // Burn gas so that there's about 20k left before the external call. + } + + // This call fails because MSG_VALUE_SIMULATOR forcibly takes 27k gas + (bool s, bytes memory data) = MSG_VALUE_SIMULATOR.call( + abi.encodeWithSignature("deadBeef()") + ); + + success = s; + data_first_byte = data[0]; + } +} diff --git a/etc/env/base/house_keeper.toml b/etc/env/base/house_keeper.toml index 9596f63d062f..6f86561d1c60 100644 --- a/etc/env/base/house_keeper.toml +++ b/etc/env/base/house_keeper.toml @@ -1,15 +1,2 @@ [house_keeper] l1_batch_metrics_reporting_interval_ms = 10000 -gpu_prover_queue_reporting_interval_ms = 10000 -witness_generator_stats_reporting_interval_ms = 10000 -witness_job_moving_interval_ms = 40000 -prover_job_retrying_interval_ms = 30000 -witness_generator_job_retrying_interval_ms = 30000 -prover_db_pool_size = 2 -prover_stats_reporting_interval_ms = 50000 -proof_compressor_job_retrying_interval_ms = 30000 -proof_compressor_stats_reporting_interval_ms = 10000 -prover_job_archiver_archiving_interval_ms = 1800000 -prover_job_archiver_archive_after_secs = 172800 -fri_gpu_prover_archiver_archiving_interval_ms = 86400000 -fri_gpu_prover_archiver_archive_after_secs = 172800 \ No newline at end of file diff --git a/etc/env/file_based/general.yaml b/etc/env/file_based/general.yaml index 064a3b447b9c..864bff15dedf 100644 --- a/etc/env/file_based/general.yaml +++ b/etc/env/file_based/general.yaml @@ -303,19 +303,6 @@ external_price_api_client: house_keeper: l1_batch_metrics_reporting_interval_ms: 10000 - gpu_prover_queue_reporting_interval_ms: 10000 - prover_job_retrying_interval_ms: 30000 - witness_generator_job_retrying_interval_ms: 30000 - witness_generator_stats_reporting_interval_ms: 10000 - witness_job_moving_interval_ms: 40000 - prover_db_pool_size: 2 - prover_stats_reporting_interval_ms: 5000 - proof_compressor_job_retrying_interval_ms: 30000 - proof_compressor_stats_reporting_interval_ms: 10000 - prover_job_archiver_archiving_interval_ms: 1800000 - prover_job_archiver_archive_after_secs: 172800 - fri_gpu_prover_archiver_archiving_interval_ms: 86400000 - fri_gpu_prover_archiver_archive_after_secs: 172800 prometheus: listener_port: 3314 diff --git a/etc/upgrades/1720794961-decentralize-governance/common.json b/etc/upgrades/1720794961-decentralize-governance/common.json new file mode 100644 index 000000000000..655d2c435f59 --- /dev/null +++ b/etc/upgrades/1720794961-decentralize-governance/common.json @@ -0,0 +1,5 @@ +{ + "name": "decentralize-governance", + "creationTimestamp": 1720794961, + "protocolVersion": "0.24.2" +} \ No newline at end of file diff --git a/etc/upgrades/1720794961-decentralize-governance/mainnet/transactions.json b/etc/upgrades/1720794961-decentralize-governance/mainnet/transactions.json new file mode 100644 index 000000000000..cd292b92d4ca --- /dev/null +++ b/etc/upgrades/1720794961-decentralize-governance/mainnet/transactions.json @@ -0,0 +1,72 @@ +{ + "proposeUpgradeTx": { + "l2ProtocolUpgradeTx": { + "txType": 0, + "from": "0x0000000000000000000000000000000000000000", + "to": "0x0000000000000000000000000000000000000000", + "gasLimit": 0, + "gasPerPubdataByteLimit": 0, + "maxFeePerGas": 0, + "maxPriorityFeePerGas": 0, + "paymaster": 0, + "nonce": 0, + "value": 0, + "reserved": [ + 0, + 0, + 0, + 0 + ], + "data": "0x", + "signature": "0x", + "factoryDeps": [], + "paymasterInput": "0x", + "reservedDynamic": "0x" + }, + "bootloaderHash": "0x0000000000000000000000000000000000000000000000000000000000000000", + "defaultAccountHash": "0x0000000000000000000000000000000000000000000000000000000000000000", + "verifier": "0x0000000000000000000000000000000000000000", + "verifierParams": { + "recursionNodeLevelVkHash": "0x0000000000000000000000000000000000000000000000000000000000000000", + "recursionLeafLevelVkHash": "0x0000000000000000000000000000000000000000000000000000000000000000", + "recursionCircuitsSetVksHash": "0x0000000000000000000000000000000000000000000000000000000000000000" + }, + "l1ContractsUpgradeCalldata": "0x", + "postUpgradeCalldata": "0x", + "upgradeTimestamp": { + "type": "BigNumber", + "hex": "0x66ab923f" + }, + "factoryDeps": [], + "newProtocolVersion": 103079215106, + "newAllowList": "0x0000000000000000000000000000000000000000" + }, + "l1upgradeCalldata": "0x08284e5700000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000180000000000000000000000000000000000000000000000000000000000000048000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004a000000000000000000000000000000000000000000000000000000000000004c00000000000000000000000000000000000000000000000000000000066ab923f0000000000000000000000000000000000000000000000000000001800000002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000260000000000000000000000000000000000000000000000000000000000000028000000000000000000000000000000000000000000000000000000000000002a000000000000000000000000000000000000000000000000000000000000002c000000000000000000000000000000000000000000000000000000000000002e000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "upgradeAddress": "0x4d376798Ba8F69cEd59642c3AE8687c7457e855d", + "protocolVersionSemVer": "0.24.2", + "packedProtocolVersion": 103079215106, + "upgradeTimestamp": "1722520127", + "stmScheduleTransparentOperation": "0x2c4319170000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000020000000000000000000000000c2ee6b6af7d616f6e27ce7f4a451aedc2b0f5f5c0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000006442e52285100000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000001800000001ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff000000000000000000000000000000000000000000000000000000180000000200000000000000000000000000000000000000000000000000000000000000600000000000000000000000004d376798ba8f69ced59642c3ae8687c7457e855d00000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000050408284e5700000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000180000000000000000000000000000000000000000000000000000000000000048000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004a000000000000000000000000000000000000000000000000000000000000004c00000000000000000000000000000000000000000000000000000000066ab923f0000000000000000000000000000000000000000000000000000001800000002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000260000000000000000000000000000000000000000000000000000000000000028000000000000000000000000000000000000000000000000000000000000002a000000000000000000000000000000000000000000000000000000000000002c000000000000000000000000000000000000000000000000000000000000002e0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "stmExecuteOperation": "0x74da756b000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000020000000000000000000000000c2ee6b6af7d616f6e27ce7f4a451aedc2b0f5f5c0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000006442e52285100000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000001800000001ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff000000000000000000000000000000000000000000000000000000180000000200000000000000000000000000000000000000000000000000000000000000600000000000000000000000004d376798ba8f69ced59642c3ae8687c7457e855d00000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000050408284e5700000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000180000000000000000000000000000000000000000000000000000000000000048000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004a000000000000000000000000000000000000000000000000000000000000004c00000000000000000000000000000000000000000000000000000000066ab923f0000000000000000000000000000000000000000000000000000001800000002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000260000000000000000000000000000000000000000000000000000000000000028000000000000000000000000000000000000000000000000000000000000002a000000000000000000000000000000000000000000000000000000000000002c000000000000000000000000000000000000000000000000000000000000002e0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "scheduleTransparentOperation": "0x2c431917000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000032400084c286cf3e17e7b677ea9583e60a000324000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000604fc57565f0000000000000000000000000000000000000000000000000000001800000001000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000600000000000000000000000004d376798ba8f69ced59642c3ae8687c7457e855d00000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000050408284e5700000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000180000000000000000000000000000000000000000000000000000000000000048000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004a000000000000000000000000000000000000000000000000000000000000004c00000000000000000000000000000000000000000000000000000000066ab923f0000000000000000000000000000000000000000000000000000001800000002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000260000000000000000000000000000000000000000000000000000000000000028000000000000000000000000000000000000000000000000000000000000002a000000000000000000000000000000000000000000000000000000000000002c000000000000000000000000000000000000000000000000000000000000002e0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "executeOperation": "0x74da756b00000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000032400084c286cf3e17e7b677ea9583e60a000324000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000604fc57565f0000000000000000000000000000000000000000000000000000001800000001000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000600000000000000000000000004d376798ba8f69ced59642c3ae8687c7457e855d00000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000050408284e5700000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000180000000000000000000000000000000000000000000000000000000000000048000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004a000000000000000000000000000000000000000000000000000000000000004c00000000000000000000000000000000000000000000000000000000066ab923f0000000000000000000000000000000000000000000000000000001800000002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000260000000000000000000000000000000000000000000000000000000000000028000000000000000000000000000000000000000000000000000000000000002a000000000000000000000000000000000000000000000000000000000000002c000000000000000000000000000000000000000000000000000000000000002e0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "newExecuteChainUpgradeCalldata": "0x69340beb000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000032400084c286cf3e17e7b677ea9583e60a000324000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000604fc57565f0000000000000000000000000000000000000000000000000000001800000001000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000600000000000000000000000004d376798ba8f69ced59642c3ae8687c7457e855d00000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000050408284e5700000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000180000000000000000000000000000000000000000000000000000000000000048000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004a000000000000000000000000000000000000000000000000000000000000004c00000000000000000000000000000000000000000000000000000000066ab923f0000000000000000000000000000000000000000000000000000001800000002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000260000000000000000000000000000000000000000000000000000000000000028000000000000000000000000000000000000000000000000000000000000002a000000000000000000000000000000000000000000000000000000000000002c000000000000000000000000000000000000000000000000000000000000002e0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "diamondCut": { + "facetCuts": [], + "initAddress": "0x4d376798Ba8F69cEd59642c3AE8687c7457e855d", + "initCalldata": "0x08284e5700000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000180000000000000000000000000000000000000000000000000000000000000048000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004a000000000000000000000000000000000000000000000000000000000000004c00000000000000000000000000000000000000000000000000000000066ab923f0000000000000000000000000000000000000000000000000000001800000002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000260000000000000000000000000000000000000000000000000000000000000028000000000000000000000000000000000000000000000000000000000000002a000000000000000000000000000000000000000000000000000000000000002c000000000000000000000000000000000000000000000000000000000000002e000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + "governanceOperation": { + "calls": [ + { + "target": "0x32400084C286CF3E17e7B677ea9583e60a000324", + "value": 0, + "data": "0xfc57565f0000000000000000000000000000000000000000000000000000001800000001000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000600000000000000000000000004d376798ba8f69ced59642c3ae8687c7457e855d00000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000050408284e5700000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000180000000000000000000000000000000000000000000000000000000000000048000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004a000000000000000000000000000000000000000000000000000000000000004c00000000000000000000000000000000000000000000000000000000066ab923f0000000000000000000000000000000000000000000000000000001800000002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000260000000000000000000000000000000000000000000000000000000000000028000000000000000000000000000000000000000000000000000000000000002a000000000000000000000000000000000000000000000000000000000000002c000000000000000000000000000000000000000000000000000000000000002e00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + } + ], + "predecessor": "0x0000000000000000000000000000000000000000000000000000000000000000", + "salt": "0x0000000000000000000000000000000000000000000000000000000000000000" + }, + "legacyScheduleOperation": "0x2c431917000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000032400084c286cf3e17e7b677ea9583e60a0003240000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000005e4a9f6d941000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000600000000000000000000000004d376798ba8f69ced59642c3ae8687c7457e855d00000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000050408284e5700000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000180000000000000000000000000000000000000000000000000000000000000048000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004a000000000000000000000000000000000000000000000000000000000000004c00000000000000000000000000000000000000000000000000000000066ab923f0000000000000000000000000000000000000000000000000000001800000002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000260000000000000000000000000000000000000000000000000000000000000028000000000000000000000000000000000000000000000000000000000000002a000000000000000000000000000000000000000000000000000000000000002c000000000000000000000000000000000000000000000000000000000000002e0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "legacyExecuteOperation": "0x74da756b00000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000032400084c286cf3e17e7b677ea9583e60a0003240000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000005e4a9f6d941000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000600000000000000000000000004d376798ba8f69ced59642c3ae8687c7457e855d00000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000050408284e5700000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000180000000000000000000000000000000000000000000000000000000000000048000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004a000000000000000000000000000000000000000000000000000000000000004c00000000000000000000000000000000000000000000000000000000066ab923f0000000000000000000000000000000000000000000000000000001800000002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000260000000000000000000000000000000000000000000000000000000000000028000000000000000000000000000000000000000000000000000000000000002a000000000000000000000000000000000000000000000000000000000000002c000000000000000000000000000000000000000000000000000000000000002e0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" +} \ No newline at end of file diff --git a/etc/upgrades/1720794961-decentralize-governance/stage-proofs/transactions.json b/etc/upgrades/1720794961-decentralize-governance/stage-proofs/transactions.json new file mode 100644 index 000000000000..61abc87f040b --- /dev/null +++ b/etc/upgrades/1720794961-decentralize-governance/stage-proofs/transactions.json @@ -0,0 +1,72 @@ +{ + "proposeUpgradeTx": { + "l2ProtocolUpgradeTx": { + "txType": 0, + "from": "0x0000000000000000000000000000000000000000", + "to": "0x0000000000000000000000000000000000000000", + "gasLimit": 0, + "gasPerPubdataByteLimit": 0, + "maxFeePerGas": 0, + "maxPriorityFeePerGas": 0, + "paymaster": 0, + "nonce": 0, + "value": 0, + "reserved": [ + 0, + 0, + 0, + 0 + ], + "data": "0x", + "signature": "0x", + "factoryDeps": [], + "paymasterInput": "0x", + "reservedDynamic": "0x" + }, + "bootloaderHash": "0x0000000000000000000000000000000000000000000000000000000000000000", + "defaultAccountHash": "0x0000000000000000000000000000000000000000000000000000000000000000", + "verifier": "0x0000000000000000000000000000000000000000", + "verifierParams": { + "recursionNodeLevelVkHash": "0x0000000000000000000000000000000000000000000000000000000000000000", + "recursionLeafLevelVkHash": "0x0000000000000000000000000000000000000000000000000000000000000000", + "recursionCircuitsSetVksHash": "0x0000000000000000000000000000000000000000000000000000000000000000" + }, + "l1ContractsUpgradeCalldata": "0x", + "postUpgradeCalldata": "0x", + "upgradeTimestamp": { + "type": "BigNumber", + "hex": "0x66a375e5" + }, + "factoryDeps": [], + "newProtocolVersion": 103079215106, + "newAllowList": "0x0000000000000000000000000000000000000000" + }, + "l1upgradeCalldata": "0x08284e5700000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000180000000000000000000000000000000000000000000000000000000000000048000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004a000000000000000000000000000000000000000000000000000000000000004c00000000000000000000000000000000000000000000000000000000066a375e50000000000000000000000000000000000000000000000000000001800000002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000260000000000000000000000000000000000000000000000000000000000000028000000000000000000000000000000000000000000000000000000000000002a000000000000000000000000000000000000000000000000000000000000002c000000000000000000000000000000000000000000000000000000000000002e000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "upgradeAddress": "0xF08528979Aedd80cC2cF8d1Ba9396790909Ed7B1", + "protocolVersionSemVer": "0.24.2", + "packedProtocolVersion": 103079215106, + "upgradeTimestamp": "1721988581", + "stmScheduleTransparentOperation": "0x2c4319170000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000020000000000000000000000000925dd0bc14552b0b261ca8a23ad26df9c6f2c8ba0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000006442e52285100000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000001800000001ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00000000000000000000000000000000000000000000000000000018000000020000000000000000000000000000000000000000000000000000000000000060000000000000000000000000f08528979aedd80cc2cf8d1ba9396790909ed7b100000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000050408284e5700000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000180000000000000000000000000000000000000000000000000000000000000048000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004a000000000000000000000000000000000000000000000000000000000000004c00000000000000000000000000000000000000000000000000000000066a375e50000000000000000000000000000000000000000000000000000001800000002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000260000000000000000000000000000000000000000000000000000000000000028000000000000000000000000000000000000000000000000000000000000002a000000000000000000000000000000000000000000000000000000000000002c000000000000000000000000000000000000000000000000000000000000002e0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "stmExecuteOperation": "0x74da756b000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000020000000000000000000000000925dd0bc14552b0b261ca8a23ad26df9c6f2c8ba0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000006442e52285100000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000001800000001ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00000000000000000000000000000000000000000000000000000018000000020000000000000000000000000000000000000000000000000000000000000060000000000000000000000000f08528979aedd80cc2cf8d1ba9396790909ed7b100000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000050408284e5700000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000180000000000000000000000000000000000000000000000000000000000000048000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004a000000000000000000000000000000000000000000000000000000000000004c00000000000000000000000000000000000000000000000000000000066a375e50000000000000000000000000000000000000000000000000000001800000002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000260000000000000000000000000000000000000000000000000000000000000028000000000000000000000000000000000000000000000000000000000000002a000000000000000000000000000000000000000000000000000000000000002c000000000000000000000000000000000000000000000000000000000000002e0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "scheduleTransparentOperation": "0x2c43191700000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000200000000000000000000000005bbdede0f0bac61aa64068b60379fe32ecc0f96c000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000604fc57565f000000000000000000000000000000000000000000000000000000180000000100000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000060000000000000000000000000f08528979aedd80cc2cf8d1ba9396790909ed7b100000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000050408284e5700000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000180000000000000000000000000000000000000000000000000000000000000048000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004a000000000000000000000000000000000000000000000000000000000000004c00000000000000000000000000000000000000000000000000000000066a375e50000000000000000000000000000000000000000000000000000001800000002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000260000000000000000000000000000000000000000000000000000000000000028000000000000000000000000000000000000000000000000000000000000002a000000000000000000000000000000000000000000000000000000000000002c000000000000000000000000000000000000000000000000000000000000002e0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "executeOperation": "0x74da756b0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000200000000000000000000000005bbdede0f0bac61aa64068b60379fe32ecc0f96c000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000604fc57565f000000000000000000000000000000000000000000000000000000180000000100000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000060000000000000000000000000f08528979aedd80cc2cf8d1ba9396790909ed7b100000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000050408284e5700000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000180000000000000000000000000000000000000000000000000000000000000048000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004a000000000000000000000000000000000000000000000000000000000000004c00000000000000000000000000000000000000000000000000000000066a375e50000000000000000000000000000000000000000000000000000001800000002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000260000000000000000000000000000000000000000000000000000000000000028000000000000000000000000000000000000000000000000000000000000002a000000000000000000000000000000000000000000000000000000000000002c000000000000000000000000000000000000000000000000000000000000002e0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "newExecuteChainUpgradeCalldata": "0x69340beb00000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000200000000000000000000000005bbdede0f0bac61aa64068b60379fe32ecc0f96c000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000604fc57565f000000000000000000000000000000000000000000000000000000180000000100000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000060000000000000000000000000f08528979aedd80cc2cf8d1ba9396790909ed7b100000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000050408284e5700000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000180000000000000000000000000000000000000000000000000000000000000048000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004a000000000000000000000000000000000000000000000000000000000000004c00000000000000000000000000000000000000000000000000000000066a375e50000000000000000000000000000000000000000000000000000001800000002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000260000000000000000000000000000000000000000000000000000000000000028000000000000000000000000000000000000000000000000000000000000002a000000000000000000000000000000000000000000000000000000000000002c000000000000000000000000000000000000000000000000000000000000002e0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "diamondCut": { + "facetCuts": [], + "initAddress": "0xF08528979Aedd80cC2cF8d1Ba9396790909Ed7B1", + "initCalldata": "0x08284e5700000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000180000000000000000000000000000000000000000000000000000000000000048000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004a000000000000000000000000000000000000000000000000000000000000004c00000000000000000000000000000000000000000000000000000000066a375e50000000000000000000000000000000000000000000000000000001800000002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000260000000000000000000000000000000000000000000000000000000000000028000000000000000000000000000000000000000000000000000000000000002a000000000000000000000000000000000000000000000000000000000000002c000000000000000000000000000000000000000000000000000000000000002e000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + "governanceOperation": { + "calls": [ + { + "target": "0x5BBdEDe0F0bAc61AA64068b60379fe32ecc0F96C", + "value": 0, + "data": "0xfc57565f000000000000000000000000000000000000000000000000000000180000000100000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000060000000000000000000000000f08528979aedd80cc2cf8d1ba9396790909ed7b100000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000050408284e5700000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000180000000000000000000000000000000000000000000000000000000000000048000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004a000000000000000000000000000000000000000000000000000000000000004c00000000000000000000000000000000000000000000000000000000066a375e50000000000000000000000000000000000000000000000000000001800000002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000260000000000000000000000000000000000000000000000000000000000000028000000000000000000000000000000000000000000000000000000000000002a000000000000000000000000000000000000000000000000000000000000002c000000000000000000000000000000000000000000000000000000000000002e00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + } + ], + "predecessor": "0x0000000000000000000000000000000000000000000000000000000000000000", + "salt": "0x0000000000000000000000000000000000000000000000000000000000000000" + }, + "legacyScheduleOperation": "0x2c43191700000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000200000000000000000000000005bbdede0f0bac61aa64068b60379fe32ecc0f96c0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000005e4a9f6d94100000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000060000000000000000000000000f08528979aedd80cc2cf8d1ba9396790909ed7b100000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000050408284e5700000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000180000000000000000000000000000000000000000000000000000000000000048000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004a000000000000000000000000000000000000000000000000000000000000004c00000000000000000000000000000000000000000000000000000000066a375e50000000000000000000000000000000000000000000000000000001800000002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000260000000000000000000000000000000000000000000000000000000000000028000000000000000000000000000000000000000000000000000000000000002a000000000000000000000000000000000000000000000000000000000000002c000000000000000000000000000000000000000000000000000000000000002e0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "legacyExecuteOperation": "0x74da756b0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000200000000000000000000000005bbdede0f0bac61aa64068b60379fe32ecc0f96c0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000005e4a9f6d94100000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000060000000000000000000000000f08528979aedd80cc2cf8d1ba9396790909ed7b100000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000050408284e5700000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000180000000000000000000000000000000000000000000000000000000000000048000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004a000000000000000000000000000000000000000000000000000000000000004c00000000000000000000000000000000000000000000000000000000066a375e50000000000000000000000000000000000000000000000000000001800000002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000260000000000000000000000000000000000000000000000000000000000000028000000000000000000000000000000000000000000000000000000000000002a000000000000000000000000000000000000000000000000000000000000002c000000000000000000000000000000000000000000000000000000000000002e0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" +} \ No newline at end of file diff --git a/etc/upgrades/1720794961-decentralize-governance/stage/transactions.json b/etc/upgrades/1720794961-decentralize-governance/stage/transactions.json new file mode 100644 index 000000000000..ff030ae9f0d7 --- /dev/null +++ b/etc/upgrades/1720794961-decentralize-governance/stage/transactions.json @@ -0,0 +1,72 @@ +{ + "proposeUpgradeTx": { + "l2ProtocolUpgradeTx": { + "txType": 0, + "from": "0x0000000000000000000000000000000000000000", + "to": "0x0000000000000000000000000000000000000000", + "gasLimit": 0, + "gasPerPubdataByteLimit": 0, + "maxFeePerGas": 0, + "maxPriorityFeePerGas": 0, + "paymaster": 0, + "nonce": 0, + "value": 0, + "reserved": [ + 0, + 0, + 0, + 0 + ], + "data": "0x", + "signature": "0x", + "factoryDeps": [], + "paymasterInput": "0x", + "reservedDynamic": "0x" + }, + "bootloaderHash": "0x0000000000000000000000000000000000000000000000000000000000000000", + "defaultAccountHash": "0x0000000000000000000000000000000000000000000000000000000000000000", + "verifier": "0x0000000000000000000000000000000000000000", + "verifierParams": { + "recursionNodeLevelVkHash": "0x0000000000000000000000000000000000000000000000000000000000000000", + "recursionLeafLevelVkHash": "0x0000000000000000000000000000000000000000000000000000000000000000", + "recursionCircuitsSetVksHash": "0x0000000000000000000000000000000000000000000000000000000000000000" + }, + "l1ContractsUpgradeCalldata": "0x", + "postUpgradeCalldata": "0x", + "upgradeTimestamp": { + "type": "BigNumber", + "hex": "0x669123f2" + }, + "factoryDeps": [], + "newProtocolVersion": 103079215106, + "newAllowList": "0x0000000000000000000000000000000000000000" + }, + "l1upgradeCalldata": "0x08284e5700000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000180000000000000000000000000000000000000000000000000000000000000048000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004a000000000000000000000000000000000000000000000000000000000000004c000000000000000000000000000000000000000000000000000000000669123f20000000000000000000000000000000000000000000000000000001800000002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000260000000000000000000000000000000000000000000000000000000000000028000000000000000000000000000000000000000000000000000000000000002a000000000000000000000000000000000000000000000000000000000000002c000000000000000000000000000000000000000000000000000000000000002e000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "upgradeAddress": "0xF08528979Aedd80cC2cF8d1Ba9396790909Ed7B1", + "protocolVersionSemVer": "0.24.2", + "packedProtocolVersion": 103079215106, + "upgradeTimestamp": "1720787954", + "stmScheduleTransparentOperation": "0x2c43191700000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000200000000000000000000000008b448ac7cd0f18f3d8464e2645575772a26a3b6b0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000006442e52285100000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000001800000001ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00000000000000000000000000000000000000000000000000000018000000020000000000000000000000000000000000000000000000000000000000000060000000000000000000000000f08528979aedd80cc2cf8d1ba9396790909ed7b100000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000050408284e5700000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000180000000000000000000000000000000000000000000000000000000000000048000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004a000000000000000000000000000000000000000000000000000000000000004c000000000000000000000000000000000000000000000000000000000669123f20000000000000000000000000000000000000000000000000000001800000002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000260000000000000000000000000000000000000000000000000000000000000028000000000000000000000000000000000000000000000000000000000000002a000000000000000000000000000000000000000000000000000000000000002c000000000000000000000000000000000000000000000000000000000000002e0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "stmExecuteOperation": "0x74da756b0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000200000000000000000000000008b448ac7cd0f18f3d8464e2645575772a26a3b6b0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000006442e52285100000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000001800000001ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00000000000000000000000000000000000000000000000000000018000000020000000000000000000000000000000000000000000000000000000000000060000000000000000000000000f08528979aedd80cc2cf8d1ba9396790909ed7b100000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000050408284e5700000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000180000000000000000000000000000000000000000000000000000000000000048000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004a000000000000000000000000000000000000000000000000000000000000004c000000000000000000000000000000000000000000000000000000000669123f20000000000000000000000000000000000000000000000000000001800000002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000260000000000000000000000000000000000000000000000000000000000000028000000000000000000000000000000000000000000000000000000000000002a000000000000000000000000000000000000000000000000000000000000002c000000000000000000000000000000000000000000000000000000000000002e0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "scheduleTransparentOperation": "0x2c43191700000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000200000000000000000000000006d6e010a2680e2e5a3b097ce411528b36d880ef6000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000604fc57565f000000000000000000000000000000000000000000000000000000180000000100000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000060000000000000000000000000f08528979aedd80cc2cf8d1ba9396790909ed7b100000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000050408284e5700000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000180000000000000000000000000000000000000000000000000000000000000048000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004a000000000000000000000000000000000000000000000000000000000000004c000000000000000000000000000000000000000000000000000000000669123f20000000000000000000000000000000000000000000000000000001800000002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000260000000000000000000000000000000000000000000000000000000000000028000000000000000000000000000000000000000000000000000000000000002a000000000000000000000000000000000000000000000000000000000000002c000000000000000000000000000000000000000000000000000000000000002e0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "executeOperation": "0x74da756b0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000200000000000000000000000006d6e010a2680e2e5a3b097ce411528b36d880ef6000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000604fc57565f000000000000000000000000000000000000000000000000000000180000000100000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000060000000000000000000000000f08528979aedd80cc2cf8d1ba9396790909ed7b100000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000050408284e5700000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000180000000000000000000000000000000000000000000000000000000000000048000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004a000000000000000000000000000000000000000000000000000000000000004c000000000000000000000000000000000000000000000000000000000669123f20000000000000000000000000000000000000000000000000000001800000002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000260000000000000000000000000000000000000000000000000000000000000028000000000000000000000000000000000000000000000000000000000000002a000000000000000000000000000000000000000000000000000000000000002c000000000000000000000000000000000000000000000000000000000000002e0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "newExecuteChainUpgradeCalldata": "0x69340beb00000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000200000000000000000000000006d6e010a2680e2e5a3b097ce411528b36d880ef6000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000604fc57565f000000000000000000000000000000000000000000000000000000180000000100000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000060000000000000000000000000f08528979aedd80cc2cf8d1ba9396790909ed7b100000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000050408284e5700000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000180000000000000000000000000000000000000000000000000000000000000048000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004a000000000000000000000000000000000000000000000000000000000000004c000000000000000000000000000000000000000000000000000000000669123f20000000000000000000000000000000000000000000000000000001800000002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000260000000000000000000000000000000000000000000000000000000000000028000000000000000000000000000000000000000000000000000000000000002a000000000000000000000000000000000000000000000000000000000000002c000000000000000000000000000000000000000000000000000000000000002e0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "diamondCut": { + "facetCuts": [], + "initAddress": "0xF08528979Aedd80cC2cF8d1Ba9396790909Ed7B1", + "initCalldata": "0x08284e5700000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000180000000000000000000000000000000000000000000000000000000000000048000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004a000000000000000000000000000000000000000000000000000000000000004c000000000000000000000000000000000000000000000000000000000669123f20000000000000000000000000000000000000000000000000000001800000002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000260000000000000000000000000000000000000000000000000000000000000028000000000000000000000000000000000000000000000000000000000000002a000000000000000000000000000000000000000000000000000000000000002c000000000000000000000000000000000000000000000000000000000000002e000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + "governanceOperation": { + "calls": [ + { + "target": "0x6d6e010A2680E2E5a3b097ce411528b36d880EF6", + "value": 0, + "data": "0xfc57565f000000000000000000000000000000000000000000000000000000180000000100000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000060000000000000000000000000f08528979aedd80cc2cf8d1ba9396790909ed7b100000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000050408284e5700000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000180000000000000000000000000000000000000000000000000000000000000048000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004a000000000000000000000000000000000000000000000000000000000000004c000000000000000000000000000000000000000000000000000000000669123f20000000000000000000000000000000000000000000000000000001800000002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000260000000000000000000000000000000000000000000000000000000000000028000000000000000000000000000000000000000000000000000000000000002a000000000000000000000000000000000000000000000000000000000000002c000000000000000000000000000000000000000000000000000000000000002e00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + } + ], + "predecessor": "0x0000000000000000000000000000000000000000000000000000000000000000", + "salt": "0x0000000000000000000000000000000000000000000000000000000000000000" + }, + "legacyScheduleOperation": "0x2c43191700000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000200000000000000000000000006d6e010a2680e2e5a3b097ce411528b36d880ef60000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000005e4a9f6d94100000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000060000000000000000000000000f08528979aedd80cc2cf8d1ba9396790909ed7b100000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000050408284e5700000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000180000000000000000000000000000000000000000000000000000000000000048000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004a000000000000000000000000000000000000000000000000000000000000004c000000000000000000000000000000000000000000000000000000000669123f20000000000000000000000000000000000000000000000000000001800000002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000260000000000000000000000000000000000000000000000000000000000000028000000000000000000000000000000000000000000000000000000000000002a000000000000000000000000000000000000000000000000000000000000002c000000000000000000000000000000000000000000000000000000000000002e0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "legacyExecuteOperation": "0x74da756b0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000200000000000000000000000006d6e010a2680e2e5a3b097ce411528b36d880ef60000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000005e4a9f6d94100000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000060000000000000000000000000f08528979aedd80cc2cf8d1ba9396790909ed7b100000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000050408284e5700000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000180000000000000000000000000000000000000000000000000000000000000048000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004a000000000000000000000000000000000000000000000000000000000000004c000000000000000000000000000000000000000000000000000000000669123f20000000000000000000000000000000000000000000000000000001800000002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000260000000000000000000000000000000000000000000000000000000000000028000000000000000000000000000000000000000000000000000000000000002a000000000000000000000000000000000000000000000000000000000000002c000000000000000000000000000000000000000000000000000000000000002e0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" +} \ No newline at end of file diff --git a/etc/upgrades/1720794961-decentralize-governance/testnet/transactions.json b/etc/upgrades/1720794961-decentralize-governance/testnet/transactions.json new file mode 100644 index 000000000000..19187138aec3 --- /dev/null +++ b/etc/upgrades/1720794961-decentralize-governance/testnet/transactions.json @@ -0,0 +1,72 @@ +{ + "proposeUpgradeTx": { + "l2ProtocolUpgradeTx": { + "txType": 0, + "from": "0x0000000000000000000000000000000000000000", + "to": "0x0000000000000000000000000000000000000000", + "gasLimit": 0, + "gasPerPubdataByteLimit": 0, + "maxFeePerGas": 0, + "maxPriorityFeePerGas": 0, + "paymaster": 0, + "nonce": 0, + "value": 0, + "reserved": [ + 0, + 0, + 0, + 0 + ], + "data": "0x", + "signature": "0x", + "factoryDeps": [], + "paymasterInput": "0x", + "reservedDynamic": "0x" + }, + "bootloaderHash": "0x0000000000000000000000000000000000000000000000000000000000000000", + "defaultAccountHash": "0x0000000000000000000000000000000000000000000000000000000000000000", + "verifier": "0x0000000000000000000000000000000000000000", + "verifierParams": { + "recursionNodeLevelVkHash": "0x0000000000000000000000000000000000000000000000000000000000000000", + "recursionLeafLevelVkHash": "0x0000000000000000000000000000000000000000000000000000000000000000", + "recursionCircuitsSetVksHash": "0x0000000000000000000000000000000000000000000000000000000000000000" + }, + "l1ContractsUpgradeCalldata": "0x", + "postUpgradeCalldata": "0x", + "upgradeTimestamp": { + "type": "BigNumber", + "hex": "0x66a21f2e" + }, + "factoryDeps": [], + "newProtocolVersion": 103079215106, + "newAllowList": "0x0000000000000000000000000000000000000000" + }, + "l1upgradeCalldata": "0x08284e5700000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000180000000000000000000000000000000000000000000000000000000000000048000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004a000000000000000000000000000000000000000000000000000000000000004c00000000000000000000000000000000000000000000000000000000066a21f2e0000000000000000000000000000000000000000000000000000001800000002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000260000000000000000000000000000000000000000000000000000000000000028000000000000000000000000000000000000000000000000000000000000002a000000000000000000000000000000000000000000000000000000000000002c000000000000000000000000000000000000000000000000000000000000002e000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "upgradeAddress": "0xF08528979Aedd80cC2cF8d1Ba9396790909Ed7B1", + "protocolVersionSemVer": "0.24.2", + "packedProtocolVersion": 103079215106, + "upgradeTimestamp": "1721900846", + "stmScheduleTransparentOperation": "0x2c43191700000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000200000000000000000000000004e39e90746a9ee410a8ce173c7b96d3afed444a50000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000006442e52285100000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000001800000001ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00000000000000000000000000000000000000000000000000000018000000020000000000000000000000000000000000000000000000000000000000000060000000000000000000000000f08528979aedd80cc2cf8d1ba9396790909ed7b100000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000050408284e5700000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000180000000000000000000000000000000000000000000000000000000000000048000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004a000000000000000000000000000000000000000000000000000000000000004c00000000000000000000000000000000000000000000000000000000066a21f2e0000000000000000000000000000000000000000000000000000001800000002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000260000000000000000000000000000000000000000000000000000000000000028000000000000000000000000000000000000000000000000000000000000002a000000000000000000000000000000000000000000000000000000000000002c000000000000000000000000000000000000000000000000000000000000002e0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "stmExecuteOperation": "0x74da756b0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000200000000000000000000000004e39e90746a9ee410a8ce173c7b96d3afed444a50000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000006442e52285100000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000001800000001ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00000000000000000000000000000000000000000000000000000018000000020000000000000000000000000000000000000000000000000000000000000060000000000000000000000000f08528979aedd80cc2cf8d1ba9396790909ed7b100000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000050408284e5700000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000180000000000000000000000000000000000000000000000000000000000000048000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004a000000000000000000000000000000000000000000000000000000000000004c00000000000000000000000000000000000000000000000000000000066a21f2e0000000000000000000000000000000000000000000000000000001800000002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000260000000000000000000000000000000000000000000000000000000000000028000000000000000000000000000000000000000000000000000000000000002a000000000000000000000000000000000000000000000000000000000000002c000000000000000000000000000000000000000000000000000000000000002e0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "scheduleTransparentOperation": "0x2c43191700000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000200000000000000000000000009a6de0f62aa270a8bcb1e2610078650d539b1ef9000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000604fc57565f000000000000000000000000000000000000000000000000000000180000000100000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000060000000000000000000000000f08528979aedd80cc2cf8d1ba9396790909ed7b100000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000050408284e5700000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000180000000000000000000000000000000000000000000000000000000000000048000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004a000000000000000000000000000000000000000000000000000000000000004c00000000000000000000000000000000000000000000000000000000066a21f2e0000000000000000000000000000000000000000000000000000001800000002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000260000000000000000000000000000000000000000000000000000000000000028000000000000000000000000000000000000000000000000000000000000002a000000000000000000000000000000000000000000000000000000000000002c000000000000000000000000000000000000000000000000000000000000002e0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "executeOperation": "0x74da756b0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000200000000000000000000000009a6de0f62aa270a8bcb1e2610078650d539b1ef9000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000604fc57565f000000000000000000000000000000000000000000000000000000180000000100000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000060000000000000000000000000f08528979aedd80cc2cf8d1ba9396790909ed7b100000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000050408284e5700000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000180000000000000000000000000000000000000000000000000000000000000048000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004a000000000000000000000000000000000000000000000000000000000000004c00000000000000000000000000000000000000000000000000000000066a21f2e0000000000000000000000000000000000000000000000000000001800000002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000260000000000000000000000000000000000000000000000000000000000000028000000000000000000000000000000000000000000000000000000000000002a000000000000000000000000000000000000000000000000000000000000002c000000000000000000000000000000000000000000000000000000000000002e0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "newExecuteChainUpgradeCalldata": "0x69340beb00000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000200000000000000000000000009a6de0f62aa270a8bcb1e2610078650d539b1ef9000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000604fc57565f000000000000000000000000000000000000000000000000000000180000000100000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000060000000000000000000000000f08528979aedd80cc2cf8d1ba9396790909ed7b100000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000050408284e5700000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000180000000000000000000000000000000000000000000000000000000000000048000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004a000000000000000000000000000000000000000000000000000000000000004c00000000000000000000000000000000000000000000000000000000066a21f2e0000000000000000000000000000000000000000000000000000001800000002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000260000000000000000000000000000000000000000000000000000000000000028000000000000000000000000000000000000000000000000000000000000002a000000000000000000000000000000000000000000000000000000000000002c000000000000000000000000000000000000000000000000000000000000002e0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "diamondCut": { + "facetCuts": [], + "initAddress": "0xF08528979Aedd80cC2cF8d1Ba9396790909Ed7B1", + "initCalldata": "0x08284e5700000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000180000000000000000000000000000000000000000000000000000000000000048000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004a000000000000000000000000000000000000000000000000000000000000004c00000000000000000000000000000000000000000000000000000000066a21f2e0000000000000000000000000000000000000000000000000000001800000002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000260000000000000000000000000000000000000000000000000000000000000028000000000000000000000000000000000000000000000000000000000000002a000000000000000000000000000000000000000000000000000000000000002c000000000000000000000000000000000000000000000000000000000000002e000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + "governanceOperation": { + "calls": [ + { + "target": "0x9A6DE0f62Aa270A8bCB1e2610078650D539B1Ef9", + "value": 0, + "data": "0xfc57565f000000000000000000000000000000000000000000000000000000180000000100000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000060000000000000000000000000f08528979aedd80cc2cf8d1ba9396790909ed7b100000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000050408284e5700000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000180000000000000000000000000000000000000000000000000000000000000048000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004a000000000000000000000000000000000000000000000000000000000000004c00000000000000000000000000000000000000000000000000000000066a21f2e0000000000000000000000000000000000000000000000000000001800000002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000260000000000000000000000000000000000000000000000000000000000000028000000000000000000000000000000000000000000000000000000000000002a000000000000000000000000000000000000000000000000000000000000002c000000000000000000000000000000000000000000000000000000000000002e00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + } + ], + "predecessor": "0x0000000000000000000000000000000000000000000000000000000000000000", + "salt": "0x0000000000000000000000000000000000000000000000000000000000000000" + }, + "legacyScheduleOperation": "0x2c43191700000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000200000000000000000000000009a6de0f62aa270a8bcb1e2610078650d539b1ef90000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000005e4a9f6d94100000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000060000000000000000000000000f08528979aedd80cc2cf8d1ba9396790909ed7b100000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000050408284e5700000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000180000000000000000000000000000000000000000000000000000000000000048000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004a000000000000000000000000000000000000000000000000000000000000004c00000000000000000000000000000000000000000000000000000000066a21f2e0000000000000000000000000000000000000000000000000000001800000002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000260000000000000000000000000000000000000000000000000000000000000028000000000000000000000000000000000000000000000000000000000000002a000000000000000000000000000000000000000000000000000000000000002c000000000000000000000000000000000000000000000000000000000000002e0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "legacyExecuteOperation": "0x74da756b0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000200000000000000000000000009a6de0f62aa270a8bcb1e2610078650d539b1ef90000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000005e4a9f6d94100000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000060000000000000000000000000f08528979aedd80cc2cf8d1ba9396790909ed7b100000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000050408284e5700000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000180000000000000000000000000000000000000000000000000000000000000048000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004a000000000000000000000000000000000000000000000000000000000000004c00000000000000000000000000000000000000000000000000000000066a21f2e0000000000000000000000000000000000000000000000000000001800000002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000260000000000000000000000000000000000000000000000000000000000000028000000000000000000000000000000000000000000000000000000000000002a000000000000000000000000000000000000000000000000000000000000002c000000000000000000000000000000000000000000000000000000000000002e0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" +} \ No newline at end of file diff --git a/infrastructure/protocol-upgrade/src/transaction.ts b/infrastructure/protocol-upgrade/src/transaction.ts index 4aaed4186d75..dfea3a3bfc35 100644 --- a/infrastructure/protocol-upgrade/src/transaction.ts +++ b/infrastructure/protocol-upgrade/src/transaction.ts @@ -4,7 +4,8 @@ import { DefaultUpgradeFactory as DefaultUpgradeFactoryL1, AdminFacetFactory, GovernanceFactory, - StateTransitionManagerFactory + StateTransitionManagerFactory, + ChainAdminFactory } from 'l1-contracts/typechain'; import { FacetCut } from 'l1-contracts/src.ts/diamondCut'; import { IZkSyncFactory } from '../pre-boojum/IZkSyncFactory'; @@ -207,6 +208,19 @@ function prepareGovernanceTxs(target: string, data: BytesLike): GovernanceTx { }; } +function prepareChainAdminCalldata(target: string, data: BytesLike): string { + const call = { + target: target, + value: 0, + data: data + }; + + const chainAdmin = new ChainAdminFactory(); + const calldata = chainAdmin.interface.encodeFunctionData('multicall', [[call], true]); + + return calldata; +} + export function prepareTransparentUpgradeCalldataForNewGovernance( oldProtocolVersion, oldProtocolVersionDeadline, @@ -249,6 +263,8 @@ export function prepareTransparentUpgradeCalldataForNewGovernance( operation: governanceOperation } = prepareGovernanceTxs(zksyncAddress, diamondProxyUpgradeCalldata); + const newExecuteChainUpgradeCalldata = prepareChainAdminCalldata(zksyncAddress, diamondProxyUpgradeCalldata); + const legacyScheduleTransparentOperation = adminFacet.interface.encodeFunctionData('executeUpgrade', [diamondCut]); const { scheduleCalldata: legacyScheduleOperation, executeCalldata: legacyExecuteOperation } = prepareGovernanceTxs( zksyncAddress, @@ -260,6 +276,7 @@ export function prepareTransparentUpgradeCalldataForNewGovernance( stmExecuteOperation, scheduleTransparentOperation, executeOperation, + newExecuteChainUpgradeCalldata, diamondCut, governanceOperation, legacyScheduleOperation, diff --git a/prover/Cargo.lock b/prover/Cargo.lock index a0044b2bbd48..8b6478ffa43b 100644 --- a/prover/Cargo.lock +++ b/prover/Cargo.lock @@ -745,9 +745,9 @@ dependencies = [ [[package]] name = "boojum-cuda" -version = "0.150.4" +version = "0.150.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c861b4baec895cb8e53b10825407f0844b0eafda2ac79e7f02de95439f0f1e74" +checksum = "252c28bc729eb32a053de0cbd1c8c55b2f51d00ca0c656f30bc70d255c2d8753" dependencies = [ "boojum", "cmake", @@ -1924,9 +1924,9 @@ checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" [[package]] name = "era_cudart" -version = "0.150.4" +version = "0.150.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ac97d833b861e32bc0a71d0542bf5c92094f9818c52d65c695227bfa95ffbe3" +checksum = "803be147b389086e33254a6c9fe26a0d1d21a11f9f73181cad06cf5b1beb7d16" dependencies = [ "bitflags 2.6.0", "era_cudart_sys", @@ -1935,13 +1935,21 @@ dependencies = [ [[package]] name = "era_cudart_sys" -version = "0.150.4" +version = "0.150.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee6aed60cf09cb6d0b954d74351acb9beb13daab0bacad279691f6b97504b7e6" +checksum = "49f9a3d87f3d45d11bc835e5fc78fe6e3fe243355d435f6b3e794b98df7d3323" dependencies = [ "serde_json", ] +[[package]] +name = "eravm-stable-interface" +version = "0.1.0" +source = "git+https://github.com/matter-labs/vm2.git?rev=4ef15d46410ffc11744771a3a6c7c09dd9470c90#4ef15d46410ffc11744771a3a6c7c09dd9470c90" +dependencies = [ + "primitive-types", +] + [[package]] name = "errno" version = "0.3.9" @@ -5672,9 +5680,9 @@ checksum = "24188a676b6ae68c3b2cb3a01be17fbf7240ce009799bb56d5b1409051e78fde" [[package]] name = "shivini" -version = "0.150.4" +version = "0.150.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5e5d862287bb883a4cb0bc4f8ea938ba3fdaa5e495f1a59bc3515231017a0e2" +checksum = "331868b8d92ffec8887c17e786632cf0c9bd4750986fc1400a6d1fbf3739cba4" dependencies = [ "bincode", "blake2 0.10.6", @@ -6943,9 +6951,10 @@ dependencies = [ [[package]] name = "vm2" version = "0.1.0" -source = "git+https://github.com/matter-labs/vm2.git?rev=2276b7b5af520fca0477bdafe43781b51896d235#2276b7b5af520fca0477bdafe43781b51896d235" +source = "git+https://github.com/matter-labs/vm2.git?rev=4ef15d46410ffc11744771a3a6c7c09dd9470c90#4ef15d46410ffc11744771a3a6c7c09dd9470c90" dependencies = [ "enum_dispatch", + "eravm-stable-interface", "primitive-types", "zk_evm_abstractions 0.150.4", "zkevm_opcode_defs 0.150.4", @@ -7676,13 +7685,15 @@ dependencies = [ [[package]] name = "zksync-gpu-ffi" -version = "0.150.4" +version = "0.150.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82fe099f4f4a2cc8ca8ca591d7619ac00b8054f63b712fa6ceee2b84c6e04c62" +checksum = "ae694dc0ad818e4d45af70b2cf579ff46f1ac938b42ee55543529beb45ba1464" dependencies = [ "bindgen 0.59.2", + "cmake", "crossbeam 0.8.4", "derivative", + "era_cudart_sys", "futures 0.3.30", "futures-locks", "num_cpus", @@ -7690,9 +7701,9 @@ dependencies = [ [[package]] name = "zksync-gpu-prover" -version = "0.150.4" +version = "0.150.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f73d27e0e4589c7445f5a22e511cb5186e2d205172ca4b26acd7a334b3af9492" +checksum = "f8156dbaf36764409cc93424d43dc86c993601d73f5aa9a5938e6552a14dc2df" dependencies = [ "bit-vec", "cfg-if 1.0.0", @@ -7707,9 +7718,9 @@ dependencies = [ [[package]] name = "zksync-wrapper-prover" -version = "0.150.4" +version = "0.150.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1cf4c09adf0a84af0d7ded1fd85a2487fef4cbf1cfc1925412717d0eef03dd5a" +checksum = "83975189451bfacfa97dbcce899fde9db15a0c072196a9b92ddfabbe756bab9d" dependencies = [ "circuit_definitions", "zkevm_test_harness", @@ -8052,6 +8063,7 @@ dependencies = [ "circuit_sequencer_api 0.141.1", "circuit_sequencer_api 0.142.0", "circuit_sequencer_api 0.150.4", + "ethabi", "hex", "itertools 0.10.5", "once_cell", @@ -8144,10 +8156,10 @@ dependencies = [ "zksync_prover_dal", "zksync_prover_fri_types", "zksync_prover_interface", + "zksync_prover_keystore", "zksync_queued_job_processor", "zksync_types", "zksync_utils", - "zksync_vk_setup_data_generator_server_fri", "zksync_vlog", ] @@ -8244,10 +8256,10 @@ dependencies = [ "zksync_prover_dal", "zksync_prover_fri_types", "zksync_prover_fri_utils", + "zksync_prover_keystore", "zksync_queued_job_processor", "zksync_types", "zksync_utils", - "zksync_vk_setup_data_generator_server_fri", "zksync_vlog", ] @@ -8338,6 +8350,29 @@ dependencies = [ "zksync_vlog", ] +[[package]] +name = "zksync_prover_keystore" +version = "0.1.0" +dependencies = [ + "anyhow", + "bincode", + "circuit_definitions", + "hex", + "md5", + "once_cell", + "serde", + "serde_json", + "sha3 0.10.8", + "shivini", + "tracing", + "zkevm_test_harness", + "zksync_config", + "zksync_env_config", + "zksync_prover_fri_types", + "zksync_types", + "zksync_utils", +] + [[package]] name = "zksync_queued_job_processor" version = "0.1.0" @@ -8464,29 +8499,17 @@ name = "zksync_vk_setup_data_generator_server_fri" version = "0.1.0" dependencies = [ "anyhow", - "bincode", "circuit_definitions", "clap 4.5.4", - "hex", "indicatif", - "itertools 0.10.5", - "md5", - "once_cell", "proptest", - "serde", - "serde_derive", - "serde_json", - "sha3 0.10.8", - "shivini", "toml_edit 0.14.4", "tracing", "tracing-subscriber", "zkevm_test_harness", - "zksync_config", - "zksync_env_config", "zksync_prover_fri_types", + "zksync_prover_keystore", "zksync_types", - "zksync_utils", "zksync_vlog", ] @@ -8582,11 +8605,11 @@ dependencies = [ "zksync_prover_fri_types", "zksync_prover_fri_utils", "zksync_prover_interface", + "zksync_prover_keystore", "zksync_queued_job_processor", "zksync_system_constants", "zksync_types", "zksync_utils", - "zksync_vk_setup_data_generator_server_fri", "zksync_vlog", ] @@ -8609,10 +8632,10 @@ dependencies = [ "zksync_prover_dal", "zksync_prover_fri_types", "zksync_prover_fri_utils", + "zksync_prover_keystore", "zksync_queued_job_processor", "zksync_types", "zksync_utils", - "zksync_vk_setup_data_generator_server_fri", "zksync_vlog", ] diff --git a/prover/Cargo.toml b/prover/Cargo.toml index 9d37c2fb5cbe..403314cc13ca 100644 --- a/prover/Cargo.toml +++ b/prover/Cargo.toml @@ -61,8 +61,8 @@ circuit_sequencer_api = "=0.150.4" zkevm_test_harness = "=0.150.4" # GPU proving dependencies -wrapper_prover = { package = "zksync-wrapper-prover", version = "=0.150.4" } -shivini = "=0.150.4" +wrapper_prover = { package = "zksync-wrapper-prover", version = "=0.150.6" } +shivini = "=0.150.6" # Core workspace dependencies zksync_multivm = { path = "../core/lib/multivm", version = "0.1.0" } @@ -87,6 +87,7 @@ zksync_periodic_job = { path = "../core/lib/periodic_job" } zksync_prover_dal = { path = "crates/lib/prover_dal" } zksync_prover_fri_types = { path = "crates/lib/prover_fri_types" } zksync_prover_fri_utils = { path = "crates/lib/prover_fri_utils" } +zksync_prover_keystore = { path = "crates/lib/keystore" } zksync_vk_setup_data_generator_server_fri = { path = "crates/bin/vk_setup_data_generator_server_fri" } # for `perf` profiling diff --git a/prover/crates/bin/proof_fri_compressor/Cargo.toml b/prover/crates/bin/proof_fri_compressor/Cargo.toml index 6f2d8b6fcc27..936f0cb5100b 100644 --- a/prover/crates/bin/proof_fri_compressor/Cargo.toml +++ b/prover/crates/bin/proof_fri_compressor/Cargo.toml @@ -21,7 +21,7 @@ zksync_utils.workspace = true zksync_core_leftovers.workspace = true zksync_prover_fri_types.workspace = true zksync_queued_job_processor.workspace = true -zksync_vk_setup_data_generator_server_fri.workspace = true +zksync_prover_keystore.workspace = true zksync_vlog.workspace = true circuit_sequencer_api.workspace = true diff --git a/prover/crates/bin/proof_fri_compressor/src/compressor.rs b/prover/crates/bin/proof_fri_compressor/src/compressor.rs index 067114ca5a6c..c7747b2e45bd 100644 --- a/prover/crates/bin/proof_fri_compressor/src/compressor.rs +++ b/prover/crates/bin/proof_fri_compressor/src/compressor.rs @@ -23,9 +23,9 @@ use zksync_prover_fri_types::{ get_current_pod_name, AuxOutputWitnessWrapper, FriProofWrapper, }; use zksync_prover_interface::outputs::L1BatchProofForL1; +use zksync_prover_keystore::keystore::Keystore; use zksync_queued_job_processor::JobProcessor; use zksync_types::{protocol_version::ProtocolSemanticVersion, L1BatchNumber}; -use zksync_vk_setup_data_server_fri::keystore::Keystore; use crate::metrics::METRICS; diff --git a/prover/crates/bin/prover_fri/Cargo.toml b/prover/crates/bin/prover_fri/Cargo.toml index ea7d77783158..ae7853427e96 100644 --- a/prover/crates/bin/prover_fri/Cargo.toml +++ b/prover/crates/bin/prover_fri/Cargo.toml @@ -22,7 +22,7 @@ zksync_prover_fri_utils.workspace = true zksync_core_leftovers.workspace = true zksync_prover_fri_types.workspace = true zksync_utils.workspace = true -zksync_vk_setup_data_generator_server_fri.workspace = true +zksync_prover_keystore.workspace = true shivini = { workspace = true, optional = true, features = [ "circuit_definitions", "zksync", @@ -45,4 +45,4 @@ clap = { workspace = true, features = ["derive"] } [features] default = [] -gpu = ["shivini", "zksync_vk_setup_data_generator_server_fri/gpu"] +gpu = ["shivini", "zksync_prover_keystore/gpu"] diff --git a/prover/crates/bin/prover_fri/src/gpu_prover_job_processor.rs b/prover/crates/bin/prover_fri/src/gpu_prover_job_processor.rs index dc8594cbdc1b..4b11353eac5c 100644 --- a/prover/crates/bin/prover_fri/src/gpu_prover_job_processor.rs +++ b/prover/crates/bin/prover_fri/src/gpu_prover_job_processor.rs @@ -5,6 +5,7 @@ pub mod gpu_prover { use anyhow::Context as _; use shivini::{ gpu_proof_config::GpuProofConfig, gpu_prove_from_external_witness_data, ProverContext, + ProverContextConfig, }; use tokio::task::JoinHandle; use zksync_config::configs::{fri_prover_group::FriProverGroupConfig, FriProverConfig}; @@ -29,12 +30,12 @@ pub mod gpu_prover { CircuitWrapper, FriProofWrapper, ProverServiceDataKey, WitnessVectorArtifacts, }; use zksync_prover_fri_utils::region_fetcher::Zone; + use zksync_prover_keystore::{keystore::Keystore, GoldilocksGpuProverSetupData}; use zksync_queued_job_processor::{async_trait, JobProcessor}; use zksync_types::{ basic_fri_types::CircuitIdRoundTuple, protocol_version::ProtocolSemanticVersion, prover_dal::SocketAddress, }; - use zksync_vk_setup_data_server_fri::{keystore::Keystore, GoldilocksGpuProverSetupData}; use crate::{ metrics::METRICS, @@ -82,7 +83,15 @@ pub mod gpu_prover { address: SocketAddress, zone: Zone, protocol_version: ProtocolSemanticVersion, + max_allocation: Option, ) -> Self { + let prover_context = match max_allocation { + Some(max_allocation) => ProverContext::create_with_config( + ProverContextConfig::default().with_maximum_device_allocation(max_allocation), + ) + .expect("failed initializing gpu prover context"), + None => ProverContext::create().expect("failed initializing gpu prover context"), + }; Prover { blob_store, public_blob_store, @@ -91,8 +100,7 @@ pub mod gpu_prover { setup_load_mode, circuit_ids_for_round_to_be_proven, witness_vector_queue, - prover_context: ProverContext::create() - .expect("failed initializing gpu prover context"), + prover_context, address, zone, protocol_version, diff --git a/prover/crates/bin/prover_fri/src/main.rs b/prover/crates/bin/prover_fri/src/main.rs index db813394c194..b93eb9c03958 100644 --- a/prover/crates/bin/prover_fri/src/main.rs +++ b/prover/crates/bin/prover_fri/src/main.rs @@ -139,6 +139,7 @@ async fn main() -> anyhow::Result<()> { public_blob_store, pool, circuit_ids_for_round_to_be_proven, + opt.max_allocation, notify, ) .await @@ -178,6 +179,7 @@ async fn get_prover_tasks( public_blob_store: Option>, pool: ConnectionPool, circuit_ids_for_round_to_be_proven: Vec, + _max_allocation: Option, _init_notifier: Arc, ) -> anyhow::Result>>> { use crate::prover_job_processor::{load_setup_data_cache, Prover}; @@ -213,6 +215,7 @@ async fn get_prover_tasks( public_blob_store: Option>, pool: ConnectionPool, circuit_ids_for_round_to_be_proven: Vec, + max_allocation: Option, init_notifier: Arc, ) -> anyhow::Result>>> { use gpu_prover_job_processor::gpu_prover; @@ -245,6 +248,7 @@ async fn get_prover_tasks( address.clone(), zone.clone(), protocol_version, + max_allocation, ); let producer = shared_witness_vector_queue.clone(); @@ -295,4 +299,6 @@ pub(crate) struct Cli { pub(crate) config_path: Option, #[arg(long)] pub(crate) secrets_path: Option, + #[arg(long)] + pub(crate) max_allocation: Option, } diff --git a/prover/crates/bin/prover_fri/src/prover_job_processor.rs b/prover/crates/bin/prover_fri/src/prover_job_processor.rs index 2df1b626497f..4de11a68b534 100644 --- a/prover/crates/bin/prover_fri/src/prover_job_processor.rs +++ b/prover/crates/bin/prover_fri/src/prover_job_processor.rs @@ -20,11 +20,11 @@ use zksync_prover_fri_types::{ CircuitWrapper, FriProofWrapper, ProverJob, ProverServiceDataKey, }; use zksync_prover_fri_utils::fetch_next_circuit; +use zksync_prover_keystore::{keystore::Keystore, GoldilocksProverSetupData}; use zksync_queued_job_processor::{async_trait, JobProcessor}; use zksync_types::{ basic_fri_types::CircuitIdRoundTuple, protocol_version::ProtocolSemanticVersion, }; -use zksync_vk_setup_data_server_fri::{keystore::Keystore, GoldilocksProverSetupData}; use crate::{ metrics::{CircuitLabels, Layer, METRICS}, diff --git a/prover/crates/bin/prover_fri/tests/basic_test.rs b/prover/crates/bin/prover_fri/tests/basic_test.rs index b6d6226e6967..6dc3f5642efa 100644 --- a/prover/crates/bin/prover_fri/tests/basic_test.rs +++ b/prover/crates/bin/prover_fri/tests/basic_test.rs @@ -9,10 +9,10 @@ use zksync_prover_fri::prover_job_processor::Prover; use zksync_prover_fri_types::{ keys::FriCircuitKey, CircuitWrapper, ProverJob, ProverServiceDataKey, }; -use zksync_types::{basic_fri_types::AggregationRound, L1BatchNumber}; -use zksync_vk_setup_data_server_fri::{ +use zksync_prover_keystore::{ keystore::Keystore, setup_data_generator::generate_setup_data_common, }; +use zksync_types::{basic_fri_types::AggregationRound, L1BatchNumber}; fn compare_serialized(expected: &T, actual: &T) { let serialized_expected = bincode::serialize(expected).unwrap(); diff --git a/prover/crates/bin/vk_setup_data_generator_server_fri/Cargo.toml b/prover/crates/bin/vk_setup_data_generator_server_fri/Cargo.toml index 57fca6c89796..7c17e845450c 100644 --- a/prover/crates/bin/vk_setup_data_generator_server_fri/Cargo.toml +++ b/prover/crates/bin/vk_setup_data_generator_server_fri/Cargo.toml @@ -14,36 +14,20 @@ categories.workspace = true name = "key_generator" path = "src/main.rs" -[lib] -name = "zksync_vk_setup_data_server_fri" -path = "src/lib.rs" - [dependencies] zksync_vlog.workspace = true zksync_types.workspace = true -zksync_utils.workspace = true zksync_prover_fri_types.workspace = true +zksync_prover_keystore.workspace = true zkevm_test_harness.workspace = true circuit_definitions = { workspace = true, features = ["log_tracing"] } -shivini = { workspace = true, optional = true } -zksync_config.workspace = true -zksync_env_config.workspace = true anyhow.workspace = true clap = { workspace = true, features = ["derive"] } tracing.workspace = true tracing-subscriber = { workspace = true, features = ["env-filter"] } -serde_json.workspace = true -serde = { workspace = true, features = ["derive"] } -serde_derive.workspace = true -itertools.workspace = true -bincode.workspace = true -once_cell.workspace = true toml_edit.workspace = true -md5.workspace = true -sha3.workspace = true -hex.workspace = true indicatif.workspace = true [dev-dependencies] @@ -51,4 +35,4 @@ proptest.workspace = true [features] default = [] -gpu = ["shivini"] +gpu = ["zksync_prover_keystore/gpu"] diff --git a/prover/crates/bin/vk_setup_data_generator_server_fri/src/commitment_generator.rs b/prover/crates/bin/vk_setup_data_generator_server_fri/src/commitment_generator.rs index fe4d5b2482a4..8c2a17590099 100644 --- a/prover/crates/bin/vk_setup_data_generator_server_fri/src/commitment_generator.rs +++ b/prover/crates/bin/vk_setup_data_generator_server_fri/src/commitment_generator.rs @@ -1,8 +1,8 @@ use anyhow::Context; -use zksync_vk_setup_data_server_fri::{ - commitment_utils::generate_commitments, - keystore::Keystore, - vk_commitment_helper::{get_toml_formatted_value, read_contract_toml, write_contract_toml}, +use zksync_prover_keystore::{commitment_utils::generate_commitments, keystore::Keystore}; + +use crate::vk_commitment_helper::{ + get_toml_formatted_value, read_contract_toml, write_contract_toml, }; pub fn read_and_update_contract_toml(keystore: &Keystore, dryrun: bool) -> anyhow::Result<()> { diff --git a/prover/crates/bin/vk_setup_data_generator_server_fri/src/main.rs b/prover/crates/bin/vk_setup_data_generator_server_fri/src/main.rs index da86f931b1c2..313678bc5da8 100644 --- a/prover/crates/bin/vk_setup_data_generator_server_fri/src/main.rs +++ b/prover/crates/bin/vk_setup_data_generator_server_fri/src/main.rs @@ -23,13 +23,14 @@ use zksync_prover_fri_types::{ circuit_definitions::circuit_definitions::recursion_layer::ZkSyncRecursionLayerStorageType, ProverServiceDataKey, }; -use zksync_vk_setup_data_server_fri::{ +use zksync_prover_keystore::{ commitment_utils::generate_commitments, keystore::Keystore, setup_data_generator::{CPUSetupDataGenerator, GPUSetupDataGenerator, SetupDataGenerator}, }; mod commitment_generator; +mod vk_commitment_helper; #[cfg(test)] mod tests; diff --git a/prover/crates/bin/vk_setup_data_generator_server_fri/src/tests.rs b/prover/crates/bin/vk_setup_data_generator_server_fri/src/tests.rs index 39b5f7a44fb8..d704f4e8fb60 100644 --- a/prover/crates/bin/vk_setup_data_generator_server_fri/src/tests.rs +++ b/prover/crates/bin/vk_setup_data_generator_server_fri/src/tests.rs @@ -6,8 +6,8 @@ use zksync_prover_fri_types::{ }, ProverServiceDataKey, }; +use zksync_prover_keystore::keystore::Keystore; use zksync_types::basic_fri_types::AggregationRound; -use zksync_vk_setup_data_server_fri::keystore::Keystore; fn all_possible_prover_service_data_key() -> impl Strategy { let mut keys = Vec::with_capacity(30); diff --git a/prover/crates/bin/vk_setup_data_generator_server_fri/src/vk_commitment_helper.rs b/prover/crates/bin/vk_setup_data_generator_server_fri/src/vk_commitment_helper.rs index bf568e06157b..02cbe6e0c4de 100644 --- a/prover/crates/bin/vk_setup_data_generator_server_fri/src/vk_commitment_helper.rs +++ b/prover/crates/bin/vk_setup_data_generator_server_fri/src/vk_commitment_helper.rs @@ -2,8 +2,7 @@ use std::{fs, path::PathBuf}; use anyhow::Context as _; use toml_edit::{Document, Item, Value}; - -use crate::utils::core_workspace_dir_or_current_dir; +use zksync_prover_keystore::utils::core_workspace_dir_or_current_dir; pub fn get_toml_formatted_value(string_value: String) -> Item { let mut value = Value::from(string_value); diff --git a/prover/crates/bin/witness_generator/Cargo.toml b/prover/crates/bin/witness_generator/Cargo.toml index e86656d15bb4..bb6a44e7eb33 100644 --- a/prover/crates/bin/witness_generator/Cargo.toml +++ b/prover/crates/bin/witness_generator/Cargo.toml @@ -22,7 +22,7 @@ zksync_multivm.workspace = true zksync_object_store.workspace = true zksync_types.workspace = true zksync_utils.workspace = true -zksync_vk_setup_data_generator_server_fri.workspace = true +zksync_prover_keystore.workspace = true zksync_prover_fri_types.workspace = true zksync_prover_fri_utils.workspace = true zksync_core_leftovers.workspace = true diff --git a/prover/crates/bin/witness_generator/src/leaf_aggregation.rs b/prover/crates/bin/witness_generator/src/leaf_aggregation.rs index 2f4494187975..6600b3012496 100644 --- a/prover/crates/bin/witness_generator/src/leaf_aggregation.rs +++ b/prover/crates/bin/witness_generator/src/leaf_aggregation.rs @@ -27,12 +27,12 @@ use zksync_prover_fri_types::{ FriProofWrapper, }; use zksync_prover_fri_utils::get_recursive_layer_circuit_id_for_base_layer; +use zksync_prover_keystore::keystore::Keystore; use zksync_queued_job_processor::JobProcessor; use zksync_types::{ basic_fri_types::AggregationRound, protocol_version::ProtocolSemanticVersion, prover_dal::LeafAggregationJobMetadata, L1BatchNumber, }; -use zksync_vk_setup_data_server_fri::keystore::Keystore; use crate::{ metrics::WITNESS_GENERATOR_METRICS, diff --git a/prover/crates/bin/witness_generator/src/main.rs b/prover/crates/bin/witness_generator/src/main.rs index 50c955168602..0e304b46cf74 100644 --- a/prover/crates/bin/witness_generator/src/main.rs +++ b/prover/crates/bin/witness_generator/src/main.rs @@ -14,10 +14,10 @@ use zksync_env_config::object_store::ProverObjectStoreConfig; use zksync_object_store::ObjectStoreFactory; use zksync_prover_dal::{ConnectionPool, Prover, ProverDal}; use zksync_prover_fri_types::PROVER_PROTOCOL_SEMANTIC_VERSION; +use zksync_prover_keystore::commitment_utils::get_cached_commitments; use zksync_queued_job_processor::JobProcessor; use zksync_types::basic_fri_types::AggregationRound; use zksync_utils::wait_for_tasks::ManagedTasks; -use zksync_vk_setup_data_server_fri::commitment_utils::get_cached_commitments; use zksync_vlog::prometheus::PrometheusExporterConfig; use zksync_witness_generator::{ basic_circuits::BasicWitnessGenerator, leaf_aggregation::LeafAggregationWitnessGenerator, @@ -171,7 +171,10 @@ async fn main() -> anyhow::Result<()> { let witness_generator_task = match round { AggregationRound::BasicCircuits => { + let start = Instant::now(); let vk_commitments = get_cached_commitments(Some(setup_data_path.clone())); + let end = start.elapsed(); + tracing::info!("Calculating commitment took: {:?}", end); assert_eq!( vk_commitments, vk_commitments_in_db, diff --git a/prover/crates/bin/witness_generator/src/node_aggregation.rs b/prover/crates/bin/witness_generator/src/node_aggregation.rs index b6fc6b8f7c65..87835d79e13f 100644 --- a/prover/crates/bin/witness_generator/src/node_aggregation.rs +++ b/prover/crates/bin/witness_generator/src/node_aggregation.rs @@ -23,12 +23,12 @@ use zksync_prover_fri_types::{ keys::AggregationsKey, FriProofWrapper, }; +use zksync_prover_keystore::{keystore::Keystore, utils::get_leaf_vk_params}; use zksync_queued_job_processor::JobProcessor; use zksync_types::{ basic_fri_types::AggregationRound, protocol_version::ProtocolSemanticVersion, prover_dal::NodeAggregationJobMetadata, L1BatchNumber, }; -use zksync_vk_setup_data_server_fri::{keystore::Keystore, utils::get_leaf_vk_params}; use crate::{ metrics::WITNESS_GENERATOR_METRICS, diff --git a/prover/crates/bin/witness_generator/src/recursion_tip.rs b/prover/crates/bin/witness_generator/src/recursion_tip.rs index e05a0cc38cf8..c04959b98952 100644 --- a/prover/crates/bin/witness_generator/src/recursion_tip.rs +++ b/prover/crates/bin/witness_generator/src/recursion_tip.rs @@ -43,11 +43,11 @@ use zksync_prover_fri_types::{ keys::{ClosedFormInputKey, FriCircuitKey}, CircuitWrapper, }; +use zksync_prover_keystore::{keystore::Keystore, utils::get_leaf_vk_params}; use zksync_queued_job_processor::JobProcessor; use zksync_types::{ basic_fri_types::AggregationRound, protocol_version::ProtocolSemanticVersion, L1BatchNumber, }; -use zksync_vk_setup_data_server_fri::{keystore::Keystore, utils::get_leaf_vk_params}; use crate::{ metrics::WITNESS_GENERATOR_METRICS, diff --git a/prover/crates/bin/witness_generator/src/scheduler.rs b/prover/crates/bin/witness_generator/src/scheduler.rs index c389e037ffa6..6e3461150fe2 100644 --- a/prover/crates/bin/witness_generator/src/scheduler.rs +++ b/prover/crates/bin/witness_generator/src/scheduler.rs @@ -25,11 +25,11 @@ use zksync_prover_fri_types::{ keys::FriCircuitKey, CircuitWrapper, FriProofWrapper, }; +use zksync_prover_keystore::{keystore::Keystore, utils::get_leaf_vk_params}; use zksync_queued_job_processor::JobProcessor; use zksync_types::{ basic_fri_types::AggregationRound, protocol_version::ProtocolSemanticVersion, L1BatchNumber, }; -use zksync_vk_setup_data_server_fri::{keystore::Keystore, utils::get_leaf_vk_params}; use crate::{metrics::WITNESS_GENERATOR_METRICS, utils::SchedulerPartialInputWrapper}; diff --git a/prover/crates/bin/witness_vector_generator/Cargo.toml b/prover/crates/bin/witness_vector_generator/Cargo.toml index 278ab2791d0d..e8386c8090a3 100644 --- a/prover/crates/bin/witness_vector_generator/Cargo.toml +++ b/prover/crates/bin/witness_vector_generator/Cargo.toml @@ -22,7 +22,7 @@ zksync_prover_fri_types.workspace = true zksync_core_leftovers.workspace = true zksync_queued_job_processor.workspace = true zksync_vlog.workspace = true -zksync_vk_setup_data_generator_server_fri.workspace = true +zksync_prover_keystore.workspace = true anyhow.workspace = true tracing.workspace = true diff --git a/prover/crates/bin/witness_vector_generator/src/generator.rs b/prover/crates/bin/witness_vector_generator/src/generator.rs index 800931f5d7cc..f482637c1778 100644 --- a/prover/crates/bin/witness_vector_generator/src/generator.rs +++ b/prover/crates/bin/witness_vector_generator/src/generator.rs @@ -17,12 +17,12 @@ use zksync_prover_fri_types::{ use zksync_prover_fri_utils::{ fetch_next_circuit, get_numeric_circuit_id, region_fetcher::Zone, socket_utils::send_assembly, }; +use zksync_prover_keystore::keystore::Keystore; use zksync_queued_job_processor::JobProcessor; use zksync_types::{ basic_fri_types::CircuitIdRoundTuple, protocol_version::ProtocolSemanticVersion, prover_dal::GpuProverInstanceStatus, }; -use zksync_vk_setup_data_server_fri::keystore::Keystore; use crate::metrics::METRICS; diff --git a/prover/crates/bin/witness_vector_generator/tests/basic_test.rs b/prover/crates/bin/witness_vector_generator/tests/basic_test.rs index c6dfec5009f5..dd1ef8404198 100644 --- a/prover/crates/bin/witness_vector_generator/tests/basic_test.rs +++ b/prover/crates/bin/witness_vector_generator/tests/basic_test.rs @@ -1,8 +1,8 @@ use std::fs; use zksync_prover_fri_types::{CircuitWrapper, ProverJob, ProverServiceDataKey}; +use zksync_prover_keystore::keystore::Keystore; use zksync_types::{basic_fri_types::AggregationRound, L1BatchNumber}; -use zksync_vk_setup_data_server_fri::keystore::Keystore; use zksync_witness_vector_generator::generator::WitnessVectorGenerator; #[test] diff --git a/prover/crates/lib/keystore/Cargo.toml b/prover/crates/lib/keystore/Cargo.toml new file mode 100644 index 000000000000..41e9f0244f69 --- /dev/null +++ b/prover/crates/lib/keystore/Cargo.toml @@ -0,0 +1,35 @@ +[package] +name = "zksync_prover_keystore" +version.workspace = true +edition.workspace = true +authors.workspace = true +homepage.workspace = true +repository.workspace = true +license.workspace = true +keywords.workspace = true +categories.workspace = true + + +[dependencies] +zksync_types.workspace = true +zksync_utils.workspace = true +zksync_prover_fri_types.workspace = true +zkevm_test_harness.workspace = true +circuit_definitions = { workspace = true, features = ["log_tracing"] } +shivini = { workspace = true, optional = true } +zksync_config.workspace = true +zksync_env_config.workspace = true + +anyhow.workspace = true +tracing.workspace = true +serde_json.workspace = true +serde = { workspace = true, features = ["derive"] } +bincode.workspace = true +once_cell.workspace = true +md5.workspace = true +sha3.workspace = true +hex.workspace = true + +[features] +default = [] +gpu = ["shivini"] diff --git a/prover/crates/bin/vk_setup_data_generator_server_fri/src/commitment_utils.rs b/prover/crates/lib/keystore/src/commitment_utils.rs similarity index 100% rename from prover/crates/bin/vk_setup_data_generator_server_fri/src/commitment_utils.rs rename to prover/crates/lib/keystore/src/commitment_utils.rs diff --git a/prover/crates/bin/vk_setup_data_generator_server_fri/src/keystore.rs b/prover/crates/lib/keystore/src/keystore.rs similarity index 99% rename from prover/crates/bin/vk_setup_data_generator_server_fri/src/keystore.rs rename to prover/crates/lib/keystore/src/keystore.rs index c683ed3d2965..7ba5a3aaa701 100644 --- a/prover/crates/bin/vk_setup_data_generator_server_fri/src/keystore.rs +++ b/prover/crates/lib/keystore/src/keystore.rs @@ -475,6 +475,7 @@ impl Keystore { pub fn load_commitments(&self) -> anyhow::Result { Self::load_json_from_file(self.get_base_path().join("commitments.json")) } + pub fn save_commitments(&self, commitments: &VkCommitments) -> anyhow::Result<()> { Self::save_json_pretty(self.get_base_path().join("commitments.json"), &commitments) } diff --git a/prover/crates/bin/vk_setup_data_generator_server_fri/src/lib.rs b/prover/crates/lib/keystore/src/lib.rs similarity index 99% rename from prover/crates/bin/vk_setup_data_generator_server_fri/src/lib.rs rename to prover/crates/lib/keystore/src/lib.rs index 4b66df56f182..7e60e3fa29cd 100644 --- a/prover/crates/bin/vk_setup_data_generator_server_fri/src/lib.rs +++ b/prover/crates/lib/keystore/src/lib.rs @@ -26,7 +26,6 @@ pub mod commitment_utils; pub mod keystore; pub mod setup_data_generator; pub mod utils; -pub mod vk_commitment_helper; #[derive(Debug, Serialize, Deserialize)] #[serde( diff --git a/prover/crates/bin/vk_setup_data_generator_server_fri/src/setup_data_generator.rs b/prover/crates/lib/keystore/src/setup_data_generator.rs similarity index 100% rename from prover/crates/bin/vk_setup_data_generator_server_fri/src/setup_data_generator.rs rename to prover/crates/lib/keystore/src/setup_data_generator.rs diff --git a/prover/crates/bin/vk_setup_data_generator_server_fri/src/utils.rs b/prover/crates/lib/keystore/src/utils.rs similarity index 100% rename from prover/crates/bin/vk_setup_data_generator_server_fri/src/utils.rs rename to prover/crates/lib/keystore/src/utils.rs diff --git a/prover/crates/lib/prover_dal/src/fri_prover_dal.rs b/prover/crates/lib/prover_dal/src/fri_prover_dal.rs index c2dadae58d0b..4e68154290da 100644 --- a/prover/crates/lib/prover_dal/src/fri_prover_dal.rs +++ b/prover/crates/lib/prover_dal/src/fri_prover_dal.rs @@ -476,33 +476,6 @@ impl FriProverDal<'_, '_> { } } - pub async fn min_unproved_l1_batch_number_for_aggregation_round( - &mut self, - aggregation_round: AggregationRound, - ) -> Option { - sqlx::query!( - r#" - SELECT - l1_batch_number - FROM - prover_jobs_fri - WHERE - status <> 'skipped' - AND status <> 'successful' - AND aggregation_round = $1 - ORDER BY - l1_batch_number ASC - LIMIT - 1 - "#, - aggregation_round as i16 - ) - .fetch_optional(self.storage.conn()) - .await - .unwrap() - .map(|row| L1BatchNumber(row.l1_batch_number as u32)) - } - pub async fn update_status(&mut self, id: u32, status: &str) { sqlx::query!( r#" diff --git a/renovate.json b/renovate.json index 055bc3425806..eeccfee848dc 100644 --- a/renovate.json +++ b/renovate.json @@ -1,11 +1,5 @@ { - "enabled": false, - "extends": [ - "config:base", - "helpers:pinGitHubActionDigests" - ], - "enabledManagers": [ - "github-actions" - ], + "extends": ["config:base", "schedule:earlyMondays","helpers:pinGitHubActionDigests"], + "enabledManagers": ["github-actions"], "prCreation": "immediate" } diff --git a/zk_toolbox/crates/common/src/lib.rs b/zk_toolbox/crates/common/src/lib.rs index fbd6e93eb5d0..5a6f63e3a51f 100644 --- a/zk_toolbox/crates/common/src/lib.rs +++ b/zk_toolbox/crates/common/src/lib.rs @@ -14,6 +14,9 @@ pub mod git; pub mod server; pub mod wallets; -pub use prerequisites::{check_general_prerequisites, check_prover_prequisites}; +pub use prerequisites::{ + check_general_prerequisites, check_prerequisites, GCLOUD_PREREQUISITES, GPU_PREREQUISITES, + WGET_PREREQUISITES, +}; pub use prompt::{init_prompt_theme, Prompt, PromptConfirm, PromptSelect}; pub use term::{error, logger, spinner}; diff --git a/zk_toolbox/crates/common/src/prerequisites.rs b/zk_toolbox/crates/common/src/prerequisites.rs index 6c437302470d..87ec396d0e63 100644 --- a/zk_toolbox/crates/common/src/prerequisites.rs +++ b/zk_toolbox/crates/common/src/prerequisites.rs @@ -30,15 +30,7 @@ const DOCKER_COMPOSE_PREREQUISITE: Prerequisite = Prerequisite { download_link: "https://docs.docker.com/compose/install/", }; -const PROVER_PREREQUISITES: [Prerequisite; 5] = [ - Prerequisite { - name: "gcloud", - download_link: "https://cloud.google.com/sdk/docs/install", - }, - Prerequisite { - name: "wget", - download_link: "https://www.gnu.org/software/wget/", - }, +pub const GPU_PREREQUISITES: [Prerequisite; 3] = [ Prerequisite { name: "cmake", download_link: "https://cmake.org/download/", @@ -53,7 +45,17 @@ const PROVER_PREREQUISITES: [Prerequisite; 5] = [ }, // CUDA GPU driver ]; -struct Prerequisite { +pub const WGET_PREREQUISITES: [Prerequisite; 1] = [Prerequisite { + name: "wget", + download_link: "https://www.gnu.org/software/wget/", +}]; + +pub const GCLOUD_PREREQUISITES: [Prerequisite; 1] = [Prerequisite { + name: "gcloud", + download_link: "https://cloud.google.com/sdk/docs/install", +}]; + +pub struct Prerequisite { name: &'static str, download_link: &'static str, } @@ -62,11 +64,7 @@ pub fn check_general_prerequisites(shell: &Shell) { check_prerequisites(shell, &PREREQUISITES, true); } -pub fn check_prover_prequisites(shell: &Shell) { - check_prerequisites(shell, &PROVER_PREREQUISITES, false); -} - -fn check_prerequisites(shell: &Shell, prerequisites: &[Prerequisite], check_compose: bool) { +pub fn check_prerequisites(shell: &Shell, prerequisites: &[Prerequisite], check_compose: bool) { let mut missing_prerequisites = vec![]; for prerequisite in prerequisites { diff --git a/zk_toolbox/crates/config/src/general.rs b/zk_toolbox/crates/config/src/general.rs index 3426b21c6f6e..bcbe69e47196 100644 --- a/zk_toolbox/crates/config/src/general.rs +++ b/zk_toolbox/crates/config/src/general.rs @@ -127,7 +127,7 @@ pub fn update_ports(config: &mut GeneralConfig, ports_config: &PortsConfig) -> a let prometheus = config .prometheus_config .as_mut() - .context("Contract Verifier config is not presented")?; + .context("Prometheus config is not presented")?; api.web3_json_rpc.http_port = ports_config.web3_json_rpc_http_port; update_port_in_url( diff --git a/zk_toolbox/crates/zk_inception/README.md b/zk_toolbox/crates/zk_inception/README.md index 037a7e3fc925..25eeff40247b 100644 --- a/zk_toolbox/crates/zk_inception/README.md +++ b/zk_toolbox/crates/zk_inception/README.md @@ -21,7 +21,7 @@ This document contains the help content for the `zk_inception` command-line prog - [`zk_inception chain update-token-multiplier-setter`↴](#zk_inception-chain-update-token-multiplier-setter) - [`zk_inception prover`↴](#zk_inception-prover) - [`zk_inception prover init`↴](#zk_inception-prover-init) -- [`zk_inception prover generate-sk`↴](#zk_inception-prover-generate-sk) +- [`zk_inception prover setup-keys`↴](#zk_inception-prover-setup-keys) - [`zk_inception prover run`↴](#zk_inception-prover-run) - [`zk_inception prover init-bellman-cuda`↴](#zk_inception-prover-init-bellman-cuda) - [`zk_inception server`↴](#zk_inception-server) @@ -475,11 +475,21 @@ Initialize prover Possible values: `gcp`, `local` -## `zk_inception prover generate-sk` +## `zk_inception prover setup-keys` -Generate setup keys +Setup keys -**Usage:** `zk_inception prover generate-sk` +**Usage:** `zk_inception prover setup-keys` + +###### **Options:** + +- `--mode` + + Possible valuess: `download`, `generate` + +- `--region` + + Possible values: `asia`, `europe`, `us` ## `zk_inception prover run` diff --git a/zk_toolbox/crates/zk_inception/src/commands/chain/args/init.rs b/zk_toolbox/crates/zk_inception/src/commands/chain/args/init.rs index 2253eeb314ef..9dd6c490bd78 100644 --- a/zk_toolbox/crates/zk_inception/src/commands/chain/args/init.rs +++ b/zk_toolbox/crates/zk_inception/src/commands/chain/args/init.rs @@ -22,7 +22,7 @@ pub struct PortOffset(u16); impl PortOffset { pub fn from_chain_id(chain_id: u16) -> Self { - Self(chain_id * 100) + Self((chain_id - 1) * 100) } } @@ -88,7 +88,7 @@ impl InitArgs { l1_rpc_url, port_offset: self .port_offset - .unwrap_or(PortOffset::from_chain_id(config.chain_id.as_u64() as u16)) + .unwrap_or(PortOffset::from_chain_id(config.id as u16)) .into(), } } diff --git a/zk_toolbox/crates/zk_inception/src/commands/prover/args/mod.rs b/zk_toolbox/crates/zk_inception/src/commands/prover/args/mod.rs index 66d97d75094c..903ecdb81d91 100644 --- a/zk_toolbox/crates/zk_inception/src/commands/prover/args/mod.rs +++ b/zk_toolbox/crates/zk_inception/src/commands/prover/args/mod.rs @@ -1,3 +1,4 @@ pub mod init; pub mod init_bellman_cuda; pub mod run; +pub mod setup_keys; diff --git a/zk_toolbox/crates/zk_inception/src/commands/prover/args/setup_keys.rs b/zk_toolbox/crates/zk_inception/src/commands/prover/args/setup_keys.rs new file mode 100644 index 000000000000..4839c03eb429 --- /dev/null +++ b/zk_toolbox/crates/zk_inception/src/commands/prover/args/setup_keys.rs @@ -0,0 +1,53 @@ +use clap::{Parser, ValueEnum}; +use common::PromptSelect; +use strum::{EnumIter, IntoEnumIterator}; + +use crate::messages::{MSG_SETUP_KEYS_DOWNLOAD_HELP, MSG_SETUP_KEYS_REGION_PROMPT}; + +#[derive(Debug, Clone, Parser, Default)] +pub struct SetupKeysArgs { + #[clap(long)] + pub region: Option, + #[clap(long)] + pub mode: Option, +} + +#[derive(Debug, Clone)] +pub struct SetupKeysArgsFinal { + pub region: Option, + pub mode: Mode, +} + +#[derive(Debug, Clone, ValueEnum, strum::EnumString, EnumIter, PartialEq, Eq, strum::Display)] +pub enum Mode { + Download, + Generate, +} + +#[derive(Debug, Clone, ValueEnum, strum::EnumString, EnumIter, PartialEq, Eq, strum::Display)] +pub enum Region { + Us, + Europe, + Asia, +} + +impl SetupKeysArgs { + pub fn fill_values_with_prompt(self) -> SetupKeysArgsFinal { + let mode = self + .mode + .unwrap_or_else(|| PromptSelect::new(MSG_SETUP_KEYS_DOWNLOAD_HELP, Mode::iter()).ask()); + + if mode == Mode::Download { + let region = self.region.unwrap_or_else(|| { + PromptSelect::new(MSG_SETUP_KEYS_REGION_PROMPT, Region::iter()).ask() + }); + + SetupKeysArgsFinal { + region: Some(region), + mode, + } + } else { + SetupKeysArgsFinal { region: None, mode } + } + } +} diff --git a/zk_toolbox/crates/zk_inception/src/commands/prover/gcs.rs b/zk_toolbox/crates/zk_inception/src/commands/prover/gcs.rs index 0c76cb10f542..700209f5ffc8 100644 --- a/zk_toolbox/crates/zk_inception/src/commands/prover/gcs.rs +++ b/zk_toolbox/crates/zk_inception/src/commands/prover/gcs.rs @@ -1,4 +1,4 @@ -use common::{cmd::Cmd, logger, spinner::Spinner}; +use common::{check_prerequisites, cmd::Cmd, logger, spinner::Spinner, GCLOUD_PREREQUISITES}; use xshell::{cmd, Shell}; use zksync_config::{configs::object_store::ObjectStoreMode, ObjectStoreConfig}; @@ -14,6 +14,8 @@ pub(crate) fn create_gcs_bucket( shell: &Shell, config: ProofStorageGCSCreateBucket, ) -> anyhow::Result { + check_prerequisites(shell, &GCLOUD_PREREQUISITES, false); + let bucket_name = config.bucket_name; let location = config.location; let project_id = config.project_id; diff --git a/zk_toolbox/crates/zk_inception/src/commands/prover/generate_sk.rs b/zk_toolbox/crates/zk_inception/src/commands/prover/generate_sk.rs deleted file mode 100644 index c13d1c3b5e03..000000000000 --- a/zk_toolbox/crates/zk_inception/src/commands/prover/generate_sk.rs +++ /dev/null @@ -1,29 +0,0 @@ -use anyhow::Ok; -use common::{check_prover_prequisites, cmd::Cmd, logger, spinner::Spinner}; -use config::EcosystemConfig; -use xshell::{cmd, Shell}; - -use super::utils::get_link_to_prover; -use crate::messages::{MSG_GENERATING_SK_SPINNER, MSG_SK_GENERATED}; - -pub(crate) async fn run(shell: &Shell) -> anyhow::Result<()> { - check_prover_prequisites(shell); - - let ecosystem_config = EcosystemConfig::from_file(shell)?; - let link_to_prover = get_link_to_prover(&ecosystem_config); - shell.change_dir(&link_to_prover); - - let spinner = Spinner::new(MSG_GENERATING_SK_SPINNER); - let cmd = Cmd::new(cmd!( - shell, - "cargo run --features gpu --release --bin key_generator -- - generate-sk-gpu all --recompute-if-missing - --setup-path=data/keys - --path={link_to_prover}/data/keys" - )); - cmd.run()?; - spinner.finish(); - logger::outro(MSG_SK_GENERATED); - - Ok(()) -} diff --git a/zk_toolbox/crates/zk_inception/src/commands/prover/init.rs b/zk_toolbox/crates/zk_inception/src/commands/prover/init.rs index 051fd26801c9..7aadd04bf6b7 100644 --- a/zk_toolbox/crates/zk_inception/src/commands/prover/init.rs +++ b/zk_toolbox/crates/zk_inception/src/commands/prover/init.rs @@ -2,12 +2,13 @@ use std::path::PathBuf; use anyhow::Context; use common::{ - check_prover_prequisites, + check_prerequisites, cmd::Cmd, config::global_config, db::{drop_db_if_exists, init_db, migrate_db, DatabaseConfig}, logger, spinner::Spinner, + WGET_PREREQUISITES, }; use config::{copy_configs, set_prover_database, traits::SaveConfigWithBasePath, EcosystemConfig}; use xshell::{cmd, Shell}; @@ -34,8 +35,6 @@ use crate::{ }; pub(crate) async fn run(args: ProverInitArgs, shell: &Shell) -> anyhow::Result<()> { - check_prover_prequisites(shell); - let ecosystem_config = EcosystemConfig::from_file(shell)?; let setup_key_path = get_default_setup_key_path(&ecosystem_config)?; @@ -115,6 +114,7 @@ fn download_setup_key( general_config: &GeneralConfig, path: &str, ) -> anyhow::Result<()> { + check_prerequisites(shell, &WGET_PREREQUISITES, false); let spinner = Spinner::new(MSG_DOWNLOADING_SETUP_KEY_SPINNER); let compressor_config: zksync_config::configs::FriProofCompressorConfig = general_config .proof_compressor_config diff --git a/zk_toolbox/crates/zk_inception/src/commands/prover/init_bellman_cuda.rs b/zk_toolbox/crates/zk_inception/src/commands/prover/init_bellman_cuda.rs index 75535587c42c..5ed1473a33f6 100644 --- a/zk_toolbox/crates/zk_inception/src/commands/prover/init_bellman_cuda.rs +++ b/zk_toolbox/crates/zk_inception/src/commands/prover/init_bellman_cuda.rs @@ -1,5 +1,5 @@ use anyhow::Context; -use common::{check_prover_prequisites, cmd::Cmd, git, logger, spinner::Spinner}; +use common::{check_prerequisites, cmd::Cmd, git, logger, spinner::Spinner, GPU_PREREQUISITES}; use config::{traits::SaveConfigWithBasePath, EcosystemConfig}; use xshell::{cmd, Shell}; @@ -13,7 +13,7 @@ use crate::{ }; pub(crate) async fn run(shell: &Shell, args: InitBellmanCudaArgs) -> anyhow::Result<()> { - check_prover_prequisites(shell); + check_prerequisites(shell, &GPU_PREREQUISITES, false); let mut ecosystem_config = EcosystemConfig::from_file(shell)?; diff --git a/zk_toolbox/crates/zk_inception/src/commands/prover/mod.rs b/zk_toolbox/crates/zk_inception/src/commands/prover/mod.rs index 31c3a02e3806..4fb90dcfd020 100644 --- a/zk_toolbox/crates/zk_inception/src/commands/prover/mod.rs +++ b/zk_toolbox/crates/zk_inception/src/commands/prover/mod.rs @@ -2,12 +2,14 @@ use args::{init::ProverInitArgs, init_bellman_cuda::InitBellmanCudaArgs, run::Pr use clap::Subcommand; use xshell::Shell; +use crate::commands::prover::args::setup_keys::SetupKeysArgs; + mod args; mod gcs; -mod generate_sk; mod init; mod init_bellman_cuda; mod run; +mod setup_keys; mod utils; #[derive(Subcommand, Debug)] @@ -16,7 +18,7 @@ pub enum ProverCommands { Init(Box), /// Generate setup keys #[command(alias = "sk")] - GenerateSK, + SetupKeys(SetupKeysArgs), /// Run prover Run(ProverRunArgs), /// Initialize bellman-cuda @@ -27,7 +29,7 @@ pub enum ProverCommands { pub(crate) async fn run(shell: &Shell, args: ProverCommands) -> anyhow::Result<()> { match args { ProverCommands::Init(args) => init::run(*args, shell).await, - ProverCommands::GenerateSK => generate_sk::run(shell).await, + ProverCommands::SetupKeys(args) => setup_keys::run(args, shell).await, ProverCommands::Run(args) => run::run(args, shell).await, ProverCommands::InitBellmanCuda(args) => init_bellman_cuda::run(shell, *args).await, } diff --git a/zk_toolbox/crates/zk_inception/src/commands/prover/run.rs b/zk_toolbox/crates/zk_inception/src/commands/prover/run.rs index 20ddfea6ac55..a819c3322a89 100644 --- a/zk_toolbox/crates/zk_inception/src/commands/prover/run.rs +++ b/zk_toolbox/crates/zk_inception/src/commands/prover/run.rs @@ -1,5 +1,5 @@ use anyhow::Context; -use common::{check_prover_prequisites, cmd::Cmd, config::global_config, logger}; +use common::{check_prerequisites, cmd::Cmd, config::global_config, logger, GPU_PREREQUISITES}; use config::{ChainConfig, EcosystemConfig}; use xshell::{cmd, Shell}; @@ -20,7 +20,6 @@ use crate::messages::{ }; pub(crate) async fn run(args: ProverRunArgs, shell: &Shell) -> anyhow::Result<()> { - check_prover_prequisites(shell); let args = args.fill_values_with_prompt()?; let ecosystem_config = EcosystemConfig::from_file(shell)?; let chain = ecosystem_config @@ -97,6 +96,7 @@ fn run_witness_vector_generator( } fn run_prover(shell: &Shell, chain: &ChainConfig) -> anyhow::Result<()> { + check_prerequisites(shell, &GPU_PREREQUISITES, false); logger::info(MSG_RUNNING_PROVER); let config_path = chain.path_to_general_config(); let secrets_path = chain.path_to_secrets_config(); @@ -113,6 +113,7 @@ fn run_compressor( chain: &ChainConfig, ecosystem: &EcosystemConfig, ) -> anyhow::Result<()> { + check_prerequisites(shell, &GPU_PREREQUISITES, false); logger::info(MSG_RUNNING_COMPRESSOR); let config_path = chain.path_to_general_config(); let secrets_path = chain.path_to_secrets_config(); diff --git a/zk_toolbox/crates/zk_inception/src/commands/prover/setup_keys.rs b/zk_toolbox/crates/zk_inception/src/commands/prover/setup_keys.rs new file mode 100644 index 000000000000..09d9f76a47cf --- /dev/null +++ b/zk_toolbox/crates/zk_inception/src/commands/prover/setup_keys.rs @@ -0,0 +1,83 @@ +use anyhow::Ok; +use common::{ + check_prerequisites, cmd::Cmd, logger, spinner::Spinner, GCLOUD_PREREQUISITES, + GPU_PREREQUISITES, +}; +use config::EcosystemConfig; +use xshell::{cmd, Shell}; + +use super::utils::get_link_to_prover; +use crate::{ + commands::prover::args::setup_keys::{Mode, Region, SetupKeysArgs}, + messages::{MSG_GENERATING_SK_SPINNER, MSG_SK_GENERATED}, +}; + +pub(crate) async fn run(args: SetupKeysArgs, shell: &Shell) -> anyhow::Result<()> { + let args = args.fill_values_with_prompt(); + let ecosystem_config = EcosystemConfig::from_file(shell)?; + + if args.mode == Mode::Generate { + check_prerequisites(shell, &GPU_PREREQUISITES, false); + let link_to_prover = get_link_to_prover(&ecosystem_config); + shell.change_dir(&link_to_prover); + + let spinner = Spinner::new(MSG_GENERATING_SK_SPINNER); + let cmd = Cmd::new(cmd!( + shell, + "cargo run --features gpu --release --bin key_generator -- + generate-sk-gpu all --recompute-if-missing + --setup-path=data/keys + --path={link_to_prover}/data/keys" + )); + cmd.run()?; + spinner.finish(); + logger::outro(MSG_SK_GENERATED); + } else { + check_prerequisites(shell, &GCLOUD_PREREQUISITES, false); + + let link_to_setup_keys = get_link_to_prover(&ecosystem_config).join("data/keys"); + let path_to_keys_buckets = + get_link_to_prover(&ecosystem_config).join("setup-data-gpu-keys.json"); + + let region = args.region.expect("Region is not provided"); + + let file = shell + .read_file(path_to_keys_buckets) + .expect("Could not find commitments file in zksync-era"); + let json: serde_json::Value = + serde_json::from_str(&file).expect("Could not parse commitments.json"); + + let bucket = &match region { + Region::Us => json + .get("us") + .expect("Could not find link to US bucket") + .to_string(), + Region::Europe => json + .get("europe") + .expect("Could not find link to Europe bucket") + .to_string(), + Region::Asia => json + .get("asia") + .expect("Could not find link to Asia bucket") + .to_string(), + }; + + let len = bucket.len() - 2usize; + let bucket = &bucket[1..len]; + + let spinner = Spinner::new(&format!( + "Downloading keys from bucket: {} to {:?}", + bucket, link_to_setup_keys + )); + + let cmd = Cmd::new(cmd!( + shell, + "gsutil -m rsync -r {bucket} {link_to_setup_keys}" + )); + cmd.run()?; + spinner.finish(); + logger::outro("Keys are downloaded"); + } + + Ok(()) +} diff --git a/zk_toolbox/crates/zk_inception/src/messages.rs b/zk_toolbox/crates/zk_inception/src/messages.rs index 30cb422dfca6..25933d39db30 100644 --- a/zk_toolbox/crates/zk_inception/src/messages.rs +++ b/zk_toolbox/crates/zk_inception/src/messages.rs @@ -5,6 +5,10 @@ use ethers::{ utils::format_ether, }; +pub(super) const MSG_SETUP_KEYS_DOWNLOAD_HELP: &str = + "Do you want to download the setup keys or generate them?"; +pub(super) const MSG_SETUP_KEYS_REGION_PROMPT: &str = + "From which region you want setup keys to be downloaded?"; /// Common messages pub(super) const MSG_SELECTED_CONFIG: &str = "Selected config"; pub(super) const MSG_CHAIN_NOT_INITIALIZED: &str = diff --git a/zk_toolbox/crates/zk_supervisor/src/commands/contracts.rs b/zk_toolbox/crates/zk_supervisor/src/commands/contracts.rs index 0c635b2b0d34..bab4205cd66f 100644 --- a/zk_toolbox/crates/zk_supervisor/src/commands/contracts.rs +++ b/zk_toolbox/crates/zk_supervisor/src/commands/contracts.rs @@ -1,16 +1,16 @@ use std::path::PathBuf; -use clap::{Parser, ValueEnum}; +use clap::Parser; use common::{cmd::Cmd, logger, spinner::Spinner}; use config::EcosystemConfig; -use strum::EnumIter; use xshell::{cmd, Shell}; use crate::messages::{ MSG_BUILDING_CONTRACTS, MSG_BUILDING_CONTRACTS_SUCCESS, MSG_BUILDING_L1_CONTRACTS_SPINNER, MSG_BUILDING_L2_CONTRACTS_SPINNER, MSG_BUILDING_SYSTEM_CONTRACTS_SPINNER, - MSG_BUILD_L1_CONTRACTS_HELP, MSG_BUILD_L2_CONTRACTS_HELP, MSG_BUILD_SYSTEM_CONTRACTS_HELP, - MSG_CONTRACTS_DEPS_SPINNER, MSG_NOTHING_TO_BUILD_MSG, + MSG_BUILDING_TEST_CONTRACTS_SPINNER, MSG_BUILD_L1_CONTRACTS_HELP, MSG_BUILD_L2_CONTRACTS_HELP, + MSG_BUILD_SYSTEM_CONTRACTS_HELP, MSG_BUILD_TEST_CONTRACTS_HELP, MSG_CONTRACTS_DEPS_SPINNER, + MSG_NOTHING_TO_BUILD_MSG, }; #[derive(Debug, Parser)] @@ -21,6 +21,8 @@ pub struct ContractsArgs { pub l2_contracts: Option, #[clap(long, alias = "sc", help = MSG_BUILD_SYSTEM_CONTRACTS_HELP, default_missing_value = "true", num_args = 0..=1)] pub system_contracts: Option, + #[clap(long, alias = "test", help = MSG_BUILD_TEST_CONTRACTS_HELP, default_missing_value = "true", num_args = 0..=1)] + pub test_contracts: Option, } impl ContractsArgs { @@ -28,11 +30,13 @@ impl ContractsArgs { if self.l1_contracts.is_none() && self.l2_contracts.is_none() && self.system_contracts.is_none() + && self.test_contracts.is_none() { return vec![ ContractType::L1, ContractType::L2, ContractType::SystemContracts, + ContractType::TestContracts, ]; } @@ -47,17 +51,20 @@ impl ContractsArgs { if self.system_contracts.unwrap_or(false) { contracts.push(ContractType::SystemContracts); } + if self.test_contracts.unwrap_or(false) { + contracts.push(ContractType::TestContracts); + } contracts } } -#[derive(Debug, ValueEnum, EnumIter, strum::Display, PartialEq, Eq, Clone, Copy)] -#[strum(serialize_all = "lowercase")] +#[derive(Debug, PartialEq, Eq, Clone, Copy)] pub enum ContractType { L1, L2, SystemContracts, + TestContracts, } #[derive(Debug)] @@ -85,6 +92,11 @@ impl ContractBuilder { cmd: "yarn sc build".to_string(), msg: MSG_BUILDING_SYSTEM_CONTRACTS_SPINNER.to_string(), }, + ContractType::TestContracts => Self { + dir: ecosystem.link_to_code.join("etc/contracts-test-data"), + cmd: "yarn build".to_string(), + msg: MSG_BUILDING_TEST_CONTRACTS_SPINNER.to_string(), + }, } } diff --git a/zk_toolbox/crates/zk_supervisor/src/commands/test/rust.rs b/zk_toolbox/crates/zk_supervisor/src/commands/test/rust.rs index 59c86743291d..ad1318cfa768 100644 --- a/zk_toolbox/crates/zk_supervisor/src/commands/test/rust.rs +++ b/zk_toolbox/crates/zk_supervisor/src/commands/test/rust.rs @@ -1,12 +1,16 @@ +use std::{path::Path, str::FromStr}; + use anyhow::Context; -use common::{cmd::Cmd, config::global_config, db::wait_for_db, logger}; +use common::{cmd::Cmd, db::wait_for_db, logger}; use config::EcosystemConfig; +use url::Url; use xshell::{cmd, Shell}; use super::args::rust::RustArgs; use crate::{ commands::database, - dals::get_test_dals, + dals::{Dal, CORE_DAL_PATH, PROVER_DAL_PATH}, + defaults::{TEST_DATABASE_PROVER_URL, TEST_DATABASE_SERVER_URL}, messages::{ MSG_CARGO_NEXTEST_MISSING_ERR, MSG_CHAIN_NOT_FOUND_ERR, MSG_POSTGRES_CONFIG_NOT_FOUND_ERR, MSG_RESETTING_TEST_DATABASES, MSG_UNIT_TESTS_RUN_SUCCESS, MSG_USING_CARGO_NEXTEST, @@ -17,16 +21,45 @@ pub async fn run(shell: &Shell, args: RustArgs) -> anyhow::Result<()> { let ecosystem = EcosystemConfig::from_file(shell)?; let chain = ecosystem .clone() - .load_chain(global_config().chain_name.clone()) + .load_chain(Some(ecosystem.default_chain)) .context(MSG_CHAIN_NOT_FOUND_ERR)?; - let general_config = chain.get_general_config()?; - let postgres = general_config - .postgres_config - .context(MSG_POSTGRES_CONFIG_NOT_FOUND_ERR)?; + let general_config = chain.get_general_config(); + let link_to_code = ecosystem.link_to_code; + + let (test_server_url, test_prover_url) = if let Ok(general_config) = general_config { + let postgres = general_config + .postgres_config + .context(MSG_POSTGRES_CONFIG_NOT_FOUND_ERR)?; + + ( + postgres + .test_server_url + .context(MSG_POSTGRES_CONFIG_NOT_FOUND_ERR)?, + postgres + .test_prover_url + .context(MSG_POSTGRES_CONFIG_NOT_FOUND_ERR)?, + ) + } else { + ( + TEST_DATABASE_SERVER_URL.to_string(), + TEST_DATABASE_PROVER_URL.to_string(), + ) + }; + + let dals = vec![ + Dal { + url: Url::from_str(&test_server_url.clone())?, + path: CORE_DAL_PATH.to_string(), + }, + Dal { + url: Url::from_str(&test_prover_url.clone())?, + path: PROVER_DAL_PATH.to_string(), + }, + ]; - reset_test_databases(shell).await?; + reset_test_databases(shell, &link_to_code, dals).await?; - let _dir_guard = shell.push_dir(&ecosystem.link_to_code); + let _dir_guard = shell.push_dir(&link_to_code); let cmd = if nextest_is_installed(shell)? { logger::info(MSG_USING_CARGO_NEXTEST); @@ -43,18 +76,8 @@ pub async fn run(shell: &Shell, args: RustArgs) -> anyhow::Result<()> { }; let cmd = cmd - .env( - "TEST_DATABASE_URL", - postgres - .test_server_url - .context(MSG_POSTGRES_CONFIG_NOT_FOUND_ERR)?, - ) - .env( - "TEST_PROVER_DATABASE_URL", - postgres - .test_prover_url - .context(MSG_POSTGRES_CONFIG_NOT_FOUND_ERR)?, - ); + .env("TEST_DATABASE_URL", test_server_url) + .env("TEST_PROVER_DATABASE_URL", test_prover_url); cmd.run()?; logger::outro(MSG_UNIT_TESTS_RUN_SUCCESS); @@ -70,9 +93,12 @@ fn nextest_is_installed(shell: &Shell) -> anyhow::Result { Ok(out.contains("cargo-nextest")) } -async fn reset_test_databases(shell: &Shell) -> anyhow::Result<()> { +async fn reset_test_databases( + shell: &Shell, + link_to_code: &Path, + dals: Vec, +) -> anyhow::Result<()> { logger::info(MSG_RESETTING_TEST_DATABASES); - let ecosystem = EcosystemConfig::from_file(shell)?; Cmd::new(cmd!( shell, @@ -85,11 +111,11 @@ async fn reset_test_databases(shell: &Shell) -> anyhow::Result<()> { )) .run()?; - for dal in get_test_dals(shell)? { + for dal in dals { let mut url = dal.url.clone(); url.set_path(""); wait_for_db(&url, 3).await?; - database::reset::reset_database(shell, ecosystem.link_to_code.clone(), dal.clone()).await?; + database::reset::reset_database(shell, link_to_code, dal.clone()).await?; } Ok(()) diff --git a/zk_toolbox/crates/zk_supervisor/src/dals.rs b/zk_toolbox/crates/zk_supervisor/src/dals.rs index a8600a2665e6..f9c07585f6dd 100644 --- a/zk_toolbox/crates/zk_supervisor/src/dals.rs +++ b/zk_toolbox/crates/zk_supervisor/src/dals.rs @@ -1,5 +1,3 @@ -use std::str::FromStr; - use anyhow::{anyhow, Context}; use common::config::global_config; use config::{EcosystemConfig, SecretsConfig}; @@ -11,8 +9,8 @@ use crate::{ messages::{MSG_CHAIN_NOT_FOUND_ERR, MSG_DATABASE_MUST_BE_PRESENTED}, }; -const CORE_DAL_PATH: &str = "core/lib/dal"; -const PROVER_DAL_PATH: &str = "prover/crates/lib/prover_dal"; +pub const CORE_DAL_PATH: &str = "core/lib/dal"; +pub const PROVER_DAL_PATH: &str = "prover/crates/lib/prover_dal"; #[derive(Debug, Clone)] pub struct SelectedDals { @@ -50,10 +48,6 @@ pub fn get_dals( Ok(dals) } -pub fn get_test_dals(shell: &Shell) -> anyhow::Result> { - Ok(vec![get_test_prover_dal(shell)?, get_test_core_dal(shell)?]) -} - pub fn get_prover_dal(shell: &Shell, url: Option) -> anyhow::Result { let url = if let Some(url) = url { Url::parse(&url)? @@ -94,51 +88,6 @@ pub fn get_core_dal(shell: &Shell, url: Option) -> anyhow::Result { }) } -pub fn get_test_core_dal(shell: &Shell) -> anyhow::Result { - let general_config = get_general_config(shell)?; - let postgres = general_config - .postgres_config - .context(MSG_DATABASE_MUST_BE_PRESENTED)?; - - let url = Url::from_str( - &postgres - .test_server_url - .clone() - .context(MSG_DATABASE_MUST_BE_PRESENTED)?, - )?; - Ok(Dal { - path: CORE_DAL_PATH.to_string(), - url, - }) -} - -pub fn get_test_prover_dal(shell: &Shell) -> anyhow::Result { - let general_config = get_general_config(shell)?; - let postgres = general_config - .postgres_config - .context(MSG_DATABASE_MUST_BE_PRESENTED)?; - - let url = Url::from_str( - &postgres - .test_prover_url - .clone() - .context(MSG_DATABASE_MUST_BE_PRESENTED)?, - )?; - - Ok(Dal { - path: PROVER_DAL_PATH.to_string(), - url, - }) -} - -fn get_general_config(shell: &Shell) -> anyhow::Result { - let ecosystem_config = EcosystemConfig::from_file(shell)?; - let chain_config = ecosystem_config - .load_chain(global_config().chain_name.clone()) - .context(MSG_CHAIN_NOT_FOUND_ERR)?; - chain_config.get_general_config() -} - fn get_secrets(shell: &Shell) -> anyhow::Result { let ecosystem_config = EcosystemConfig::from_file(shell)?; let chain_config = ecosystem_config diff --git a/zk_toolbox/crates/zk_supervisor/src/defaults.rs b/zk_toolbox/crates/zk_supervisor/src/defaults.rs new file mode 100644 index 000000000000..f4bae739c2d1 --- /dev/null +++ b/zk_toolbox/crates/zk_supervisor/src/defaults.rs @@ -0,0 +1,4 @@ +pub const TEST_DATABASE_SERVER_URL: &str = + "postgres://postgres:notsecurepassword@localhost:5433/zksync_local_test"; +pub const TEST_DATABASE_PROVER_URL: &str = + "postgres://postgres:notsecurepassword@localhost:5433/prover_local_test"; diff --git a/zk_toolbox/crates/zk_supervisor/src/main.rs b/zk_toolbox/crates/zk_supervisor/src/main.rs index 6b5bfa46943e..a8722787b5ff 100644 --- a/zk_toolbox/crates/zk_supervisor/src/main.rs +++ b/zk_toolbox/crates/zk_supervisor/src/main.rs @@ -21,6 +21,7 @@ use crate::commands::{clean::CleanCommands, fmt::FmtArgs}; mod commands; mod dals; +mod defaults; mod messages; #[derive(Parser, Debug)] diff --git a/zk_toolbox/crates/zk_supervisor/src/messages.rs b/zk_toolbox/crates/zk_supervisor/src/messages.rs index 17f01e664678..ff9cc104a505 100644 --- a/zk_toolbox/crates/zk_supervisor/src/messages.rs +++ b/zk_toolbox/crates/zk_supervisor/src/messages.rs @@ -112,10 +112,12 @@ pub(super) const MSG_CONTRACTS_DEPS_SPINNER: &str = "Installing dependencies.."; pub(super) const MSG_BUILDING_L2_CONTRACTS_SPINNER: &str = "Building L2 contracts.."; pub(super) const MSG_BUILDING_L1_CONTRACTS_SPINNER: &str = "Building L1 contracts.."; pub(super) const MSG_BUILDING_SYSTEM_CONTRACTS_SPINNER: &str = "Building system contracts.."; +pub(super) const MSG_BUILDING_TEST_CONTRACTS_SPINNER: &str = "Building test contracts.."; pub(super) const MSG_BUILDING_CONTRACTS_SUCCESS: &str = "Contracts built successfully"; pub(super) const MSG_BUILD_L1_CONTRACTS_HELP: &str = "Build L1 contracts"; pub(super) const MSG_BUILD_L2_CONTRACTS_HELP: &str = "Build L2 contracts"; pub(super) const MSG_BUILD_SYSTEM_CONTRACTS_HELP: &str = "Build system contracts"; +pub(super) const MSG_BUILD_TEST_CONTRACTS_HELP: &str = "Build test contracts"; // Integration tests related messages pub(super) fn msg_integration_tests_run(external_node: bool) -> String {