diff --git a/.github/workflows/build-docker-from-tag.yml b/.github/workflows/build-docker-from-tag.yml index cd222a6e43b..791f4411747 100644 --- a/.github/workflows/build-docker-from-tag.yml +++ b/.github/workflows/build-docker-from-tag.yml @@ -23,7 +23,7 @@ concurrency: docker-build jobs: setup: name: Setup - runs-on: [ubuntu-latest] + runs-on: [ ubuntu-latest ] outputs: image_tag_suffix: ${{ steps.set.outputs.image_tag_suffix }} prover_fri_gpu_key_id: ${{ steps.extract-prover-fri-setup-key-ids.outputs.gpu_short_commit_sha }} @@ -48,7 +48,7 @@ jobs: build-push-core-images: name: Build and push image - needs: [setup] + needs: [ setup ] uses: ./.github/workflows/build-core-template.yml if: contains(github.ref_name, 'core') secrets: @@ -60,7 +60,7 @@ jobs: build-push-tee-prover-images: name: Build and push images - needs: [setup] + needs: [ setup ] uses: ./.github/workflows/build-tee-prover-template.yml if: contains(github.ref_name, 'core') secrets: @@ -72,7 +72,7 @@ jobs: build-push-contract-verifier: name: Build and push image - needs: [setup] + needs: [ setup ] uses: ./.github/workflows/build-contract-verifier-template.yml if: contains(github.ref_name, 'contract_verifier') secrets: @@ -83,20 +83,20 @@ jobs: build-push-prover-images: name: Build and push image - needs: [setup] + needs: [ setup ] uses: ./.github/workflows/build-prover-template.yml if: contains(github.ref_name, 'prover') with: image_tag_suffix: ${{ needs.setup.outputs.image_tag_suffix }} ERA_BELLMAN_CUDA_RELEASE: ${{ vars.ERA_BELLMAN_CUDA_RELEASE }} - CUDA_ARCH: "60;70;75;89" + CUDA_ARCH: "60;70;75;80;89" secrets: DOCKERHUB_USER: ${{ secrets.DOCKERHUB_USER }} DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }} build-push-witness-generator-image-avx512: name: Build and push image - needs: [setup] + needs: [ setup ] uses: ./.github/workflows/build-witness-generator-template.yml if: contains(github.ref_name, 'prover') with: @@ -110,7 +110,7 @@ jobs: build-gar-prover-fri-gpu: name: Build GAR prover FRI GPU - needs: [setup, build-push-prover-images] + needs: [ setup, build-push-prover-images ] uses: ./.github/workflows/build-prover-fri-gpu-gar.yml if: contains(github.ref_name, 'prover') with: diff --git a/.github/workflows/ci-core-reusable.yml b/.github/workflows/ci-core-reusable.yml index 53bd1ab7a51..a88a8fe3944 100644 --- a/.github/workflows/ci-core-reusable.yml +++ b/.github/workflows/ci-core-reusable.yml @@ -71,7 +71,7 @@ jobs: strategy: fail-fast: false matrix: - vm_mode: [ "old", "new" ] + vm_mode: [ "OLD", "NEW" ] steps: - uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4 @@ -87,13 +87,12 @@ jobs: - name: Loadtest configuration run: | - echo EXPECTED_TX_COUNT=${{ matrix.vm_mode == 'new' && 21000 || 16000 }} >> .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 - name: Start services run: | @@ -107,23 +106,34 @@ jobs: ci_run git config --global --add safe.directory /usr/src/zksync/contracts/system-contracts ci_run git config --global --add safe.directory /usr/src/zksync/contracts - ci_run zk - ci_run zk init --local-legacy-bridge-testing + ci_run ./bin/zkt + ci_run zk_inception chain create \ + --chain-name legacy \ + --chain-id sequential \ + --prover-mode no-proofs \ + --wallet-creation localhost \ + --l1-batch-commit-data-generator-mode rollup \ + --base-token-address 0x0000000000000000000000000000000000000001 \ + --base-token-price-nominator 1 \ + --base-token-price-denominator 1 \ + --set-as-default false \ + --ignore-prerequisites \ + --legacy-bridge + + ci_run zk_inception ecosystem init --dev --verbose + ci_run zk_supervisor contracts --test-contracts # `sleep 60` because we need to wait until server added all the tokens - name: Run server run: | - EXPERIMENTAL_VM_STATE_KEEPER_FAST_VM_MODE=${{ matrix.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 sed -i -e 's/mode: FULL/mode: LIGHTWEIGHT/' chains/legacy/configs/general.yaml + ci_run sed -i -e 's/state_keeper_fast_vm_mode:.*/state_keeper_fast_vm_mode: ${{ matrix.vm_mode }}/' chains/legacy/configs/general.yaml + ci_run sed -i -e 's/delay_interval:.*/delay_interval: 50/' chains/legacy/configs/general.yaml + ci_run zk_inception server --uring --chain=legacy --components api,tree,eth,state_keeper,housekeeper,commitment_generator,vm_runner_protective_reads &>server.log & ci_run sleep 60 - - name: Deploy legacy era contracts - run: ci_run zk contract setup-legacy-bridge-era - - name: Perform loadtest - run: ci_run zk run loadtest + run: ci_run zk_supervisor t loadtest -v --chain=legacy - name: Show server.log logs if: always() @@ -293,7 +303,7 @@ jobs: - name: Show revert.log logs if: always() - run: ci_run cat core/tests/revert-test/revert.log || true + run: ci_run cat logs/revert/default/server.log || true - name: Show upgrade.log logs if: always() @@ -382,7 +392,11 @@ jobs: - name: Run revert test run: | - ENABLE_CONSENSUS=${{ matrix.consensus }} DEPLOYMENT_MODE=${{ matrix.deployment_mode }} PASSED_ENV_VARS="ENABLE_CONSENSUS,DEPLOYMENT_MODE" ci_run zk test i revert-en + ENABLE_CONSENSUS=${{ matrix.consensus }} \ + DEPLOYMENT_MODE=${{ matrix.deployment_mode }} \ + PASSED_ENV_VARS="ENABLE_CONSENSUS,DEPLOYMENT_MODE" \ + ci_run zk test i revert-en + # test terminates the nodes, so we restart them. if [[ "${{ matrix.deployment_mode }}" == "Rollup" ]]; then ZKSYNC_ENV=docker ci_run zk server --components=$SERVER_COMPONENTS &>>server.log & @@ -414,13 +428,13 @@ jobs: if: always() run: ci_run cat ext-node.log || true - - name: Show revert_main.log logs + - name: Show revert logs (main node) if: always() - run: ci_run cat core/tests/revert-test/revert_main.log || true + run: ci_run cat logs/revert/en/default/server.log || true - - name: Show revert_ext.log logs + - name: Show revert logs (EN) if: always() - run: ci_run cat core/tests/revert-test/revert_ext.log || true + run: ci_run cat logs/revert/en/default/external_node.log || true - name: Show upgrade.log logs if: always() diff --git a/.github/workflows/ci-zk-toolbox-reusable.yml b/.github/workflows/ci-zk-toolbox-reusable.yml index 5f82df646c1..638f168de30 100644 --- a/.github/workflows/ci-zk-toolbox-reusable.yml +++ b/.github/workflows/ci-zk-toolbox-reusable.yml @@ -4,6 +4,11 @@ on: env: CLICOLOR: 1 + # We run multiple binaries in parallel, and by default they will try to utilize all the + # available CPUs. In tests, there is not much CPU-intensive work (rayon), but a lot of + # async work (tokio), so we prioritize tokio. + TOKIO_WORKER_THREADS: 4 + RAYON_NUM_THREADS: 2 jobs: lint: @@ -11,7 +16,7 @@ jobs: uses: ./.github/workflows/ci-core-lint-reusable.yml tests: - runs-on: [ matterlabs-ci-runner ] + runs-on: [ matterlabs-ci-runner-ultra-performance ] steps: - uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4 with: @@ -127,6 +132,30 @@ jobs: --prover-db-name=zksync_prover_localhost_custom_token \ --port-offset 3000 \ --chain custom_token + + - name: Create and initialize Consensus chain + run: | + ci_run zk_inception chain create \ + --chain-name consensus \ + --chain-id sequential \ + --prover-mode no-proofs \ + --wallet-creation localhost \ + --l1-batch-commit-data-generator-mode validium \ + --base-token-address ${{ env.address }} \ + --base-token-price-nominator 3 \ + --base-token-price-denominator 2 \ + --set-as-default false \ + --ignore-prerequisites + + ci_run zk_inception chain init \ + --deploy-paymaster \ + --l1-rpc-url=http://localhost:8545 \ + --server-db-url=postgres://postgres:notsecurepassword@localhost:5432 \ + --server-db-name=zksync_server_localhost_consensus \ + --prover-db-url=postgres://postgres:notsecurepassword@localhost:5432 \ + --prover-db-name=zksync_prover_localhost_consensus \ + --port-offset 4000 \ + --chain consensus - name: Build test dependencies run: | @@ -137,6 +166,10 @@ jobs: ci_run zk_inception server --ignore-prerequisites --chain era &> ${{ env.SERVER_LOGS_DIR }}/rollup.log & ci_run zk_inception server --ignore-prerequisites --chain validium &> ${{ env.SERVER_LOGS_DIR }}/validium.log & ci_run zk_inception server --ignore-prerequisites --chain custom_token &> ${{ env.SERVER_LOGS_DIR }}/custom_token.log & + ci_run zk_inception server --ignore-prerequisites --chain consensus \ + --components=api,tree,eth,state_keeper,housekeeper,commitment_generator,vm_runner_protective_reads,vm_runner_bwip,vm_playground,da_dispatcher,consensus \ + &> ${{ env.SERVER_LOGS_DIR }}/consensus.log & + ci_run sleep 5 - name: Run integration tests @@ -150,9 +183,13 @@ jobs: ci_run zk_supervisor test integration --no-deps --ignore-prerequisites --chain custom_token &> ${{ env.INTEGRATION_TESTS_LOGS_DIR }}/custom_token.log & PID3=$! + ci_run zk_supervisor test integration --no-deps --ignore-prerequisites --chain consensus &> ${{ env.INTEGRATION_TESTS_LOGS_DIR }}/consensus.log & + PID4=$! + wait $PID1 wait $PID2 wait $PID3 + wait $PID4 - name: Init external nodes run: | @@ -168,6 +205,10 @@ jobs: --db-name=zksync_en_localhost_era_custom_token --l1-rpc-url=http://localhost:8545 --chain custom_token ci_run zk_inception external-node init --ignore-prerequisites --chain custom_token + ci_run zk_inception external-node configs --db-url=postgres://postgres:notsecurepassword@localhost:5432 \ + --db-name=zksync_en_localhost_era_consensus --l1-rpc-url=http://localhost:8545 --chain consensus + ci_run zk_inception external-node init --ignore-prerequisites --chain consensus + - name: Run recovery tests (from snapshot) run: | @@ -180,9 +221,13 @@ jobs: ci_run zk_supervisor test recovery --snapshot --no-deps --ignore-prerequisites --verbose --chain custom_token &> ${{ env.SNAPSHOT_RECOVERY_LOGS_DIR }}//custom_token.log & PID3=$! + ci_run zk_supervisor test recovery --snapshot --no-deps --ignore-prerequisites --verbose --chain consensus &> ${{ env.SNAPSHOT_RECOVERY_LOGS_DIR }}//consensus.log & + PID4=$! + wait $PID1 wait $PID2 wait $PID3 + wait $PID4 - name: Run recovery tests (from genesis) run: | @@ -195,15 +240,20 @@ jobs: ci_run zk_supervisor test recovery --no-deps --no-kill --ignore-prerequisites --verbose --chain custom_token &> ${{ env.GENESIS_RECOVERY_LOGS_DIR }}/custom_token.log & PID3=$! + ci_run zk_supervisor test recovery --no-deps --no-kill --ignore-prerequisites --verbose --chain consensus &> ${{ env.GENESIS_RECOVERY_LOGS_DIR }}/consensus.log & + PID4=$! + wait $PID1 wait $PID2 wait $PID3 + wait $PID4 - name: Run external node server run: | ci_run zk_inception external-node run --ignore-prerequisites --chain era &> ${{ env.EXTERNAL_NODE_LOGS_DIR }}/rollup.log & ci_run zk_inception external-node run --ignore-prerequisites --chain validium &> ${{ env.EXTERNAL_NODE_LOGS_DIR }}/validium.log & ci_run zk_inception external-node run --ignore-prerequisites --chain custom_token &> ${{ env.EXTERNAL_NODE_LOGS_DIR }}/custom_token.log & + ci_run zk_inception external-node run --ignore-prerequisites --chain consensus --enable-consensus &> ${{ env.EXTERNAL_NODE_LOGS_DIR }}/consensus.log & ci_run sleep 5 - name: Run integration tests en @@ -217,9 +267,13 @@ jobs: ci_run zk_supervisor test integration --no-deps --ignore-prerequisites --external-node --chain custom_token &> ${{ env.INTEGRATION_TESTS_EN_LOGS_DIR }}/custom_token.log & PID3=$! + ci_run zk_supervisor test integration --no-deps --ignore-prerequisites --external-node --chain consensus &> ${{ env.INTEGRATION_TESTS_EN_LOGS_DIR }}/consensus.log & + PID4=$! + wait $PID1 wait $PID2 wait $PID3 + wait $PID4 - name: Run revert tests run: | @@ -234,10 +288,14 @@ jobs: ci_run zk_supervisor test revert --no-deps --external-node --no-kill --ignore-prerequisites --chain custom_token &> ${{ env.REVERT_LOGS_DIR }}/custom_token.log & PID3=$! + + ci_run zk_supervisor test revert --no-deps --external-node --no-kill --ignore-prerequisites --chain consensus &> ${{ env.REVERT_LOGS_DIR }}/consensus.log & + PID4=$! wait $PID1 wait $PID2 wait $PID3 + wait $PID4 # Upgrade tests should run last, because as soon as they diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 53c16911491..e05b84cda97 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -76,6 +76,7 @@ jobs: - 'etc/**' - 'contracts/**' - 'infrastructure/zk/**' + - 'docker/zk-environment/**' - '!**/*.md' - '!**/*.MD' diff --git a/Cargo.lock b/Cargo.lock index b755824c29e..22217d0ea31 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2,16 +2,6 @@ # It is not intended for manual editing. version = 3 -[[package]] -name = "Inflector" -version = "0.11.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe438c63458706e03479442743baae6c88256498e6431708f6dfc520a26515d3" -dependencies = [ - "lazy_static", - "regex", -] - [[package]] name = "addchain" version = "0.2.0" @@ -23,22 +13,13 @@ dependencies = [ "num-traits", ] -[[package]] -name = "addr2line" -version = "0.19.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a76fd60b23679b7d19bd066031410fb7e458ccc5e958eb5c325888ce4baedc97" -dependencies = [ - "gimli 0.27.3", -] - [[package]] name = "addr2line" version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb" dependencies = [ - "gimli 0.28.0", + "gimli", ] [[package]] @@ -54,7 +35,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d122413f284cf2d62fb1b7db97e02edb8cda96d769b16e443a4f6195e35662b0" dependencies = [ "crypto-common", - "generic-array 0.14.7", + "generic-array", ] [[package]] @@ -63,7 +44,7 @@ version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ac1f845298e95f983ff1944b728ae08b8cebab80d684f0a832ed0fc74dfa27e2" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "cipher", "cpufeatures", ] @@ -88,7 +69,7 @@ version = "0.7.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5a824f2aa7e75a0c98c5a504fceb80649e9c35265d44525b5f94de4771a395cd" dependencies = [ - "getrandom 0.2.10", + "getrandom", "once_cell", "version_check", ] @@ -99,8 +80,7 @@ version = "0.8.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "77c3a9648d43b9cd48db467b3f87fdd6e146bcc88ab0180006cef2179fe11d01" dependencies = [ - "cfg-if 1.0.0", - "getrandom 0.2.10", + "cfg-if", "once_cell", "version_check", "zerocopy", @@ -122,10085 +102,6833 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5" [[package]] -name = "alloy" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ba1c79677c9ce51c8d45e20845b05e6fb070ea2c863fba03ad6af2c778474bd" -dependencies = [ - "alloy-consensus", - "alloy-contract", - "alloy-core", - "alloy-eips", - "alloy-genesis", - "alloy-network", - "alloy-provider", - "alloy-pubsub", - "alloy-rpc-client", - "alloy-rpc-types", - "alloy-serde", - "alloy-signer", - "alloy-signer-local", - "alloy-transport", - "alloy-transport-http", - "alloy-transport-ipc", - "alloy-transport-ws", -] - -[[package]] -name = "alloy-chains" -version = "0.1.30" +name = "android-tzdata" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b4f201b0ac8f81315fbdc55269965a8ddadbc04ab47fa65a1a468f9a40f7a5f" -dependencies = [ - "num_enum 0.7.2", - "strum", -] +checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0" [[package]] -name = "alloy-consensus" -version = "0.1.4" +name = "android_system_properties" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da374e868f54c7f4ad2ad56829827badca388efd645f8cf5fccc61c2b5343504" +checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" dependencies = [ - "alloy-eips", - "alloy-primitives", - "alloy-rlp", - "alloy-serde", - "c-kzg", - "serde", + "libc", ] [[package]] -name = "alloy-contract" -version = "0.1.4" +name = "anes" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7dc6957ff706f9e5f6fd42f52a93e4bce476b726c92d077b348de28c4a76730c" -dependencies = [ - "alloy-dyn-abi", - "alloy-json-abi", - "alloy-network", - "alloy-primitives", - "alloy-provider", - "alloy-pubsub", - "alloy-rpc-types-eth", - "alloy-sol-types", - "alloy-transport", - "futures 0.3.30", - "futures-util", - "thiserror", -] +checksum = "4b46cbb362ab8752921c97e041f5e366ee6297bd428a31275b9fcf1e380f7299" [[package]] -name = "alloy-core" -version = "0.7.7" +name = "ansi_term" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "529fc6310dc1126c8de51c376cbc59c79c7f662bd742be7dc67055d5421a81b4" +checksum = "d52a9bb7ec0cf484c551830a7ce27bd20d67eac647e1befb56b0be4ee39a55d2" dependencies = [ - "alloy-dyn-abi", - "alloy-json-abi", - "alloy-primitives", - "alloy-sol-types", + "winapi", ] [[package]] -name = "alloy-dyn-abi" -version = "0.7.7" +name = "anstream" +version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "413902aa18a97569e60f679c23f46a18db1656d87ab4d4e49d0e1e52042f66df" +checksum = "2ab91ebe16eb252986481c5b62f6098f3b698a45e34b5b98200cf20dd2484a44" dependencies = [ - "alloy-json-abi", - "alloy-primitives", - "alloy-sol-type-parser", - "alloy-sol-types", - "const-hex", - "itoa", - "serde", - "serde_json", - "winnow 0.6.18", + "anstyle", + "anstyle-parse", + "anstyle-query", + "anstyle-wincon", + "colorchoice", + "utf8parse", ] [[package]] -name = "alloy-eips" -version = "0.1.4" +name = "anstyle" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f76ecab54890cdea1e4808fc0891c7e6cfcf71fe1a9fe26810c7280ef768f4ed" -dependencies = [ - "alloy-primitives", - "alloy-rlp", - "alloy-serde", - "c-kzg", - "derive_more 0.99.18", - "once_cell", - "serde", - "sha2 0.10.8", -] +checksum = "7079075b41f533b8c61d2a4d073c4676e1f8b249ff94a393b0595db304e0dd87" [[package]] -name = "alloy-genesis" -version = "0.1.4" +name = "anstyle-parse" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bca15afde1b6d15e3fc1c97421262b1bbb37aee45752e3c8b6d6f13f776554ff" +checksum = "317b9a89c1868f5ea6ff1d9539a69f45dffc21ce321ac1fd1160dfa48c8e2140" dependencies = [ - "alloy-primitives", - "alloy-serde", - "serde", + "utf8parse", ] [[package]] -name = "alloy-json-abi" -version = "0.7.7" +name = "anstyle-query" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc05b04ac331a9f07e3a4036ef7926e49a8bf84a99a1ccfc7e2ab55a5fcbb372" +checksum = "5ca11d4be1bab0c8bc8734a9aa7bf4ee8316d462a08c6ac5052f888fef5b494b" dependencies = [ - "alloy-primitives", - "alloy-sol-type-parser", - "serde", - "serde_json", + "windows-sys 0.48.0", ] [[package]] -name = "alloy-json-rpc" -version = "0.1.4" +name = "anstyle-wincon" +version = "3.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d6f34930b7e3e2744bcc79056c217f00cb2abb33bc5d4ff88da7623c5bb078b" +checksum = "f0699d10d2f4d628a98ee7b57b289abbc98ff3bad977cb3152709d4bf2330628" dependencies = [ - "alloy-primitives", - "serde", - "serde_json", - "thiserror", - "tracing", + "anstyle", + "windows-sys 0.48.0", ] [[package]] -name = "alloy-network" -version = "0.1.4" +name = "anyhow" +version = "1.0.80" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25f6895fc31b48fa12306ef9b4f78b7764f8bd6d7d91cdb0a40e233704a0f23f" -dependencies = [ - "alloy-consensus", - "alloy-eips", - "alloy-json-rpc", - "alloy-primitives", - "alloy-rpc-types-eth", - "alloy-serde", - "alloy-signer", - "alloy-sol-types", - "async-trait", - "auto_impl", - "futures-utils-wasm", - "thiserror", -] +checksum = "5ad32ce52e4161730f7098c077cd2ed6229b5804ccf99e5366be1ab72a98b4e1" [[package]] -name = "alloy-primitives" -version = "0.7.7" +name = "arr_macro" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ccb3ead547f4532bc8af961649942f0b9c16ee9226e26caa3f38420651cc0bf4" +checksum = "6a105bfda48707cf19220129e78fca01e9639433ffaef4163546ed8fb04120a5" dependencies = [ - "alloy-rlp", - "bytes", - "cfg-if 1.0.0", - "const-hex", - "derive_more 0.99.18", - "hex-literal", - "itoa", - "k256 0.13.3", - "keccak-asm", - "proptest", - "rand 0.8.5", - "ruint", - "serde", - "tiny-keccak 2.0.2", + "arr_macro_impl", + "proc-macro-hack", ] [[package]] -name = "alloy-provider" -version = "0.1.4" +name = "arr_macro_impl" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c538bfa893d07e27cb4f3c1ab5f451592b7c526d511d62b576a2ce59e146e4a" -dependencies = [ - "alloy-chains", - "alloy-consensus", - "alloy-eips", - "alloy-json-rpc", - "alloy-network", - "alloy-primitives", - "alloy-pubsub", - "alloy-rpc-client", - "alloy-rpc-types-eth", - "alloy-transport", - "alloy-transport-http", - "alloy-transport-ipc", - "alloy-transport-ws", - "async-stream", - "async-trait", - "auto_impl", - "dashmap", - "futures 0.3.30", - "futures-utils-wasm", - "lru", - "pin-project", - "reqwest 0.12.5", - "serde", - "serde_json", - "tokio", - "tracing", - "url", +checksum = "0609c78bd572f4edc74310dfb63a01f5609d53fa8b4dd7c4d98aef3b3e8d72d1" +dependencies = [ + "proc-macro-hack", + "quote 1.0.36", + "syn 1.0.109", ] [[package]] -name = "alloy-pubsub" -version = "0.1.4" +name = "arrayref" +version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a7341322d9bc0e49f6e9fd9f2eb8e30f73806f2dd12cbb3d6bab2694c921f87" -dependencies = [ - "alloy-json-rpc", - "alloy-primitives", - "alloy-transport", - "bimap", - "futures 0.3.30", - "serde", - "serde_json", - "tokio", - "tokio-stream", - "tower", - "tracing", -] +checksum = "6b4930d2cb77ce62f89ee5d5289b4ac049559b1c45539271f5ed4fdc7db34545" [[package]] -name = "alloy-rlp" -version = "0.3.8" +name = "arrayvec" +version = "0.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26154390b1d205a4a7ac7352aa2eb4f81f391399d4e2f546fb81a2f8bb383f62" +checksum = "cd9fd44efafa8690358b7408d253adf110036b88f55672a933f01d616ad9b1b9" dependencies = [ - "alloy-rlp-derive", - "arrayvec 0.7.4", - "bytes", + "nodrop", ] [[package]] -name = "alloy-rlp-derive" -version = "0.3.8" +name = "arrayvec" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d0f2d905ebd295e7effec65e5f6868d153936130ae718352771de3e7d03c75c" -dependencies = [ - "proc-macro2 1.0.86", - "quote 1.0.37", - "syn 2.0.72", -] +checksum = "23b62fc65de8e4e7f52534fb52b0f3ed04746ae267519eef2a83941e8085068b" [[package]] -name = "alloy-rpc-client" -version = "0.1.4" +name = "arrayvec" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ba31bae67773fd5a60020bea900231f8396202b7feca4d0c70c6b59308ab4a8" -dependencies = [ - "alloy-json-rpc", - "alloy-primitives", - "alloy-pubsub", - "alloy-transport", - "alloy-transport-http", - "alloy-transport-ipc", - "alloy-transport-ws", - "futures 0.3.30", - "pin-project", - "reqwest 0.12.5", - "serde", - "serde_json", - "tokio", - "tokio-stream", - "tower", - "tracing", - "url", -] +checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" [[package]] -name = "alloy-rpc-types" -version = "0.1.4" +name = "assert_matches" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "184a7a42c7ba9141cc9e76368356168c282c3bc3d9e5d78f3556bdfe39343447" -dependencies = [ - "alloy-rpc-types-engine", - "alloy-rpc-types-eth", - "alloy-serde", -] +checksum = "9b34d609dfbaf33d6889b2b7106d3ca345eacad44200913df5ba02bfd31d2ba9" [[package]] -name = "alloy-rpc-types-engine" -version = "0.1.4" +name = "async-channel" +version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e765962e3b82fd6f276a0873b5bd897e5d75a25f78fa9a6a21bd350d8e98a4e" +checksum = "89b47800b0be77592da0afd425cc03468052844aff33b84e33cc696f64e77b6a" dependencies = [ - "alloy-consensus", - "alloy-eips", - "alloy-primitives", - "alloy-rlp", - "alloy-rpc-types-eth", - "alloy-serde", - "jsonwebtoken", - "rand 0.8.5", - "serde", - "thiserror", + "concurrent-queue", + "event-listener-strategy", + "futures-core", + "pin-project-lite", ] [[package]] -name = "alloy-rpc-types-eth" -version = "0.1.4" +name = "async-executor" +version = "1.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab4123ee21f99ba4bd31bfa36ba89112a18a500f8b452f02b35708b1b951e2b9" +checksum = "30ca9a001c1e8ba5149f91a74362376cc6bc5b919d92d988668657bd570bdcec" dependencies = [ - "alloy-consensus", - "alloy-eips", - "alloy-primitives", - "alloy-rlp", - "alloy-serde", - "alloy-sol-types", - "itertools 0.13.0", - "serde", - "serde_json", - "thiserror", + "async-task", + "concurrent-queue", + "fastrand", + "futures-lite", + "slab", ] [[package]] -name = "alloy-serde" -version = "0.1.4" +name = "async-fs" +version = "2.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9416c52959e66ead795a11f4a86c248410e9e368a0765710e57055b8a1774dd6" +checksum = "ebcd09b382f40fcd159c2d695175b2ae620ffa5f3bd6f664131efff4e8b9e04a" dependencies = [ - "alloy-primitives", - "serde", - "serde_json", + "async-lock", + "blocking", + "futures-lite", ] [[package]] -name = "alloy-signer" -version = "0.1.4" +name = "async-io" +version = "2.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b33753c09fa1ad85e5b092b8dc2372f1e337a42e84b9b4cff9fede75ba4adb32" +checksum = "444b0228950ee6501b3568d3c93bf1176a1fdbc3b758dcd9475046d30f4dc7e8" dependencies = [ - "alloy-primitives", - "async-trait", - "auto_impl", - "elliptic-curve 0.13.8", - "k256 0.13.3", - "thiserror", + "async-lock", + "cfg-if", + "concurrent-queue", + "futures-io", + "futures-lite", + "parking", + "polling", + "rustix", + "slab", + "tracing", + "windows-sys 0.59.0", ] [[package]] -name = "alloy-signer-local" -version = "0.1.4" +name = "async-lock" +version = "3.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6dfc9c26fe6c6f1bad818c9a976de9044dd12e1f75f1f156a801ee3e8148c1b6" +checksum = "ff6e472cdea888a4bd64f342f09b3f50e1886d32afe8df3d663c01140b811b18" dependencies = [ - "alloy-consensus", - "alloy-network", - "alloy-primitives", - "alloy-signer", - "async-trait", - "k256 0.13.3", - "rand 0.8.5", - "thiserror", + "event-listener 5.3.1", + "event-listener-strategy", + "pin-project-lite", ] [[package]] -name = "alloy-sol-macro" -version = "0.7.7" +name = "async-net" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b40397ddcdcc266f59f959770f601ce1280e699a91fc1862f29cef91707cd09" +checksum = "b948000fad4873c1c9339d60f2623323a0cfd3816e5181033c6a5cb68b2accf7" dependencies = [ - "alloy-sol-macro-expander", - "alloy-sol-macro-input", - "proc-macro-error", - "proc-macro2 1.0.86", - "quote 1.0.37", - "syn 2.0.72", + "async-io", + "blocking", + "futures-lite", ] [[package]] -name = "alloy-sol-macro-expander" -version = "0.7.7" +name = "async-process" +version = "2.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "867a5469d61480fea08c7333ffeca52d5b621f5ca2e44f271b117ec1fc9a0525" +checksum = "a8a07789659a4d385b79b18b9127fc27e1a59e1e89117c78c5ea3b806f016374" dependencies = [ - "alloy-json-abi", - "alloy-sol-macro-input", - "const-hex", - "heck 0.5.0", - "indexmap 2.1.0", - "proc-macro-error", - "proc-macro2 1.0.86", - "quote 1.0.37", - "syn 2.0.72", - "syn-solidity", - "tiny-keccak 2.0.2", + "async-channel", + "async-io", + "async-lock", + "async-signal", + "async-task", + "blocking", + "cfg-if", + "event-listener 5.3.1", + "futures-lite", + "rustix", + "tracing", + "windows-sys 0.59.0", ] [[package]] -name = "alloy-sol-macro-input" -version = "0.7.7" +name = "async-signal" +version = "0.2.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e482dc33a32b6fadbc0f599adea520bd3aaa585c141a80b404d0a3e3fa72528" +checksum = "637e00349800c0bdf8bfc21ebbc0b6524abea702b0da4168ac00d070d0c0b9f3" dependencies = [ - "alloy-json-abi", - "const-hex", - "dunce", - "heck 0.5.0", - "proc-macro2 1.0.86", - "quote 1.0.37", - "serde_json", - "syn 2.0.72", - "syn-solidity", + "async-io", + "async-lock", + "atomic-waker", + "cfg-if", + "futures-core", + "futures-io", + "rustix", + "signal-hook-registry", + "slab", + "windows-sys 0.59.0", ] [[package]] -name = "alloy-sol-type-parser" -version = "0.7.7" +name = "async-stream" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cbcba3ca07cf7975f15d871b721fb18031eec8bce51103907f6dcce00b255d98" +checksum = "cd56dd203fef61ac097dd65721a419ddccb106b2d2b70ba60a6b529f03961a51" dependencies = [ - "serde", - "winnow 0.6.18", + "async-stream-impl", + "futures-core", + "pin-project-lite", ] [[package]] -name = "alloy-sol-types" -version = "0.7.7" +name = "async-stream-impl" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a91ca40fa20793ae9c3841b83e74569d1cc9af29a2f5237314fd3452d51e38c7" +checksum = "16e62a023e7c117e27523144c5d2459f4397fcc3cab0085af8e2224f643a0193" dependencies = [ - "alloy-json-abi", - "alloy-primitives", - "alloy-sol-macro", - "const-hex", - "serde", + "proc-macro2 1.0.86", + "quote 1.0.36", + "syn 2.0.72", ] [[package]] -name = "alloy-transport" -version = "0.1.4" +name = "async-task" +version = "4.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01b51a291f949f755e6165c3ed562883175c97423703703355f4faa4b7d0a57c" -dependencies = [ - "alloy-json-rpc", - "base64 0.22.1", - "futures-util", - "futures-utils-wasm", - "serde", - "serde_json", - "thiserror", - "tokio", - "tower", - "tracing", - "url", -] +checksum = "8b75356056920673b02621b35afd0f7dda9306d03c79a30f5c56c44cf256e3de" [[package]] -name = "alloy-transport-http" -version = "0.1.4" +name = "async-trait" +version = "0.1.74" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86d65871f9f1cafe1ed25cde2f1303be83e6473e995a2d56c275ae4fcce6119c" +checksum = "a66537f1bb974b254c98ed142ff995236e81b9d0fe4db0575f46612cb15eb0f9" dependencies = [ - "alloy-json-rpc", - "alloy-transport", - "reqwest 0.12.5", - "serde_json", - "tower", - "tracing", - "url", + "proc-macro2 1.0.86", + "quote 1.0.36", + "syn 2.0.72", ] [[package]] -name = "alloy-transport-ipc" -version = "0.1.4" +name = "atoi" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd7fbc8b6282ce41b01cbddef7bffb133fe6e1bf65dcd39770d45a905c051179" +checksum = "f28d99ec8bfea296261ca1af174f24225171fea9664ba9003cbebee704810528" dependencies = [ - "alloy-json-rpc", - "alloy-pubsub", - "alloy-transport", - "bytes", - "futures 0.3.30", - "interprocess", - "pin-project", - "serde_json", - "tokio", - "tokio-util", - "tracing", + "num-traits", ] [[package]] -name = "alloy-transport-ws" -version = "0.1.4" +name = "atomic-take" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aec83fd052684556c78c54df111433493267234d82321c2236560c752f595f20" -dependencies = [ - "alloy-pubsub", - "alloy-transport", - "futures 0.3.30", - "http 1.1.0", - "rustls 0.23.10", - "serde_json", - "tokio", - "tokio-tungstenite", - "tracing", - "ws_stream_wasm", -] +checksum = "a8ab6b55fe97976e46f91ddbed8d147d966475dc29b2032757ba47e02376fbc3" [[package]] -name = "android-tzdata" -version = "0.1.1" +name = "atomic-waker" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0" +checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" [[package]] -name = "android_system_properties" -version = "0.1.5" +name = "atty" +version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" +checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" dependencies = [ + "hermit-abi 0.1.19", "libc", + "winapi", ] [[package]] -name = "anes" -version = "0.1.6" +name = "autocfg" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b46cbb362ab8752921c97e041f5e366ee6297bd428a31275b9fcf1e380f7299" +checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" [[package]] -name = "ansi_term" -version = "0.12.1" +name = "aws-lc-rs" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d52a9bb7ec0cf484c551830a7ce27bd20d67eac647e1befb56b0be4ee39a55d2" +checksum = "a8a47f2fb521b70c11ce7369a6c5fa4bd6af7e5d62ec06303875bafe7c6ba245" dependencies = [ - "winapi", + "aws-lc-sys", + "mirai-annotations", + "paste", + "zeroize", ] [[package]] -name = "anstream" -version = "0.6.4" +name = "aws-lc-sys" +version = "0.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2ab91ebe16eb252986481c5b62f6098f3b698a45e34b5b98200cf20dd2484a44" +checksum = "2927c7af777b460b7ccd95f8b67acd7b4c04ec8896bf0c8e80ba30523cffc057" dependencies = [ - "anstyle", - "anstyle-parse", - "anstyle-query", - "anstyle-wincon", - "colorchoice", - "utf8parse", + "bindgen 0.69.4", + "cc", + "cmake", + "dunce", + "fs_extra", + "libc", + "paste", ] [[package]] -name = "anstyle" -version = "1.0.4" +name = "axum" +version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7079075b41f533b8c61d2a4d073c4676e1f8b249ff94a393b0595db304e0dd87" +checksum = "3a6c9af12842a67734c9a2e355436e5d03b22383ed60cf13cd0c18fbfe3dcbcf" +dependencies = [ + "async-trait", + "axum-core", + "bytes", + "futures-util", + "http 1.1.0", + "http-body 1.0.0", + "http-body-util", + "hyper 1.3.1", + "hyper-util", + "itoa", + "matchit", + "memchr", + "mime", + "multer", + "percent-encoding", + "pin-project-lite", + "rustversion", + "serde", + "serde_json", + "serde_path_to_error", + "serde_urlencoded", + "sync_wrapper 1.0.1", + "tokio", + "tower", + "tower-layer", + "tower-service", + "tracing", +] [[package]] -name = "anstyle-parse" -version = "0.2.2" +name = "axum-core" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "317b9a89c1868f5ea6ff1d9539a69f45dffc21ce321ac1fd1160dfa48c8e2140" +checksum = "a15c63fd72d41492dc4f497196f5da1fb04fb7529e631d73630d1b491e47a2e3" dependencies = [ - "utf8parse", + "async-trait", + "bytes", + "futures-util", + "http 1.1.0", + "http-body 1.0.0", + "http-body-util", + "mime", + "pin-project-lite", + "rustversion", + "sync_wrapper 0.1.2", + "tower-layer", + "tower-service", + "tracing", ] [[package]] -name = "anstyle-query" -version = "1.0.0" +name = "backon" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ca11d4be1bab0c8bc8734a9aa7bf4ee8316d462a08c6ac5052f888fef5b494b" +checksum = "d67782c3f868daa71d3533538e98a8e13713231969def7536e8039606fc46bf0" dependencies = [ - "windows-sys 0.48.0", + "fastrand", + "futures-core", + "pin-project", + "tokio", ] [[package]] -name = "anstyle-wincon" -version = "3.0.1" +name = "backtrace" +version = "0.3.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0699d10d2f4d628a98ee7b57b289abbc98ff3bad977cb3152709d4bf2330628" +checksum = "2089b7e3f35b9dd2d0ed921ead4f6d318c27680d4a5bd167b3ee120edb105837" dependencies = [ - "anstyle", - "windows-sys 0.48.0", + "addr2line", + "cc", + "cfg-if", + "libc", + "miniz_oxide", + "object", + "rustc-demangle", ] [[package]] -name = "anyhow" -version = "1.0.87" +name = "base16ct" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10f00e1f6e58a40e807377c75c6a7f97bf9044fab57816f2414e6f5f4499d7b8" +checksum = "349a06037c7bf932dd7e7d1f653678b2038b9ad46a74102f1fc7bd7872678cce" [[package]] -name = "aquamarine" -version = "0.5.0" +name = "base16ct" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21cc1548309245035eb18aa7f0967da6bc65587005170c56e6ef2788a4cf3f4e" -dependencies = [ - "include_dir", - "itertools 0.10.5", - "proc-macro-error", - "proc-macro2 1.0.86", - "quote 1.0.37", - "syn 2.0.72", -] +checksum = "4c7f02d4ea65f2c1853089ffd8d2787bdbc63de2f0d29dedbcf8ccdfa0ccd4cf" [[package]] -name = "ark-bls12-377" -version = "0.4.0" +name = "base58" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb00293ba84f51ce3bd026bd0de55899c4e68f0a39a5728cebae3a73ffdc0a4f" -dependencies = [ - "ark-ec", - "ark-ff 0.4.2", - "ark-std 0.4.0", -] +checksum = "6107fe1be6682a68940da878d9e9f5e90ca5745b3dec9fd1bb393c8777d4f581" [[package]] -name = "ark-bls12-377-ext" -version = "0.4.1" +name = "base64" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "20c7021f180a0cbea0380eba97c2af3c57074cdaffe0eef7e840e1c9f2841e55" -dependencies = [ - "ark-bls12-377", - "ark-ec", - "ark-models-ext", - "ark-std 0.4.0", -] +checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" [[package]] -name = "ark-bls12-381" -version = "0.4.0" +name = "base64" +version = "0.21.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c775f0d12169cba7aae4caeb547bb6a50781c7449a8aa53793827c9ec4abf488" -dependencies = [ - "ark-ec", - "ark-ff 0.4.2", - "ark-serialize 0.4.2", - "ark-std 0.4.0", -] +checksum = "35636a1494ede3b646cc98f74f8e62c773a38a659ebc777a2cf26b9b74171df9" [[package]] -name = "ark-bls12-381-ext" -version = "0.4.1" +name = "base64" +version = "0.22.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1dc4b3d08f19e8ec06e949712f95b8361e43f1391d94f65e4234df03480631c" -dependencies = [ - "ark-bls12-381", - "ark-ec", - "ark-ff 0.4.2", - "ark-models-ext", - "ark-serialize 0.4.2", - "ark-std 0.4.0", -] +checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" [[package]] -name = "ark-bw6-761" -version = "0.4.0" +name = "base64ct" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e0605daf0cc5aa2034b78d008aaf159f56901d92a52ee4f6ecdfdac4f426700" -dependencies = [ - "ark-bls12-377", - "ark-ec", - "ark-ff 0.4.2", - "ark-std 0.4.0", -] +checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b" [[package]] -name = "ark-bw6-761-ext" -version = "0.4.1" +name = "basic-toml" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ccee5fba47266f460067588ee1bf070a9c760bf2050c1c509982c5719aadb4f2" +checksum = "7bfc506e7a2370ec239e1d072507b2a80c833083699d3c6fa176fbb4de8448c6" dependencies = [ - "ark-bw6-761", - "ark-ec", - "ark-ff 0.4.2", - "ark-models-ext", - "ark-std 0.4.0", + "serde", ] [[package]] -name = "ark-ec" -version = "0.4.2" +name = "beef" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "defd9a439d56ac24968cca0571f598a61bc8c55f71d50a89cda591cb750670ba" +checksum = "3a8241f3ebb85c056b509d4327ad0358fbbba6ffb340bf388f26350aeda225b1" dependencies = [ - "ark-ff 0.4.2", - "ark-poly", - "ark-serialize 0.4.2", - "ark-std 0.4.0", - "derivative", - "hashbrown 0.13.2", - "itertools 0.10.5", - "num-traits", - "rayon", - "zeroize", + "serde", ] [[package]] -name = "ark-ed-on-bls12-377" -version = "0.4.0" +name = "bigdecimal" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b10d901b9ac4b38f9c32beacedfadcdd64e46f8d7f8e88c1ae1060022cf6f6c6" +checksum = "51d712318a27c7150326677b321a5fa91b55f6d9034ffd67f20319e147d40cee" dependencies = [ - "ark-bls12-377", - "ark-ec", - "ark-ff 0.4.2", - "ark-std 0.4.0", + "autocfg", + "libm", + "num-bigint 0.4.6", + "num-integer", + "num-traits", ] [[package]] -name = "ark-ed-on-bls12-377-ext" -version = "0.4.1" +name = "bincode" +version = "1.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "524a4fb7540df2e1a8c2e67a83ba1d1e6c3947f4f9342cc2359fc2e789ad731d" +checksum = "b1f45e9417d87227c7a56d22e471c6206462cba514c7590c09aff4cf6d1ddcad" dependencies = [ - "ark-ec", - "ark-ed-on-bls12-377", - "ark-ff 0.4.2", - "ark-models-ext", - "ark-std 0.4.0", + "serde", ] [[package]] -name = "ark-ed-on-bls12-381-bandersnatch" -version = "0.4.0" +name = "bindgen" +version = "0.65.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9cde0f2aa063a2a5c28d39b47761aa102bda7c13c84fc118a61b87c7b2f785c" +checksum = "cfdf7b466f9a4903edc73f95d6d2bcd5baf8ae620638762244d3f60143643cc5" dependencies = [ - "ark-bls12-381", - "ark-ec", - "ark-ff 0.4.2", - "ark-std 0.4.0", + "bitflags 1.3.2", + "cexpr", + "clang-sys", + "lazy_static", + "lazycell", + "peeking_take_while", + "prettyplease", + "proc-macro2 1.0.86", + "quote 1.0.36", + "regex", + "rustc-hash", + "shlex", + "syn 2.0.72", ] [[package]] -name = "ark-ed-on-bls12-381-bandersnatch-ext" -version = "0.4.1" +name = "bindgen" +version = "0.69.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d15185f1acb49a07ff8cbe5f11a1adc5a93b19e211e325d826ae98e98e124346" +checksum = "a00dc851838a2120612785d195287475a3ac45514741da670b735818822129a0" dependencies = [ - "ark-ec", - "ark-ed-on-bls12-381-bandersnatch", - "ark-ff 0.4.2", - "ark-models-ext", - "ark-std 0.4.0", + "bitflags 2.6.0", + "cexpr", + "clang-sys", + "itertools 0.12.0", + "lazy_static", + "lazycell", + "log", + "prettyplease", + "proc-macro2 1.0.86", + "quote 1.0.36", + "regex", + "rustc-hash", + "shlex", + "syn 2.0.72", + "which", ] [[package]] -name = "ark-ff" -version = "0.3.0" +name = "bip39" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b3235cc41ee7a12aaaf2c575a2ad7b46713a8a50bda2fc3b003a04845c05dd6" +checksum = "93f2635620bf0b9d4576eb7bb9a38a55df78bd1205d26fa994b25911a69f212f" dependencies = [ - "ark-ff-asm 0.3.0", - "ark-ff-macros 0.3.0", - "ark-serialize 0.3.0", - "ark-std 0.3.0", - "derivative", - "num-bigint 0.4.6", - "num-traits", - "paste", - "rustc_version 0.3.3", - "zeroize", + "bitcoin_hashes", + "serde", + "unicode-normalization", ] [[package]] -name = "ark-ff" -version = "0.4.2" +name = "bit-vec" +version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec847af850f44ad29048935519032c33da8aa03340876d351dfab5660d2966ba" +checksum = "349f9b6a179ed607305526ca489b34ad0a41aed5f7980fa90eb03160b69598fb" dependencies = [ - "ark-ff-asm 0.4.2", - "ark-ff-macros 0.4.2", - "ark-serialize 0.4.2", - "ark-std 0.4.0", - "derivative", - "digest 0.10.7", - "itertools 0.10.5", - "num-bigint 0.4.6", - "num-traits", - "paste", - "rustc_version 0.4.0", - "zeroize", + "serde", ] [[package]] -name = "ark-ff-asm" -version = "0.3.0" +name = "bitcoin_hashes" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db02d390bf6643fb404d3d22d31aee1c4bc4459600aef9113833d17e786c6e44" -dependencies = [ - "quote 1.0.37", - "syn 1.0.109", -] +checksum = "90064b8dee6815a6470d60bad07bbbaee885c0e12d04177138fa3291a01b7bc4" [[package]] -name = "ark-ff-asm" -version = "0.4.2" +name = "bitflags" +version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ed4aa4fe255d0bc6d79373f7e31d2ea147bcf486cba1be5ba7ea85abdb92348" -dependencies = [ - "quote 1.0.37", - "syn 1.0.109", -] +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] -name = "ark-ff-macros" -version = "0.3.0" +name = "bitflags" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db2fd794a08ccb318058009eefdf15bcaaaaf6f8161eb3345f907222bac38b20" +checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" dependencies = [ - "num-bigint 0.4.6", - "num-traits", - "quote 1.0.37", - "syn 1.0.109", + "serde", ] [[package]] -name = "ark-ff-macros" -version = "0.4.2" +name = "bitmaps" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7abe79b0e4288889c4574159ab790824d0033b9fdcb2a112a3182fac2e514565" +checksum = "031043d04099746d8db04daf1fa424b2bc8bd69d92b25962dcde24da39ab64a2" dependencies = [ - "num-bigint 0.4.6", - "num-traits", - "proc-macro2 1.0.86", - "quote 1.0.37", - "syn 1.0.109", + "typenum", ] [[package]] -name = "ark-models-ext" -version = "0.4.1" +name = "bitvec" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e9eab5d4b5ff2f228b763d38442adc9b084b0a465409b059fac5c2308835ec2" +checksum = "1bc2832c24239b0141d5674bb9174f9d68a8b5b3f2753311927c172ca46f7e9c" dependencies = [ - "ark-ec", - "ark-ff 0.4.2", - "ark-serialize 0.4.2", - "ark-std 0.4.0", - "derivative", + "funty", + "radium", + "tap", + "wyz", ] [[package]] -name = "ark-poly" -version = "0.4.2" +name = "blake2" +version = "0.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d320bfc44ee185d899ccbadfa8bc31aab923ce1558716e1997a1e74057fe86bf" +checksum = "0a4e37d16930f5459780f5621038b6382b9bb37c19016f39fb6b5808d831f174" dependencies = [ - "ark-ff 0.4.2", - "ark-serialize 0.4.2", - "ark-std 0.4.0", - "derivative", - "hashbrown 0.13.2", + "crypto-mac", + "digest 0.9.0", + "opaque-debug", ] [[package]] -name = "ark-scale" -version = "0.0.12" +name = "blake2" +version = "0.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f69c00b3b529be29528a6f2fd5fa7b1790f8bed81b9cdca17e326538545a179" +checksum = "46502ad458c9a52b69d4d4d32775c788b7a1b85e8bc9d482d92250fc0e3f8efe" dependencies = [ - "ark-ec", - "ark-ff 0.4.2", - "ark-serialize 0.4.2", - "ark-std 0.4.0", - "parity-scale-codec", - "scale-info", + "digest 0.10.7", ] [[package]] -name = "ark-secret-scalar" -version = "0.0.2" -source = "git+https://github.com/w3f/ring-vrf?rev=e9782f9#e9782f938629c90f3adb3fff2358bc8d1386af3e" +name = "blake2-rfc" +version = "0.2.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d6d530bdd2d52966a6d03b7a964add7ae1a288d25214066fd4b600f0f796400" dependencies = [ - "ark-ec", - "ark-ff 0.4.2", - "ark-serialize 0.4.2", - "ark-std 0.4.0", - "ark-transcript 0.0.2 (git+https://github.com/w3f/ring-vrf?rev=e9782f9)", - "digest 0.10.7", - "getrandom_or_panic", - "zeroize", + "arrayvec 0.4.12", + "constant_time_eq 0.1.5", ] [[package]] -name = "ark-serialize" -version = "0.3.0" +name = "blake2-rfc_bellman_edition" +version = "0.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d6c2b318ee6e10f8c2853e73a83adc0ccb88995aa978d8a3408d492ab2ee671" +checksum = "fdc60350286c7c3db13b98e91dbe5c8b6830a6821bc20af5b0c310ce94d74915" dependencies = [ - "ark-std 0.3.0", - "digest 0.9.0", + "arrayvec 0.4.12", + "byteorder", + "constant_time_eq 0.1.5", ] [[package]] -name = "ark-serialize" -version = "0.4.2" +name = "blake2_ce" +version = "0.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adb7b85a02b83d2f22f89bd5cac66c9c89474240cb6207cb1efc16d098e822a5" +checksum = "90cef65f11dd09a6c58914148161dbf190e5dcc02c87ed2aa47b3b97d3e7ce76" dependencies = [ - "ark-serialize-derive", - "ark-std 0.4.0", "digest 0.10.7", - "num-bigint 0.4.6", ] [[package]] -name = "ark-serialize-derive" -version = "0.4.2" +name = "blake2b_simd" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae3281bc6d0fd7e549af32b52511e1302185bd688fd3359fa36423346ff682ea" +checksum = "23285ad32269793932e830392f2fe2f83e26488fd3ec778883a93c8323735780" dependencies = [ - "proc-macro2 1.0.86", - "quote 1.0.37", - "syn 1.0.109", + "arrayref", + "arrayvec 0.7.4", + "constant_time_eq 0.3.1", ] [[package]] -name = "ark-std" -version = "0.3.0" +name = "blake2s_simd" +version = "0.5.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1df2c09229cbc5a028b1d70e00fdb2acee28b1055dfb5ca73eea49c5a25c4e7c" +checksum = "9e461a7034e85b211a4acb57ee2e6730b32912b06c08cc242243c39fc21ae6a2" dependencies = [ - "num-traits", - "rand 0.8.5", + "arrayref", + "arrayvec 0.5.2", + "constant_time_eq 0.1.5", ] [[package]] -name = "ark-std" -version = "0.4.0" +name = "block-buffer" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94893f1e0c6eeab764ade8dc4c0db24caf4fe7cbbaafc0eba0a9030f447b5185" +checksum = "4152116fd6e9dadb291ae18fc1ec3575ed6d84c29642d97890f4b4a3417297e4" dependencies = [ - "num-traits", - "rand 0.8.5", - "rayon", + "block-padding", + "generic-array", ] [[package]] -name = "ark-transcript" -version = "0.0.2" -source = "git+https://github.com/w3f/ring-vrf?rev=e9782f9#e9782f938629c90f3adb3fff2358bc8d1386af3e" +name = "block-buffer" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" dependencies = [ - "ark-ff 0.4.2", - "ark-serialize 0.4.2", - "ark-std 0.4.0", - "digest 0.10.7", - "rand_core 0.6.4", - "sha3 0.10.8", + "generic-array", ] [[package]] -name = "ark-transcript" -version = "0.0.2" -source = "git+https://github.com/w3f/ring-vrf#0fef8266d851932ad25d6b41bc4b34d834d1e11d" +name = "block-padding" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d696c370c750c948ada61c69a0ee2cbbb9c50b1019ddb86d9317157a99c2cae" + +[[package]] +name = "block_reverter" +version = "0.1.0" dependencies = [ - "ark-ff 0.4.2", - "ark-serialize 0.4.2", - "ark-std 0.4.0", - "digest 0.10.7", - "rand_core 0.6.4", - "sha3 0.10.8", + "anyhow", + "clap 4.4.6", + "serde_json", + "tokio", + "zksync_block_reverter", + "zksync_config", + "zksync_core_leftovers", + "zksync_dal", + "zksync_env_config", + "zksync_object_store", + "zksync_protobuf_config", + "zksync_types", + "zksync_vlog", ] [[package]] -name = "arr_macro" -version = "0.1.3" +name = "blocking" +version = "1.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a105bfda48707cf19220129e78fca01e9639433ffaef4163546ed8fb04120a5" +checksum = "703f41c54fc768e63e091340b424302bb1c29ef4aa0c7f10fe849dfb114d29ea" dependencies = [ - "arr_macro_impl", - "proc-macro-hack", + "async-channel", + "async-task", + "futures-io", + "futures-lite", + "piper", ] [[package]] -name = "arr_macro_impl" -version = "0.1.3" +name = "blst" +version = "0.3.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0609c78bd572f4edc74310dfb63a01f5609d53fa8b4dd7c4d98aef3b3e8d72d1" +checksum = "4378725facc195f1a538864863f6de233b500a8862747e7f165078a419d5e874" dependencies = [ - "proc-macro-hack", - "quote 1.0.37", - "syn 1.0.109", + "cc", + "glob", + "threadpool", + "zeroize", ] [[package]] -name = "array-bytes" -version = "6.2.3" +name = "boojum" +version = "0.30.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d5dde061bd34119e902bbb2d9b90c5692635cf59fb91d582c2b68043f1b8293" +checksum = "68ec2f007ff8f90cc459f03e9f30ca1065440170f013c868823646e2e48d0234" +dependencies = [ + "arrayvec 0.7.4", + "bincode", + "blake2 0.10.6", + "const_format", + "convert_case 0.6.0", + "crossbeam", + "crypto-bigint 0.5.3", + "derivative", + "ethereum-types", + "firestorm", + "itertools 0.10.5", + "lazy_static", + "num-modular", + "num_cpus", + "rand 0.8.5", + "rayon", + "serde", + "sha2 0.10.8", + "sha3_ce", + "smallvec", + "unroll", + "zksync_cs_derive", + "zksync_pairing", +] [[package]] -name = "array-init" -version = "0.0.4" +name = "borsh" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23589ecb866b460d3a0f1278834750268c607e8e28a1b982c907219f3178cd72" +checksum = "26d4d6dafc1a3bb54687538972158f07b2c948bc57d5890df22c0739098b3028" dependencies = [ - "nodrop", + "borsh-derive", + "cfg_aliases", ] [[package]] -name = "arrayref" -version = "0.3.7" +name = "borsh-derive" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b4930d2cb77ce62f89ee5d5289b4ac049559b1c45539271f5ed4fdc7db34545" +checksum = "bf4918709cc4dd777ad2b6303ed03cb37f3ca0ccede8c1b0d28ac6db8f4710e0" +dependencies = [ + "once_cell", + "proc-macro-crate 2.0.0", + "proc-macro2 1.0.86", + "quote 1.0.36", + "syn 2.0.72", + "syn_derive", +] [[package]] -name = "arrayvec" -version = "0.4.12" +name = "bs58" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd9fd44efafa8690358b7408d253adf110036b88f55672a933f01d616ad9b1b9" +checksum = "bf88ba1141d185c399bee5288d850d63b8369520c1eafc32a0430b5b6c287bf4" dependencies = [ - "nodrop", + "tinyvec", ] [[package]] -name = "arrayvec" -version = "0.5.2" +name = "build_html" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23b62fc65de8e4e7f52534fb52b0f3ed04746ae267519eef2a83941e8085068b" +checksum = "225eb82ce9e70dcc0cfa6e404d0f353326b6e163bf500ec4711cec317d11935c" [[package]] -name = "arrayvec" -version = "0.7.4" +name = "bumpalo" +version = "3.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" +checksum = "7f30e7476521f6f8af1a1c4c0b8cc94f0bee37d91763d0ca2665f299b6cd8aec" [[package]] -name = "assert_matches" -version = "1.5.0" +name = "byte-slice-cast" +version = "1.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b34d609dfbaf33d6889b2b7106d3ca345eacad44200913df5ba02bfd31d2ba9" +checksum = "c3ac9f8b63eca6fd385229b3675f6cc0dc5c8a5c8a54a59d4f52ffd670d87b0c" [[package]] -name = "async-channel" -version = "2.3.1" +name = "bytecheck" +version = "0.6.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89b47800b0be77592da0afd425cc03468052844aff33b84e33cc696f64e77b6a" +checksum = "8b6372023ac861f6e6dc89c8344a8f398fb42aaba2b5dbc649ca0c0e9dbcb627" dependencies = [ - "concurrent-queue", - "event-listener-strategy", - "futures-core", - "pin-project-lite", + "bytecheck_derive", + "ptr_meta", + "simdutf8", ] [[package]] -name = "async-executor" -version = "1.13.1" +name = "bytecheck_derive" +version = "0.6.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30ca9a001c1e8ba5149f91a74362376cc6bc5b919d92d988668657bd570bdcec" +checksum = "a7ec4c6f261935ad534c0c22dbef2201b45918860eb1c574b972bd213a76af61" dependencies = [ - "async-task", - "concurrent-queue", - "fastrand", - "futures-lite", - "slab", + "proc-macro2 1.0.86", + "quote 1.0.36", + "syn 1.0.109", ] [[package]] -name = "async-fs" -version = "2.1.2" +name = "bytecount" +version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ebcd09b382f40fcd159c2d695175b2ae620ffa5f3bd6f664131efff4e8b9e04a" -dependencies = [ - "async-lock", - "blocking", - "futures-lite", -] +checksum = "d1a12477b7237a01c11a80a51278165f9ba0edd28fa6db00a65ab230320dc58c" [[package]] -name = "async-io" -version = "2.3.4" +name = "byteorder" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "444b0228950ee6501b3568d3c93bf1176a1fdbc3b758dcd9475046d30f4dc7e8" -dependencies = [ - "async-lock", - "cfg-if 1.0.0", - "concurrent-queue", - "futures-io", - "futures-lite", - "parking", - "polling", - "rustix 0.38.34", - "slab", - "tracing", - "windows-sys 0.59.0", -] +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] -name = "async-lock" -version = "3.4.0" +name = "bytes" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff6e472cdea888a4bd64f342f09b3f50e1886d32afe8df3d663c01140b811b18" -dependencies = [ - "event-listener 5.3.1", - "event-listener-strategy", - "pin-project-lite", -] +checksum = "514de17de45fdb8dc022b1a7975556c53c86f9f0aa5f534b98977b171857c2c9" [[package]] -name = "async-net" -version = "2.0.0" +name = "bytesize" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b948000fad4873c1c9339d60f2623323a0cfd3816e5181033c6a5cb68b2accf7" -dependencies = [ - "async-io", - "blocking", - "futures-lite", -] +checksum = "a3e368af43e418a04d52505cf3dbc23dda4e3407ae2fa99fd0e4f308ce546acc" [[package]] -name = "async-process" -version = "2.2.4" +name = "bzip2-sys" +version = "0.1.11+1.0.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8a07789659a4d385b79b18b9127fc27e1a59e1e89117c78c5ea3b806f016374" +checksum = "736a955f3fa7875102d57c82b8cac37ec45224a07fd32d58f9f7a186b6cd4cdc" dependencies = [ - "async-channel", - "async-io", - "async-lock", - "async-signal", - "async-task", - "blocking", - "cfg-if 1.0.0", - "event-listener 5.3.1", - "futures-lite", - "rustix 0.38.34", - "tracing", - "windows-sys 0.59.0", + "cc", + "libc", + "pkg-config", ] [[package]] -name = "async-signal" -version = "0.2.10" +name = "camino" +version = "1.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "637e00349800c0bdf8bfc21ebbc0b6524abea702b0da4168ac00d070d0c0b9f3" +checksum = "c59e92b5a388f549b863a7bea62612c09f24c8393560709a54558a9abdfb3b9c" dependencies = [ - "async-io", - "async-lock", - "atomic-waker", - "cfg-if 1.0.0", - "futures-core", - "futures-io", - "rustix 0.38.34", - "signal-hook-registry", - "slab", - "windows-sys 0.59.0", + "serde", ] [[package]] -name = "async-stream" -version = "0.3.5" +name = "cargo-platform" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd56dd203fef61ac097dd65721a419ddccb106b2d2b70ba60a6b529f03961a51" +checksum = "12024c4645c97566567129c204f65d5815a8c9aecf30fcbe682b2fe034996d36" dependencies = [ - "async-stream-impl", - "futures-core", - "pin-project-lite", + "serde", ] [[package]] -name = "async-stream-impl" -version = "0.3.5" +name = "cargo_metadata" +version = "0.14.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16e62a023e7c117e27523144c5d2459f4397fcc3cab0085af8e2224f643a0193" +checksum = "4acbb09d9ee8e23699b9634375c72795d095bf268439da88562cf9b501f181fa" dependencies = [ - "proc-macro2 1.0.86", - "quote 1.0.37", - "syn 2.0.72", + "camino", + "cargo-platform", + "semver", + "serde", + "serde_json", ] [[package]] -name = "async-task" -version = "4.7.1" +name = "cast" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b75356056920673b02621b35afd0f7dda9306d03c79a30f5c56c44cf256e3de" +checksum = "37b2a672a2cb129a2e41c10b1224bb368f9f37a2b16b612598138befd7b37eb5" [[package]] -name = "async-trait" -version = "0.1.74" +name = "cc" +version = "1.1.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a66537f1bb974b254c98ed142ff995236e81b9d0fe4db0575f46612cb15eb0f9" +checksum = "50d2eb3cd3d1bf4529e31c215ee6f93ec5a3d536d9f578f93d9d33ee19562932" dependencies = [ - "proc-macro2 1.0.86", - "quote 1.0.37", - "syn 2.0.72", + "jobserver", + "libc", + "shlex", ] [[package]] -name = "async_io_stream" -version = "0.3.3" +name = "cesu8" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6d7b9decdf35d8908a7e3ef02f64c5e9b1695e230154c0e8de3969142d9b94c" -dependencies = [ - "futures 0.3.30", - "pharos", - "rustc_version 0.4.0", -] +checksum = "6d43a04d8753f35258c91f8ec639f792891f748a1edbd759cf1dcea3382ad83c" [[package]] -name = "atoi" -version = "2.0.0" +name = "cexpr" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f28d99ec8bfea296261ca1af174f24225171fea9664ba9003cbebee704810528" +checksum = "6fac387a98bb7c37292057cffc56d62ecb629900026402633ae9160df93a8766" dependencies = [ - "num-traits", + "nom", ] [[package]] -name = "atomic-take" -version = "1.1.0" +name = "cfg-if" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8ab6b55fe97976e46f91ddbed8d147d966475dc29b2032757ba47e02376fbc3" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] -name = "atomic-waker" -version = "1.1.2" +name = "cfg_aliases" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" +checksum = "fd16c4719339c4530435d38e511904438d07cce7950afa3718a84ac36c10e89e" [[package]] -name = "atty" -version = "0.2.14" +name = "chacha20" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" +checksum = "c3613f74bd2eac03dad61bd53dbe620703d4371614fe0bc3b9f04dd36fe4e818" dependencies = [ - "hermit-abi 0.1.19", - "libc", - "winapi", + "cfg-if", + "cipher", + "cpufeatures", ] [[package]] -name = "auto_impl" -version = "1.2.0" +name = "chacha20poly1305" +version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c87f3f15e7794432337fc718554eaa4dc8f04c9677a950ffe366f20a162ae42" +checksum = "10cd79432192d1c0f4e1a0fef9527696cc039165d729fb41b3f4f4f354c2dc35" dependencies = [ - "proc-macro2 1.0.86", - "quote 1.0.37", - "syn 2.0.72", + "aead", + "chacha20", + "cipher", + "poly1305", + "zeroize", ] [[package]] -name = "autocfg" -version = "1.1.0" +name = "chrono" +version = "0.4.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" - -[[package]] -name = "avail-base" -version = "0.1.0" -source = "git+https://github.com/availproject/avail?tag=v2.2.5.0-rc1#fe7e86296d8fb0e664ff614cc04b022dc92a813d" +checksum = "a21f936df1771bf62b77f047b726c4625ff2e8aa607c01ec06e5a05bd8463401" dependencies = [ - "avail-core", - "binary-merkle-tree", - "derive_more 0.99.18", - "frame-support", - "itertools 0.10.5", - "log", - "once_cell", - "parity-scale-codec", - "sp-api", - "sp-core", - "sp-io", - "sp-runtime", - "sp-runtime-interface 24.0.0 (git+https://github.com/availproject/polkadot-sdk.git?tag=polkadot-1.7.1-patch-8)", - "sp-std 14.0.0 (git+https://github.com/availproject/polkadot-sdk.git?tag=polkadot-1.7.1-patch-8)", - "substrate-prometheus-endpoint", + "android-tzdata", + "iana-time-zone", + "js-sys", + "num-traits", + "serde", + "wasm-bindgen", + "windows-targets 0.52.6", ] [[package]] -name = "avail-core" -version = "0.6.2" -source = "git+https://github.com/availproject/avail-core?tag=core-node-1#659628aa1e5e8b1563c1218b890185e70b61dda6" +name = "ciborium" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "effd91f6c78e5a4ace8a5d3c0b6bfaec9e2baaef55f3efc00e45fb2e477ee926" dependencies = [ - "binary-merkle-tree", - "bounded-collections", - "derive_more 0.99.18", - "ethabi-decode", - "frame-support", - "hash256-std-hasher", - "hex", - "log", - "parity-scale-codec", - "scale-info", + "ciborium-io", + "ciborium-ll", "serde", - "sp-arithmetic", - "sp-core", - "sp-io", - "sp-runtime", - "sp-runtime-interface 24.0.0 (git+https://github.com/availproject/polkadot-sdk.git?tag=polkadot-1.7.1-patch-8)", - "sp-std 14.0.0 (git+https://github.com/availproject/polkadot-sdk.git?tag=polkadot-1.7.1-patch-8)", - "sp-trie", - "static_assertions", - "thiserror-no-std", - "tiny-keccak 2.0.2", ] [[package]] -name = "avail-subxt" -version = "0.5.0" -source = "git+https://github.com/availproject/avail?tag=v2.2.5.0-rc1#fe7e86296d8fb0e664ff614cc04b022dc92a813d" -dependencies = [ - "anyhow", - "avail-base", - "avail-core", - "bounded-collections", - "curve25519-dalek 2.1.3", - "derive_more 0.99.18", - "futures 0.3.30", - "hex", - "jsonrpsee 0.22.5", - "num_enum 0.5.11", - "parity-scale-codec", - "scale-info", - "schnorrkel 0.9.1", - "serde", - "serde-hex", - "serde_json", - "sp-core", - "sp-runtime", - "structopt", - "subxt", - "tokio", - "tokio-util", -] +name = "ciborium-io" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cdf919175532b369853f5d5e20b26b43112613fd6fe7aee757e35f7a44642656" [[package]] -name = "avail_client" -version = "0.1.0" +name = "ciborium-ll" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "defaa24ecc093c77630e6c15e17c51f5e187bf35ee514f4e2d67baaa96dae22b" dependencies = [ - "alloy", - "anyhow", - "async-trait", - "avail-core", - "avail-subxt", - "da_config", - "da_utils", - "proto_config", - "reqwest 0.12.5", - "serde", - "subxt-signer", - "tokio", - "zksync_da_client", - "zksync_env_config", - "zksync_node_framework", + "ciborium-io", + "half", ] [[package]] -name = "aws-lc-rs" -version = "1.8.0" +name = "cipher" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8a47f2fb521b70c11ce7369a6c5fa4bd6af7e5d62ec06303875bafe7c6ba245" +checksum = "773f3b9af64447d2ce9850330c473515014aa235e6a783b02db81ff39e4a3dad" dependencies = [ - "aws-lc-sys", - "mirai-annotations", - "paste", + "crypto-common", + "inout", "zeroize", ] [[package]] -name = "aws-lc-sys" -version = "0.19.0" +name = "circuit_encodings" +version = "0.140.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2927c7af777b460b7ccd95f8b67acd7b4c04ec8896bf0c8e80ba30523cffc057" +checksum = "b8438d7af992b730143b679e2c6938cb9e0193897ecaf668c59189af8ac296b7" dependencies = [ - "bindgen 0.69.4", - "cc", - "cmake", - "dunce", - "fs_extra", - "libc", - "paste", + "derivative", + "serde", + "zk_evm 0.140.0", + "zkevm_circuits 0.140.2", ] [[package]] -name = "axum" -version = "0.7.5" +name = "circuit_encodings" +version = "0.141.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a6c9af12842a67734c9a2e355436e5d03b22383ed60cf13cd0c18fbfe3dcbcf" +checksum = "01a2fcc80e97682104f355dd819cb4972583828a6c0f65ec26889a78a84b0c56" dependencies = [ - "async-trait", - "axum-core", - "bytes", - "futures-util", - "http 1.1.0", - "http-body 1.0.0", - "http-body-util", - "hyper 1.3.1", - "hyper-util", - "itoa", - "matchit", - "memchr", - "mime", - "multer", - "percent-encoding", - "pin-project-lite", - "rustversion", + "derivative", "serde", - "serde_json", - "serde_path_to_error", - "serde_urlencoded", - "sync_wrapper 1.0.1", - "tokio", - "tower", - "tower-layer", - "tower-service", - "tracing", + "zk_evm 0.141.0", + "zkevm_circuits 0.141.1", ] [[package]] -name = "axum-core" -version = "0.4.3" +name = "circuit_encodings" +version = "0.142.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a15c63fd72d41492dc4f497196f5da1fb04fb7529e631d73630d1b491e47a2e3" +checksum = "94be7afb5ace6024d6e3c105d521b4b9b563bac14a92c2f59c4683e9169a25d8" dependencies = [ - "async-trait", - "bytes", - "futures-util", - "http 1.1.0", - "http-body 1.0.0", - "http-body-util", - "mime", - "pin-project-lite", - "rustversion", - "sync_wrapper 0.1.2", - "tower-layer", - "tower-service", - "tracing", + "derivative", + "serde", + "zk_evm 0.141.0", + "zkevm_circuits 0.141.1", ] [[package]] -name = "backon" -version = "0.4.4" +name = "circuit_encodings" +version = "0.150.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d67782c3f868daa71d3533538e98a8e13713231969def7536e8039606fc46bf0" +checksum = "e67617688c66640c84f9b98ff26d48f7898dca4faeb45241a4f21ec333788e7b" dependencies = [ - "fastrand", - "futures-core", - "pin-project", - "tokio", + "derivative", + "serde", + "zk_evm 0.150.5", + "zkevm_circuits 0.150.5", ] [[package]] -name = "backtrace" -version = "0.3.69" +name = "circuit_sequencer_api" +version = "0.133.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2089b7e3f35b9dd2d0ed921ead4f6d318c27680d4a5bd167b3ee120edb105837" +checksum = "eb959b1f8c6bbd8be711994d182e85452a26a5d2213a709290b71c8262af1331" dependencies = [ - "addr2line 0.21.0", - "cc", - "cfg-if 1.0.0", - "libc", - "miniz_oxide", - "object 0.32.1", - "rustc-demangle", + "derivative", + "rayon", + "serde", + "zk_evm 0.133.0", + "zksync_bellman", ] [[package]] -name = "bandersnatch_vrfs" -version = "0.0.4" -source = "git+https://github.com/w3f/ring-vrf?rev=e9782f9#e9782f938629c90f3adb3fff2358bc8d1386af3e" +name = "circuit_sequencer_api" +version = "0.140.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa5f22311ce609d852d7d9f4943535ea4610aeb785129ae6ff83d5201c4fb387" dependencies = [ - "ark-bls12-381", - "ark-ec", - "ark-ed-on-bls12-381-bandersnatch", - "ark-ff 0.4.2", - "ark-serialize 0.4.2", - "ark-std 0.4.0", - "dleq_vrf", - "fflonk", - "merlin 3.0.0", - "rand_chacha 0.3.1", - "rand_core 0.6.4", - "ring 0.1.0", - "sha2 0.10.8", - "sp-ark-bls12-381", - "sp-ark-ed-on-bls12-381-bandersnatch", - "zeroize", + "circuit_encodings 0.140.1", + "derivative", + "rayon", + "serde", + "zk_evm 0.140.0", + "zksync_bellman", ] [[package]] -name = "base16ct" -version = "0.1.1" +name = "circuit_sequencer_api" +version = "0.141.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "349a06037c7bf932dd7e7d1f653678b2038b9ad46a74102f1fc7bd7872678cce" +checksum = "4c47c71d6ba83a8beb0af13af70beffd627f5497caf3d44c6f96363e788b07ea" +dependencies = [ + "circuit_encodings 0.141.1", + "derivative", + "rayon", + "serde", + "zk_evm 0.141.0", + "zksync_bellman", +] [[package]] -name = "base16ct" -version = "0.2.0" +name = "circuit_sequencer_api" +version = "0.142.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c7f02d4ea65f2c1853089ffd8d2787bdbc63de2f0d29dedbcf8ccdfa0ccd4cf" +checksum = "e264723359e6a1aad98110bdccf1ae3ad596e93e7d31da9e40f6adc07e4add54" +dependencies = [ + "circuit_encodings 0.142.1", + "derivative", + "rayon", + "serde", + "zk_evm 0.141.0", + "zksync_bellman", +] [[package]] -name = "base58" -version = "0.2.0" +name = "circuit_sequencer_api" +version = "0.150.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6107fe1be6682a68940da878d9e9f5e90ca5745b3dec9fd1bb393c8777d4f581" +checksum = "21017310971d4a051e4a52ad70eed11d1ae69defeca8314f73a3a4bad16705a9" +dependencies = [ + "circuit_encodings 0.150.5", + "derivative", + "rayon", + "serde", + "zksync_bellman", +] [[package]] -name = "base64" -version = "0.13.1" +name = "clang-sys" +version = "1.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" +checksum = "c688fc74432808e3eb684cae8830a86be1d66a2bd58e1f248ed0960a590baf6f" +dependencies = [ + "glob", + "libc", + "libloading", +] [[package]] -name = "base64" -version = "0.21.5" +name = "clap" +version = "2.34.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35636a1494ede3b646cc98f74f8e62c773a38a659ebc777a2cf26b9b74171df9" +checksum = "a0610544180c38b88101fecf2dd634b174a62eef6946f84dfc6a7127512b381c" +dependencies = [ + "ansi_term", + "atty", + "bitflags 1.3.2", + "strsim 0.8.0", + "textwrap 0.11.0", + "unicode-width", + "vec_map", +] [[package]] -name = "base64" -version = "0.22.1" +name = "clap" +version = "3.2.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" - -[[package]] -name = "base64ct" -version = "1.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b" +checksum = "4ea181bf566f71cb9a5d17a59e1871af638180a18fb0035c92ae62b705207123" +dependencies = [ + "bitflags 1.3.2", + "clap_lex 0.2.4", + "indexmap 1.9.3", + "textwrap 0.16.0", +] [[package]] -name = "basic-toml" -version = "0.1.4" +name = "clap" +version = "4.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7bfc506e7a2370ec239e1d072507b2a80c833083699d3c6fa176fbb4de8448c6" +checksum = "d04704f56c2cde07f43e8e2c154b43f216dc5c92fc98ada720177362f953b956" dependencies = [ - "serde", + "clap_builder", + "clap_derive", ] [[package]] -name = "beef" -version = "0.5.2" +name = "clap_builder" +version = "4.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a8241f3ebb85c056b509d4327ad0358fbbba6ffb340bf388f26350aeda225b1" +checksum = "0e231faeaca65ebd1ea3c737966bf858971cd38c3849107aa3ea7de90a804e45" dependencies = [ - "serde", + "anstream", + "anstyle", + "clap_lex 0.5.1", + "strsim 0.10.0", ] [[package]] -name = "bellman_ce" -version = "0.7.0" +name = "clap_derive" +version = "4.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ea340d5c1394ee4daf4415dd80e06f74e0ad9b08e21f73f6bb1fa3a9dfae80d" +checksum = "0862016ff20d69b84ef8247369fabf5c008a7417002411897d40ee1f4532b873" dependencies = [ - "arrayvec 0.7.4", - "bit-vec", - "blake2s_const", - "blake2s_simd", - "byteorder", - "cfg-if 1.0.0", - "crossbeam 0.7.3", - "futures 0.3.30", - "hex", - "lazy_static", - "num_cpus", - "pairing_ce", - "rand 0.4.6", - "serde", - "smallvec 1.13.1", - "tiny-keccak 1.5.0", + "heck 0.4.1", + "proc-macro2 1.0.86", + "quote 1.0.36", + "syn 2.0.72", ] [[package]] -name = "bigdecimal" -version = "0.4.5" +name = "clap_lex" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51d712318a27c7150326677b321a5fa91b55f6d9034ffd67f20319e147d40cee" +checksum = "2850f2f5a82cbf437dd5af4d49848fbdfc27c157c3d010345776f952765261c5" dependencies = [ - "autocfg", - "libm", - "num-bigint 0.4.6", - "num-integer", - "num-traits", + "os_str_bytes", ] [[package]] -name = "bimap" -version = "0.6.3" +name = "clap_lex" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "230c5f1ca6a325a32553f8640d31ac9b49f2411e901e427570154868b46da4f7" +checksum = "cd7cc57abe963c6d3b9d8be5b06ba7c8957a930305ca90304f24ef040aa6f961" [[package]] -name = "binary-merkle-tree" -version = "13.0.0" -source = "git+https://github.com/availproject/polkadot-sdk.git?tag=polkadot-1.7.1-patch-8#fdbd3a9cb323c191bc90bacf79112800c64c6d8a" +name = "cmake" +version = "0.1.50" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a31c789563b815f77f4250caee12365734369f942439b7defd71e18a48197130" dependencies = [ - "hash-db", - "log", + "cc", ] [[package]] -name = "bincode" -version = "1.3.3" +name = "codegen" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1f45e9417d87227c7a56d22e471c6206462cba514c7590c09aff4cf6d1ddcad" +checksum = "ff61280aed771c3070e7dcc9e050c66f1eb1e3b96431ba66f9f74641d02fc41d" dependencies = [ - "serde", + "indexmap 1.9.3", ] [[package]] -name = "bindgen" -version = "0.65.1" +name = "colorchoice" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cfdf7b466f9a4903edc73f95d6d2bcd5baf8ae620638762244d3f60143643cc5" +checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7" + +[[package]] +name = "combine" +version = "4.6.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba5a308b75df32fe02788e748662718f03fde005016435c444eea572398219fd" dependencies = [ - "bitflags 1.3.2", - "cexpr", - "clang-sys", - "lazy_static", - "lazycell", - "peeking_take_while", - "prettyplease", - "proc-macro2 1.0.86", - "quote 1.0.37", - "regex", - "rustc-hash", - "shlex", - "syn 2.0.72", + "bytes", + "memchr", ] [[package]] -name = "bindgen" -version = "0.69.4" +name = "compile-fmt" +version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a00dc851838a2120612785d195287475a3ac45514741da670b735818822129a0" +checksum = "bed69047ed42e52c7e38d6421eeb8ceefb4f2a2b52eed59137f7bad7908f6800" + +[[package]] +name = "concurrent-queue" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ca0197aee26d1ae37445ee532fefce43251d24cc7c166799f4d46817f1d3973" dependencies = [ - "bitflags 2.6.0", - "cexpr", - "clang-sys", - "itertools 0.12.0", - "lazy_static", - "lazycell", - "log", - "prettyplease", - "proc-macro2 1.0.86", - "quote 1.0.37", - "regex", - "rustc-hash", - "shlex", - "syn 2.0.72", - "which", + "crossbeam-utils", ] [[package]] -name = "bip39" -version = "2.0.0" +name = "console" +version = "0.15.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93f2635620bf0b9d4576eb7bb9a38a55df78bd1205d26fa994b25911a69f212f" +checksum = "c926e00cc70edefdc64d3a5ff31cc65bb97a3460097762bd23afb4d8145fccf8" dependencies = [ - "bitcoin_hashes", - "rand 0.8.5", - "rand_core 0.6.4", - "serde", - "unicode-normalization", + "encode_unicode", + "lazy_static", + "libc", + "windows-sys 0.45.0", ] [[package]] -name = "bit-set" -version = "0.5.3" +name = "const-oid" +version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0700ddab506f33b20a03b13996eccd309a48e5ff77d0d95926aa0210fb4e95f1" +checksum = "28c122c3980598d243d63d9a704629a2d748d101f278052ff068be5a4423ab6f" + +[[package]] +name = "const_format" +version = "0.2.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3a214c7af3d04997541b18d432afaff4c455e79e2029079647e72fc2bd27673" dependencies = [ - "bit-vec", + "const_format_proc_macros", ] [[package]] -name = "bit-vec" -version = "0.6.3" +name = "const_format_proc_macros" +version = "0.2.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "349f9b6a179ed607305526ca489b34ad0a41aed5f7980fa90eb03160b69598fb" +checksum = "c7f6ff08fd20f4f299298a28e2dfa8a8ba1036e6cd2460ac1de7b425d76f2500" dependencies = [ - "serde", + "proc-macro2 1.0.86", + "quote 1.0.36", + "unicode-xid 0.2.4", ] [[package]] -name = "bitcoin_hashes" -version = "0.11.0" +name = "constant_time_eq" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90064b8dee6815a6470d60bad07bbbaee885c0e12d04177138fa3291a01b7bc4" +checksum = "245097e9a4535ee1e3e3931fcfcd55a796a44c643e8596ff6566d68f09b87bbc" [[package]] -name = "bitflags" -version = "1.3.2" +name = "constant_time_eq" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" +checksum = "7c74b8349d32d297c9134b8c88677813a227df8f779daa29bfc29c183fe3dca6" [[package]] -name = "bitflags" -version = "2.6.0" +name = "convert_case" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" -dependencies = [ - "serde", -] +checksum = "6245d59a3e82a7fc217c5828a6692dbc6dfb63a0c8c90495621f7b9d79704a0e" [[package]] -name = "bitmaps" -version = "2.1.0" +name = "convert_case" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "031043d04099746d8db04daf1fa424b2bc8bd69d92b25962dcde24da39ab64a2" +checksum = "ec182b0ca2f35d8fc196cf3404988fd8b8c739a4d270ff118a398feb0cbec1ca" dependencies = [ - "typenum", + "unicode-segmentation", ] [[package]] -name = "bitvec" -version = "1.0.1" +name = "core-foundation" +version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bc2832c24239b0141d5674bb9174f9d68a8b5b3f2753311927c172ca46f7e9c" +checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" dependencies = [ - "funty", - "radium", - "tap", - "wyz", + "core-foundation-sys", + "libc", ] [[package]] -name = "blake2" -version = "0.9.2" +name = "core-foundation-sys" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a4e37d16930f5459780f5621038b6382b9bb37c19016f39fb6b5808d831f174" -dependencies = [ - "crypto-mac 0.8.0", - "digest 0.9.0", - "opaque-debug 0.3.0", -] +checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" [[package]] -name = "blake2" -version = "0.10.6" +name = "cpufeatures" +version = "0.2.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46502ad458c9a52b69d4d4d32775c788b7a1b85e8bc9d482d92250fc0e3f8efe" +checksum = "3fbc60abd742b35f2492f808e1abbb83d45f72db402e14c55057edc9c7b1e9e4" dependencies = [ - "digest 0.10.7", + "libc", ] [[package]] -name = "blake2-rfc" -version = "0.2.18" +name = "crc" +version = "3.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d6d530bdd2d52966a6d03b7a964add7ae1a288d25214066fd4b600f0f796400" +checksum = "86ec7a15cbe22e59248fc7eadb1907dab5ba09372595da4d73dd805ed4417dfe" dependencies = [ - "arrayvec 0.4.12", - "constant_time_eq 0.1.5", + "crc-catalog", ] [[package]] -name = "blake2-rfc_bellman_edition" -version = "0.0.1" +name = "crc-catalog" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fdc60350286c7c3db13b98e91dbe5c8b6830a6821bc20af5b0c310ce94d74915" -dependencies = [ - "arrayvec 0.4.12", - "byteorder", - "constant_time_eq 0.1.5", -] +checksum = "19d374276b40fb8bbdee95aef7c7fa6b5316ec764510eb64b8dd0e2ed0d7e7f5" [[package]] -name = "blake2_ce" -version = "0.10.6" +name = "crc32fast" +version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90cef65f11dd09a6c58914148161dbf190e5dcc02c87ed2aa47b3b97d3e7ce76" +checksum = "b540bd8bc810d3885c6ea91e2018302f68baba2129ab3e88f32389ee9370880d" dependencies = [ - "digest 0.10.7", + "cfg-if", ] [[package]] -name = "blake2b_simd" -version = "1.0.2" +name = "criterion" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23285ad32269793932e830392f2fe2f83e26488fd3ec778883a93c8323735780" +checksum = "e7c76e09c1aae2bc52b3d2f29e13c6572553b30c4aa1b8a49fd70de6412654cb" dependencies = [ - "arrayref", - "arrayvec 0.7.4", - "constant_time_eq 0.3.1", + "anes", + "atty", + "cast", + "ciborium", + "clap 3.2.25", + "criterion-plot", + "itertools 0.10.5", + "lazy_static", + "num-traits", + "oorandom", + "plotters", + "rayon", + "regex", + "serde", + "serde_derive", + "serde_json", + "tinytemplate", + "walkdir", ] [[package]] -name = "blake2s_const" -version = "0.7.0" +name = "criterion-plot" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f39d933cb38939f885001867874c65699c36f30f0c78aae9f4c9f01b3e4b306a" +checksum = "6b50826342786a51a89e2da3a28f1c32b06e387201bc2d19791f622c673706b1" dependencies = [ - "arrayref", - "arrayvec 0.5.2", - "constant_time_eq 0.1.5", + "cast", + "itertools 0.10.5", ] [[package]] -name = "blake2s_simd" -version = "0.5.11" +name = "crossbeam" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e461a7034e85b211a4acb57ee2e6730b32912b06c08cc242243c39fc21ae6a2" +checksum = "1137cd7e7fc0fb5d3c5a8678be38ec56e819125d8d7907411fe24ccb943faca8" dependencies = [ - "arrayref", - "arrayvec 0.5.2", - "constant_time_eq 0.1.5", + "crossbeam-channel", + "crossbeam-deque", + "crossbeam-epoch", + "crossbeam-queue", + "crossbeam-utils", ] [[package]] -name = "block-buffer" -version = "0.7.3" +name = "crossbeam-channel" +version = "0.5.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0940dc441f31689269e10ac70eb1002a3a1d3ad1390e030043662eb7fe4688b" +checksum = "33480d6946193aa8033910124896ca395333cae7e2d1113d1fef6c3272217df2" dependencies = [ - "block-padding 0.1.5", - "byte-tools", - "byteorder", - "generic-array 0.12.4", + "crossbeam-utils", ] [[package]] -name = "block-buffer" -version = "0.9.0" +name = "crossbeam-deque" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4152116fd6e9dadb291ae18fc1ec3575ed6d84c29642d97890f4b4a3417297e4" +checksum = "613f8cc01fe9cf1a3eb3d7f488fd2fa8388403e97039e2f73692932e291a770d" dependencies = [ - "block-padding 0.2.1", - "generic-array 0.14.7", + "crossbeam-epoch", + "crossbeam-utils", ] [[package]] -name = "block-buffer" -version = "0.10.4" +name = "crossbeam-epoch" +version = "0.9.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" +checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" dependencies = [ - "generic-array 0.14.7", + "crossbeam-utils", ] [[package]] -name = "block-padding" -version = "0.1.5" +name = "crossbeam-queue" +version = "0.3.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa79dedbb091f449f1f39e53edf88d5dbe95f895dae6135a8d7b881fb5af73f5" +checksum = "df0346b5d5e76ac2fe4e327c5fd1118d6be7c51dfb18f9b7922923f287471e35" dependencies = [ - "byte-tools", + "crossbeam-utils", ] [[package]] -name = "block-padding" -version = "0.2.1" +name = "crossbeam-utils" +version = "0.8.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d696c370c750c948ada61c69a0ee2cbbb9c50b1019ddb86d9317157a99c2cae" +checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80" [[package]] -name = "block_reverter" -version = "0.1.0" -dependencies = [ - "anyhow", - "clap 4.4.6", - "serde_json", - "tokio", - "zksync_block_reverter", - "zksync_config", - "zksync_core_leftovers", - "zksync_dal", - "zksync_env_config", - "zksync_object_store", - "zksync_protobuf_config", - "zksync_types", - "zksync_vlog", -] +name = "crunchy" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" [[package]] -name = "blocking" -version = "1.6.1" +name = "crypto-bigint" +version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "703f41c54fc768e63e091340b424302bb1c29ef4aa0c7f10fe849dfb114d29ea" +checksum = "ef2b4b23cddf68b89b8f8069890e8c270d54e2d5fe1b143820234805e4cb17ef" dependencies = [ - "async-channel", - "async-task", - "futures-io", - "futures-lite", - "piper", + "generic-array", + "rand_core 0.6.4", + "subtle", + "zeroize", ] [[package]] -name = "blst" -version = "0.3.13" +name = "crypto-bigint" +version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4378725facc195f1a538864863f6de233b500a8862747e7f165078a419d5e874" +checksum = "740fe28e594155f10cfc383984cbefd529d7396050557148f79cb0f621204124" dependencies = [ - "cc", - "glob", - "threadpool", + "generic-array", + "rand_core 0.6.4", + "subtle", "zeroize", ] [[package]] -name = "boojum" -version = "0.2.2" +name = "crypto-common" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df88daa33db46d683967ca09a4f04817c38950483f2501a771d497669a8a4bb1" +checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" dependencies = [ - "arrayvec 0.7.4", - "bincode", - "blake2 0.10.6", - "const_format", - "convert_case 0.6.0", - "crossbeam 0.8.4", - "crypto-bigint 0.5.3", - "cs_derive", - "derivative", - "ethereum-types", - "firestorm", - "itertools 0.10.5", - "lazy_static", - "num-modular", - "num_cpus", - "pairing_ce", - "rand 0.8.5", - "rayon", - "serde", - "sha2 0.10.8", - "sha3_ce", - "smallvec 1.13.1", - "unroll", + "generic-array", + "rand_core 0.6.4", + "typenum", ] [[package]] -name = "borsh" -version = "1.3.0" +name = "crypto-mac" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26d4d6dafc1a3bb54687538972158f07b2c948bc57d5890df22c0739098b3028" +checksum = "b584a330336237c1eecd3e94266efb216c56ed91225d634cb2991c5f3fd1aeab" dependencies = [ - "borsh-derive", - "cfg_aliases", + "generic-array", + "subtle", ] [[package]] -name = "borsh-derive" -version = "1.3.0" +name = "cs_derive" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf4918709cc4dd777ad2b6303ed03cb37f3ca0ccede8c1b0d28ac6db8f4710e0" +checksum = "24cf603ca4299c6e20e644da88897f7b81d688510f4887e818b0bfe0b792081b" dependencies = [ - "once_cell", - "proc-macro-crate 2.0.0", + "proc-macro-error", "proc-macro2 1.0.86", - "quote 1.0.37", + "quote 1.0.36", + "syn 1.0.109", +] + +[[package]] +name = "ctor" +version = "0.2.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "edb49164822f3ee45b17acd4a208cfc1251410cf0cad9a833234c9890774dd9f" +dependencies = [ + "quote 1.0.36", "syn 2.0.72", - "syn_derive", ] [[package]] -name = "bounded-collections" -version = "0.2.0" +name = "ctr" +version = "0.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d32385ecb91a31bddaf908e8dcf4a15aef1bcd3913cc03ebfad02ff6d568abc1" +checksum = "0369ee1ad671834580515889b80f2ea915f23b8be8d0daa4bbaf2ac5c7590835" dependencies = [ - "log", - "parity-scale-codec", - "scale-info", - "serde", + "cipher", ] [[package]] -name = "bs58" -version = "0.5.1" +name = "ctrlc" +version = "3.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf88ba1141d185c399bee5288d850d63b8369520c1eafc32a0430b5b6c287bf4" +checksum = "82e95fbd621905b854affdc67943b043a0fbb6ed7385fd5a25650d19a8a6cfdf" dependencies = [ - "tinyvec", + "nix", + "windows-sys 0.48.0", ] [[package]] -name = "build_html" -version = "2.4.0" +name = "curve25519-dalek" +version = "4.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3108fe6fe7ac796fb7625bdde8fa2b67b5a7731496251ca57c7b8cadd78a16a1" +checksum = "97fb8b7c4503de7d6ae7b42ab72a5a59857b4c937ec27a3d4539dba95b5ab2be" +dependencies = [ + "cfg-if", + "cpufeatures", + "curve25519-dalek-derive", + "digest 0.10.7", + "fiat-crypto", + "rustc_version", + "subtle", + "zeroize", +] [[package]] -name = "bumpalo" -version = "3.14.0" +name = "curve25519-dalek-derive" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f30e7476521f6f8af1a1c4c0b8cc94f0bee37d91763d0ca2665f299b6cd8aec" +checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" +dependencies = [ + "proc-macro2 1.0.86", + "quote 1.0.36", + "syn 2.0.72", +] [[package]] -name = "byte-slice-cast" -version = "1.2.2" +name = "darling" +version = "0.13.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3ac9f8b63eca6fd385229b3675f6cc0dc5c8a5c8a54a59d4f52ffd670d87b0c" +checksum = "a01d95850c592940db9b8194bc39f4bc0e89dee5c4265e4b1807c34a9aba453c" +dependencies = [ + "darling_core 0.13.4", + "darling_macro 0.13.4", +] [[package]] -name = "byte-tools" -version = "0.3.1" +name = "darling" +version = "0.14.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3b5ca7a04898ad4bcd41c90c5285445ff5b791899bb1b0abdd2a2aa791211d7" +checksum = "7b750cb3417fd1b327431a470f388520309479ab0bf5e323505daf0290cd3850" +dependencies = [ + "darling_core 0.14.4", + "darling_macro 0.14.4", +] [[package]] -name = "bytecheck" -version = "0.6.11" +name = "darling" +version = "0.20.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b6372023ac861f6e6dc89c8344a8f398fb42aaba2b5dbc649ca0c0e9dbcb627" +checksum = "6f63b86c8a8826a49b8c21f08a2d07338eec8d900540f8630dc76284be802989" dependencies = [ - "bytecheck_derive", - "ptr_meta", - "simdutf8", + "darling_core 0.20.10", + "darling_macro 0.20.10", ] [[package]] -name = "bytecheck_derive" -version = "0.6.11" +name = "darling_core" +version = "0.13.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7ec4c6f261935ad534c0c22dbef2201b45918860eb1c574b972bd213a76af61" +checksum = "859d65a907b6852c9361e3185c862aae7fafd2887876799fa55f5f99dc40d610" dependencies = [ + "fnv", + "ident_case", "proc-macro2 1.0.86", - "quote 1.0.37", + "quote 1.0.36", + "strsim 0.10.0", "syn 1.0.109", ] [[package]] -name = "bytecount" -version = "0.6.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d1a12477b7237a01c11a80a51278165f9ba0edd28fa6db00a65ab230320dc58c" +name = "darling_core" +version = "0.14.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "109c1ca6e6b7f82cc233a97004ea8ed7ca123a9af07a8230878fcfda9b158bf0" +dependencies = [ + "fnv", + "ident_case", + "proc-macro2 1.0.86", + "quote 1.0.36", + "strsim 0.10.0", + "syn 1.0.109", +] [[package]] -name = "byteorder" -version = "1.5.0" +name = "darling_core" +version = "0.20.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" +checksum = "95133861a8032aaea082871032f5815eb9e98cef03fa916ab4500513994df9e5" +dependencies = [ + "fnv", + "ident_case", + "proc-macro2 1.0.86", + "quote 1.0.36", + "strsim 0.11.1", + "syn 2.0.72", +] [[package]] -name = "bytes" -version = "1.6.0" +name = "darling_macro" +version = "0.13.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "514de17de45fdb8dc022b1a7975556c53c86f9f0aa5f534b98977b171857c2c9" +checksum = "9c972679f83bdf9c42bd905396b6c3588a843a17f0f16dfcfa3e2c5d57441835" dependencies = [ - "serde", + "darling_core 0.13.4", + "quote 1.0.36", + "syn 1.0.109", ] [[package]] -name = "bytesize" -version = "1.3.0" +name = "darling_macro" +version = "0.14.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3e368af43e418a04d52505cf3dbc23dda4e3407ae2fa99fd0e4f308ce546acc" +checksum = "a4aab4dbc9f7611d8b55048a3a16d2d010c2c8334e46304b40ac1cc14bf3b48e" +dependencies = [ + "darling_core 0.14.4", + "quote 1.0.36", + "syn 1.0.109", +] [[package]] -name = "bzip2-sys" -version = "0.1.11+1.0.8" +name = "darling_macro" +version = "0.20.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "736a955f3fa7875102d57c82b8cac37ec45224a07fd32d58f9f7a186b6cd4cdc" +checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" dependencies = [ - "cc", - "libc", - "pkg-config", + "darling_core 0.20.10", + "quote 1.0.36", + "syn 2.0.72", ] [[package]] -name = "c-kzg" -version = "1.0.3" +name = "dashmap" +version = "5.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0307f72feab3300336fb803a57134159f6e20139af1357f36c54cb90d8e8928" +checksum = "978747c1d849a7d2ee5e8adc0159961c48fb7e5db2f06af6723b80123bb53856" dependencies = [ - "blst", - "cc", - "glob", - "hex", - "libc", + "cfg-if", + "hashbrown 0.14.5", + "lock_api", "once_cell", - "serde", + "parking_lot_core", ] [[package]] -name = "camino" -version = "1.1.6" +name = "debugid" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c59e92b5a388f549b863a7bea62612c09f24c8393560709a54558a9abdfb3b9c" +checksum = "bef552e6f588e446098f6ba40d89ac146c8c7b64aade83c051ee00bb5d2bc18d" dependencies = [ "serde", + "uuid", ] [[package]] -name = "cargo-platform" -version = "0.1.4" +name = "der" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12024c4645c97566567129c204f65d5815a8c9aecf30fcbe682b2fe034996d36" +checksum = "f1a467a65c5e759bce6e65eaf91cc29f466cdc57cb65777bd646872a8a1fd4de" dependencies = [ - "serde", + "const-oid", + "zeroize", ] [[package]] -name = "cargo_metadata" -version = "0.14.2" +name = "der" +version = "0.7.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4acbb09d9ee8e23699b9634375c72795d095bf268439da88562cf9b501f181fa" +checksum = "fffa369a668c8af7dbf8b5e56c9f744fbd399949ed171606040001947de40b1c" dependencies = [ - "camino", - "cargo-platform", - "semver 1.0.20", + "const-oid", + "pem-rfc7468", + "zeroize", +] + +[[package]] +name = "deranged" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f32d04922c60427da6f9fef14d042d9edddef64cb9d4ce0d64d0685fbeb1fd3" +dependencies = [ + "powerfmt", "serde", - "serde_json", ] [[package]] -name = "cast" -version = "0.3.0" +name = "derivative" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37b2a672a2cb129a2e41c10b1224bb368f9f37a2b16b612598138befd7b37eb5" +checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" +dependencies = [ + "proc-macro2 1.0.86", + "quote 1.0.36", + "syn 1.0.109", +] [[package]] -name = "cc" -version = "1.1.14" +name = "derive_more" +version = "0.99.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50d2eb3cd3d1bf4529e31c215ee6f93ec5a3d536d9f578f93d9d33ee19562932" +checksum = "5f33878137e4dafd7fa914ad4e259e18a4e8e532b9617a2d0150262bf53abfce" dependencies = [ - "jobserver", - "libc", - "shlex", + "convert_case 0.4.0", + "proc-macro2 1.0.86", + "quote 1.0.36", + "rustc_version", + "syn 2.0.72", ] [[package]] -name = "celestia_client" -version = "0.1.0" +name = "derive_more" +version = "1.0.0-beta.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7abbfc297053be59290e3152f8cbcd52c8642e0728b69ee187d991d4c1af08d" dependencies = [ - "anyhow", - "async-trait", - "da_config", - "da_utils", - "serde", - "tokio", - "zksync_da_client", - "zksync_env_config", - "zksync_node_framework", + "derive_more-impl", ] [[package]] -name = "cesu8" -version = "1.1.0" +name = "derive_more-impl" +version = "1.0.0-beta.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d43a04d8753f35258c91f8ec639f792891f748a1edbd759cf1dcea3382ad83c" +checksum = "2bba3e9872d7c58ce7ef0fcf1844fcc3e23ef2a58377b50df35dd98e42a5726e" +dependencies = [ + "proc-macro2 1.0.86", + "quote 1.0.36", + "syn 2.0.72", + "unicode-xid 0.2.4", +] [[package]] -name = "cexpr" -version = "0.6.0" +name = "diff" +version = "0.1.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fac387a98bb7c37292057cffc56d62ecb629900026402633ae9160df93a8766" +checksum = "56254986775e3233ffa9c4d7d3faaf6d36a2c09d30b20687e9f88bc8bafc16c8" + +[[package]] +name = "digest" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066" dependencies = [ - "nom", + "generic-array", ] [[package]] -name = "cfg-expr" -version = "0.15.8" +name = "digest" +version = "0.10.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d067ad48b8650848b989a59a86c6c36a995d02d2bf778d45c3c5d57bc2718f02" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" dependencies = [ - "smallvec 1.13.1", + "block-buffer 0.10.4", + "const-oid", + "crypto-common", + "subtle", ] [[package]] -name = "cfg-if" -version = "0.1.10" +name = "dotenvy" +version = "0.15.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" +checksum = "1aaf95b3e5c8f23aa320147307562d361db0ae0d51242340f558153b4eb2439b" [[package]] -name = "cfg-if" -version = "1.0.0" +name = "downcast-rs" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" +checksum = "75b325c5dbd37f80359721ad39aca5a29fb04c89279657cffdda8736d0c0b9d2" [[package]] -name = "cfg_aliases" -version = "0.1.1" +name = "dtoa" +version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd16c4719339c4530435d38e511904438d07cce7950afa3718a84ac36c10e89e" +checksum = "dcbb2bf8e87535c23f7a8a321e364ce21462d0ff10cb6407820e8e96dfff6653" [[package]] -name = "chacha20" -version = "0.9.1" +name = "dunce" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3613f74bd2eac03dad61bd53dbe620703d4371614fe0bc3b9f04dd36fe4e818" +checksum = "56ce8c6da7551ec6c462cbaf3bfbc75131ebbfa1c944aeaa9dab51ca1c5f0c3b" + +[[package]] +name = "ecdsa" +version = "0.14.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "413301934810f597c1d19ca71c8710e99a3f1ba28a0d2ebc01551a2daeea3c5c" dependencies = [ - "cfg-if 1.0.0", - "cipher", - "cpufeatures", + "der 0.6.1", + "elliptic-curve 0.12.3", + "rfc6979 0.3.1", + "signature 1.6.4", ] [[package]] -name = "chacha20poly1305" -version = "0.10.1" +name = "ecdsa" +version = "0.16.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10cd79432192d1c0f4e1a0fef9527696cc039165d729fb41b3f4f4f354c2dc35" +checksum = "ee27f32b5c5292967d2d4a9d7f1e0b0aed2c15daded5a60300e4abb9d8020bca" dependencies = [ - "aead", - "chacha20", - "cipher", - "poly1305", - "zeroize", + "der 0.7.8", + "digest 0.10.7", + "elliptic-curve 0.13.8", + "rfc6979 0.4.0", + "signature 2.2.0", + "spki 0.7.2", ] [[package]] -name = "chrono" -version = "0.4.38" +name = "ed25519" +version = "2.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a21f936df1771bf62b77f047b726c4625ff2e8aa607c01ec06e5a05bd8463401" +checksum = "115531babc129696a58c64a4fef0a8bf9e9698629fb97e9e40767d235cfbcd53" dependencies = [ - "android-tzdata", - "iana-time-zone", - "js-sys", - "num-traits", - "serde", - "wasm-bindgen", - "windows-targets 0.52.6", + "pkcs8 0.10.2", + "signature 2.2.0", ] [[package]] -name = "ciborium" -version = "0.2.1" +name = "ed25519-dalek" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "effd91f6c78e5a4ace8a5d3c0b6bfaec9e2baaef55f3efc00e45fb2e477ee926" +checksum = "7277392b266383ef8396db7fdeb1e77b6c52fed775f5df15bb24f35b72156980" dependencies = [ - "ciborium-io", - "ciborium-ll", + "curve25519-dalek", + "ed25519", + "rand_core 0.6.4", "serde", + "sha2 0.10.8", + "zeroize", ] [[package]] -name = "ciborium-io" -version = "0.2.1" +name = "ed25519-zebra" +version = "4.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cdf919175532b369853f5d5e20b26b43112613fd6fe7aee757e35f7a44642656" - -[[package]] -name = "ciborium-ll" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "defaa24ecc093c77630e6c15e17c51f5e187bf35ee514f4e2d67baaa96dae22b" +checksum = "7d9ce6874da5d4415896cd45ffbc4d1cfc0c4f9c079427bd870742c30f2f65a9" dependencies = [ - "ciborium-io", - "half", + "curve25519-dalek", + "ed25519", + "hashbrown 0.14.5", + "hex", + "rand_core 0.6.4", + "sha2 0.10.8", + "zeroize", ] [[package]] -name = "cipher" -version = "0.4.4" +name = "either" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "773f3b9af64447d2ce9850330c473515014aa235e6a783b02db81ff39e4a3dad" +checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" dependencies = [ - "crypto-common", - "inout", - "zeroize", + "serde", ] [[package]] -name = "circuit_encodings" -version = "0.140.1" +name = "elliptic-curve" +version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8438d7af992b730143b679e2c6938cb9e0193897ecaf668c59189af8ac296b7" +checksum = "e7bb888ab5300a19b8e5bceef25ac745ad065f3c9f7efc6de1b91958110891d3" dependencies = [ - "derivative", - "serde", - "zk_evm 0.140.0", - "zkevm_circuits 0.140.2", + "base16ct 0.1.1", + "crypto-bigint 0.4.9", + "der 0.6.1", + "digest 0.10.7", + "ff 0.12.1", + "generic-array", + "group 0.12.1", + "pkcs8 0.9.0", + "rand_core 0.6.4", + "sec1 0.3.0", + "subtle", + "zeroize", ] [[package]] -name = "circuit_encodings" -version = "0.141.1" +name = "elliptic-curve" +version = "0.13.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01a2fcc80e97682104f355dd819cb4972583828a6c0f65ec26889a78a84b0c56" +checksum = "b5e6043086bf7973472e0c7dff2142ea0b680d30e18d9cc40f267efbf222bd47" dependencies = [ - "derivative", - "serde", - "zk_evm 0.141.0", - "zkevm_circuits 0.141.1", + "base16ct 0.2.0", + "crypto-bigint 0.5.3", + "digest 0.10.7", + "ff 0.13.0", + "generic-array", + "group 0.13.0", + "pem-rfc7468", + "pkcs8 0.10.2", + "rand_core 0.6.4", + "sec1 0.7.3", + "subtle", + "zeroize", ] [[package]] -name = "circuit_encodings" -version = "0.142.1" +name = "elsa" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94be7afb5ace6024d6e3c105d521b4b9b563bac14a92c2f59c4683e9169a25d8" +checksum = "714f766f3556b44e7e4776ad133fcc3445a489517c25c704ace411bb14790194" dependencies = [ - "derivative", - "serde", - "zk_evm 0.141.0", - "zkevm_circuits 0.141.1", + "stable_deref_trait", ] [[package]] -name = "circuit_encodings" -version = "0.150.4" +name = "encode_unicode" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a357d28ed41a50f9c765dbfe56cbc04a64e53e5fc58ba79fbc34c10ef3df831f" + +[[package]] +name = "encoding_rs" +version = "0.8.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2593c02ad6b4b31ba63506c3f807f666133dd36bf47422f99b1d2947cf3c8dc1" +checksum = "7268b386296a025e474d5140678f75d6de9493ae55a5d709eeb9dd08149945e1" dependencies = [ - "derivative", - "serde", - "zk_evm 0.150.4", - "zkevm_circuits 0.150.4", + "cfg-if", ] [[package]] -name = "circuit_sequencer_api" -version = "0.133.0" +name = "enum_dispatch" +version = "0.3.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a87dc7bee6630d4954ac7982eb77e2007476662250cf18e5c460bbc5ee435f1" +checksum = "aa18ce2bc66555b3218614519ac839ddb759a7d6720732f979ef8d13be147ecd" dependencies = [ - "bellman_ce", - "derivative", - "rayon", - "serde", - "zk_evm 0.133.0", + "once_cell", + "proc-macro2 1.0.86", + "quote 1.0.36", + "syn 2.0.72", ] [[package]] -name = "circuit_sequencer_api" -version = "0.140.0" +name = "env_filter" +version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b5138e6524c73e6d49fc1d0822b26e62a8d78b2c07e4e1c56061a447c10bec0" +checksum = "a009aa4810eb158359dda09d0c87378e4bbb89b5a801f016885a4707ba24f7ea" dependencies = [ - "bellman_ce", - "circuit_encodings 0.140.1", - "derivative", - "rayon", - "serde", - "zk_evm 0.140.0", + "log", ] [[package]] -name = "circuit_sequencer_api" -version = "0.141.1" +name = "env_logger" +version = "0.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55a257b31a8ea1c1723cab4fb5661c6b4c0ebe022d4b73bea9eb7c9150bd3bc1" +checksum = "38b35839ba51819680ba087cd351788c9a3c476841207e0b8cee0b04722343b9" dependencies = [ - "bellman_ce", - "circuit_encodings 0.141.1", - "derivative", - "rayon", - "serde", - "zk_evm 0.141.0", + "env_filter", + "log", ] [[package]] -name = "circuit_sequencer_api" -version = "0.142.0" +name = "envy" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1d861a7a9b8df9389c63092985fc993c46954771da86462d7cab8cbf55a6497" +checksum = "3f47e0157f2cb54f5ae1bd371b30a2ae4311e1c028f575cd4e81de7353215965" dependencies = [ - "bellman_ce", - "circuit_encodings 0.142.1", - "derivative", - "rayon", "serde", - "zk_evm 0.141.0", ] [[package]] -name = "circuit_sequencer_api" -version = "0.150.4" +name = "equivalent" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42d1a86b9c2207f3bb2dff5f00d1af1cb95004b6d07e9bacb6519fe08f12c04b" +checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" + +[[package]] +name = "eravm-stable-interface" +version = "0.1.0" +source = "git+https://github.com/matter-labs/vm2.git?rev=4ef15d46410ffc11744771a3a6c7c09dd9470c90#4ef15d46410ffc11744771a3a6c7c09dd9470c90" dependencies = [ - "bellman_ce", - "circuit_encodings 0.150.4", - "derivative", - "rayon", - "serde", + "primitive-types", ] [[package]] -name = "clang-sys" -version = "1.6.1" +name = "errno" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c688fc74432808e3eb684cae8830a86be1d66a2bd58e1f248ed0960a590baf6f" +checksum = "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba" dependencies = [ - "glob", "libc", - "libloading", + "windows-sys 0.52.0", ] [[package]] -name = "clap" -version = "2.34.0" +name = "error-chain" +version = "0.12.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a0610544180c38b88101fecf2dd634b174a62eef6946f84dfc6a7127512b381c" +checksum = "2d2f06b9cac1506ece98fe3231e3cc9c4410ec3d5b1f24ae1c8946f0742cdefc" dependencies = [ - "ansi_term", - "atty", - "bitflags 1.3.2", - "strsim 0.8.0", - "textwrap 0.11.0", - "unicode-width", - "vec_map", + "version_check", ] [[package]] -name = "clap" -version = "3.2.25" +name = "etcetera" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ea181bf566f71cb9a5d17a59e1871af638180a18fb0035c92ae62b705207123" +checksum = "136d1b5283a1ab77bd9257427ffd09d8667ced0570b6f938942bc7568ed5b943" dependencies = [ - "bitflags 1.3.2", - "clap_lex 0.2.4", - "indexmap 1.9.3", - "textwrap 0.16.0", + "cfg-if", + "home", + "windows-sys 0.48.0", ] [[package]] -name = "clap" -version = "4.4.6" +name = "ethabi" +version = "18.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d04704f56c2cde07f43e8e2c154b43f216dc5c92fc98ada720177362f953b956" +checksum = "7413c5f74cc903ea37386a8965a936cbeb334bd270862fdece542c1b2dcbc898" dependencies = [ - "clap_builder", - "clap_derive", + "ethereum-types", + "hex", + "once_cell", + "regex", + "serde", + "serde_json", + "sha3 0.10.8", + "thiserror", + "uint", ] [[package]] -name = "clap_builder" -version = "4.4.6" +name = "ethbloom" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e231faeaca65ebd1ea3c737966bf858971cd38c3849107aa3ea7de90a804e45" +checksum = "c22d4b5885b6aa2fe5e8b9329fb8d232bf739e434e6b87347c63bdd00c120f60" dependencies = [ - "anstream", - "anstyle", - "clap_lex 0.5.1", - "strsim 0.10.0", + "crunchy", + "fixed-hash", + "impl-rlp", + "impl-serde", + "tiny-keccak 2.0.2", ] [[package]] -name = "clap_derive" -version = "4.4.2" +name = "ethereum-types" +version = "0.14.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0862016ff20d69b84ef8247369fabf5c008a7417002411897d40ee1f4532b873" +checksum = "02d215cbf040552efcbe99a38372fe80ab9d00268e20012b79fcd0f073edd8ee" dependencies = [ - "heck 0.4.1", - "proc-macro2 1.0.86", - "quote 1.0.37", - "syn 2.0.72", + "ethbloom", + "fixed-hash", + "impl-rlp", + "impl-serde", + "primitive-types", + "uint", ] [[package]] -name = "clap_lex" -version = "0.2.4" +name = "event-listener" +version = "4.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2850f2f5a82cbf437dd5af4d49848fbdfc27c157c3d010345776f952765261c5" +checksum = "67b215c49b2b248c855fb73579eb1f4f26c38ffdc12973e20e07b91d78d5646e" dependencies = [ - "os_str_bytes", + "concurrent-queue", + "pin-project-lite", ] [[package]] -name = "clap_lex" -version = "0.5.1" +name = "event-listener" +version = "5.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd7cc57abe963c6d3b9d8be5b06ba7c8957a930305ca90304f24ef040aa6f961" +checksum = "6032be9bd27023a771701cc49f9f053c751055f71efb2e0ae5c15809093675ba" +dependencies = [ + "concurrent-queue", + "parking", + "pin-project-lite", +] [[package]] -name = "cmake" -version = "0.1.50" +name = "event-listener-strategy" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a31c789563b815f77f4250caee12365734369f942439b7defd71e18a48197130" +checksum = "0f214dc438f977e6d4e3500aaa277f5ad94ca83fbbd9b1a15713ce2344ccc5a1" dependencies = [ - "cc", + "event-listener 5.3.1", + "pin-project-lite", ] [[package]] -name = "codegen" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff61280aed771c3070e7dcc9e050c66f1eb1e3b96431ba66f9f74641d02fc41d" -dependencies = [ - "indexmap 1.9.3", -] - -[[package]] -name = "colorchoice" -version = "1.0.0" +name = "fastrand" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7" +checksum = "25cbce373ec4653f1a01a31e8a5e5ec0c622dc27ff9c4e6606eefef5cbbed4a5" [[package]] -name = "combine" -version = "4.6.7" +name = "ff" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba5a308b75df32fe02788e748662718f03fde005016435c444eea572398219fd" +checksum = "d013fc25338cc558c5c2cfbad646908fb23591e2404481826742b651c9af7160" dependencies = [ - "bytes", - "memchr", -] - -[[package]] -name = "common" -version = "0.1.0" -source = "git+https://github.com/w3f/ring-proof#31658d1f5b88e106c969557c36c821aff46b2236" -dependencies = [ - "ark-ec", - "ark-ff 0.4.2", - "ark-poly", - "ark-serialize 0.4.2", - "ark-std 0.4.0", - "fflonk", - "getrandom_or_panic", "rand_core 0.6.4", + "subtle", ] [[package]] -name = "common-path" -version = "1.0.0" +name = "ff" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2382f75942f4b3be3690fe4f86365e9c853c1587d6ee58212cebf6e2a9ccd101" +checksum = "ded41244b729663b1e574f1b4fb731469f69f79c17667b5d776b16cda0479449" +dependencies = [ + "rand_core 0.6.4", + "subtle", +] [[package]] -name = "compile-fmt" -version = "0.1.0" +name = "ff_ce" +version = "0.14.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bed69047ed42e52c7e38d6421eeb8ceefb4f2a2b52eed59137f7bad7908f6800" +checksum = "5b538e4231443a5b9c507caee3356f016d832cf7393d2d90f03ea3180d4e3fbc" +dependencies = [ + "byteorder", + "hex", + "rand 0.4.6", + "serde", +] [[package]] -name = "concurrent-queue" -version = "2.5.0" +name = "fiat-crypto" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ca0197aee26d1ae37445ee532fefce43251d24cc7c166799f4d46817f1d3973" -dependencies = [ - "crossbeam-utils 0.8.20", -] +checksum = "f69037fe1b785e84986b4f2cbcf647381876a00671d25ceef715d7812dd7e1dd" [[package]] -name = "console" -version = "0.15.7" +name = "findshlibs" +version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c926e00cc70edefdc64d3a5ff31cc65bb97a3460097762bd23afb4d8145fccf8" +checksum = "40b9e59cd0f7e0806cca4be089683ecb6434e602038df21fe6bf6711b2f07f64" dependencies = [ - "encode_unicode", + "cc", "lazy_static", "libc", - "windows-sys 0.45.0", + "winapi", ] [[package]] -name = "const-hex" -version = "1.12.0" +name = "finl_unicode" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94fb8a24a26d37e1ffd45343323dc9fe6654ceea44c12f2fcb3d7ac29e610bc6" -dependencies = [ - "cfg-if 1.0.0", - "cpufeatures", - "hex", - "proptest", - "serde", -] +checksum = "8fcfdc7a0362c9f4444381a9e697c79d435fe65b52a37466fc2c1184cee9edc6" [[package]] -name = "const-oid" -version = "0.9.5" +name = "firestorm" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28c122c3980598d243d63d9a704629a2d748d101f278052ff068be5a4423ab6f" +checksum = "2c5f6c2c942da57e2aaaa84b8a521489486f14e75e7fa91dab70aba913975f98" [[package]] -name = "const-random" -version = "0.1.18" +name = "fixed-hash" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87e00182fe74b066627d63b85fd550ac2998d4b0bd86bfed477a0ae4c7c71359" +checksum = "835c052cb0c08c1acf6ffd71c022172e18723949c8282f2b9f27efbc51e64534" dependencies = [ - "const-random-macro", + "byteorder", + "rand 0.8.5", + "rustc-hex", + "static_assertions", ] [[package]] -name = "const-random-macro" -version = "0.1.16" +name = "fixedbitset" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9d839f2a20b0aee515dc581a6172f2321f96cab76c1a38a4c584a194955390e" -dependencies = [ - "getrandom 0.2.10", - "once_cell", - "tiny-keccak 2.0.2", -] +checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" [[package]] -name = "const_format" -version = "0.2.32" +name = "flate2" +version = "1.0.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3a214c7af3d04997541b18d432afaff4c455e79e2029079647e72fc2bd27673" +checksum = "46303f565772937ffe1d394a4fac6f411c6013172fadde9dcdb1e147a086940e" dependencies = [ - "const_format_proc_macros", + "crc32fast", + "miniz_oxide", ] [[package]] -name = "const_format_proc_macros" -version = "0.2.32" +name = "flume" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7f6ff08fd20f4f299298a28e2dfa8a8ba1036e6cd2460ac1de7b425d76f2500" +checksum = "55ac459de2512911e4b674ce33cf20befaba382d05b62b008afc1c8b57cbf181" dependencies = [ - "proc-macro2 1.0.86", - "quote 1.0.37", - "unicode-xid 0.2.4", + "futures-core", + "futures-sink", + "spin", ] [[package]] -name = "constant_time_eq" -version = "0.1.5" +name = "fnv" +version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "245097e9a4535ee1e3e3931fcfcd55a796a44c643e8596ff6566d68f09b87bbc" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" [[package]] -name = "constant_time_eq" -version = "0.3.1" +name = "foreign-types" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c74b8349d32d297c9134b8c88677813a227df8f779daa29bfc29c183fe3dca6" +checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" +dependencies = [ + "foreign-types-shared", +] [[package]] -name = "constcat" -version = "0.3.1" +name = "foreign-types-shared" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd7e35aee659887cbfb97aaf227ac12cad1a9d7c71e55ff3376839ed4e282d08" +checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" [[package]] -name = "convert_case" -version = "0.4.0" +name = "form_urlencoded" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6245d59a3e82a7fc217c5828a6692dbc6dfb63a0c8c90495621f7b9d79704a0e" +checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" +dependencies = [ + "percent-encoding", +] [[package]] -name = "convert_case" -version = "0.6.0" +name = "fraction" +version = "0.15.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec182b0ca2f35d8fc196cf3404988fd8b8c739a4d270ff118a398feb0cbec1ca" +checksum = "0f158e3ff0a1b334408dc9fb811cd99b446986f4d8b741bb08f9df1604085ae7" dependencies = [ - "unicode-segmentation", + "lazy_static", + "num", ] [[package]] -name = "core-foundation" -version = "0.9.4" +name = "frame-metadata" +version = "15.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" +checksum = "878babb0b136e731cc77ec2fd883ff02745ff21e6fb662729953d44923df009c" dependencies = [ - "core-foundation-sys", - "libc", + "cfg-if", + "parity-scale-codec", + "scale-info", ] [[package]] -name = "core-foundation-sys" -version = "0.8.6" +name = "frame-metadata" +version = "16.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" +checksum = "87cf1549fba25a6fcac22785b61698317d958e96cac72a59102ea45b9ae64692" +dependencies = [ + "cfg-if", + "parity-scale-codec", + "scale-info", + "serde", +] [[package]] -name = "cpp_demangle" -version = "0.3.5" +name = "franklin-crypto" +version = "0.30.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eeaa953eaad386a53111e47172c2fedba671e5684c8dd601a5f474f4f118710f" +checksum = "971289216ea5c91872e5e0bb6989214b537bbce375d09fabea5c3ccfe031b204" dependencies = [ - "cfg-if 1.0.0", + "arr_macro", + "bit-vec", + "blake2 0.9.2", + "blake2-rfc_bellman_edition", + "blake2s_simd", + "boojum", + "byteorder", + "derivative", + "digest 0.9.0", + "hex", + "indexmap 1.9.3", + "itertools 0.10.5", + "lazy_static", + "num-bigint 0.4.6", + "num-derive", + "num-integer", + "num-traits", + "rand 0.4.6", + "serde", + "sha2 0.9.9", + "sha3 0.9.1", + "smallvec", + "splitmut", + "tiny-keccak 1.5.0", + "zksync_bellman", ] [[package]] -name = "cpufeatures" -version = "0.2.10" +name = "fs_extra" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fbc60abd742b35f2492f808e1abbb83d45f72db402e14c55057edc9c7b1e9e4" -dependencies = [ - "libc", -] +checksum = "42703706b716c37f96a77aea830392ad231f44c9e9a67872fa5548707e11b11c" [[package]] -name = "cranelift-entity" -version = "0.95.1" +name = "fuchsia-cprng" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "40099d38061b37e505e63f89bab52199037a72b931ad4868d9089ff7268660b0" -dependencies = [ - "serde", -] +checksum = "a06f77d526c1a601b7c4cdd98f54b5eaabffc14d5f2f0296febdc7f357c6d3ba" [[package]] -name = "crc" -version = "3.0.1" +name = "funty" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86ec7a15cbe22e59248fc7eadb1907dab5ba09372595da4d73dd805ed4417dfe" -dependencies = [ - "crc-catalog", -] +checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c" [[package]] -name = "crc-catalog" -version = "2.4.0" +name = "futures" +version = "0.1.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19d374276b40fb8bbdee95aef7c7fa6b5316ec764510eb64b8dd0e2ed0d7e7f5" +checksum = "3a471a38ef8ed83cd6e40aa59c1ffe17db6855c18e3604d9c4ed8c08ebc28678" [[package]] -name = "crc32fast" -version = "1.3.2" +name = "futures" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b540bd8bc810d3885c6ea91e2018302f68baba2129ab3e88f32389ee9370880d" +checksum = "645c6916888f6cb6350d2550b80fb63e734897a8498abe35cfb732b6487804b0" dependencies = [ - "cfg-if 1.0.0", + "futures-channel", + "futures-core", + "futures-executor", + "futures-io", + "futures-sink", + "futures-task", + "futures-util", ] [[package]] -name = "criterion" -version = "0.4.0" +name = "futures-channel" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7c76e09c1aae2bc52b3d2f29e13c6572553b30c4aa1b8a49fd70de6412654cb" +checksum = "eac8f7d7865dcb88bd4373ab671c8cf4508703796caa2b1985a9ca867b3fcb78" dependencies = [ - "anes", - "atty", - "cast", - "ciborium", - "clap 3.2.25", - "criterion-plot", - "itertools 0.10.5", - "lazy_static", - "num-traits", - "oorandom", - "plotters", - "rayon", - "regex", - "serde", - "serde_derive", - "serde_json", - "tinytemplate", - "walkdir", + "futures-core", + "futures-sink", ] [[package]] -name = "criterion-plot" -version = "0.5.0" +name = "futures-core" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b50826342786a51a89e2da3a28f1c32b06e387201bc2d19791f622c673706b1" -dependencies = [ - "cast", - "itertools 0.10.5", -] +checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" [[package]] -name = "crossbeam" -version = "0.7.3" +name = "futures-executor" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69323bff1fb41c635347b8ead484a5ca6c3f11914d784170b158d8449ab07f8e" +checksum = "a576fc72ae164fca6b9db127eaa9a9dda0d61316034f33a0a0d4eda41f02b01d" dependencies = [ - "cfg-if 0.1.10", - "crossbeam-channel 0.4.4", - "crossbeam-deque 0.7.4", - "crossbeam-epoch 0.8.2", - "crossbeam-queue 0.2.3", - "crossbeam-utils 0.7.2", + "futures-core", + "futures-task", + "futures-util", + "num_cpus", ] [[package]] -name = "crossbeam" -version = "0.8.4" +name = "futures-intrusive" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1137cd7e7fc0fb5d3c5a8678be38ec56e819125d8d7907411fe24ccb943faca8" +checksum = "1d930c203dd0b6ff06e0201a4a2fe9149b43c684fd4420555b26d21b1a02956f" dependencies = [ - "crossbeam-channel 0.5.13", - "crossbeam-deque 0.8.5", - "crossbeam-epoch 0.9.18", - "crossbeam-queue 0.3.11", - "crossbeam-utils 0.8.20", + "futures-core", + "lock_api", + "parking_lot", ] [[package]] -name = "crossbeam-channel" -version = "0.4.4" +name = "futures-io" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b153fe7cbef478c567df0f972e02e6d736db11affe43dfc9c56a9374d1adfb87" -dependencies = [ - "crossbeam-utils 0.7.2", - "maybe-uninit", -] +checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1" [[package]] -name = "crossbeam-channel" -version = "0.5.13" +name = "futures-lite" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33480d6946193aa8033910124896ca395333cae7e2d1113d1fef6c3272217df2" +checksum = "52527eb5074e35e9339c6b4e8d12600c7128b68fb25dcb9fa9dec18f7c25f3a5" dependencies = [ - "crossbeam-utils 0.8.20", + "fastrand", + "futures-core", + "futures-io", + "parking", + "pin-project-lite", ] [[package]] -name = "crossbeam-deque" -version = "0.7.4" +name = "futures-macro" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c20ff29ded3204c5106278a81a38f4b482636ed4fa1e6cfbeef193291beb29ed" +checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ - "crossbeam-epoch 0.8.2", - "crossbeam-utils 0.7.2", - "maybe-uninit", + "proc-macro2 1.0.86", + "quote 1.0.36", + "syn 2.0.72", ] [[package]] -name = "crossbeam-deque" -version = "0.8.5" +name = "futures-sink" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "613f8cc01fe9cf1a3eb3d7f488fd2fa8388403e97039e2f73692932e291a770d" -dependencies = [ - "crossbeam-epoch 0.9.18", - "crossbeam-utils 0.8.20", -] +checksum = "9fb8e00e87438d937621c1c6269e53f536c14d3fbd6a042bb24879e57d474fb5" [[package]] -name = "crossbeam-epoch" -version = "0.8.2" +name = "futures-task" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "058ed274caafc1f60c4997b5fc07bf7dc7cca454af7c6e81edffe5f33f70dace" -dependencies = [ - "autocfg", - "cfg-if 0.1.10", - "crossbeam-utils 0.7.2", - "lazy_static", - "maybe-uninit", - "memoffset 0.5.6", - "scopeguard", -] +checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" [[package]] -name = "crossbeam-epoch" -version = "0.9.18" +name = "futures-timer" +version = "3.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" +checksum = "e64b03909df88034c26dc1547e8970b91f98bdb65165d6a4e9110d94263dbb2c" dependencies = [ - "crossbeam-utils 0.8.20", + "gloo-timers", + "send_wrapper", ] [[package]] -name = "crossbeam-queue" -version = "0.2.3" +name = "futures-util" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "774ba60a54c213d409d5353bda12d49cd68d14e45036a285234c8d6f91f92570" +checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48" dependencies = [ - "cfg-if 0.1.10", - "crossbeam-utils 0.7.2", - "maybe-uninit", + "futures 0.1.31", + "futures-channel", + "futures-core", + "futures-io", + "futures-macro", + "futures-sink", + "futures-task", + "memchr", + "pin-project-lite", + "pin-utils", + "slab", ] [[package]] -name = "crossbeam-queue" -version = "0.3.11" +name = "generic-array" +version = "0.14.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df0346b5d5e76ac2fe4e327c5fd1118d6be7c51dfb18f9b7922923f287471e35" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" dependencies = [ - "crossbeam-utils 0.8.20", + "typenum", + "version_check", + "zeroize", ] [[package]] -name = "crossbeam-utils" -version = "0.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3c7c73a2d1e9fc0886a08b93e98eb643461230d5f1925e4036204d5f2e261a8" +name = "genesis_generator" +version = "0.1.0" dependencies = [ - "autocfg", - "cfg-if 0.1.10", - "lazy_static", + "anyhow", + "clap 4.4.6", + "futures 0.3.30", + "serde", + "serde_json", + "serde_yaml", + "tokio", + "tracing", + "zksync_config", + "zksync_contracts", + "zksync_core_leftovers", + "zksync_dal", + "zksync_env_config", + "zksync_node_genesis", + "zksync_protobuf", + "zksync_protobuf_config", + "zksync_types", + "zksync_utils", ] [[package]] -name = "crossbeam-utils" -version = "0.8.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80" - -[[package]] -name = "crunchy" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" - -[[package]] -name = "crypto-bigint" -version = "0.4.9" +name = "getrandom" +version = "0.2.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef2b4b23cddf68b89b8f8069890e8c270d54e2d5fe1b143820234805e4cb17ef" +checksum = "be4136b2a15dd319360be1c07d9933517ccf0be8f16bf62a3bee4f0d618df427" dependencies = [ - "generic-array 0.14.7", - "rand_core 0.6.4", - "subtle", - "zeroize", + "cfg-if", + "js-sys", + "libc", + "wasi 0.11.0+wasi-snapshot-preview1", + "wasm-bindgen", ] [[package]] -name = "crypto-bigint" -version = "0.5.3" +name = "getrandom_or_panic" +version = "0.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "740fe28e594155f10cfc383984cbefd529d7396050557148f79cb0f621204124" +checksum = "6ea1015b5a70616b688dc230cfe50c8af89d972cb132d5a622814d29773b10b9" dependencies = [ - "generic-array 0.14.7", + "rand 0.8.5", "rand_core 0.6.4", - "subtle", - "zeroize", ] [[package]] -name = "crypto-common" -version = "0.1.6" +name = "ghash" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" +checksum = "d930750de5717d2dd0b8c0d42c076c0e884c81a73e6cab859bbd2339c71e3e40" dependencies = [ - "generic-array 0.14.7", - "rand_core 0.6.4", - "typenum", + "opaque-debug", + "polyval", ] [[package]] -name = "crypto-mac" -version = "0.8.0" +name = "gimli" +version = "0.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b584a330336237c1eecd3e94266efb216c56ed91225d634cb2991c5f3fd1aeab" -dependencies = [ - "generic-array 0.14.7", - "subtle", -] +checksum = "6fb8d784f27acf97159b40fc4db5ecd8aa23b9ad5ef69cdd136d3bc80665f0c0" [[package]] -name = "crypto-mac" -version = "0.11.0" +name = "glob" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25fab6889090c8133f3deb8f73ba3c65a7f456f66436fc012a1b1e272b1e103e" -dependencies = [ - "generic-array 0.14.7", - "subtle", -] +checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" [[package]] -name = "cs_derive" -version = "0.2.2" +name = "gloo-net" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24cf603ca4299c6e20e644da88897f7b81d688510f4887e818b0bfe0b792081b" +checksum = "43aaa242d1239a8822c15c645f02166398da4f8b5c4bae795c1f5b44e9eee173" dependencies = [ - "proc-macro-error", - "proc-macro2 1.0.86", - "quote 1.0.37", - "syn 1.0.109", + "futures-channel", + "futures-core", + "futures-sink", + "gloo-utils", + "http 0.2.9", + "js-sys", + "pin-project", + "serde", + "serde_json", + "thiserror", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", ] [[package]] -name = "ctor" -version = "0.2.8" +name = "gloo-timers" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "edb49164822f3ee45b17acd4a208cfc1251410cf0cad9a833234c9890774dd9f" +checksum = "9b995a66bb87bebce9a0f4a95aed01daca4872c050bfcb21653361c03bc35e5c" dependencies = [ - "quote 1.0.37", - "syn 2.0.72", + "futures-channel", + "futures-core", + "js-sys", + "wasm-bindgen", ] [[package]] -name = "ctr" -version = "0.9.2" +name = "gloo-utils" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0369ee1ad671834580515889b80f2ea915f23b8be8d0daa4bbaf2ac5c7590835" +checksum = "0b5555354113b18c547c1d3a98fbf7fb32a9ff4f6fa112ce823a21641a0ba3aa" dependencies = [ - "cipher", + "js-sys", + "serde", + "serde_json", + "wasm-bindgen", + "web-sys", ] [[package]] -name = "ctrlc" -version = "3.4.1" +name = "google-cloud-auth" +version = "0.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82e95fbd621905b854affdc67943b043a0fbb6ed7385fd5a25650d19a8a6cfdf" +checksum = "1112c453c2e155b3e683204ffff52bcc6d6495d04b68d9e90cd24161270c5058" dependencies = [ - "nix", - "windows-sys 0.48.0", -] - -[[package]] -name = "curve25519-dalek" -version = "2.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a9b85542f99a2dfa2a1b8e192662741c9859a846b296bef1c92ef9b58b5a216" -dependencies = [ - "byteorder", - "digest 0.8.1", - "rand_core 0.5.1", - "subtle", - "zeroize", -] - -[[package]] -name = "curve25519-dalek" -version = "3.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b9fdf9972b2bd6af2d913799d9ebc165ea4d2e65878e329d9c6b372c4491b61" -dependencies = [ - "byteorder", - "digest 0.9.0", - "rand_core 0.5.1", - "subtle", - "zeroize", + "async-trait", + "base64 0.21.5", + "google-cloud-metadata", + "google-cloud-token", + "home", + "jsonwebtoken", + "reqwest 0.12.5", + "serde", + "serde_json", + "thiserror", + "time", + "tokio", + "tracing", + "urlencoding", ] [[package]] -name = "curve25519-dalek" -version = "4.1.3" +name = "google-cloud-metadata" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97fb8b7c4503de7d6ae7b42ab72a5a59857b4c937ec27a3d4539dba95b5ab2be" +checksum = "04f945a208886a13d07636f38fb978da371d0abc3e34bad338124b9f8c135a8f" dependencies = [ - "cfg-if 1.0.0", - "cpufeatures", - "curve25519-dalek-derive", - "digest 0.10.7", - "fiat-crypto", - "rustc_version 0.4.0", - "subtle", - "zeroize", + "reqwest 0.12.5", + "thiserror", + "tokio", ] [[package]] -name = "curve25519-dalek-derive" -version = "0.1.1" +name = "google-cloud-storage" +version = "0.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" -dependencies = [ - "proc-macro2 1.0.86", - "quote 1.0.37", - "syn 2.0.72", -] - -[[package]] -name = "da_config" -version = "0.1.0" +checksum = "cc0c5b7469142d91bd77959e69375bede324a5def07c7f29aa0d582586cba305" dependencies = [ "anyhow", - "da_utils", + "async-stream", + "async-trait", + "base64 0.21.5", + "bytes", + "futures-util", + "google-cloud-auth", + "google-cloud-metadata", + "google-cloud-token", + "hex", + "once_cell", + "percent-encoding", + "pkcs8 0.10.2", + "regex", + "reqwest 0.12.5", + "reqwest-middleware", + "ring", "serde", - "zksync_env_config", - "zksync_protobuf_build", + "serde_json", + "sha2 0.10.8", + "thiserror", + "time", + "tokio", + "tracing", + "url", ] [[package]] -name = "da_utils" -version = "0.1.0" +name = "google-cloud-token" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f49c12ba8b21d128a2ce8585955246977fbce4415f680ebf9199b6f9d6d725f" dependencies = [ - "anyhow", "async-trait", - "serde", - "serde_yaml", - "tokio", - "zksync_da_client", - "zksync_env_config", - "zksync_node_framework", - "zksync_protobuf", ] [[package]] -name = "darling" -version = "0.13.4" +name = "governor" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a01d95850c592940db9b8194bc39f4bc0e89dee5c4265e4b1807c34a9aba453c" +checksum = "19775995ee20209163239355bc3ad2f33f83da35d9ef72dea26e5af753552c87" dependencies = [ - "darling_core 0.13.4", - "darling_macro 0.13.4", + "dashmap", + "futures 0.3.30", + "futures-timer", + "no-std-compat", + "nonzero_ext", + "parking_lot", + "quanta", + "rand 0.8.5", + "smallvec", ] [[package]] -name = "darling" -version = "0.14.4" +name = "group" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b750cb3417fd1b327431a470f388520309479ab0bf5e323505daf0290cd3850" +checksum = "5dfbfb3a6cfbd390d5c9564ab283a0349b9b9fcd46a706c1eb10e0db70bfbac7" dependencies = [ - "darling_core 0.14.4", - "darling_macro 0.14.4", + "ff 0.12.1", + "rand_core 0.6.4", + "subtle", ] [[package]] -name = "darling" -version = "0.20.10" +name = "group" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f63b86c8a8826a49b8c21f08a2d07338eec8d900540f8630dc76284be802989" +checksum = "f0f9ef7462f7c099f518d754361858f86d8a07af53ba9af0fe635bbccb151a63" dependencies = [ - "darling_core 0.20.10", - "darling_macro 0.20.10", + "ff 0.13.0", + "rand_core 0.6.4", + "subtle", ] [[package]] -name = "darling_core" -version = "0.13.4" +name = "h2" +version = "0.3.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "859d65a907b6852c9361e3185c862aae7fafd2887876799fa55f5f99dc40d610" +checksum = "81fe527a889e1532da5c525686d96d4c2e74cdd345badf8dfef9f6b39dd5f5e8" dependencies = [ + "bytes", "fnv", - "ident_case", - "proc-macro2 1.0.86", - "quote 1.0.37", - "strsim 0.10.0", - "syn 1.0.109", + "futures-core", + "futures-sink", + "futures-util", + "http 0.2.9", + "indexmap 2.1.0", + "slab", + "tokio", + "tokio-util", + "tracing", ] [[package]] -name = "darling_core" -version = "0.14.4" +name = "h2" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "109c1ca6e6b7f82cc233a97004ea8ed7ca123a9af07a8230878fcfda9b158bf0" +checksum = "fa82e28a107a8cc405f0839610bdc9b15f1e25ec7d696aa5cf173edbcb1486ab" dependencies = [ + "atomic-waker", + "bytes", "fnv", - "ident_case", - "proc-macro2 1.0.86", - "quote 1.0.37", - "strsim 0.10.0", - "syn 1.0.109", + "futures-core", + "futures-sink", + "http 1.1.0", + "indexmap 2.1.0", + "slab", + "tokio", + "tokio-util", + "tracing", ] [[package]] -name = "darling_core" -version = "0.20.10" +name = "half" +version = "1.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95133861a8032aaea082871032f5815eb9e98cef03fa916ab4500513994df9e5" -dependencies = [ - "fnv", - "ident_case", - "proc-macro2 1.0.86", - "quote 1.0.37", - "strsim 0.11.1", - "syn 2.0.72", -] +checksum = "eabb4a44450da02c90444cf74558da904edde8fb4e9035a9a6a4e15445af0bd7" [[package]] -name = "darling_macro" -version = "0.13.4" +name = "handlebars" +version = "3.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c972679f83bdf9c42bd905396b6c3588a843a17f0f16dfcfa3e2c5d57441835" +checksum = "4498fc115fa7d34de968184e473529abb40eeb6be8bc5f7faba3d08c316cb3e3" dependencies = [ - "darling_core 0.13.4", - "quote 1.0.37", - "syn 1.0.109", + "log", + "pest", + "pest_derive", + "quick-error", + "serde", + "serde_json", ] [[package]] -name = "darling_macro" -version = "0.14.4" +name = "hashbrown" +version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4aab4dbc9f7611d8b55048a3a16d2d010c2c8334e46304b40ac1cc14bf3b48e" +checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" dependencies = [ - "darling_core 0.14.4", - "quote 1.0.37", - "syn 1.0.109", + "ahash 0.7.7", ] [[package]] -name = "darling_macro" -version = "0.20.10" +name = "hashbrown" +version = "0.14.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" +checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" dependencies = [ - "darling_core 0.20.10", - "quote 1.0.37", - "syn 2.0.72", + "ahash 0.8.7", + "allocator-api2", + "serde", ] [[package]] -name = "dashmap" -version = "5.5.3" +name = "hashlink" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "978747c1d849a7d2ee5e8adc0159961c48fb7e5db2f06af6723b80123bb53856" +checksum = "6ba4ff7128dee98c7dc9794b6a411377e1404dba1c97deb8d1a55297bd25d8af" dependencies = [ - "cfg-if 1.0.0", "hashbrown 0.14.5", - "lock_api", - "once_cell", - "parking_lot_core", ] [[package]] -name = "data-encoding" -version = "2.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8566979429cf69b49a5c740c60791108e86440e8be149bbea4fe54d2c32d6e2" - -[[package]] -name = "debugid" -version = "0.8.0" +name = "heck" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bef552e6f588e446098f6ba40d89ac146c8c7b64aade83c051ee00bb5d2bc18d" +checksum = "6d621efb26863f0e9924c6ac577e8275e5e6b77455db64ffa6c65c904e9e132c" dependencies = [ - "serde", - "uuid", + "unicode-segmentation", ] [[package]] -name = "der" -version = "0.6.1" +name = "heck" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1a467a65c5e759bce6e65eaf91cc29f466cdc57cb65777bd646872a8a1fd4de" -dependencies = [ - "const-oid", - "zeroize", -] +checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" [[package]] -name = "der" -version = "0.7.8" +name = "heck" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fffa369a668c8af7dbf8b5e56c9f744fbd399949ed171606040001947de40b1c" -dependencies = [ - "const-oid", - "pem-rfc7468", - "zeroize", -] +checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" [[package]] -name = "deranged" -version = "0.3.9" +name = "hermit-abi" +version = "0.1.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f32d04922c60427da6f9fef14d042d9edddef64cb9d4ce0d64d0685fbeb1fd3" +checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" dependencies = [ - "powerfmt", - "serde", + "libc", ] [[package]] -name = "derivative" -version = "2.2.0" +name = "hermit-abi" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" -dependencies = [ - "proc-macro2 1.0.86", - "quote 1.0.37", - "syn 1.0.109", -] +checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" [[package]] -name = "derive-syn-parse" -version = "0.1.5" +name = "hermit-abi" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e79116f119dd1dba1abf1f3405f03b9b0e79a27a3883864bfebded8a3dc768cd" -dependencies = [ - "proc-macro2 1.0.86", - "quote 1.0.37", - "syn 1.0.109", -] +checksum = "fbf6a919d6cf397374f7dfeeea91d974c7c0a7221d0d0f4f20d859d329e53fcc" [[package]] -name = "derive-syn-parse" -version = "0.2.0" +name = "hex" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d65d7ce8132b7c0e54497a4d9a55a1c2a0912a0d786cf894472ba818fba45762" -dependencies = [ - "proc-macro2 1.0.86", - "quote 1.0.37", - "syn 2.0.72", -] +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" [[package]] -name = "derive_more" -version = "0.99.18" +name = "hkdf" +version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f33878137e4dafd7fa914ad4e259e18a4e8e532b9617a2d0150262bf53abfce" +checksum = "791a029f6b9fc27657f6f188ec6e5e43f6911f6f878e0dc5501396e09809d437" dependencies = [ - "convert_case 0.4.0", - "proc-macro2 1.0.86", - "quote 1.0.37", - "rustc_version 0.4.0", - "syn 2.0.72", + "hmac 0.12.1", ] [[package]] -name = "derive_more" -version = "1.0.0-beta.6" +name = "hmac" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7abbfc297053be59290e3152f8cbcd52c8642e0728b69ee187d991d4c1af08d" +checksum = "126888268dcc288495a26bf004b38c5fdbb31682f992c84ceb046a1f0fe38840" dependencies = [ - "derive_more-impl", + "crypto-mac", + "digest 0.9.0", ] [[package]] -name = "derive_more-impl" -version = "1.0.0-beta.6" +name = "hmac" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2bba3e9872d7c58ce7ef0fcf1844fcc3e23ef2a58377b50df35dd98e42a5726e" +checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" dependencies = [ - "proc-macro2 1.0.86", - "quote 1.0.37", - "syn 2.0.72", - "unicode-xid 0.2.4", + "digest 0.10.7", ] [[package]] -name = "diff" -version = "0.1.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56254986775e3233ffa9c4d7d3faaf6d36a2c09d30b20687e9f88bc8bafc16c8" - -[[package]] -name = "digest" -version = "0.8.1" +name = "hmac-drbg" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3d0c8c8752312f9713efd397ff63acb9f85585afbf179282e720e7704954dd5" +checksum = "17ea0a1394df5b6574da6e0c1ade9e78868c9fb0a4e5ef4428e32da4676b85b1" dependencies = [ - "generic-array 0.12.4", + "digest 0.9.0", + "generic-array", + "hmac 0.8.1", ] [[package]] -name = "digest" -version = "0.9.0" +name = "home" +version = "0.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066" +checksum = "5444c27eef6923071f7ebcc33e3444508466a76f7a2b93da00ed6e19f30c1ddb" dependencies = [ - "generic-array 0.14.7", + "windows-sys 0.48.0", ] [[package]] -name = "digest" -version = "0.10.7" +name = "hostname" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" +checksum = "3c731c3e10504cc8ed35cfe2f1db4c9274c3d35fa486e3b31df46f068ef3e867" dependencies = [ - "block-buffer 0.10.4", - "const-oid", - "crypto-common", - "subtle", + "libc", + "match_cfg", + "winapi", ] [[package]] -name = "dleq_vrf" -version = "0.0.2" -source = "git+https://github.com/w3f/ring-vrf?rev=e9782f9#e9782f938629c90f3adb3fff2358bc8d1386af3e" +name = "http" +version = "0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd6effc99afb63425aff9b05836f029929e345a6148a14b7ecd5ab67af944482" dependencies = [ - "ark-ec", - "ark-ff 0.4.2", - "ark-scale", - "ark-secret-scalar", - "ark-serialize 0.4.2", - "ark-std 0.4.0", - "ark-transcript 0.0.2 (git+https://github.com/w3f/ring-vrf?rev=e9782f9)", - "arrayvec 0.7.4", - "zeroize", + "bytes", + "fnv", + "itoa", ] [[package]] -name = "docify" -version = "0.2.8" +name = "http" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43a2f138ad521dc4a2ced1a4576148a6a610b4c5923933b062a263130a6802ce" +checksum = "21b9ddb458710bc376481b842f5da65cdf31522de232c1ca8146abce2a358258" dependencies = [ - "docify_macros", + "bytes", + "fnv", + "itoa", ] [[package]] -name = "docify_macros" -version = "0.2.8" +name = "http-body" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a081e51fb188742f5a7a1164ad752121abcb22874b21e2c3b0dd040c515fdad" +checksum = "7ceab25649e9960c0311ea418d17bee82c0dcec1bd053b5f9a66e265a693bed2" dependencies = [ - "common-path", - "derive-syn-parse 0.2.0", - "once_cell", - "proc-macro2 1.0.86", - "quote 1.0.37", - "regex", - "syn 2.0.72", - "termcolor", - "toml", - "walkdir", + "bytes", + "http 0.2.9", + "pin-project-lite", ] [[package]] -name = "doctest-file" +name = "http-body" version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aac81fa3e28d21450aa4d2ac065992ba96a1d7303efbce51a95f4fd175b67562" +checksum = "1cac85db508abc24a2e48553ba12a996e87244a0395ce011e62b37158745d643" +dependencies = [ + "bytes", + "http 1.1.0", +] [[package]] -name = "dotenvy" -version = "0.15.7" +name = "http-body-util" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1aaf95b3e5c8f23aa320147307562d361db0ae0d51242340f558153b4eb2439b" +checksum = "793429d76616a256bcb62c2a2ec2bed781c8307e797e2598c50010f2bee2544f" +dependencies = [ + "bytes", + "futures-util", + "http 1.1.0", + "http-body 1.0.0", + "pin-project-lite", +] [[package]] -name = "downcast-rs" -version = "1.2.1" +name = "httparse" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75b325c5dbd37f80359721ad39aca5a29fb04c89279657cffdda8736d0c0b9d2" +checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" [[package]] -name = "dtoa" -version = "1.0.9" +name = "httpdate" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcbb2bf8e87535c23f7a8a321e364ce21462d0ff10cb6407820e8e96dfff6653" +checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" [[package]] -name = "dunce" -version = "1.0.4" +name = "hyper" +version = "0.14.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56ce8c6da7551ec6c462cbaf3bfbc75131ebbfa1c944aeaa9dab51ca1c5f0c3b" +checksum = "f361cde2f109281a220d4307746cdfd5ee3f410da58a70377762396775634b33" +dependencies = [ + "bytes", + "futures-channel", + "futures-core", + "futures-util", + "h2 0.3.26", + "http 0.2.9", + "http-body 0.4.6", + "httparse", + "httpdate", + "itoa", + "pin-project-lite", + "socket2", + "tokio", + "tower-service", + "tracing", + "want", +] [[package]] -name = "dyn-clonable" -version = "0.9.0" +name = "hyper" +version = "1.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e9232f0e607a262ceb9bd5141a3dfb3e4db6994b31989bbfd845878cba59fd4" +checksum = "fe575dd17d0862a9a33781c8c4696a55c320909004a67a00fb286ba8b1bc496d" dependencies = [ - "dyn-clonable-impl", - "dyn-clone", + "bytes", + "futures-channel", + "futures-util", + "h2 0.4.5", + "http 1.1.0", + "http-body 1.0.0", + "httparse", + "httpdate", + "itoa", + "pin-project-lite", + "smallvec", + "tokio", + "want", ] [[package]] -name = "dyn-clonable-impl" -version = "0.9.0" +name = "hyper-rustls" +version = "0.24.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "558e40ea573c374cf53507fd240b7ee2f5477df7cfebdb97323ec61c719399c5" +checksum = "ec3efd23720e2049821a693cbc7e65ea87c72f1c58ff2f9522ff332b1491e590" dependencies = [ - "proc-macro2 1.0.86", - "quote 1.0.37", - "syn 1.0.109", + "futures-util", + "http 0.2.9", + "hyper 0.14.29", + "log", + "rustls 0.21.12", + "rustls-native-certs 0.6.3", + "tokio", + "tokio-rustls 0.24.1", ] [[package]] -name = "dyn-clone" -version = "1.0.17" +name = "hyper-rustls" +version = "0.27.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d6ef0072f8a535281e4876be788938b528e9a1d43900b82c2569af7da799125" +checksum = "5ee4be2c948921a1a5320b629c4193916ed787a7f7f293fd3f7f5a6c9de74155" +dependencies = [ + "futures-util", + "http 1.1.0", + "hyper 1.3.1", + "hyper-util", + "log", + "rustls 0.23.10", + "rustls-pki-types", + "tokio", + "tokio-rustls 0.26.0", + "tower-service", +] [[package]] -name = "ecdsa" -version = "0.14.8" +name = "hyper-timeout" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "413301934810f597c1d19ca71c8710e99a3f1ba28a0d2ebc01551a2daeea3c5c" +checksum = "3203a961e5c83b6f5498933e78b6b263e208c197b63e9c6c53cc82ffd3f63793" dependencies = [ - "der 0.6.1", - "elliptic-curve 0.12.3", - "rfc6979 0.3.1", - "signature 1.6.4", + "hyper 1.3.1", + "hyper-util", + "pin-project-lite", + "tokio", + "tower-service", ] [[package]] -name = "ecdsa" -version = "0.16.9" +name = "hyper-tls" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee27f32b5c5292967d2d4a9d7f1e0b0aed2c15daded5a60300e4abb9d8020bca" +checksum = "d6183ddfa99b85da61a140bea0efc93fdf56ceaa041b37d553518030827f9905" dependencies = [ - "der 0.7.8", - "digest 0.10.7", - "elliptic-curve 0.13.8", - "rfc6979 0.4.0", - "signature 2.2.0", - "spki 0.7.2", + "bytes", + "hyper 0.14.29", + "native-tls", + "tokio", + "tokio-native-tls", ] [[package]] -name = "ed25519" -version = "2.2.3" +name = "hyper-tls" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "115531babc129696a58c64a4fef0a8bf9e9698629fb97e9e40767d235cfbcd53" +checksum = "70206fc6890eaca9fde8a0bf71caa2ddfc9fe045ac9e5c70df101a7dbde866e0" dependencies = [ - "pkcs8 0.10.2", - "signature 2.2.0", + "bytes", + "http-body-util", + "hyper 1.3.1", + "hyper-util", + "native-tls", + "tokio", + "tokio-native-tls", + "tower-service", ] [[package]] -name = "ed25519-dalek" -version = "2.1.1" +name = "hyper-util" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a3daa8e81a3963a60642bcc1f90a670680bd4a77535faa384e9d1c79d620871" +checksum = "7b875924a60b96e5d7b9ae7b066540b1dd1cbd90d1828f54c92e02a283351c56" dependencies = [ - "curve25519-dalek 4.1.3", - "ed25519", - "rand_core 0.6.4", - "serde", - "sha2 0.10.8", - "subtle", - "zeroize", + "bytes", + "futures-channel", + "futures-util", + "http 1.1.0", + "http-body 1.0.0", + "hyper 1.3.1", + "pin-project-lite", + "socket2", + "tokio", + "tower", + "tower-service", + "tracing", ] [[package]] -name = "ed25519-zebra" -version = "3.1.0" +name = "iai" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c24f403d068ad0b359e577a77f92392118be3f3c927538f2bb544a5ecd828c6" -dependencies = [ - "curve25519-dalek 3.2.0", - "hashbrown 0.12.3", - "hex", - "rand_core 0.6.4", - "sha2 0.9.9", - "zeroize", -] +checksum = "71a816c97c42258aa5834d07590b718b4c9a598944cd39a52dc25b351185d678" [[package]] -name = "ed25519-zebra" -version = "4.0.3" +name = "iana-time-zone" +version = "0.1.58" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d9ce6874da5d4415896cd45ffbc4d1cfc0c4f9c079427bd870742c30f2f65a9" +checksum = "8326b86b6cff230b97d0d312a6c40a60726df3332e721f72a1b035f451663b20" dependencies = [ - "curve25519-dalek 4.1.3", - "ed25519", - "hashbrown 0.14.5", - "hex", - "rand_core 0.6.4", - "sha2 0.10.8", - "zeroize", + "android_system_properties", + "core-foundation-sys", + "iana-time-zone-haiku", + "js-sys", + "wasm-bindgen", + "windows-core", ] [[package]] -name = "eigen_da_client" -version = "0.1.0" +name = "iana-time-zone-haiku" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" dependencies = [ - "anyhow", - "async-trait", - "da_config", - "da_utils", - "hex", - "http 1.1.0", - "hyper 1.3.1", - "hyper-util", - "kzgpad-rs", - "prost 0.13.1", - "rcgen", - "reqwest 0.12.5", - "serde", - "tokio", - "tonic", - "tonic-build", - "tonic-web", - "tower", - "zksync_da_client", - "zksync_env_config", - "zksync_node_framework", + "cc", ] [[package]] -name = "either" -version = "1.9.0" +name = "ident_case" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" -dependencies = [ - "serde", -] +checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" [[package]] -name = "elliptic-curve" -version = "0.12.3" +name = "idna" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7bb888ab5300a19b8e5bceef25ac745ad065f3c9f7efc6de1b91958110891d3" +checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" dependencies = [ - "base16ct 0.1.1", - "crypto-bigint 0.4.9", - "der 0.6.1", - "digest 0.10.7", - "ff 0.12.1", - "generic-array 0.14.7", - "group 0.12.1", - "pkcs8 0.9.0", - "rand_core 0.6.4", - "sec1 0.3.0", - "subtle", - "zeroize", + "unicode-bidi", + "unicode-normalization", ] [[package]] -name = "elliptic-curve" -version = "0.13.8" +name = "im" +version = "15.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5e6043086bf7973472e0c7dff2142ea0b680d30e18d9cc40f267efbf222bd47" +checksum = "d0acd33ff0285af998aaf9b57342af478078f53492322fafc47450e09397e0e9" dependencies = [ - "base16ct 0.2.0", - "crypto-bigint 0.5.3", - "digest 0.10.7", - "ff 0.13.0", - "generic-array 0.14.7", - "group 0.13.0", - "pem-rfc7468", - "pkcs8 0.10.2", + "bitmaps", "rand_core 0.6.4", - "sec1 0.7.3", - "subtle", - "zeroize", + "rand_xoshiro", + "sized-chunks", + "typenum", + "version_check", ] [[package]] -name = "elsa" -version = "1.9.0" +name = "impl-codec" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "714f766f3556b44e7e4776ad133fcc3445a489517c25c704ace411bb14790194" +checksum = "ba6a270039626615617f3f36d15fc827041df3b78c439da2cadfa47455a77f2f" dependencies = [ - "stable_deref_trait", + "parity-scale-codec", ] [[package]] -name = "encode_unicode" -version = "0.3.6" +name = "impl-rlp" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a357d28ed41a50f9c765dbfe56cbc04a64e53e5fc58ba79fbc34c10ef3df831f" +checksum = "f28220f89297a075ddc7245cd538076ee98b01f2a9c23a53a4f1105d5a322808" +dependencies = [ + "rlp", +] [[package]] -name = "encoding_rs" -version = "0.8.33" +name = "impl-serde" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7268b386296a025e474d5140678f75d6de9493ae55a5d709eeb9dd08149945e1" +checksum = "ebc88fc67028ae3db0c853baa36269d398d5f45b6982f95549ff5def78c935cd" dependencies = [ - "cfg-if 1.0.0", + "serde", ] [[package]] -name = "enum_dispatch" -version = "0.3.13" +name = "impl-trait-for-tuples" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa18ce2bc66555b3218614519ac839ddb759a7d6720732f979ef8d13be147ecd" +checksum = "11d7a9f6330b71fea57921c9b61c47ee6e84f72d394754eff6163ae67e7395eb" dependencies = [ - "once_cell", "proc-macro2 1.0.86", - "quote 1.0.37", - "syn 2.0.72", + "quote 1.0.36", + "syn 1.0.109", ] [[package]] -name = "env_filter" -version = "0.1.0" +name = "indexmap" +version = "1.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a009aa4810eb158359dda09d0c87378e4bbb89b5a801f016885a4707ba24f7ea" +checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" dependencies = [ - "log", + "autocfg", + "hashbrown 0.12.3", ] [[package]] -name = "env_logger" -version = "0.11.3" +name = "indexmap" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38b35839ba51819680ba087cd351788c9a3c476841207e0b8cee0b04722343b9" +checksum = "d530e1a18b1cb4c484e6e34556a0d948706958449fca0cab753d649f2bce3d1f" dependencies = [ - "env_filter", - "log", + "equivalent", + "hashbrown 0.14.5", ] [[package]] -name = "environmental" -version = "1.1.4" +name = "indexmap-nostd" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e48c92028aaa870e83d51c64e5d4e0b6981b360c522198c23959f219a4e1b15b" +checksum = "8e04e2fd2b8188ea827b32ef11de88377086d690286ab35747ef7f9bf3ccb590" [[package]] -name = "envy" -version = "0.4.2" +name = "inout" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f47e0157f2cb54f5ae1bd371b30a2ae4311e1c028f575cd4e81de7353215965" +checksum = "a0c10553d664a4d0bcff9f4215d0aac67a639cc68ef660840afe309b807bc9f5" dependencies = [ - "serde", + "generic-array", ] [[package]] -name = "equivalent" -version = "1.0.1" +name = "insta" +version = "1.34.0" 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" +checksum = "5d64600be34b2fcfc267740a243fa7744441bb4947a619ac4e5bb6507f35fbfc" dependencies = [ - "primitive-types", + "console", + "lazy_static", + "linked-hash-map", + "serde", + "similar", + "yaml-rust", ] [[package]] -name = "errno" -version = "0.3.9" +name = "instant" +version = "0.1.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba" +checksum = "e0242819d153cba4b4b05a5a8f2a7e9bbf97b6055b2a002b395c96b5ff3c0222" dependencies = [ - "libc", - "windows-sys 0.52.0", + "cfg-if", ] [[package]] -name = "error-chain" -version = "0.12.4" +name = "ipnet" +version = "2.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d2f06b9cac1506ece98fe3231e3cc9c4410ec3d5b1f24ae1c8946f0742cdefc" -dependencies = [ - "version_check", -] +checksum = "8f518f335dce6725a761382244631d86cf0ccb2863413590b31338feb467f9c3" [[package]] -name = "etcetera" -version = "0.8.0" +name = "ipnetwork" +version = "0.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "136d1b5283a1ab77bd9257427ffd09d8667ced0570b6f938942bc7568ed5b943" +checksum = "bf466541e9d546596ee94f9f69590f89473455f88372423e0008fc1a7daf100e" dependencies = [ - "cfg-if 1.0.0", - "home", - "windows-sys 0.48.0", + "serde", ] [[package]] -name = "ethabi" -version = "18.0.0" +name = "itertools" +version = "0.10.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7413c5f74cc903ea37386a8965a936cbeb334bd270862fdece542c1b2dcbc898" +checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" dependencies = [ - "ethereum-types", - "hex", - "once_cell", - "regex", - "serde", - "serde_json", - "sha3 0.10.8", - "thiserror", - "uint", + "either", ] [[package]] -name = "ethabi-decode" -version = "1.0.0" -source = "git+https://github.com/Snowfork/ethabi-decode.git?branch=master#5c01c8a0f2d0e4eccf600507cd573b27555b1d9d" +name = "itertools" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "25db6b064527c5d482d0423354fcd07a89a2dfe07b67892e62411946db7f07b0" dependencies = [ - "ethereum-types", - "tiny-keccak 2.0.2", + "either", ] [[package]] -name = "ethbloom" -version = "0.13.0" +name = "itoa" +version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c22d4b5885b6aa2fe5e8b9329fb8d232bf739e434e6b87347c63bdd00c120f60" -dependencies = [ - "crunchy", - "fixed-hash", - "impl-rlp", - "impl-serde", - "tiny-keccak 2.0.2", -] +checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38" [[package]] -name = "ethereum-types" -version = "0.14.1" +name = "jni" +version = "0.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02d215cbf040552efcbe99a38372fe80ab9d00268e20012b79fcd0f073edd8ee" +checksum = "c6df18c2e3db7e453d3c6ac5b3e9d5182664d28788126d39b91f2d1e22b017ec" dependencies = [ - "ethbloom", - "fixed-hash", - "impl-rlp", - "impl-serde", - "primitive-types", - "uint", + "cesu8", + "combine", + "jni-sys", + "log", + "thiserror", + "walkdir", ] [[package]] -name = "event-listener" -version = "4.0.3" +name = "jni-sys" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67b215c49b2b248c855fb73579eb1f4f26c38ffdc12973e20e07b91d78d5646e" -dependencies = [ - "concurrent-queue", - "pin-project-lite", -] +checksum = "8eaf4bc02d17cbdd7ff4c7438cafcdf7fb9a4613313ad11b4f8fefe7d3fa0130" [[package]] -name = "event-listener" -version = "5.3.1" +name = "jobserver" +version = "0.1.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6032be9bd27023a771701cc49f9f053c751055f71efb2e0ae5c15809093675ba" +checksum = "48d1dbcbbeb6a7fec7e059840aa538bd62aaccf972c7346c4d9d2059312853d0" dependencies = [ - "concurrent-queue", - "parking", - "pin-project-lite", + "libc", ] [[package]] -name = "event-listener-strategy" -version = "0.5.2" +name = "js-sys" +version = "0.3.64" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f214dc438f977e6d4e3500aaa277f5ad94ca83fbbd9b1a15713ce2344ccc5a1" +checksum = "c5f195fe497f702db0f318b07fdd68edb16955aed830df8363d837542f8f935a" dependencies = [ - "event-listener 5.3.1", - "pin-project-lite", + "wasm-bindgen", ] [[package]] -name = "expander" -version = "2.2.1" +name = "jsonrpsee" +version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2c470c71d91ecbd179935b24170459e926382eaaa86b590b78814e180d8a8e2" +checksum = "9579d0ca9fb30da026bac2f0f7d9576ec93489aeb7cd4971dd5b4617d82c79b2" dependencies = [ - "blake2 0.10.6", - "file-guard", - "fs-err", - "prettyplease", - "proc-macro2 1.0.86", - "quote 1.0.37", - "syn 2.0.72", + "jsonrpsee-client-transport 0.21.0", + "jsonrpsee-core 0.21.0", + "jsonrpsee-http-client 0.21.0", + "jsonrpsee-types 0.21.0", ] [[package]] -name = "fake-simd" -version = "0.1.2" +name = "jsonrpsee" +version = "0.23.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e88a8acf291dafb59c2d96e8f59828f3838bb1a70398823ade51a84de6a6deed" +checksum = "62b089779ad7f80768693755a031cc14a7766aba707cbe886674e3f79e9b7e47" +dependencies = [ + "jsonrpsee-client-transport 0.23.2", + "jsonrpsee-core 0.23.2", + "jsonrpsee-http-client 0.23.2", + "jsonrpsee-proc-macros", + "jsonrpsee-server", + "jsonrpsee-types 0.23.2", + "jsonrpsee-wasm-client", + "jsonrpsee-ws-client", + "tokio", + "tracing", +] [[package]] -name = "fallible-iterator" -version = "0.2.0" +name = "jsonrpsee-client-transport" +version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4443176a9f2c162692bd3d352d745ef9413eec5782a80d8fd6f8a1ac692a07f7" +checksum = "3f9f9ed46590a8d5681975f126e22531698211b926129a40a2db47cbca429220" +dependencies = [ + "futures-util", + "http 0.2.9", + "jsonrpsee-core 0.21.0", + "pin-project", + "rustls-native-certs 0.7.0", + "rustls-pki-types", + "soketto 0.7.1", + "thiserror", + "tokio", + "tokio-rustls 0.25.0", + "tokio-util", + "tracing", + "url", +] [[package]] -name = "fastrand" -version = "2.0.1" +name = "jsonrpsee-client-transport" +version = "0.23.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25cbce373ec4653f1a01a31e8a5e5ec0c622dc27ff9c4e6606eefef5cbbed4a5" +checksum = "08163edd8bcc466c33d79e10f695cdc98c00d1e6ddfb95cec41b6b0279dd5432" +dependencies = [ + "base64 0.22.1", + "futures-channel", + "futures-util", + "gloo-net", + "http 1.1.0", + "jsonrpsee-core 0.23.2", + "pin-project", + "rustls 0.23.10", + "rustls-pki-types", + "rustls-platform-verifier", + "soketto 0.8.0", + "thiserror", + "tokio", + "tokio-rustls 0.26.0", + "tokio-util", + "tracing", + "url", +] [[package]] -name = "fastrlp" -version = "0.3.1" +name = "jsonrpsee-core" +version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "139834ddba373bbdd213dffe02c8d110508dcf1726c2be27e8d1f7d7e1856418" +checksum = "776d009e2f591b78c038e0d053a796f94575d66ca4e77dd84bfc5e81419e436c" dependencies = [ - "arrayvec 0.7.4", - "auto_impl", - "bytes", + "anyhow", + "async-lock", + "async-trait", + "beef", + "futures-timer", + "futures-util", + "hyper 0.14.29", + "jsonrpsee-types 0.21.0", + "pin-project", + "rustc-hash", + "serde", + "serde_json", + "thiserror", + "tokio", + "tokio-stream", + "tracing", ] [[package]] -name = "ff" -version = "0.12.1" +name = "jsonrpsee-core" +version = "0.23.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d013fc25338cc558c5c2cfbad646908fb23591e2404481826742b651c9af7160" +checksum = "79712302e737d23ca0daa178e752c9334846b08321d439fd89af9a384f8c830b" dependencies = [ - "rand_core 0.6.4", - "subtle", + "anyhow", + "async-trait", + "beef", + "bytes", + "futures-timer", + "futures-util", + "http 1.1.0", + "http-body 1.0.0", + "http-body-util", + "jsonrpsee-types 0.23.2", + "parking_lot", + "pin-project", + "rand 0.8.5", + "rustc-hash", + "serde", + "serde_json", + "thiserror", + "tokio", + "tokio-stream", + "tracing", + "wasm-bindgen-futures", ] [[package]] -name = "ff" -version = "0.13.0" +name = "jsonrpsee-http-client" +version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ded41244b729663b1e574f1b4fb731469f69f79c17667b5d776b16cda0479449" +checksum = "78b7de9f3219d95985eb77fd03194d7c1b56c19bce1abfcc9d07462574b15572" dependencies = [ - "rand_core 0.6.4", - "subtle", + "async-trait", + "hyper 0.14.29", + "hyper-rustls 0.24.2", + "jsonrpsee-core 0.21.0", + "jsonrpsee-types 0.21.0", + "serde", + "serde_json", + "thiserror", + "tokio", + "tower", + "tracing", + "url", ] [[package]] -name = "ff_ce" -version = "0.14.3" +name = "jsonrpsee-http-client" +version = "0.23.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b538e4231443a5b9c507caee3356f016d832cf7393d2d90f03ea3180d4e3fbc" +checksum = "2d90064e04fb9d7282b1c71044ea94d0bbc6eff5621c66f1a0bce9e9de7cf3ac" dependencies = [ - "byteorder", - "ff_derive_ce", - "hex", - "rand 0.4.6", + "async-trait", + "base64 0.22.1", + "http-body 1.0.0", + "hyper 1.3.1", + "hyper-rustls 0.27.2", + "hyper-util", + "jsonrpsee-core 0.23.2", + "jsonrpsee-types 0.23.2", + "rustls 0.23.10", + "rustls-platform-verifier", "serde", + "serde_json", + "thiserror", + "tokio", + "tower", + "tracing", + "url", ] [[package]] -name = "ff_derive_ce" -version = "0.11.2" +name = "jsonrpsee-proc-macros" +version = "0.23.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b96fbccd88dbb1fac4ee4a07c2fcc4ca719a74ffbd9d2b9d41d8c8eb073d8b20" +checksum = "7895f186d5921065d96e16bd795e5ca89ac8356ec423fafc6e3d7cf8ec11aee4" dependencies = [ - "num-bigint 0.4.6", - "num-integer", - "num-traits", + "heck 0.5.0", + "proc-macro-crate 3.1.0", "proc-macro2 1.0.86", - "quote 1.0.37", - "serde", - "syn 1.0.109", + "quote 1.0.36", + "syn 2.0.72", ] [[package]] -name = "fflonk" -version = "0.1.0" -source = "git+https://github.com/w3f/fflonk#1e854f35e9a65d08b11a86291405cdc95baa0a35" +name = "jsonrpsee-server" +version = "0.23.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "654afab2e92e5d88ebd8a39d6074483f3f2bfdf91c5ac57fe285e7127cdd4f51" dependencies = [ - "ark-ec", - "ark-ff 0.4.2", - "ark-poly", - "ark-serialize 0.4.2", - "ark-std 0.4.0", - "merlin 3.0.0", + "anyhow", + "futures-util", + "http 1.1.0", + "http-body 1.0.0", + "http-body-util", + "hyper 1.3.1", + "hyper-util", + "jsonrpsee-core 0.23.2", + "jsonrpsee-types 0.23.2", + "pin-project", + "route-recognizer", + "serde", + "serde_json", + "soketto 0.8.0", + "thiserror", + "tokio", + "tokio-stream", + "tokio-util", + "tower", + "tracing", ] [[package]] -name = "fiat-crypto" -version = "0.2.3" +name = "jsonrpsee-types" +version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f69037fe1b785e84986b4f2cbcf647381876a00671d25ceef715d7812dd7e1dd" +checksum = "3266dfb045c9174b24c77c2dfe0084914bb23a6b2597d70c9dc6018392e1cd1b" +dependencies = [ + "anyhow", + "beef", + "serde", + "serde_json", + "thiserror", +] [[package]] -name = "file-guard" -version = "0.2.0" +name = "jsonrpsee-types" +version = "0.23.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21ef72acf95ec3d7dbf61275be556299490a245f017cf084bd23b4f68cf9407c" +checksum = "d9c465fbe385238e861fdc4d1c85e04ada6c1fd246161d26385c1b311724d2af" dependencies = [ - "libc", - "winapi", + "beef", + "http 1.1.0", + "serde", + "serde_json", + "thiserror", ] [[package]] -name = "findshlibs" -version = "0.10.2" +name = "jsonrpsee-wasm-client" +version = "0.23.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "40b9e59cd0f7e0806cca4be089683ecb6434e602038df21fe6bf6711b2f07f64" +checksum = "4727ac037f834c6f04c0912cada7532dbddb54e92fbc64e33d6cb8c24af313c9" dependencies = [ - "cc", - "lazy_static", - "libc", - "winapi", + "jsonrpsee-client-transport 0.23.2", + "jsonrpsee-core 0.23.2", + "jsonrpsee-types 0.23.2", ] [[package]] -name = "finl_unicode" -version = "1.2.0" +name = "jsonrpsee-ws-client" +version = "0.23.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8fcfdc7a0362c9f4444381a9e697c79d435fe65b52a37466fc2c1184cee9edc6" +checksum = "1c28759775f5cb2f1ea9667672d3fe2b0e701d1f4b7b67954e60afe7fd058b5e" +dependencies = [ + "http 1.1.0", + "jsonrpsee-client-transport 0.23.2", + "jsonrpsee-core 0.23.2", + "jsonrpsee-types 0.23.2", + "url", +] [[package]] -name = "firestorm" -version = "0.5.1" +name = "jsonwebtoken" +version = "9.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c5f6c2c942da57e2aaaa84b8a521489486f14e75e7fa91dab70aba913975f98" +checksum = "b9ae10193d25051e74945f1ea2d0b42e03cc3b890f7e4cc5faa44997d808193f" +dependencies = [ + "base64 0.21.5", + "js-sys", + "pem", + "ring", + "serde", + "serde_json", + "simple_asn1", +] [[package]] -name = "fixed-hash" -version = "0.8.0" +name = "k256" +version = "0.11.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "835c052cb0c08c1acf6ffd71c022172e18723949c8282f2b9f27efbc51e64534" +checksum = "72c1e0b51e7ec0a97369623508396067a486bd0cbed95a2659a4b863d28cfc8b" dependencies = [ - "byteorder", - "rand 0.8.5", - "rustc-hex", - "static_assertions", + "cfg-if", + "ecdsa 0.14.8", + "elliptic-curve 0.12.3", + "sha2 0.10.8", ] [[package]] -name = "fixedbitset" -version = "0.4.2" +name = "k256" +version = "0.13.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" +checksum = "956ff9b67e26e1a6a866cb758f12c6f8746208489e3e4a4b5580802f2f0a587b" +dependencies = [ + "cfg-if", + "ecdsa 0.16.9", + "elliptic-curve 0.13.8", + "once_cell", + "sha2 0.10.8", + "signature 2.2.0", +] [[package]] -name = "flate2" -version = "1.0.28" +name = "keccak" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46303f565772937ffe1d394a4fac6f411c6013172fadde9dcdb1e147a086940e" +checksum = "8f6d5ed8676d904364de097082f4e7d240b571b67989ced0240f08b7f966f940" dependencies = [ - "crc32fast", - "miniz_oxide", + "cpufeatures", ] [[package]] -name = "flume" -version = "0.11.0" +name = "lazy_static" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55ac459de2512911e4b674ce33cf20befaba382d05b62b008afc1c8b57cbf181" +checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" dependencies = [ - "futures-core", - "futures-sink", "spin", ] [[package]] -name = "fnv" -version = "1.0.7" +name = "lazycell" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" +checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" [[package]] -name = "foreign-types" -version = "0.3.2" +name = "leb128" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" -dependencies = [ - "foreign-types-shared", -] +checksum = "884e2677b40cc8c339eaefcb701c32ef1fd2493d71118dc0ca4b6a736c93bd67" [[package]] -name = "foreign-types-shared" -version = "0.1.1" +name = "libc" +version = "0.2.155" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" +checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c" [[package]] -name = "form_urlencoded" -version = "1.2.1" +name = "libloading" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" +checksum = "b67380fd3b2fbe7527a606e18729d21c6f3951633d0500574c4dc22d2d638b9f" dependencies = [ - "percent-encoding", + "cfg-if", + "winapi", ] [[package]] -name = "fraction" -version = "0.15.3" +name = "libm" +version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f158e3ff0a1b334408dc9fb811cd99b446986f4d8b741bb08f9df1604085ae7" -dependencies = [ - "lazy_static", - "num", -] +checksum = "4ec2a862134d2a7d32d7983ddcdd1c4923530833c9f2ea1a44fc5fa473989058" [[package]] -name = "frame-metadata" -version = "15.1.0" +name = "librocksdb-sys" +version = "0.11.0+8.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "878babb0b136e731cc77ec2fd883ff02745ff21e6fb662729953d44923df009c" +checksum = "d3386f101bcb4bd252d8e9d2fb41ec3b0862a15a62b478c355b2982efa469e3e" dependencies = [ - "cfg-if 1.0.0", - "parity-scale-codec", - "scale-info", + "bindgen 0.65.1", + "bzip2-sys", + "cc", + "glob", + "libc", + "libz-sys", + "lz4-sys", + "zstd-sys", ] [[package]] -name = "frame-metadata" -version = "16.0.0" +name = "libsecp256k1" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87cf1549fba25a6fcac22785b61698317d958e96cac72a59102ea45b9ae64692" +checksum = "95b09eff1b35ed3b33b877ced3a691fc7a481919c7e29c53c906226fcf55e2a1" dependencies = [ - "cfg-if 1.0.0", - "parity-scale-codec", - "scale-info", + "arrayref", + "base64 0.13.1", + "digest 0.9.0", + "hmac-drbg", + "libsecp256k1-core", + "libsecp256k1-gen-ecmult", + "libsecp256k1-gen-genmult", + "rand 0.8.5", "serde", + "sha2 0.9.9", + "typenum", ] [[package]] -name = "frame-support" -version = "28.0.0" -source = "git+https://github.com/availproject/polkadot-sdk.git?tag=polkadot-1.7.1-patch-8#fdbd3a9cb323c191bc90bacf79112800c64c6d8a" +name = "libsecp256k1-core" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5be9b9bb642d8522a44d533eab56c16c738301965504753b03ad1de3425d5451" dependencies = [ - "aquamarine", - "array-bytes", - "bitflags 1.3.2", - "docify", - "environmental", - "frame-metadata 16.0.0", - "frame-support-procedural", - "impl-trait-for-tuples", - "k256 0.13.3", - "log", - "macro_magic", - "parity-scale-codec", - "paste", - "scale-info", - "serde", - "serde_json", - "smallvec 1.13.1", - "sp-api", - "sp-arithmetic", - "sp-core", - "sp-crypto-hashing-proc-macro", - "sp-debug-derive 14.0.0 (git+https://github.com/availproject/polkadot-sdk.git?tag=polkadot-1.7.1-patch-8)", - "sp-genesis-builder", - "sp-inherents", - "sp-io", - "sp-metadata-ir", - "sp-runtime", - "sp-staking", - "sp-state-machine", - "sp-std 14.0.0 (git+https://github.com/availproject/polkadot-sdk.git?tag=polkadot-1.7.1-patch-8)", - "sp-tracing 16.0.0 (git+https://github.com/availproject/polkadot-sdk.git?tag=polkadot-1.7.1-patch-8)", - "sp-weights", - "static_assertions", - "tt-call", + "crunchy", + "digest 0.9.0", + "subtle", ] [[package]] -name = "frame-support-procedural" -version = "23.0.0" -source = "git+https://github.com/availproject/polkadot-sdk.git?tag=polkadot-1.7.1-patch-8#fdbd3a9cb323c191bc90bacf79112800c64c6d8a" +name = "libsecp256k1-gen-ecmult" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3038c808c55c87e8a172643a7d87187fc6c4174468159cb3090659d55bcb4809" dependencies = [ - "Inflector", - "cfg-expr", - "derive-syn-parse 0.1.5", - "expander", - "frame-support-procedural-tools", - "itertools 0.10.5", - "macro_magic", - "proc-macro-warning", - "proc-macro2 1.0.86", - "quote 1.0.37", - "sp-crypto-hashing", - "syn 2.0.72", + "libsecp256k1-core", ] [[package]] -name = "frame-support-procedural-tools" -version = "10.0.0" -source = "git+https://github.com/availproject/polkadot-sdk.git?tag=polkadot-1.7.1-patch-8#fdbd3a9cb323c191bc90bacf79112800c64c6d8a" +name = "libsecp256k1-gen-genmult" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3db8d6ba2cec9eacc40e6e8ccc98931840301f1006e95647ceb2dd5c3aa06f7c" dependencies = [ - "frame-support-procedural-tools-derive", - "proc-macro-crate 3.1.0", - "proc-macro2 1.0.86", - "quote 1.0.37", - "syn 2.0.72", + "libsecp256k1-core", ] [[package]] -name = "frame-support-procedural-tools-derive" -version = "11.0.0" -source = "git+https://github.com/availproject/polkadot-sdk.git?tag=polkadot-1.7.1-patch-8#fdbd3a9cb323c191bc90bacf79112800c64c6d8a" +name = "libsqlite3-sys" +version = "0.30.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e99fb7a497b1e3339bc746195567ed8d3e24945ecd636e3619d20b9de9e9149" dependencies = [ - "proc-macro2 1.0.86", - "quote 1.0.37", - "syn 2.0.72", + "cc", + "pkg-config", + "vcpkg", ] [[package]] -name = "franklin-crypto" -version = "0.1.0" +name = "libz-sys" +version = "1.1.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "178bca54fc449a6f4cb45321ed9d769353143ac7ef314ea310f3a0c61bed2da2" +checksum = "d97137b25e321a73eef1418d1d5d2eda4d77e12813f8e6dead84bc52c5870a7b" dependencies = [ - "arr_macro", - "bellman_ce", - "bit-vec", - "blake2 0.9.2", - "blake2-rfc_bellman_edition", - "blake2s_simd", - "byteorder", - "digest 0.9.0", - "hex", - "indexmap 1.9.3", - "itertools 0.10.5", - "lazy_static", - "num-bigint 0.4.6", - "num-derive", - "num-integer", - "num-traits", - "rand 0.4.6", - "serde", - "sha2 0.9.9", - "sha3 0.9.1", - "smallvec 1.13.1", - "splitmut", - "tiny-keccak 1.5.0", -] - -[[package]] -name = "fs-err" -version = "2.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88a41f105fe1d5b6b34b2055e3dc59bb79b46b48b2040b9e6c7b4b5de097aa41" -dependencies = [ - "autocfg", + "cc", + "pkg-config", + "vcpkg", ] [[package]] -name = "fs_extra" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42703706b716c37f96a77aea830392ad231f44c9e9a67872fa5548707e11b11c" - -[[package]] -name = "fuchsia-cprng" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a06f77d526c1a601b7c4cdd98f54b5eaabffc14d5f2f0296febdc7f357c6d3ba" - -[[package]] -name = "funty" -version = "2.0.0" +name = "linked-hash-map" +version = "0.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c" +checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f" [[package]] -name = "futures" -version = "0.1.31" +name = "linux-raw-sys" +version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a471a38ef8ed83cd6e40aa59c1ffe17db6855c18e3604d9c4ed8c08ebc28678" +checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" [[package]] -name = "futures" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "645c6916888f6cb6350d2550b80fb63e734897a8498abe35cfb732b6487804b0" +name = "loadnext" +version = "0.1.0" dependencies = [ - "futures-channel", - "futures-core", - "futures-executor", - "futures-io", - "futures-sink", - "futures-task", - "futures-util", + "anyhow", + "async-trait", + "envy", + "futures 0.3.30", + "hex", + "num", + "once_cell", + "rand 0.8.5", + "regex", + "reqwest 0.12.5", + "serde", + "serde_json", + "static_assertions", + "thiserror", + "tokio", + "tracing", + "vise", + "zksync_config", + "zksync_contracts", + "zksync_eth_client", + "zksync_eth_signer", + "zksync_system_constants", + "zksync_types", + "zksync_utils", + "zksync_vlog", + "zksync_web3_decl", ] [[package]] -name = "futures-channel" -version = "0.3.30" +name = "lock_api" +version = "0.4.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eac8f7d7865dcb88bd4373ab671c8cf4508703796caa2b1985a9ca867b3fcb78" +checksum = "3c168f8615b12bc01f9c17e2eb0cc07dcae1940121185446edc3744920e8ef45" dependencies = [ - "futures-core", - "futures-sink", + "autocfg", + "scopeguard", ] [[package]] -name = "futures-core" -version = "0.3.30" +name = "log" +version = "0.4.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" +checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c" [[package]] -name = "futures-executor" -version = "0.3.30" +name = "logos" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a576fc72ae164fca6b9db127eaa9a9dda0d61316034f33a0a0d4eda41f02b01d" +checksum = "c000ca4d908ff18ac99b93a062cb8958d331c3220719c52e77cb19cc6ac5d2c1" dependencies = [ - "futures-core", - "futures-task", - "futures-util", - "num_cpus", + "logos-derive", ] [[package]] -name = "futures-intrusive" -version = "0.5.0" +name = "logos-codegen" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d930c203dd0b6ff06e0201a4a2fe9149b43c684fd4420555b26d21b1a02956f" +checksum = "dc487311295e0002e452025d6b580b77bb17286de87b57138f3b5db711cded68" dependencies = [ - "futures-core", - "lock_api", - "parking_lot", + "beef", + "fnv", + "proc-macro2 1.0.86", + "quote 1.0.36", + "regex-syntax 0.6.29", + "syn 2.0.72", ] [[package]] -name = "futures-io" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1" - -[[package]] -name = "futures-lite" -version = "2.3.0" +name = "logos-derive" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52527eb5074e35e9339c6b4e8d12600c7128b68fb25dcb9fa9dec18f7c25f3a5" +checksum = "dbfc0d229f1f42d790440136d941afd806bc9e949e2bcb8faa813b0f00d1267e" dependencies = [ - "fastrand", - "futures-core", - "futures-io", - "parking", - "pin-project-lite", + "logos-codegen", ] [[package]] -name = "futures-macro" -version = "0.3.30" +name = "lru" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" +checksum = "2994eeba8ed550fd9b47a0b38f0242bc3344e496483c6180b69139cc2fa5d1d7" dependencies = [ - "proc-macro2 1.0.86", - "quote 1.0.37", - "syn 2.0.72", + "hashbrown 0.14.5", ] [[package]] -name = "futures-sink" -version = "0.3.30" +name = "lz4-sys" +version = "1.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fb8e00e87438d937621c1c6269e53f536c14d3fbd6a042bb24879e57d474fb5" +checksum = "57d27b317e207b10f69f5e75494119e391a96f48861ae870d1da6edac98ca900" +dependencies = [ + "cc", + "libc", +] [[package]] -name = "futures-task" -version = "0.3.30" +name = "mach" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" +checksum = "b823e83b2affd8f40a9ee8c29dbc56404c1e34cd2710921f2801e2cf29527afa" +dependencies = [ + "libc", +] [[package]] -name = "futures-timer" -version = "3.0.2" +name = "match_cfg" +version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e64b03909df88034c26dc1547e8970b91f98bdb65165d6a4e9110d94263dbb2c" -dependencies = [ - "gloo-timers", - "send_wrapper 0.4.0", -] +checksum = "ffbee8634e0d45d258acb448e7eaab3fce7a0a467395d4d9f228e3c1f01fb2e4" [[package]] -name = "futures-util" -version = "0.3.30" +name = "matchers" +version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48" +checksum = "8263075bb86c5a1b1427b5ae862e8889656f126e9f77c484496e8b47cf5c5558" dependencies = [ - "futures 0.1.31", - "futures-channel", - "futures-core", - "futures-io", - "futures-macro", - "futures-sink", - "futures-task", - "memchr", - "pin-project-lite", - "pin-utils", - "slab", + "regex-automata 0.1.10", ] [[package]] -name = "futures-utils-wasm" -version = "0.1.0" +name = "matchit" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42012b0f064e01aa58b545fe3727f90f7dd4020f4a3ea735b50344965f5a57e9" +checksum = "0e7465ac9959cc2b1404e8e2367b43684a6d13790fe23056cc8c6c5a6b7bcb94" [[package]] -name = "generic-array" -version = "0.12.4" +name = "md-5" +version = "0.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffdf9f34f1447443d37393cc6c2b8313aebddcd96906caf34e54c68d8e57d7bd" +checksum = "d89e7ee0cfbedfc4da3340218492196241d89eefb6dab27de5df917a6d2e78cf" dependencies = [ - "typenum", + "cfg-if", + "digest 0.10.7", ] [[package]] -name = "generic-array" -version = "0.14.7" +name = "memchr" +version = "2.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" -dependencies = [ - "typenum", - "version_check", - "zeroize", -] +checksum = "f665ee40bc4a3c5590afb1e9677db74a508659dfd71e126420da8274909a0167" [[package]] -name = "genesis_generator" +name = "merkle_tree_consistency_checker" version = "0.1.0" dependencies = [ "anyhow", "clap 4.4.6", - "futures 0.3.30", - "serde", - "serde_json", - "serde_yaml", - "tokio", "tracing", "zksync_config", - "zksync_contracts", - "zksync_core_leftovers", - "zksync_dal", "zksync_env_config", - "zksync_node_genesis", - "zksync_protobuf", - "zksync_protobuf_config", + "zksync_merkle_tree", + "zksync_storage", "zksync_types", - "zksync_utils", + "zksync_vlog", ] [[package]] -name = "getrandom" -version = "0.1.16" +name = "merlin" +version = "3.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8fc3cb4d91f53b50155bdcfd23f6a4c39ae1969c2ae85982b135750cccaf5fce" +checksum = "58c38e2799fc0978b65dfff8023ec7843e2330bb462f19198840b34b6582397d" dependencies = [ - "cfg-if 1.0.0", - "libc", - "wasi 0.9.0+wasi-snapshot-preview1", + "byteorder", + "keccak", + "rand_core 0.6.4", + "zeroize", ] [[package]] -name = "getrandom" -version = "0.2.10" +name = "miette" +version = "5.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be4136b2a15dd319360be1c07d9933517ccf0be8f16bf62a3bee4f0d618df427" +checksum = "59bb584eaeeab6bd0226ccf3509a69d7936d148cf3d036ad350abe35e8c6856e" dependencies = [ - "cfg-if 1.0.0", - "js-sys", - "libc", - "wasi 0.11.0+wasi-snapshot-preview1", - "wasm-bindgen", + "miette-derive", + "once_cell", + "thiserror", + "unicode-width", ] [[package]] -name = "getrandom_or_panic" -version = "0.0.3" +name = "miette-derive" +version = "5.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ea1015b5a70616b688dc230cfe50c8af89d972cb132d5a622814d29773b10b9" +checksum = "49e7bc1560b95a3c4a25d03de42fe76ca718ab92d1a22a55b9b4cf67b3ae635c" dependencies = [ - "rand 0.8.5", - "rand_core 0.6.4", + "proc-macro2 1.0.86", + "quote 1.0.36", + "syn 2.0.72", ] [[package]] -name = "ghash" -version = "0.5.0" +name = "mime" +version = "0.3.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d930750de5717d2dd0b8c0d42c076c0e884c81a73e6cab859bbd2339c71e3e40" -dependencies = [ - "opaque-debug 0.3.0", - "polyval", -] +checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" [[package]] -name = "gimli" -version = "0.27.3" +name = "mime_guess" +version = "2.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6c80984affa11d98d1b88b66ac8853f143217b399d3c74116778ff8fdb4ed2e" +checksum = "4192263c238a5f0d0c6bfd21f336a313a4ce1c450542449ca191bb657b4642ef" dependencies = [ - "fallible-iterator", - "indexmap 1.9.3", - "stable_deref_trait", + "mime", + "unicase", ] [[package]] -name = "gimli" -version = "0.28.0" +name = "mini-moka" +version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fb8d784f27acf97159b40fc4db5ecd8aa23b9ad5ef69cdd136d3bc80665f0c0" +checksum = "23e0b72e7c9042467008b10279fc732326bd605459ae03bda88825909dd19b56" +dependencies = [ + "crossbeam-channel", + "crossbeam-utils", + "dashmap", + "skeptic", + "smallvec", + "tagptr", + "triomphe", +] [[package]] -name = "glob" -version = "0.3.1" +name = "minimal-lexical" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" +checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" [[package]] -name = "gloo-net" -version = "0.5.0" +name = "miniz_oxide" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43aaa242d1239a8822c15c645f02166398da4f8b5c4bae795c1f5b44e9eee173" +checksum = "e7810e0be55b428ada41041c41f32c9f1a42817901b4ccf45fa3d4b6561e74c7" dependencies = [ - "futures-channel", - "futures-core", - "futures-sink", - "gloo-utils", - "http 0.2.9", - "js-sys", - "pin-project", - "serde", - "serde_json", - "thiserror", - "wasm-bindgen", - "wasm-bindgen-futures", - "web-sys", + "adler", ] [[package]] -name = "gloo-timers" -version = "0.2.6" +name = "mio" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b995a66bb87bebce9a0f4a95aed01daca4872c050bfcb21653361c03bc35e5c" +checksum = "4569e456d394deccd22ce1c1913e6ea0e54519f577285001215d33557431afe4" dependencies = [ - "futures-channel", - "futures-core", - "js-sys", - "wasm-bindgen", + "hermit-abi 0.3.9", + "libc", + "wasi 0.11.0+wasi-snapshot-preview1", + "windows-sys 0.52.0", ] [[package]] -name = "gloo-utils" -version = "0.2.0" +name = "mirai-annotations" +version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b5555354113b18c547c1d3a98fbf7fb32a9ff4f6fa112ce823a21641a0ba3aa" -dependencies = [ - "js-sys", - "serde", - "serde_json", - "wasm-bindgen", - "web-sys", -] +checksum = "c9be0862c1b3f26a88803c4a49de6889c10e608b3ee9344e6ef5b45fb37ad3d1" [[package]] -name = "google-cloud-auth" -version = "0.16.0" +name = "multer" +version = "3.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1112c453c2e155b3e683204ffff52bcc6d6495d04b68d9e90cd24161270c5058" +checksum = "83e87776546dc87511aa5ee218730c92b666d7264ab6ed41f9d215af9cd5224b" dependencies = [ - "async-trait", - "base64 0.21.5", - "google-cloud-metadata", - "google-cloud-token", - "home", - "jsonwebtoken", - "reqwest 0.12.5", - "serde", - "serde_json", - "thiserror", - "time", - "tokio", - "tracing", - "urlencoding", + "bytes", + "encoding_rs", + "futures-util", + "http 1.1.0", + "httparse", + "memchr", + "mime", + "spin", + "version_check", ] [[package]] -name = "google-cloud-metadata" -version = "0.5.0" +name = "multimap" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04f945a208886a13d07636f38fb978da371d0abc3e34bad338124b9f8c135a8f" -dependencies = [ - "reqwest 0.12.5", - "thiserror", - "tokio", -] +checksum = "e5ce46fe64a9d73be07dcbe690a38ce1b293be448fd8ce1e6c1b8062c9f72c6a" [[package]] -name = "google-cloud-storage" -version = "0.20.0" +name = "native-tls" +version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc0c5b7469142d91bd77959e69375bede324a5def07c7f29aa0d582586cba305" +checksum = "07226173c32f2926027b63cce4bcd8076c3552846cbe7925f3aaffeac0a3b92e" dependencies = [ - "anyhow", - "async-stream", - "async-trait", - "base64 0.21.5", - "bytes", - "futures-util", - "google-cloud-auth", - "google-cloud-metadata", - "google-cloud-token", - "hex", - "once_cell", - "percent-encoding", - "pkcs8 0.10.2", - "regex", - "reqwest 0.12.5", - "reqwest-middleware", - "ring 0.17.7", - "serde", - "serde_json", - "sha2 0.10.8", - "thiserror", - "time", - "tokio", - "tracing", - "url", + "lazy_static", + "libc", + "log", + "openssl", + "openssl-probe", + "openssl-sys", + "schannel", + "security-framework", + "security-framework-sys", + "tempfile", ] [[package]] -name = "google-cloud-token" -version = "0.1.2" +name = "nix" +version = "0.27.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f49c12ba8b21d128a2ce8585955246977fbce4415f680ebf9199b6f9d6d725f" +checksum = "2eb04e9c688eff1c89d72b407f168cf79bb9e867a9d3323ed6c01519eb9cc053" dependencies = [ - "async-trait", + "bitflags 2.6.0", + "cfg-if", + "libc", ] [[package]] -name = "governor" -version = "0.4.2" +name = "no-std-compat" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19775995ee20209163239355bc3ad2f33f83da35d9ef72dea26e5af753552c87" -dependencies = [ - "dashmap", - "futures 0.3.30", - "futures-timer", - "no-std-compat", - "nonzero_ext", - "parking_lot", - "quanta", - "rand 0.8.5", - "smallvec 1.13.1", -] +checksum = "b93853da6d84c2e3c7d730d6473e8817692dd89be387eb01b94d7f108ecb5b8c" [[package]] -name = "group" -version = "0.12.1" +name = "no-std-net" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5dfbfb3a6cfbd390d5c9564ab283a0349b9b9fcd46a706c1eb10e0db70bfbac7" -dependencies = [ - "ff 0.12.1", - "rand_core 0.6.4", - "subtle", -] +checksum = "43794a0ace135be66a25d3ae77d41b91615fb68ae937f904090203e81f755b65" [[package]] -name = "group" -version = "0.13.0" +name = "nodrop" +version = "0.1.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0f9ef7462f7c099f518d754361858f86d8a07af53ba9af0fe635bbccb151a63" -dependencies = [ - "ff 0.13.0", - "rand_core 0.6.4", - "subtle", -] +checksum = "72ef4a56884ca558e5ddb05a1d1e7e1bfd9a68d9ed024c21704cc98872dae1bb" [[package]] -name = "h2" -version = "0.3.26" +name = "nom" +version = "7.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81fe527a889e1532da5c525686d96d4c2e74cdd345badf8dfef9f6b39dd5f5e8" +checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" dependencies = [ - "bytes", - "fnv", - "futures-core", - "futures-sink", - "futures-util", - "http 0.2.9", - "indexmap 2.1.0", - "slab", - "tokio", - "tokio-util", - "tracing", + "memchr", + "minimal-lexical", ] [[package]] -name = "h2" -version = "0.4.5" +name = "nonzero_ext" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa82e28a107a8cc405f0839610bdc9b15f1e25ec7d696aa5cf173edbcb1486ab" -dependencies = [ - "atomic-waker", - "bytes", - "fnv", - "futures-core", - "futures-sink", - "http 1.1.0", - "indexmap 2.1.0", - "slab", - "tokio", - "tokio-util", - "tracing", -] - -[[package]] -name = "half" -version = "1.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eabb4a44450da02c90444cf74558da904edde8fb4e9035a9a6a4e15445af0bd7" - -[[package]] -name = "handlebars" -version = "3.5.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4498fc115fa7d34de968184e473529abb40eeb6be8bc5f7faba3d08c316cb3e3" -dependencies = [ - "log", - "pest", - "pest_derive", - "quick-error 2.0.1", - "serde", - "serde_json", -] - -[[package]] -name = "hash-db" -version = "0.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e7d7786361d7425ae2fe4f9e407eb0efaa0840f5212d109cc018c40c35c6ab4" +checksum = "38bf9645c8b145698bb0b18a4637dcacbc421ea49bef2317e4fd8065a387cf21" [[package]] -name = "hash256-std-hasher" -version = "0.15.2" +name = "nu-ansi-term" +version = "0.46.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92c171d55b98633f4ed3860808f004099b36c1cc29c42cfc53aa8591b21efcf2" +checksum = "77a8165726e8236064dbb45459242600304b42a5ea24ee2948e18e023bf7ba84" dependencies = [ - "crunchy", + "overload", + "winapi", ] [[package]] -name = "hashbrown" -version = "0.12.3" +name = "num" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" +checksum = "35bd024e8b2ff75562e5f34e7f4905839deb4b22955ef5e73d2fea1b9813cb23" dependencies = [ - "ahash 0.7.7", + "num-bigint 0.4.6", + "num-complex", + "num-integer", + "num-iter", + "num-rational", + "num-traits", ] [[package]] -name = "hashbrown" -version = "0.13.2" +name = "num-bigint" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" +checksum = "5f6f7833f2cbf2360a6cfd58cd41a53aa7a90bd4c202f5b1c7dd2ed73c57b2c3" dependencies = [ - "ahash 0.8.7", + "autocfg", + "num-integer", + "num-traits", ] [[package]] -name = "hashbrown" -version = "0.14.5" +name = "num-bigint" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" +checksum = "a5e44f723f1133c9deac646763579fdb3ac745e418f2a7af9cd0c431da1f20b9" dependencies = [ - "ahash 0.8.7", - "allocator-api2", + "num-integer", + "num-traits", "serde", ] [[package]] -name = "hashlink" -version = "0.9.1" +name = "num-bigint-dig" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ba4ff7128dee98c7dc9794b6a411377e1404dba1c97deb8d1a55297bd25d8af" +checksum = "dc84195820f291c7697304f3cbdadd1cb7199c0efc917ff5eafd71225c136151" dependencies = [ - "hashbrown 0.14.5", + "byteorder", + "lazy_static", + "libm", + "num-integer", + "num-iter", + "num-traits", + "rand 0.8.5", + "smallvec", + "zeroize", ] [[package]] -name = "heck" -version = "0.3.3" +name = "num-complex" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d621efb26863f0e9924c6ac577e8275e5e6b77455db64ffa6c65c904e9e132c" +checksum = "73f88a1307638156682bada9d7604135552957b7818057dcef22705b4d509495" dependencies = [ - "unicode-segmentation", + "num-traits", + "serde", ] [[package]] -name = "heck" -version = "0.4.1" +name = "num-conv" +version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" +checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" [[package]] -name = "heck" -version = "0.5.0" +name = "num-derive" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" +checksum = "eafd0b45c5537c3ba526f79d3e75120036502bebacbb3f3220914067ce39dbf2" +dependencies = [ + "proc-macro2 0.4.30", + "quote 0.6.13", + "syn 0.15.44", +] [[package]] -name = "hermit-abi" -version = "0.1.19" +name = "num-integer" +version = "0.1.46" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" +checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f" dependencies = [ - "libc", + "num-traits", ] [[package]] -name = "hermit-abi" -version = "0.3.9" +name = "num-iter" +version = "0.1.45" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" +checksum = "1429034a0490724d0075ebb2bc9e875d6503c3cf69e235a8941aa757d83ef5bf" +dependencies = [ + "autocfg", + "num-integer", + "num-traits", +] [[package]] -name = "hermit-abi" -version = "0.4.0" +name = "num-modular" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbf6a919d6cf397374f7dfeeea91d974c7c0a7221d0d0f4f20d859d329e53fcc" +checksum = "64a5fe11d4135c3bcdf3a95b18b194afa9608a5f6ff034f5d857bc9a27fb0119" +dependencies = [ + "num-integer", + "num-traits", +] [[package]] -name = "hex" -version = "0.4.3" +name = "num-rational" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" +checksum = "f83d14da390562dca69fc84082e73e548e1ad308d24accdedd2720017cb37824" dependencies = [ + "num-bigint 0.4.6", + "num-integer", + "num-traits", "serde", ] [[package]] -name = "hex-literal" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" - -[[package]] -name = "hkdf" -version = "0.12.3" +name = "num-traits" +version = "0.2.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "791a029f6b9fc27657f6f188ec6e5e43f6911f6f878e0dc5501396e09809d437" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" dependencies = [ - "hmac 0.12.1", + "autocfg", + "libm", ] [[package]] -name = "hmac" -version = "0.8.1" +name = "num_cpus" +version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "126888268dcc288495a26bf004b38c5fdbb31682f992c84ceb046a1f0fe38840" +checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" dependencies = [ - "crypto-mac 0.8.0", - "digest 0.9.0", + "hermit-abi 0.3.9", + "libc", ] [[package]] -name = "hmac" -version = "0.11.0" +name = "num_enum" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a2a2320eb7ec0ebe8da8f744d7812d9fc4cb4d09344ac01898dbcb6a20ae69b" +checksum = "7a015b430d3c108a207fd776d2e2196aaf8b1cf8cf93253e3a097ff3085076a1" dependencies = [ - "crypto-mac 0.11.0", - "digest 0.9.0", + "num_enum_derive 0.6.1", ] [[package]] -name = "hmac" -version = "0.12.1" +name = "num_enum" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" +checksum = "02339744ee7253741199f897151b38e72257d13802d4ee837285cc2990a90845" dependencies = [ - "digest 0.10.7", + "num_enum_derive 0.7.2", ] [[package]] -name = "hmac-drbg" -version = "0.3.0" +name = "num_enum_derive" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17ea0a1394df5b6574da6e0c1ade9e78868c9fb0a4e5ef4428e32da4676b85b1" +checksum = "96667db765a921f7b295ffee8b60472b686a51d4f21c2ee4ffdb94c7013b65a6" dependencies = [ - "digest 0.9.0", - "generic-array 0.14.7", - "hmac 0.8.1", + "proc-macro-crate 1.3.1", + "proc-macro2 1.0.86", + "quote 1.0.36", + "syn 2.0.72", ] [[package]] -name = "home" -version = "0.5.5" +name = "num_enum_derive" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5444c27eef6923071f7ebcc33e3444508466a76f7a2b93da00ed6e19f30c1ddb" +checksum = "681030a937600a36906c185595136d26abfebb4aa9c65701cefcaf8578bb982b" dependencies = [ - "windows-sys 0.48.0", + "proc-macro-crate 3.1.0", + "proc-macro2 1.0.86", + "quote 1.0.36", + "syn 2.0.72", ] [[package]] -name = "hostname" -version = "0.3.1" +name = "object" +version = "0.32.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c731c3e10504cc8ed35cfe2f1db4c9274c3d35fa486e3b31df46f068ef3e867" +checksum = "9cf5f9dd3933bd50a9e1f149ec995f39ae2c496d31fd772c1fd45ebc27e902b0" dependencies = [ - "libc", - "match_cfg", - "winapi", + "memchr", ] [[package]] -name = "http" -version = "0.2.9" +name = "once_cell" +version = "1.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd6effc99afb63425aff9b05836f029929e345a6148a14b7ecd5ab67af944482" -dependencies = [ - "bytes", - "fnv", - "itoa", -] +checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" [[package]] -name = "http" -version = "1.1.0" +name = "oorandom" +version = "11.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21b9ddb458710bc376481b842f5da65cdf31522de232c1ca8146abce2a358258" -dependencies = [ - "bytes", - "fnv", - "itoa", -] +checksum = "0ab1bc2a289d34bd04a330323ac98a1b4bc82c9d9fcb1e66b63caa84da26b575" [[package]] -name = "http-body" -version = "0.4.6" +name = "opaque-debug" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ceab25649e9960c0311ea418d17bee82c0dcec1bd053b5f9a66e265a693bed2" -dependencies = [ - "bytes", - "http 0.2.9", - "pin-project-lite", -] +checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" [[package]] -name = "http-body" -version = "1.0.0" +name = "openssl" +version = "0.10.66" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1cac85db508abc24a2e48553ba12a996e87244a0395ce011e62b37158745d643" +checksum = "9529f4786b70a3e8c61e11179af17ab6188ad8d0ded78c5529441ed39d4bd9c1" dependencies = [ - "bytes", - "http 1.1.0", + "bitflags 2.6.0", + "cfg-if", + "foreign-types", + "libc", + "once_cell", + "openssl-macros", + "openssl-sys", ] [[package]] -name = "http-body-util" -version = "0.1.2" +name = "openssl-macros" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "793429d76616a256bcb62c2a2ec2bed781c8307e797e2598c50010f2bee2544f" +checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ - "bytes", - "futures-util", - "http 1.1.0", - "http-body 1.0.0", - "pin-project-lite", + "proc-macro2 1.0.86", + "quote 1.0.36", + "syn 2.0.72", ] [[package]] -name = "httparse" -version = "1.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" - -[[package]] -name = "httpdate" -version = "1.0.3" +name = "openssl-probe" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" +checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" [[package]] -name = "hyper" -version = "0.14.29" +name = "openssl-sys" +version = "0.9.103" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f361cde2f109281a220d4307746cdfd5ee3f410da58a70377762396775634b33" +checksum = "7f9e8deee91df40a943c71b917e5874b951d32a802526c85721ce3b776c929d6" dependencies = [ - "bytes", - "futures-channel", - "futures-core", - "futures-util", - "h2 0.3.26", - "http 0.2.9", - "http-body 0.4.6", - "httparse", - "httpdate", - "itoa", - "pin-project-lite", - "socket2", - "tokio", - "tower-service", - "tracing", - "want", + "cc", + "libc", + "pkg-config", + "vcpkg", ] [[package]] -name = "hyper" -version = "1.3.1" +name = "opentelemetry" +version = "0.24.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe575dd17d0862a9a33781c8c4696a55c320909004a67a00fb286ba8b1bc496d" +checksum = "4c365a63eec4f55b7efeceb724f1336f26a9cf3427b70e59e2cd2a5b947fba96" dependencies = [ - "bytes", - "futures-channel", - "futures-util", - "h2 0.4.5", - "http 1.1.0", - "http-body 1.0.0", - "httparse", - "httpdate", - "itoa", + "futures-core", + "futures-sink", + "js-sys", + "once_cell", "pin-project-lite", - "smallvec 1.13.1", - "tokio", - "want", + "thiserror", ] [[package]] -name = "hyper-rustls" -version = "0.24.2" +name = "opentelemetry-appender-tracing" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec3efd23720e2049821a693cbc7e65ea87c72f1c58ff2f9522ff332b1491e590" +checksum = "b84de945cb3a6f1e0d6317cbd998bbd0519ab00f4b790db67e0ff4fdcf7cedb6" dependencies = [ - "futures-util", - "http 0.2.9", - "hyper 0.14.29", - "log", - "rustls 0.21.12", - "rustls-native-certs 0.6.3", - "tokio", - "tokio-rustls 0.24.1", + "opentelemetry", + "tracing", + "tracing-core", + "tracing-subscriber", ] [[package]] -name = "hyper-rustls" -version = "0.27.2" +name = "opentelemetry-http" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ee4be2c948921a1a5320b629c4193916ed787a7f7f293fd3f7f5a6c9de74155" +checksum = "ad31e9de44ee3538fb9d64fe3376c1362f406162434609e79aea2a41a0af78ab" dependencies = [ - "futures-util", + "async-trait", + "bytes", "http 1.1.0", - "hyper 1.3.1", - "hyper-util", - "log", - "rustls 0.23.10", - "rustls-pki-types", - "tokio", - "tokio-rustls 0.26.0", - "tower-service", + "opentelemetry", + "reqwest 0.12.5", ] [[package]] -name = "hyper-timeout" -version = "0.5.1" +name = "opentelemetry-otlp" +version = "0.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3203a961e5c83b6f5498933e78b6b263e208c197b63e9c6c53cc82ffd3f63793" +checksum = "6b925a602ffb916fb7421276b86756027b37ee708f9dce2dbdcc51739f07e727" dependencies = [ - "hyper 1.3.1", - "hyper-util", - "pin-project-lite", + "async-trait", + "futures-core", + "http 1.1.0", + "opentelemetry", + "opentelemetry-http", + "opentelemetry-proto", + "opentelemetry_sdk", + "prost 0.13.1", + "reqwest 0.12.5", + "thiserror", "tokio", - "tower-service", + "tonic", ] [[package]] -name = "hyper-tls" -version = "0.5.0" +name = "opentelemetry-proto" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6183ddfa99b85da61a140bea0efc93fdf56ceaa041b37d553518030827f9905" +checksum = "30ee9f20bff9c984511a02f082dc8ede839e4a9bf15cc2487c8d6fea5ad850d9" dependencies = [ - "bytes", - "hyper 0.14.29", - "native-tls", - "tokio", - "tokio-native-tls", + "opentelemetry", + "opentelemetry_sdk", + "prost 0.13.1", + "tonic", ] [[package]] -name = "hyper-tls" -version = "0.6.0" +name = "opentelemetry-semantic-conventions" +version = "0.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70206fc6890eaca9fde8a0bf71caa2ddfc9fe045ac9e5c70df101a7dbde866e0" -dependencies = [ - "bytes", - "http-body-util", - "hyper 1.3.1", - "hyper-util", - "native-tls", - "tokio", - "tokio-native-tls", - "tower-service", -] +checksum = "1cefe0543875379e47eb5f1e68ff83f45cc41366a92dfd0d073d513bf68e9a05" [[package]] -name = "hyper-util" -version = "0.1.5" +name = "opentelemetry_sdk" +version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b875924a60b96e5d7b9ae7b066540b1dd1cbd90d1828f54c92e02a283351c56" +checksum = "692eac490ec80f24a17828d49b40b60f5aeaccdfe6a503f939713afd22bc28df" dependencies = [ - "bytes", + "async-trait", "futures-channel", + "futures-executor", "futures-util", - "http 1.1.0", - "http-body 1.0.0", - "hyper 1.3.1", - "pin-project-lite", - "socket2", + "glob", + "once_cell", + "opentelemetry", + "percent-encoding", + "rand 0.8.5", + "serde_json", + "thiserror", "tokio", - "tower", - "tower-service", - "tracing", + "tokio-stream", ] [[package]] -name = "iai" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "71a816c97c42258aa5834d07590b718b4c9a598944cd39a52dc25b351185d678" - -[[package]] -name = "iana-time-zone" -version = "0.1.58" +name = "ordered-float" +version = "2.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8326b86b6cff230b97d0d312a6c40a60726df3332e721f72a1b035f451663b20" +checksum = "68f19d67e5a2795c94e73e0bb1cc1a7edeb2e28efd39e2e1c9b7a40c1108b11c" dependencies = [ - "android_system_properties", - "core-foundation-sys", - "iana-time-zone-haiku", - "js-sys", - "wasm-bindgen", - "windows-core", + "num-traits", ] [[package]] -name = "iana-time-zone-haiku" -version = "0.1.2" +name = "os_info" +version = "3.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" +checksum = "006e42d5b888366f1880eda20371fedde764ed2213dc8496f49622fa0c99cd5e" dependencies = [ - "cc", + "log", + "serde", + "winapi", ] [[package]] -name = "ident_case" -version = "1.0.1" +name = "os_str_bytes" +version = "6.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" +checksum = "e2355d85b9a3786f481747ced0e0ff2ba35213a1f9bd406ed906554d7af805a1" [[package]] -name = "idna" -version = "0.5.0" +name = "overload" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" -dependencies = [ - "unicode-bidi", - "unicode-normalization", -] +checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" [[package]] -name = "im" -version = "15.1.0" +name = "p256" +version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0acd33ff0285af998aaf9b57342af478078f53492322fafc47450e09397e0e9" +checksum = "c9863ad85fa8f4460f9c48cb909d38a0d689dba1f6f6988a5e3e0d31071bcd4b" dependencies = [ - "bitmaps", - "rand_core 0.6.4", - "rand_xoshiro", - "sized-chunks", - "typenum", - "version_check", + "ecdsa 0.16.9", + "elliptic-curve 0.13.8", + "primeorder", + "sha2 0.10.8", ] [[package]] -name = "impl-codec" -version = "0.6.0" +name = "parity-scale-codec" +version = "3.6.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba6a270039626615617f3f36d15fc827041df3b78c439da2cadfa47455a77f2f" +checksum = "306800abfa29c7f16596b5970a588435e3d5b3149683d00c12b699cc19f895ee" dependencies = [ - "parity-scale-codec", + "arrayvec 0.7.4", + "bitvec", + "byte-slice-cast", + "impl-trait-for-tuples", + "parity-scale-codec-derive", + "serde", ] [[package]] -name = "impl-rlp" -version = "0.3.0" +name = "parity-scale-codec-derive" +version = "3.6.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f28220f89297a075ddc7245cd538076ee98b01f2a9c23a53a4f1105d5a322808" +checksum = "d830939c76d294956402033aee57a6da7b438f2294eb94864c37b0569053a42c" dependencies = [ - "rlp", + "proc-macro-crate 3.1.0", + "proc-macro2 1.0.86", + "quote 1.0.36", + "syn 1.0.109", ] [[package]] -name = "impl-serde" -version = "0.4.0" +name = "parking" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ebc88fc67028ae3db0c853baa36269d398d5f45b6982f95549ff5def78c935cd" -dependencies = [ - "serde", -] +checksum = "bb813b8af86854136c6922af0598d719255ecb2179515e6e7730d468f05c9cae" [[package]] -name = "impl-trait-for-tuples" -version = "0.2.2" +name = "parking_lot" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11d7a9f6330b71fea57921c9b61c47ee6e84f72d394754eff6163ae67e7395eb" +checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" dependencies = [ - "proc-macro2 1.0.86", - "quote 1.0.37", - "syn 1.0.109", + "lock_api", + "parking_lot_core", ] [[package]] -name = "include_dir" -version = "0.7.4" +name = "parking_lot_core" +version = "0.9.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "923d117408f1e49d914f1a379a309cffe4f18c05cf4e3d12e613a15fc81bd0dd" +checksum = "4c42a9226546d68acdd9c0a280d17ce19bfe27a46bf68784e4066115788d008e" dependencies = [ - "include_dir_macros", + "cfg-if", + "libc", + "redox_syscall", + "smallvec", + "windows-targets 0.48.5", ] [[package]] -name = "include_dir_macros" -version = "0.7.4" +name = "paste" +version = "1.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "de3145af08024dea9fa9914f381a17b8fc6034dfb00f3a84013f7ff43f29ed4c" + +[[package]] +name = "pbkdf2" +version = "0.12.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7cab85a7ed0bd5f0e76d93846e0147172bed2e2d3f859bcc33a8d9699cad1a75" +checksum = "f8ed6a7761f76e3b9f92dfb0a60a6a6477c61024b775147ff0973a02653abaf2" dependencies = [ - "proc-macro2 1.0.86", - "quote 1.0.37", + "digest 0.10.7", ] [[package]] -name = "indexmap" -version = "1.9.3" +name = "peeking_take_while" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" +checksum = "19b17cddbe7ec3f8bc800887bab5e717348c95ea2ca0b1bf0837fb964dc67099" + +[[package]] +name = "pem" +version = "3.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e459365e590736a54c3fa561947c84837534b8e9af6fc5bf781307e82658fae" dependencies = [ - "autocfg", - "hashbrown 0.12.3", + "base64 0.22.1", "serde", ] [[package]] -name = "indexmap" -version = "2.1.0" +name = "pem-rfc7468" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d530e1a18b1cb4c484e6e34556a0d948706958449fca0cab753d649f2bce3d1f" +checksum = "88b39c9bfcfc231068454382784bb460aae594343fb030d46e9f50a645418412" dependencies = [ - "equivalent", - "hashbrown 0.14.5", + "base64ct", ] [[package]] -name = "indexmap-nostd" -version = "0.4.0" +name = "percent-encoding" +version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e04e2fd2b8188ea827b32ef11de88377086d690286ab35747ef7f9bf3ccb590" +checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" [[package]] -name = "inout" -version = "0.1.3" +name = "pest" +version = "2.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a0c10553d664a4d0bcff9f4215d0aac67a639cc68ef660840afe309b807bc9f5" +checksum = "1f200d8d83c44a45b21764d1916299752ca035d15ecd46faca3e9a2a2bf6ad06" dependencies = [ - "generic-array 0.14.7", + "memchr", + "thiserror", + "ucd-trie", ] [[package]] -name = "insta" -version = "1.34.0" +name = "pest_derive" +version = "2.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d64600be34b2fcfc267740a243fa7744441bb4947a619ac4e5bb6507f35fbfc" +checksum = "bcd6ab1236bbdb3a49027e920e693192ebfe8913f6d60e294de57463a493cfde" dependencies = [ - "console", - "lazy_static", - "linked-hash-map", - "serde", - "similar", - "yaml-rust", + "pest", + "pest_generator", ] [[package]] -name = "instant" -version = "0.1.13" +name = "pest_generator" +version = "2.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0242819d153cba4b4b05a5a8f2a7e9bbf97b6055b2a002b395c96b5ff3c0222" +checksum = "2a31940305ffc96863a735bef7c7994a00b325a7138fdbc5bda0f1a0476d3275" dependencies = [ - "cfg-if 1.0.0", + "pest", + "pest_meta", + "proc-macro2 1.0.86", + "quote 1.0.36", + "syn 2.0.72", ] [[package]] -name = "integer-sqrt" -version = "0.1.5" +name = "pest_meta" +version = "2.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "276ec31bcb4a9ee45f58bec6f9ec700ae4cf4f4f8f2fa7e06cb406bd5ffdd770" +checksum = "a7ff62f5259e53b78d1af898941cdcdccfae7385cf7d793a6e55de5d05bb4b7d" dependencies = [ - "num-traits", + "once_cell", + "pest", + "sha2 0.10.8", ] [[package]] -name = "interprocess" -version = "2.2.1" +name = "petgraph" +version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2f4e4a06d42fab3e85ab1b419ad32b09eab58b901d40c57935ff92db3287a13" +checksum = "e1d3afd2628e69da2be385eb6f2fd57c8ac7977ceeff6dc166ff1657b0e386a9" dependencies = [ - "doctest-file", - "futures-core", - "libc", - "recvmsg", - "tokio", - "widestring", - "windows-sys 0.52.0", + "fixedbitset", + "indexmap 2.1.0", ] [[package]] -name = "io-lifetimes" -version = "1.0.11" +name = "pin-project" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eae7b9aee968036d54dce06cebaefd919e4472e753296daccd6d344e3e2df0c2" +checksum = "fda4ed1c6c173e3fc7a83629421152e01d7b1f9b7f65fb301e490e8cfc656422" dependencies = [ - "hermit-abi 0.3.9", - "libc", - "windows-sys 0.48.0", + "pin-project-internal", ] [[package]] -name = "ipnet" -version = "2.9.0" +name = "pin-project-internal" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f518f335dce6725a761382244631d86cf0ccb2863413590b31338feb467f9c3" +checksum = "4359fd9c9171ec6e8c62926d6faaf553a8dc3f64e1507e76da7911b4f6a04405" +dependencies = [ + "proc-macro2 1.0.86", + "quote 1.0.36", + "syn 2.0.72", +] [[package]] -name = "ipnetwork" -version = "0.20.0" +name = "pin-project-lite" +version = "0.2.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf466541e9d546596ee94f9f69590f89473455f88372423e0008fc1a7daf100e" +checksum = "8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58" + +[[package]] +name = "pin-utils" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" + +[[package]] +name = "piper" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96c8c490f422ef9a4efd2cb5b42b76c8613d7e7dfc1caf667b8a3350a5acc066" dependencies = [ - "serde", + "atomic-waker", + "fastrand", + "futures-io", ] [[package]] -name = "itertools" -version = "0.10.5" +name = "pkcs1" +version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" +checksum = "c8ffb9f10fa047879315e6625af03c164b16962a5368d724ed16323b68ace47f" dependencies = [ - "either", + "der 0.7.8", + "pkcs8 0.10.2", + "spki 0.7.2", ] [[package]] -name = "itertools" -version = "0.12.0" +name = "pkcs8" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25db6b064527c5d482d0423354fcd07a89a2dfe07b67892e62411946db7f07b0" +checksum = "9eca2c590a5f85da82668fa685c09ce2888b9430e83299debf1f34b65fd4a4ba" dependencies = [ - "either", + "der 0.6.1", + "spki 0.6.0", ] [[package]] -name = "itertools" -version = "0.13.0" +name = "pkcs8" +version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186" +checksum = "f950b2377845cebe5cf8b5165cb3cc1a5e0fa5cfa3e1f7f55707d8fd82e0a7b7" dependencies = [ - "either", + "der 0.7.8", + "spki 0.7.2", ] [[package]] -name = "itoa" -version = "1.0.9" +name = "pkg-config" +version = "0.3.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38" +checksum = "26072860ba924cbfa98ea39c8c19b4dd6a4a25423dbdf219c1eca91aa0cf6964" [[package]] -name = "jni" -version = "0.19.0" +name = "plotters" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6df18c2e3db7e453d3c6ac5b3e9d5182664d28788126d39b91f2d1e22b017ec" +checksum = "d2c224ba00d7cadd4d5c660deaf2098e5e80e07846537c51f9cfa4be50c1fd45" dependencies = [ - "cesu8", - "combine", - "jni-sys", - "log", - "thiserror", - "walkdir", + "num-traits", + "plotters-backend", + "plotters-svg", + "wasm-bindgen", + "web-sys", ] [[package]] -name = "jni-sys" -version = "0.3.0" +name = "plotters-backend" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8eaf4bc02d17cbdd7ff4c7438cafcdf7fb9a4613313ad11b4f8fefe7d3fa0130" +checksum = "9e76628b4d3a7581389a35d5b6e2139607ad7c75b17aed325f210aa91f4a9609" [[package]] -name = "jobserver" -version = "0.1.32" +name = "plotters-svg" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48d1dbcbbeb6a7fec7e059840aa538bd62aaccf972c7346c4d9d2059312853d0" +checksum = "38f6d39893cca0701371e3c27294f09797214b86f1fb951b89ade8ec04e2abab" dependencies = [ - "libc", + "plotters-backend", ] [[package]] -name = "js-sys" -version = "0.3.64" +name = "polling" +version = "3.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5f195fe497f702db0f318b07fdd68edb16955aed830df8363d837542f8f935a" +checksum = "cc2790cd301dec6cd3b7a025e4815cf825724a51c98dccfe6a3e55f05ffb6511" dependencies = [ - "wasm-bindgen", + "cfg-if", + "concurrent-queue", + "hermit-abi 0.4.0", + "pin-project-lite", + "rustix", + "tracing", + "windows-sys 0.59.0", ] [[package]] -name = "jsonrpsee" -version = "0.21.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9579d0ca9fb30da026bac2f0f7d9576ec93489aeb7cd4971dd5b4617d82c79b2" -dependencies = [ - "jsonrpsee-client-transport 0.21.0", - "jsonrpsee-core 0.21.0", - "jsonrpsee-http-client 0.21.0", - "jsonrpsee-types 0.21.0", -] - -[[package]] -name = "jsonrpsee" -version = "0.22.5" +name = "poly1305" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cfdb12a2381ea5b2e68c3469ec604a007b367778cdb14d09612c8069ebd616ad" +checksum = "8159bd90725d2df49889a078b54f4f79e87f1f8a8444194cdca81d38f5393abf" dependencies = [ - "jsonrpsee-client-transport 0.22.5", - "jsonrpsee-core 0.22.5", - "jsonrpsee-http-client 0.22.5", - "jsonrpsee-proc-macros 0.22.5", - "jsonrpsee-types 0.22.5", - "jsonrpsee-wasm-client 0.22.5", - "jsonrpsee-ws-client 0.22.5", - "tracing", + "cpufeatures", + "opaque-debug", + "universal-hash", ] [[package]] -name = "jsonrpsee" -version = "0.23.2" +name = "polyval" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62b089779ad7f80768693755a031cc14a7766aba707cbe886674e3f79e9b7e47" +checksum = "d52cff9d1d4dee5fe6d03729099f4a310a41179e0a10dbf542039873f2e826fb" dependencies = [ - "jsonrpsee-client-transport 0.23.2", - "jsonrpsee-core 0.23.2", - "jsonrpsee-http-client 0.23.2", - "jsonrpsee-proc-macros 0.23.2", - "jsonrpsee-server", - "jsonrpsee-types 0.23.2", - "jsonrpsee-wasm-client 0.23.2", - "jsonrpsee-ws-client 0.23.2", - "tokio", - "tracing", + "cfg-if", + "cpufeatures", + "opaque-debug", + "universal-hash", ] [[package]] -name = "jsonrpsee-client-transport" -version = "0.21.0" +name = "powerfmt" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f9f9ed46590a8d5681975f126e22531698211b926129a40a2db47cbca429220" -dependencies = [ - "futures-util", - "http 0.2.9", - "jsonrpsee-core 0.21.0", - "pin-project", - "rustls-native-certs 0.7.0", - "rustls-pki-types", - "soketto 0.7.1", - "thiserror", - "tokio", - "tokio-rustls 0.25.0", - "tokio-util", - "tracing", - "url", -] +checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" [[package]] -name = "jsonrpsee-client-transport" -version = "0.22.5" +name = "ppv-lite86" +version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4978087a58c3ab02efc5b07c5e5e2803024536106fd5506f558db172c889b3aa" -dependencies = [ - "futures-channel", - "futures-util", - "gloo-net", - "http 0.2.9", - "jsonrpsee-core 0.22.5", - "pin-project", - "rustls-native-certs 0.7.0", - "rustls-pki-types", - "soketto 0.7.1", - "thiserror", - "tokio", - "tokio-rustls 0.25.0", - "tokio-util", - "tracing", - "url", - "webpki-roots", -] +checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" [[package]] -name = "jsonrpsee-client-transport" -version = "0.23.2" +name = "pretty_assertions" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08163edd8bcc466c33d79e10f695cdc98c00d1e6ddfb95cec41b6b0279dd5432" +checksum = "af7cee1a6c8a5b9208b3cb1061f10c0cb689087b3d8ce85fb9d2dd7a29b6ba66" dependencies = [ - "base64 0.22.1", - "futures-channel", - "futures-util", - "gloo-net", - "http 1.1.0", - "jsonrpsee-core 0.23.2", - "pin-project", - "rustls 0.23.10", - "rustls-pki-types", - "rustls-platform-verifier", - "soketto 0.8.0", - "thiserror", - "tokio", - "tokio-rustls 0.26.0", - "tokio-util", - "tracing", - "url", + "diff", + "yansi", ] [[package]] -name = "jsonrpsee-core" -version = "0.21.0" +name = "prettyplease" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "776d009e2f591b78c038e0d053a796f94575d66ca4e77dd84bfc5e81419e436c" +checksum = "ae005bd773ab59b4725093fd7df83fd7892f7d8eafb48dbd7de6e024e4215f9d" dependencies = [ - "anyhow", - "async-lock", - "async-trait", - "beef", - "futures-timer", - "futures-util", - "hyper 0.14.29", - "jsonrpsee-types 0.21.0", - "pin-project", - "rustc-hash", - "serde", - "serde_json", - "thiserror", - "tokio", - "tokio-stream", - "tracing", + "proc-macro2 1.0.86", + "syn 2.0.72", ] [[package]] -name = "jsonrpsee-core" -version = "0.22.5" +name = "primeorder" +version = "0.13.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4b257e1ec385e07b0255dde0b933f948b5c8b8c28d42afda9587c3a967b896d" +checksum = "353e1ca18966c16d9deb1c69278edbc5f194139612772bd9537af60ac231e1e6" dependencies = [ - "anyhow", - "async-trait", - "beef", - "futures-timer", - "futures-util", - "hyper 0.14.29", - "jsonrpsee-types 0.22.5", - "pin-project", - "rustc-hash", - "serde", - "serde_json", - "thiserror", - "tokio", - "tokio-stream", - "tracing", - "wasm-bindgen-futures", + "elliptic-curve 0.13.8", ] [[package]] -name = "jsonrpsee-core" -version = "0.23.2" +name = "primitive-types" +version = "0.12.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79712302e737d23ca0daa178e752c9334846b08321d439fd89af9a384f8c830b" +checksum = "0b34d9fd68ae0b74a41b21c03c2f62847aa0ffea044eee893b4c140b37e244e2" dependencies = [ - "anyhow", - "async-trait", - "beef", - "bytes", - "futures-timer", - "futures-util", - "http 1.1.0", - "http-body 1.0.0", - "http-body-util", - "jsonrpsee-types 0.23.2", - "parking_lot", - "pin-project", - "rand 0.8.5", - "rustc-hash", - "serde", - "serde_json", - "thiserror", - "tokio", - "tokio-stream", - "tracing", - "wasm-bindgen-futures", + "fixed-hash", + "impl-codec", + "impl-rlp", + "impl-serde", + "scale-info", + "uint", ] [[package]] -name = "jsonrpsee-http-client" -version = "0.21.0" +name = "proc-macro-crate" +version = "1.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78b7de9f3219d95985eb77fd03194d7c1b56c19bce1abfcc9d07462574b15572" +checksum = "7f4c021e1093a56626774e81216a4ce732a735e5bad4868a03f3ed65ca0c3919" dependencies = [ - "async-trait", - "hyper 0.14.29", - "hyper-rustls 0.24.2", - "jsonrpsee-core 0.21.0", - "jsonrpsee-types 0.21.0", - "serde", - "serde_json", - "thiserror", - "tokio", - "tower", - "tracing", - "url", + "once_cell", + "toml_edit 0.19.15", ] [[package]] -name = "jsonrpsee-http-client" -version = "0.22.5" +name = "proc-macro-crate" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ccf93fc4a0bfe05d851d37d7c32b7f370fe94336b52a2f0efc5f1981895c2e5" +checksum = "7e8366a6159044a37876a2b9817124296703c586a5c92e2c53751fa06d8d43e8" dependencies = [ - "async-trait", - "hyper 0.14.29", - "hyper-rustls 0.24.2", - "jsonrpsee-core 0.22.5", - "jsonrpsee-types 0.22.5", - "serde", - "serde_json", - "thiserror", - "tokio", - "tower", - "tracing", - "url", + "toml_edit 0.20.2", ] [[package]] -name = "jsonrpsee-http-client" -version = "0.23.2" +name = "proc-macro-crate" +version = "3.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d90064e04fb9d7282b1c71044ea94d0bbc6eff5621c66f1a0bce9e9de7cf3ac" +checksum = "6d37c51ca738a55da99dc0c4a34860fd675453b8b36209178c2249bb13651284" dependencies = [ - "async-trait", - "base64 0.22.1", - "http-body 1.0.0", - "hyper 1.3.1", - "hyper-rustls 0.27.2", - "hyper-util", - "jsonrpsee-core 0.23.2", - "jsonrpsee-types 0.23.2", - "rustls 0.23.10", - "rustls-platform-verifier", - "serde", - "serde_json", - "thiserror", - "tokio", - "tower", - "tracing", - "url", + "toml_edit 0.21.1", ] [[package]] -name = "jsonrpsee-proc-macros" -version = "0.22.5" +name = "proc-macro-error" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d0bb047e79a143b32ea03974a6bf59b62c2a4c5f5d42a381c907a8bbb3f75c0" +checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" dependencies = [ - "heck 0.4.1", - "proc-macro-crate 3.1.0", + "proc-macro-error-attr", "proc-macro2 1.0.86", - "quote 1.0.37", - "syn 2.0.72", + "quote 1.0.36", + "syn 1.0.109", + "version_check", ] [[package]] -name = "jsonrpsee-proc-macros" -version = "0.23.2" +name = "proc-macro-error-attr" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7895f186d5921065d96e16bd795e5ca89ac8356ec423fafc6e3d7cf8ec11aee4" +checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" dependencies = [ - "heck 0.5.0", - "proc-macro-crate 3.1.0", "proc-macro2 1.0.86", - "quote 1.0.37", - "syn 2.0.72", + "quote 1.0.36", + "version_check", ] [[package]] -name = "jsonrpsee-server" -version = "0.23.2" +name = "proc-macro-hack" +version = "0.5.20+deprecated" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "654afab2e92e5d88ebd8a39d6074483f3f2bfdf91c5ac57fe285e7127cdd4f51" +checksum = "dc375e1527247fe1a97d8b7156678dfe7c1af2fc075c9a4db3690ecd2a148068" + +[[package]] +name = "proc-macro2" +version = "0.4.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf3d2011ab5c909338f7887f4fc896d35932e29146c12c8d01da6b22a80ba759" dependencies = [ - "anyhow", - "futures-util", - "http 1.1.0", - "http-body 1.0.0", - "http-body-util", - "hyper 1.3.1", - "hyper-util", - "jsonrpsee-core 0.23.2", - "jsonrpsee-types 0.23.2", - "pin-project", - "route-recognizer", - "serde", - "serde_json", - "soketto 0.8.0", - "thiserror", - "tokio", - "tokio-stream", - "tokio-util", - "tower", - "tracing", + "unicode-xid 0.1.0", ] [[package]] -name = "jsonrpsee-types" -version = "0.21.0" +name = "proc-macro2" +version = "1.0.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3266dfb045c9174b24c77c2dfe0084914bb23a6b2597d70c9dc6018392e1cd1b" +checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" dependencies = [ - "anyhow", - "beef", - "serde", - "serde_json", - "thiserror", + "unicode-ident", ] [[package]] -name = "jsonrpsee-types" -version = "0.22.5" +name = "prometheus-client" +version = "0.22.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "150d6168405890a7a3231a3c74843f58b8959471f6df76078db2619ddee1d07d" +checksum = "c1ca959da22a332509f2a73ae9e5f23f9dcfc31fd3a54d71f159495bd5909baa" dependencies = [ - "anyhow", - "beef", - "serde", - "serde_json", - "thiserror", + "dtoa", + "itoa", + "parking_lot", + "prometheus-client-derive-encode", ] [[package]] -name = "jsonrpsee-types" -version = "0.23.2" +name = "prometheus-client-derive-encode" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9c465fbe385238e861fdc4d1c85e04ada6c1fd246161d26385c1b311724d2af" +checksum = "440f724eba9f6996b75d63681b0a92b06947f1457076d503a4d2e2c8f56442b8" dependencies = [ - "beef", - "http 1.1.0", - "serde", - "serde_json", - "thiserror", + "proc-macro2 1.0.86", + "quote 1.0.36", + "syn 2.0.72", ] [[package]] -name = "jsonrpsee-wasm-client" -version = "0.22.5" +name = "prost" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f448d8eacd945cc17b6c0b42c361531ca36a962ee186342a97cdb8fca679cd77" +checksum = "f4fdd22f3b9c31b53c060df4a0613a1c7f062d4115a2b984dd15b1858f7e340d" dependencies = [ - "jsonrpsee-client-transport 0.22.5", - "jsonrpsee-core 0.22.5", - "jsonrpsee-types 0.22.5", + "bytes", + "prost-derive 0.12.1", ] [[package]] -name = "jsonrpsee-wasm-client" -version = "0.23.2" +name = "prost" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4727ac037f834c6f04c0912cada7532dbddb54e92fbc64e33d6cb8c24af313c9" +checksum = "e13db3d3fde688c61e2446b4d843bc27a7e8af269a69440c0308021dc92333cc" dependencies = [ - "jsonrpsee-client-transport 0.23.2", - "jsonrpsee-core 0.23.2", - "jsonrpsee-types 0.23.2", + "bytes", + "prost-derive 0.13.1", ] [[package]] -name = "jsonrpsee-ws-client" -version = "0.22.5" +name = "prost-build" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58b9db2dfd5bb1194b0ce921504df9ceae210a345bc2f6c5a61432089bbab070" +checksum = "8bdf592881d821b83d471f8af290226c8d51402259e9bb5be7f9f8bdebbb11ac" dependencies = [ - "http 0.2.9", - "jsonrpsee-client-transport 0.22.5", - "jsonrpsee-core 0.22.5", - "jsonrpsee-types 0.22.5", - "url", + "bytes", + "heck 0.4.1", + "itertools 0.10.5", + "log", + "multimap", + "once_cell", + "petgraph", + "prettyplease", + "prost 0.12.1", + "prost-types", + "regex", + "syn 2.0.72", + "tempfile", + "which", ] [[package]] -name = "jsonrpsee-ws-client" -version = "0.23.2" +name = "prost-derive" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c28759775f5cb2f1ea9667672d3fe2b0e701d1f4b7b67954e60afe7fd058b5e" +checksum = "265baba7fabd416cf5078179f7d2cbeca4ce7a9041111900675ea7c4cb8a4c32" dependencies = [ - "http 1.1.0", - "jsonrpsee-client-transport 0.23.2", - "jsonrpsee-core 0.23.2", - "jsonrpsee-types 0.23.2", - "url", + "anyhow", + "itertools 0.10.5", + "proc-macro2 1.0.86", + "quote 1.0.36", + "syn 2.0.72", ] [[package]] -name = "jsonwebtoken" -version = "9.3.0" +name = "prost-derive" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9ae10193d25051e74945f1ea2d0b42e03cc3b890f7e4cc5faa44997d808193f" +checksum = "18bec9b0adc4eba778b33684b7ba3e7137789434769ee3ce3930463ef904cfca" +dependencies = [ + "anyhow", + "itertools 0.12.0", + "proc-macro2 1.0.86", + "quote 1.0.36", + "syn 2.0.72", +] + +[[package]] +name = "prost-reflect" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "057237efdb71cf4b3f9396302a3d6599a92fa94063ba537b66130980ea9909f3" dependencies = [ "base64 0.21.5", - "js-sys", - "pem", - "ring 0.17.7", + "logos", + "miette", + "once_cell", + "prost 0.12.1", + "prost-types", "serde", - "serde_json", - "simple_asn1", + "serde-value", ] [[package]] -name = "k256" -version = "0.11.6" +name = "prost-types" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72c1e0b51e7ec0a97369623508396067a486bd0cbed95a2659a4b863d28cfc8b" +checksum = "e081b29f63d83a4bc75cfc9f3fe424f9156cf92d8a4f0c9407cce9a1b67327cf" dependencies = [ - "cfg-if 1.0.0", - "ecdsa 0.14.8", - "elliptic-curve 0.12.3", - "sha2 0.10.8", + "prost 0.12.1", ] [[package]] -name = "k256" -version = "0.13.3" +name = "protox" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "956ff9b67e26e1a6a866cb758f12c6f8746208489e3e4a4b5580802f2f0a587b" +checksum = "00bb76c5f6221de491fe2c8f39b106330bbd9762c6511119c07940e10eb9ff11" dependencies = [ - "cfg-if 1.0.0", - "ecdsa 0.16.9", - "elliptic-curve 0.13.8", - "once_cell", - "sha2 0.10.8", - "signature 2.2.0", + "bytes", + "miette", + "prost 0.12.1", + "prost-reflect", + "prost-types", + "protox-parse", + "thiserror", ] [[package]] -name = "keccak" -version = "0.1.4" +name = "protox-parse" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f6d5ed8676d904364de097082f4e7d240b571b67989ced0240f08b7f966f940" +checksum = "7b4581f441c58863525a3e6bec7b8de98188cf75239a56c725a3e7288450a33f" dependencies = [ - "cpufeatures", + "logos", + "miette", + "prost-types", + "thiserror", ] [[package]] -name = "keccak-asm" +name = "ptr_meta" version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "505d1856a39b200489082f90d897c3f07c455563880bc5952e38eabf731c83b6" +checksum = "0738ccf7ea06b608c10564b31debd4f5bc5e197fc8bfe088f68ae5ce81e7a4f1" dependencies = [ - "digest 0.10.7", - "sha3-asm", + "ptr_meta_derive", ] [[package]] -name = "kzgpad-rs" -version = "0.1.0" -source = "git+https://github.com/Layr-Labs/kzgpad-rs.git?tag=v0.1.0#b5f8c8d3d6482407dc118cb1f51597a017a1cc89" +name = "ptr_meta_derive" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "16b845dbfca988fa33db069c0e230574d15a3088f147a87b64c7589eb662c9ac" dependencies = [ - "rand 0.8.5", + "proc-macro2 1.0.86", + "quote 1.0.36", + "syn 1.0.109", ] [[package]] -name = "lazy_static" -version = "1.5.0" +name = "pulldown-cmark" +version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" +checksum = "77a1a2f1f0a7ecff9c31abbe177637be0e97a0aef46cf8738ece09327985d998" dependencies = [ - "spin", + "bitflags 1.3.2", + "memchr", + "unicase", ] [[package]] -name = "lazycell" -version = "1.3.0" +name = "quanta" +version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" +checksum = "20afe714292d5e879d8b12740aa223c6a88f118af41870e8b6196e39a02238a8" +dependencies = [ + "crossbeam-utils", + "libc", + "mach", + "once_cell", + "raw-cpuid", + "wasi 0.10.2+wasi-snapshot-preview1", + "web-sys", + "winapi", +] [[package]] -name = "leb128" -version = "0.2.5" +name = "quick-error" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "884e2677b40cc8c339eaefcb701c32ef1fd2493d71118dc0ca4b6a736c93bd67" +checksum = "a993555f31e5a609f617c12db6250dedcac1b0a85076912c436e6fc9b2c8e6a3" [[package]] -name = "libc" -version = "0.2.155" +name = "quick-protobuf" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c" +checksum = "9d6da84cc204722a989e01ba2f6e1e276e190f22263d0cb6ce8526fcdb0d2e1f" +dependencies = [ + "byteorder", +] [[package]] -name = "libloading" -version = "0.7.4" +name = "quote" +version = "0.6.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b67380fd3b2fbe7527a606e18729d21c6f3951633d0500574c4dc22d2d638b9f" +checksum = "6ce23b6b870e8f94f81fb0a363d65d86675884b34a09043c81e5562f11c1f8e1" dependencies = [ - "cfg-if 1.0.0", - "winapi", + "proc-macro2 0.4.30", ] [[package]] -name = "libm" -version = "0.2.8" +name = "quote" +version = "1.0.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ec2a862134d2a7d32d7983ddcdd1c4923530833c9f2ea1a44fc5fa473989058" +checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" +dependencies = [ + "proc-macro2 1.0.86", +] [[package]] -name = "librocksdb-sys" -version = "0.11.0+8.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3386f101bcb4bd252d8e9d2fb41ec3b0862a15a62b478c355b2982efa469e3e" -dependencies = [ - "bindgen 0.65.1", - "bzip2-sys", - "cc", - "glob", - "libc", - "libz-sys", - "lz4-sys", - "zstd-sys", -] - -[[package]] -name = "libsecp256k1" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95b09eff1b35ed3b33b877ced3a691fc7a481919c7e29c53c906226fcf55e2a1" -dependencies = [ - "arrayref", - "base64 0.13.1", - "digest 0.9.0", - "hmac-drbg", - "libsecp256k1-core", - "libsecp256k1-gen-ecmult", - "libsecp256k1-gen-genmult", - "rand 0.8.5", - "serde", - "sha2 0.9.9", - "typenum", -] - -[[package]] -name = "libsecp256k1-core" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5be9b9bb642d8522a44d533eab56c16c738301965504753b03ad1de3425d5451" -dependencies = [ - "crunchy", - "digest 0.9.0", - "subtle", -] - -[[package]] -name = "libsecp256k1-gen-ecmult" -version = "0.3.0" +name = "radium" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3038c808c55c87e8a172643a7d87187fc6c4174468159cb3090659d55bcb4809" -dependencies = [ - "libsecp256k1-core", -] +checksum = "dc33ff2d4973d518d823d61aa239014831e521c75da58e3df4840d3f47749d09" [[package]] -name = "libsecp256k1-gen-genmult" -version = "0.3.0" +name = "rand" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3db8d6ba2cec9eacc40e6e8ccc98931840301f1006e95647ceb2dd5c3aa06f7c" +checksum = "552840b97013b1a26992c11eac34bdd778e464601a4c2054b5f0bff7c6761293" dependencies = [ - "libsecp256k1-core", + "fuchsia-cprng", + "libc", + "rand_core 0.3.1", + "rdrand", + "winapi", ] [[package]] -name = "libsqlite3-sys" -version = "0.30.1" +name = "rand" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e99fb7a497b1e3339bc746195567ed8d3e24945ecd636e3619d20b9de9e9149" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" dependencies = [ - "cc", - "pkg-config", - "vcpkg", + "libc", + "rand_chacha", + "rand_core 0.6.4", ] [[package]] -name = "libz-sys" -version = "1.1.12" +name = "rand_chacha" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d97137b25e321a73eef1418d1d5d2eda4d77e12813f8e6dead84bc52c5870a7b" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" dependencies = [ - "cc", - "pkg-config", - "vcpkg", + "ppv-lite86", + "rand_core 0.6.4", ] [[package]] -name = "linked-hash-map" -version = "0.5.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f" - -[[package]] -name = "linux-raw-sys" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f051f77a7c8e6957c0696eac88f26b0117e54f52d3fc682ab19397a8812846a4" - -[[package]] -name = "linux-raw-sys" -version = "0.4.14" +name = "rand_core" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" - -[[package]] -name = "loadnext" -version = "0.1.0" +checksum = "7a6fdeb83b075e8266dcc8762c22776f6877a63111121f5f8c7411e5be7eed4b" dependencies = [ - "anyhow", - "async-trait", - "envy", - "futures 0.3.30", - "hex", - "num", - "once_cell", - "rand 0.8.5", - "regex", - "reqwest 0.12.5", - "serde", - "serde_json", - "static_assertions", - "thiserror", - "tokio", - "tracing", - "vise", - "zksync_config", - "zksync_contracts", - "zksync_eth_client", - "zksync_eth_signer", - "zksync_system_constants", - "zksync_types", - "zksync_utils", - "zksync_vlog", - "zksync_web3_decl", + "rand_core 0.4.2", ] [[package]] -name = "lock_api" -version = "0.4.11" +name = "rand_core" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c168f8615b12bc01f9c17e2eb0cc07dcae1940121185446edc3744920e8ef45" -dependencies = [ - "autocfg", - "scopeguard", -] +checksum = "9c33a3c44ca05fa6f1807d8e6743f3824e8509beca625669633be0acbdf509dc" [[package]] -name = "log" -version = "0.4.22" +name = "rand_core" +version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" dependencies = [ - "serde", + "getrandom", ] [[package]] -name = "logos" -version = "0.13.0" +name = "rand_xoshiro" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c000ca4d908ff18ac99b93a062cb8958d331c3220719c52e77cb19cc6ac5d2c1" +checksum = "6f97cdb2a36ed4183de61b2f824cc45c9f1037f28afe0a322e9fff4c108b5aaa" dependencies = [ - "logos-derive", + "rand_core 0.6.4", ] [[package]] -name = "logos-codegen" -version = "0.13.0" +name = "raw-cpuid" +version = "10.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc487311295e0002e452025d6b580b77bb17286de87b57138f3b5db711cded68" +checksum = "6c297679cb867470fa8c9f67dbba74a78d78e3e98d7cf2b08d6d71540f797332" dependencies = [ - "beef", - "fnv", - "proc-macro2 1.0.86", - "quote 1.0.37", - "regex-syntax 0.6.29", - "syn 2.0.72", + "bitflags 1.3.2", ] [[package]] -name = "logos-derive" -version = "0.13.0" +name = "rayon" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbfc0d229f1f42d790440136d941afd806bc9e949e2bcb8faa813b0f00d1267e" +checksum = "b418a60154510ca1a002a752ca9714984e21e4241e804d32555251faf8b78ffa" dependencies = [ - "logos-codegen", + "either", + "rayon-core", ] [[package]] -name = "lru" -version = "0.12.1" +name = "rayon-core" +version = "1.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2994eeba8ed550fd9b47a0b38f0242bc3344e496483c6180b69139cc2fa5d1d7" +checksum = "1465873a3dfdaa8ae7cb14b4383657caab0b3e8a0aa9ae8e04b044854c8dfce2" dependencies = [ - "hashbrown 0.14.5", + "crossbeam-deque", + "crossbeam-utils", ] [[package]] -name = "lz4-sys" -version = "1.9.4" +name = "rdrand" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57d27b317e207b10f69f5e75494119e391a96f48861ae870d1da6edac98ca900" +checksum = "678054eb77286b51581ba43620cc911abf02758c91f93f479767aed0f90458b2" dependencies = [ - "cc", - "libc", + "rand_core 0.3.1", ] [[package]] -name = "mach" -version = "0.3.2" +name = "redox_syscall" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b823e83b2affd8f40a9ee8c29dbc56404c1e34cd2710921f2801e2cf29527afa" +checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" dependencies = [ - "libc", + "bitflags 1.3.2", ] [[package]] -name = "macro_magic" -version = "0.5.1" +name = "regex" +version = "1.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc33f9f0351468d26fbc53d9ce00a096c8522ecb42f19b50f34f2c422f76d21d" +checksum = "4219d74c6b67a3654a9fbebc4b419e22126d13d2f3c4a07ee0cb61ff79a79619" dependencies = [ - "macro_magic_core", - "macro_magic_macros", - "quote 1.0.37", - "syn 2.0.72", + "aho-corasick", + "memchr", + "regex-automata 0.4.7", + "regex-syntax 0.8.2", ] [[package]] -name = "macro_magic_core" -version = "0.5.1" +name = "regex-automata" +version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1687dc887e42f352865a393acae7cf79d98fab6351cde1f58e9e057da89bf150" +checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132" dependencies = [ - "const-random", - "derive-syn-parse 0.2.0", - "macro_magic_core_macros", - "proc-macro2 1.0.86", - "quote 1.0.37", - "syn 2.0.72", + "regex-syntax 0.6.29", ] [[package]] -name = "macro_magic_core_macros" -version = "0.5.1" +name = "regex-automata" +version = "0.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b02abfe41815b5bd98dbd4260173db2c116dda171dc0fe7838cb206333b83308" +checksum = "38caf58cc5ef2fed281f89292ef23f6365465ed9a41b7a7754eb4e26496c92df" dependencies = [ - "proc-macro2 1.0.86", - "quote 1.0.37", - "syn 2.0.72", + "aho-corasick", + "memchr", + "regex-syntax 0.8.2", ] [[package]] -name = "macro_magic_macros" -version = "0.5.1" +name = "regex-syntax" +version = "0.6.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73ea28ee64b88876bf45277ed9a5817c1817df061a74f2b988971a12570e5869" -dependencies = [ - "macro_magic_core", - "quote 1.0.37", - "syn 2.0.72", -] +checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" [[package]] -name = "match_cfg" -version = "0.1.0" +name = "regex-syntax" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffbee8634e0d45d258acb448e7eaab3fce7a0a467395d4d9f228e3c1f01fb2e4" +checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" [[package]] -name = "matchers" -version = "0.0.1" +name = "rend" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f099785f7595cc4b4553a174ce30dd7589ef93391ff414dbb67f62392b9e0ce1" +checksum = "a2571463863a6bd50c32f94402933f03457a3fbaf697a707c5be741e459f08fd" dependencies = [ - "regex-automata 0.1.10", + "bytecheck", ] [[package]] -name = "matchers" -version = "0.1.0" +name = "reqwest" +version = "0.11.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8263075bb86c5a1b1427b5ae862e8889656f126e9f77c484496e8b47cf5c5558" +checksum = "046cd98826c46c2ac8ddecae268eb5c2e58628688a5fc7a2643704a73faba95b" dependencies = [ - "regex-automata 0.1.10", -] - -[[package]] -name = "matchit" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e7465ac9959cc2b1404e8e2367b43684a6d13790fe23056cc8c6c5a6b7bcb94" - -[[package]] -name = "maybe-uninit" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60302e4db3a61da70c0cb7991976248362f30319e88850c487b9b95bbf059e00" + "base64 0.21.5", + "bytes", + "encoding_rs", + "futures-core", + "futures-util", + "h2 0.3.26", + "http 0.2.9", + "http-body 0.4.6", + "hyper 0.14.29", + "hyper-tls 0.5.0", + "ipnet", + "js-sys", + "log", + "mime", + "native-tls", + "once_cell", + "percent-encoding", + "pin-project-lite", + "serde", + "serde_json", + "serde_urlencoded", + "system-configuration", + "tokio", + "tokio-native-tls", + "tower-service", + "url", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", + "winreg 0.50.0", +] [[package]] -name = "md-5" -version = "0.10.6" +name = "reqwest" +version = "0.12.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d89e7ee0cfbedfc4da3340218492196241d89eefb6dab27de5df917a6d2e78cf" +checksum = "c7d6d2a27d57148378eb5e111173f4276ad26340ecc5c49a4a2152167a2d6a37" dependencies = [ - "cfg-if 1.0.0", - "digest 0.10.7", + "base64 0.22.1", + "bytes", + "encoding_rs", + "futures-channel", + "futures-core", + "futures-util", + "h2 0.4.5", + "http 1.1.0", + "http-body 1.0.0", + "http-body-util", + "hyper 1.3.1", + "hyper-rustls 0.27.2", + "hyper-tls 0.6.0", + "hyper-util", + "ipnet", + "js-sys", + "log", + "mime", + "mime_guess", + "native-tls", + "once_cell", + "percent-encoding", + "pin-project-lite", + "rustls-pemfile 2.0.0", + "serde", + "serde_json", + "serde_urlencoded", + "sync_wrapper 1.0.1", + "system-configuration", + "tokio", + "tokio-native-tls", + "tokio-util", + "tower-service", + "url", + "wasm-bindgen", + "wasm-bindgen-futures", + "wasm-streams", + "web-sys", + "winreg 0.52.0", ] [[package]] -name = "memchr" -version = "2.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f665ee40bc4a3c5590afb1e9677db74a508659dfd71e126420da8274909a0167" - -[[package]] -name = "memfd" -version = "0.6.4" +name = "reqwest-middleware" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2cffa4ad52c6f791f4f8b15f0c05f9824b2ced1160e88cc393d64fff9a8ac64" +checksum = "39346a33ddfe6be00cbc17a34ce996818b97b230b87229f10114693becca1268" dependencies = [ - "rustix 0.38.34", + "anyhow", + "async-trait", + "http 1.1.0", + "reqwest 0.12.5", + "serde", + "thiserror", + "tower-service", ] [[package]] -name = "memoffset" -version = "0.5.6" +name = "rescue_poseidon" +version = "0.30.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "043175f069eda7b85febe4a74abbaeff828d9f8b448515d3151a14a3542811aa" +checksum = "82900c877a0ba5362ac5756efbd82c5b795dc509011c1253e2389d8708f1389d" dependencies = [ - "autocfg", + "addchain", + "arrayvec 0.7.4", + "blake2 0.10.6", + "byteorder", + "derivative", + "franklin-crypto", + "lazy_static", + "log", + "num-bigint 0.3.3", + "num-integer", + "num-iter", + "num-traits", + "rand 0.4.6", + "serde", + "sha3 0.9.1", + "smallvec", + "typemap_rev", ] [[package]] -name = "memoffset" -version = "0.8.0" +name = "rfc6979" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d61c719bcfbcf5d62b3a09efa6088de8c54bc0bfcd3ea7ae39fcc186108b8de1" +checksum = "7743f17af12fa0b03b803ba12cd6a8d9483a587e89c69445e3909655c0b9fabb" dependencies = [ - "autocfg", + "crypto-bigint 0.4.9", + "hmac 0.12.1", + "zeroize", ] [[package]] -name = "memory-db" -version = "0.32.0" +name = "rfc6979" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "808b50db46293432a45e63bc15ea51e0ab4c0a1647b8eb114e31a3e698dd6fbe" +checksum = "f8dd2a808d456c4a54e300a23e9f5a67e122c3024119acbfd73e3bf664491cb2" dependencies = [ - "hash-db", + "hmac 0.12.1", + "subtle", ] [[package]] -name = "merkle_tree_consistency_checker" -version = "0.1.0" +name = "ring" +version = "0.17.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "688c63d65483050968b2a8937f7995f443e27041a0f7700aa59b0822aedebb74" dependencies = [ - "anyhow", - "clap 4.4.6", - "tracing", - "zksync_config", - "zksync_env_config", - "zksync_merkle_tree", - "zksync_storage", - "zksync_types", - "zksync_vlog", + "cc", + "getrandom", + "libc", + "spin", + "untrusted", + "windows-sys 0.48.0", ] [[package]] -name = "merlin" -version = "2.0.1" +name = "rkyv" +version = "0.7.43" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e261cf0f8b3c42ded9f7d2bb59dea03aa52bc8a1cbc7482f9fc3fd1229d3b42" +checksum = "527a97cdfef66f65998b5f3b637c26f5a5ec09cc52a3f9932313ac645f4190f5" dependencies = [ - "byteorder", - "keccak", - "rand_core 0.5.1", - "zeroize", + "bitvec", + "bytecheck", + "bytes", + "hashbrown 0.12.3", + "ptr_meta", + "rend", + "rkyv_derive", + "seahash", + "tinyvec", + "uuid", ] [[package]] -name = "merlin" -version = "3.0.0" +name = "rkyv_derive" +version = "0.7.43" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58c38e2799fc0978b65dfff8023ec7843e2330bb462f19198840b34b6582397d" +checksum = "b5c462a1328c8e67e4d6dbad1eb0355dd43e8ab432c6e227a43657f16ade5033" dependencies = [ - "byteorder", - "keccak", - "rand_core 0.6.4", - "zeroize", + "proc-macro2 1.0.86", + "quote 1.0.36", + "syn 1.0.109", ] [[package]] -name = "miette" -version = "5.10.0" +name = "rlp" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59bb584eaeeab6bd0226ccf3509a69d7936d148cf3d036ad350abe35e8c6856e" +checksum = "bb919243f34364b6bd2fc10ef797edbfa75f33c252e7998527479c6d6b47e1ec" dependencies = [ - "miette-derive", - "once_cell", - "thiserror", - "unicode-width", + "bytes", + "rustc-hex", ] [[package]] -name = "miette-derive" -version = "5.10.0" +name = "rocksdb" +version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49e7bc1560b95a3c4a25d03de42fe76ca718ab92d1a22a55b9b4cf67b3ae635c" +checksum = "bb6f170a4041d50a0ce04b0d2e14916d6ca863ea2e422689a5b694395d299ffe" dependencies = [ - "proc-macro2 1.0.86", - "quote 1.0.37", - "syn 2.0.72", + "libc", + "librocksdb-sys", ] [[package]] -name = "mime" -version = "0.3.17" +name = "route-recognizer" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" +checksum = "afab94fb28594581f62d981211a9a4d53cc8130bbcbbb89a0440d9b8e81a7746" [[package]] -name = "mime_guess" -version = "2.0.4" +name = "rsa" +version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4192263c238a5f0d0c6bfd21f336a313a4ce1c450542449ca191bb657b4642ef" +checksum = "af6c4b23d99685a1408194da11270ef8e9809aff951cc70ec9b17350b087e474" dependencies = [ - "mime", - "unicase", + "const-oid", + "digest 0.10.7", + "num-bigint-dig", + "num-integer", + "num-traits", + "pkcs1", + "pkcs8 0.10.2", + "rand_core 0.6.4", + "signature 2.2.0", + "spki 0.7.2", + "subtle", + "zeroize", ] [[package]] -name = "mini-moka" -version = "0.10.2" +name = "rust_decimal" +version = "1.33.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23e0b72e7c9042467008b10279fc732326bd605459ae03bda88825909dd19b56" +checksum = "06676aec5ccb8fc1da723cc8c0f9a46549f21ebb8753d3915c6c41db1e7f1dc4" dependencies = [ - "crossbeam-channel 0.5.13", - "crossbeam-utils 0.8.20", - "dashmap", - "skeptic", - "smallvec 1.13.1", - "tagptr", - "triomphe", + "arrayvec 0.7.4", + "borsh", + "bytes", + "num-traits", + "rand 0.8.5", + "rkyv", + "serde", + "serde_json", ] [[package]] -name = "minimal-lexical" -version = "0.2.1" +name = "rustc-demangle" +version = "0.1.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" +checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" [[package]] -name = "miniz_oxide" -version = "0.7.1" +name = "rustc-hash" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7810e0be55b428ada41041c41f32c9f1a42817901b4ccf45fa3d4b6561e74c7" +checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" + +[[package]] +name = "rustc-hex" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e75f6a532d0fd9f7f13144f392b6ad56a32696bfcd9c78f797f16bbb6f072d6" + +[[package]] +name = "rustc_version" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" dependencies = [ - "adler", + "semver", ] [[package]] -name = "mio" -version = "1.0.1" +name = "rustix" +version = "0.38.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4569e456d394deccd22ce1c1913e6ea0e54519f577285001215d33557431afe4" +checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f" dependencies = [ - "hermit-abi 0.3.9", + "bitflags 2.6.0", + "errno", "libc", - "wasi 0.11.0+wasi-snapshot-preview1", + "linux-raw-sys", "windows-sys 0.52.0", ] [[package]] -name = "mirai-annotations" -version = "1.12.0" +name = "rustls" +version = "0.21.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c9be0862c1b3f26a88803c4a49de6889c10e608b3ee9344e6ef5b45fb37ad3d1" +checksum = "3f56a14d1f48b391359b22f731fd4bd7e43c97f3c50eee276f3aa09c94784d3e" +dependencies = [ + "log", + "ring", + "rustls-webpki 0.101.7", + "sct", +] [[package]] -name = "multer" -version = "3.1.0" +name = "rustls" +version = "0.22.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83e87776546dc87511aa5ee218730c92b666d7264ab6ed41f9d215af9cd5224b" +checksum = "bf4ef73721ac7bcd79b2b315da7779d8fc09718c6b3d2d1b2d94850eb8c18432" dependencies = [ - "bytes", - "encoding_rs", - "futures-util", - "http 1.1.0", - "httparse", - "memchr", - "mime", - "spin", - "version_check", + "log", + "ring", + "rustls-pki-types", + "rustls-webpki 0.102.4", + "subtle", + "zeroize", ] [[package]] -name = "multimap" -version = "0.8.3" +name = "rustls" +version = "0.23.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5ce46fe64a9d73be07dcbe690a38ce1b293be448fd8ce1e6c1b8062c9f72c6a" +checksum = "05cff451f60db80f490f3c182b77c35260baace73209e9cdbbe526bfe3a4d402" +dependencies = [ + "aws-lc-rs", + "log", + "once_cell", + "ring", + "rustls-pki-types", + "rustls-webpki 0.102.4", + "subtle", + "zeroize", +] [[package]] -name = "native-tls" -version = "0.2.11" +name = "rustls-native-certs" +version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07226173c32f2926027b63cce4bcd8076c3552846cbe7925f3aaffeac0a3b92e" +checksum = "a9aace74cb666635c918e9c12bc0d348266037aa8eb599b5cba565709a8dff00" dependencies = [ - "lazy_static", - "libc", - "log", - "openssl", "openssl-probe", - "openssl-sys", + "rustls-pemfile 1.0.4", "schannel", "security-framework", - "security-framework-sys", - "tempfile", ] [[package]] -name = "nix" -version = "0.27.1" +name = "rustls-native-certs" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2eb04e9c688eff1c89d72b407f168cf79bb9e867a9d3323ed6c01519eb9cc053" +checksum = "8f1fb85efa936c42c6d5fc28d2629bb51e4b2f4b8a5211e297d599cc5a093792" dependencies = [ - "bitflags 2.6.0", - "cfg-if 1.0.0", - "libc", + "openssl-probe", + "rustls-pemfile 2.0.0", + "rustls-pki-types", + "schannel", + "security-framework", ] [[package]] -name = "no-std-compat" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b93853da6d84c2e3c7d730d6473e8817692dd89be387eb01b94d7f108ecb5b8c" - -[[package]] -name = "no-std-net" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43794a0ace135be66a25d3ae77d41b91615fb68ae937f904090203e81f755b65" - -[[package]] -name = "nodrop" -version = "0.1.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72ef4a56884ca558e5ddb05a1d1e7e1bfd9a68d9ed024c21704cc98872dae1bb" - -[[package]] -name = "nohash-hasher" -version = "0.2.0" +name = "rustls-pemfile" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2bf50223579dc7cdcfb3bfcacf7069ff68243f8c363f62ffa99cf000a6b9c451" +checksum = "1c74cae0a4cf6ccbbf5f359f08efdf8ee7e1dc532573bf0db71968cb56b1448c" +dependencies = [ + "base64 0.21.5", +] [[package]] -name = "nom" -version = "7.1.3" +name = "rustls-pemfile" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" +checksum = "35e4980fa29e4c4b212ffb3db068a564cbf560e51d3944b7c88bd8bf5bec64f4" dependencies = [ - "memchr", - "minimal-lexical", + "base64 0.21.5", + "rustls-pki-types", ] [[package]] -name = "nonzero_ext" -version = "0.3.0" +name = "rustls-pki-types" +version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38bf9645c8b145698bb0b18a4637dcacbc421ea49bef2317e4fd8065a387cf21" +checksum = "976295e77ce332211c0d24d92c0e83e50f5c5f046d11082cea19f3df13a3562d" [[package]] -name = "nu-ansi-term" -version = "0.46.0" +name = "rustls-platform-verifier" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77a8165726e8236064dbb45459242600304b42a5ea24ee2948e18e023bf7ba84" +checksum = "3e3beb939bcd33c269f4bf946cc829fcd336370267c4a927ac0399c84a3151a1" dependencies = [ - "overload", + "core-foundation", + "core-foundation-sys", + "jni", + "log", + "once_cell", + "rustls 0.23.10", + "rustls-native-certs 0.7.0", + "rustls-platform-verifier-android", + "rustls-webpki 0.102.4", + "security-framework", + "security-framework-sys", + "webpki-roots", "winapi", ] [[package]] -name = "num" -version = "0.4.3" +name = "rustls-platform-verifier-android" +version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35bd024e8b2ff75562e5f34e7f4905839deb4b22955ef5e73d2fea1b9813cb23" -dependencies = [ - "num-bigint 0.4.6", - "num-complex", - "num-integer", - "num-iter", - "num-rational", - "num-traits", -] +checksum = "84e217e7fdc8466b5b35d30f8c0a30febd29173df4a3a0c2115d306b9c4117ad" [[package]] -name = "num-bigint" -version = "0.3.3" +name = "rustls-webpki" +version = "0.101.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f6f7833f2cbf2360a6cfd58cd41a53aa7a90bd4c202f5b1c7dd2ed73c57b2c3" +checksum = "8b6275d1ee7a1cd780b64aca7726599a1dbc893b1e64144529e55c3c2f745765" dependencies = [ - "autocfg", - "num-integer", - "num-traits", + "ring", + "untrusted", ] [[package]] -name = "num-bigint" -version = "0.4.6" +name = "rustls-webpki" +version = "0.102.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5e44f723f1133c9deac646763579fdb3ac745e418f2a7af9cd0c431da1f20b9" +checksum = "ff448f7e92e913c4b7d4c6d8e4540a1724b319b4152b8aef6d4cf8339712b33e" dependencies = [ - "num-integer", - "num-traits", - "serde", + "aws-lc-rs", + "ring", + "rustls-pki-types", + "untrusted", ] [[package]] -name = "num-bigint-dig" -version = "0.8.4" +name = "rustversion" +version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc84195820f291c7697304f3cbdadd1cb7199c0efc917ff5eafd71225c136151" -dependencies = [ - "byteorder", - "lazy_static", - "libm", - "num-integer", - "num-iter", - "num-traits", - "rand 0.8.5", - "smallvec 1.13.1", - "zeroize", -] +checksum = "7ffc183a10b4478d04cbbbfc96d0873219d962dd5accaff2ffbd4ceb7df837f4" [[package]] -name = "num-complex" -version = "0.4.6" +name = "ruzstd" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73f88a1307638156682bada9d7604135552957b7818057dcef22705b4d509495" +checksum = "58c4eb8a81997cf040a091d1f7e1938aeab6749d3a0dfa73af43cdc32393483d" dependencies = [ - "num-traits", - "serde", + "byteorder", + "derive_more 0.99.18", + "twox-hash", ] [[package]] -name = "num-conv" -version = "0.1.0" +name = "ryu" +version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" +checksum = "1ad4cc8da4ef723ed60bced201181d83791ad433213d8c24efffda1eec85d741" [[package]] -name = "num-derive" -version = "0.2.5" +name = "same-file" +version = "1.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eafd0b45c5537c3ba526f79d3e75120036502bebacbb3f3220914067ce39dbf2" +checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" dependencies = [ - "proc-macro2 0.4.30", - "quote 0.6.13", - "syn 0.15.44", + "winapi-util", ] [[package]] -name = "num-format" -version = "0.4.4" +name = "scale-bits" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a652d9771a63711fd3c3deb670acfbe5c30a4072e664d7a3bf5a9e1056ac72c3" +checksum = "036575c29af9b6e4866ffb7fa055dbf623fe7a9cc159b33786de6013a6969d89" dependencies = [ - "arrayvec 0.7.4", - "itoa", + "parity-scale-codec", + "scale-info", + "serde", ] [[package]] -name = "num-integer" -version = "0.1.46" +name = "scale-decode" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f" +checksum = "7caaf753f8ed1ab4752c6afb20174f03598c664724e0e32628e161c21000ff76" dependencies = [ - "num-traits", + "derive_more 0.99.18", + "parity-scale-codec", + "primitive-types", + "scale-bits", + "scale-decode-derive", + "scale-info", + "smallvec", ] [[package]] -name = "num-iter" -version = "0.1.45" +name = "scale-decode-derive" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1429034a0490724d0075ebb2bc9e875d6503c3cf69e235a8941aa757d83ef5bf" +checksum = "d3475108a1b62c7efd1b5c65974f30109a598b2f45f23c9ae030acb9686966db" dependencies = [ - "autocfg", - "num-integer", - "num-traits", + "darling 0.14.4", + "proc-macro-crate 1.3.1", + "proc-macro2 1.0.86", + "quote 1.0.36", + "syn 1.0.109", ] [[package]] -name = "num-modular" -version = "0.5.1" +name = "scale-encode" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64a5fe11d4135c3bcdf3a95b18b194afa9608a5f6ff034f5d857bc9a27fb0119" +checksum = "6d70cb4b29360105483fac1ed567ff95d65224a14dd275b6303ed0a654c78de5" dependencies = [ - "num-integer", - "num-traits", + "derive_more 0.99.18", + "parity-scale-codec", + "primitive-types", + "scale-bits", + "scale-encode-derive", + "scale-info", + "smallvec", ] [[package]] -name = "num-rational" -version = "0.4.2" +name = "scale-encode-derive" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f83d14da390562dca69fc84082e73e548e1ad308d24accdedd2720017cb37824" +checksum = "995491f110efdc6bea96d6a746140e32bfceb4ea47510750a5467295a4707a25" dependencies = [ - "num-bigint 0.4.6", - "num-integer", - "num-traits", - "serde", + "darling 0.14.4", + "proc-macro-crate 1.3.1", + "proc-macro2 1.0.86", + "quote 1.0.36", + "syn 1.0.109", ] [[package]] -name = "num-traits" -version = "0.2.19" +name = "scale-info" +version = "2.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" +checksum = "eca070c12893629e2cc820a9761bedf6ce1dcddc9852984d1dc734b8bd9bd024" dependencies = [ - "autocfg", - "libm", + "bitvec", + "cfg-if", + "derive_more 0.99.18", + "parity-scale-codec", + "scale-info-derive", + "serde", ] [[package]] -name = "num_cpus" -version = "1.16.0" +name = "scale-info-derive" +version = "2.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" +checksum = "2d35494501194174bda522a32605929eefc9ecf7e0a326c26db1fdd85881eb62" dependencies = [ - "hermit-abi 0.3.9", - "libc", + "proc-macro-crate 3.1.0", + "proc-macro2 1.0.86", + "quote 1.0.36", + "syn 1.0.109", ] [[package]] -name = "num_enum" -version = "0.5.11" +name = "scale-typegen" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f646caf906c20226733ed5b1374287eb97e3c2a5c227ce668c1f2ce20ae57c9" +checksum = "00860983481ac590ac87972062909bef0d6a658013b592ccc0f2feb272feab11" dependencies = [ - "num_enum_derive 0.5.11", + "proc-macro2 1.0.86", + "quote 1.0.36", + "scale-info", + "syn 2.0.72", + "thiserror", ] [[package]] -name = "num_enum" -version = "0.6.1" +name = "scale-value" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a015b430d3c108a207fd776d2e2196aaf8b1cf8cf93253e3a097ff3085076a1" +checksum = "58223c7691bf0bd46b43c9aea6f0472d1067f378d574180232358d7c6e0a8089" dependencies = [ - "num_enum_derive 0.6.1", + "base58", + "blake2 0.10.6", + "derive_more 0.99.18", + "either", + "frame-metadata 15.1.0", + "parity-scale-codec", + "scale-bits", + "scale-decode", + "scale-encode", + "scale-info", + "serde", + "yap", ] [[package]] -name = "num_enum" -version = "0.7.2" +name = "schannel" +version = "0.1.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02339744ee7253741199f897151b38e72257d13802d4ee837285cc2990a90845" +checksum = "0c3733bf4cf7ea0880754e19cb5a462007c4a8c1914bff372ccc95b464f1df88" dependencies = [ - "num_enum_derive 0.7.2", + "windows-sys 0.48.0", ] [[package]] -name = "num_enum_derive" -version = "0.5.11" +name = "schnorrkel" +version = "0.11.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcbff9bc912032c62bf65ef1d5aea88983b420f4f839db1e9b0c281a25c9c799" +checksum = "8de18f6d8ba0aad7045f5feae07ec29899c1112584a38509a84ad7b04451eaa0" dependencies = [ - "proc-macro-crate 1.3.1", - "proc-macro2 1.0.86", - "quote 1.0.37", - "syn 1.0.109", + "aead", + "arrayref", + "arrayvec 0.7.4", + "curve25519-dalek", + "getrandom_or_panic", + "merlin", + "rand_core 0.6.4", + "serde_bytes", + "sha2 0.10.8", + "subtle", + "zeroize", ] [[package]] -name = "num_enum_derive" -version = "0.6.1" +name = "scopeguard" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96667db765a921f7b295ffee8b60472b686a51d4f21c2ee4ffdb94c7013b65a6" -dependencies = [ - "proc-macro-crate 1.3.1", - "proc-macro2 1.0.86", - "quote 1.0.37", - "syn 2.0.72", -] +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" [[package]] -name = "num_enum_derive" -version = "0.7.2" +name = "sct" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "681030a937600a36906c185595136d26abfebb4aa9c65701cefcaf8578bb982b" +checksum = "da046153aa2352493d6cb7da4b6e5c0c057d8a1d0a9aa8560baffdd945acd414" dependencies = [ - "proc-macro-crate 3.1.0", - "proc-macro2 1.0.86", - "quote 1.0.37", - "syn 2.0.72", + "ring", + "untrusted", ] [[package]] -name = "object" -version = "0.30.4" +name = "seahash" +version = "4.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03b4680b86d9cfafba8fc491dc9b6df26b68cf40e9e6cd73909194759a63c385" -dependencies = [ - "crc32fast", - "hashbrown 0.13.2", - "indexmap 1.9.3", - "memchr", -] +checksum = "1c107b6f4780854c8b126e228ea8869f4d7b71260f962fefb57b996b8959ba6b" [[package]] -name = "object" -version = "0.32.1" +name = "sec1" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9cf5f9dd3933bd50a9e1f149ec995f39ae2c496d31fd772c1fd45ebc27e902b0" +checksum = "3be24c1842290c45df0a7bf069e0c268a747ad05a192f2fd7dcfdbc1cba40928" dependencies = [ - "memchr", + "base16ct 0.1.1", + "der 0.6.1", + "generic-array", + "pkcs8 0.9.0", + "subtle", + "zeroize", ] [[package]] -name = "once_cell" -version = "1.19.0" +name = "sec1" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" +checksum = "d3e97a565f76233a6003f9f5c54be1d9c5bdfa3eccfb189469f11ec4901c47dc" +dependencies = [ + "base16ct 0.2.0", + "der 0.7.8", + "generic-array", + "pkcs8 0.10.2", + "subtle", + "zeroize", +] [[package]] -name = "oorandom" -version = "11.1.3" +name = "secp256k1" +version = "0.27.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ab1bc2a289d34bd04a330323ac98a1b4bc82c9d9fcb1e66b63caa84da26b575" +checksum = "25996b82292a7a57ed3508f052cfff8640d38d32018784acd714758b43da9c8f" +dependencies = [ + "secp256k1-sys", + "serde", +] [[package]] -name = "opaque-debug" -version = "0.2.3" +name = "secp256k1-sys" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2839e79665f131bdb5782e51f2c6c9599c133c6098982a54c794358bf432529c" +checksum = "70a129b9e9efbfb223753b9163c4ab3b13cff7fd9c7f010fbac25ab4099fa07e" +dependencies = [ + "cc", +] [[package]] -name = "opaque-debug" -version = "0.3.0" +name = "secrecy" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" +checksum = "9bd1c54ea06cfd2f6b63219704de0b9b4f72dcc2b8fdef820be6cd799780e91e" +dependencies = [ + "zeroize", +] [[package]] -name = "openssl" -version = "0.10.66" +name = "security-framework" +version = "2.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9529f4786b70a3e8c61e11179af17ab6188ad8d0ded78c5529441ed39d4bd9c1" +checksum = "c627723fd09706bacdb5cf41499e95098555af3c3c29d014dc3c458ef6be11c0" dependencies = [ "bitflags 2.6.0", - "cfg-if 1.0.0", - "foreign-types", + "core-foundation", + "core-foundation-sys", "libc", - "once_cell", - "openssl-macros", - "openssl-sys", + "num-bigint 0.4.6", + "security-framework-sys", ] [[package]] -name = "openssl-macros" -version = "0.1.1" +name = "security-framework-sys" +version = "2.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" +checksum = "317936bbbd05227752583946b9e66d7ce3b489f84e11a94a510b4437fef407d7" dependencies = [ - "proc-macro2 1.0.86", - "quote 1.0.37", - "syn 2.0.72", + "core-foundation-sys", + "libc", ] [[package]] -name = "openssl-probe" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" +name = "selector_generator" +version = "0.1.0" +dependencies = [ + "clap 4.4.6", + "glob", + "serde", + "serde_json", + "sha3 0.10.8", +] [[package]] -name = "openssl-sys" -version = "0.9.103" +name = "semver" +version = "1.0.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f9e8deee91df40a943c71b917e5874b951d32a802526c85721ce3b776c929d6" +checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" dependencies = [ - "cc", - "libc", - "pkg-config", - "vcpkg", + "serde", ] [[package]] -name = "opentelemetry" -version = "0.24.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c365a63eec4f55b7efeceb724f1336f26a9cf3427b70e59e2cd2a5b947fba96" -dependencies = [ - "futures-core", - "futures-sink", - "js-sys", - "once_cell", - "pin-project-lite", - "thiserror", -] +name = "send_wrapper" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f638d531eccd6e23b980caf34876660d38e265409d8e99b397ab71eb3612fad0" [[package]] -name = "opentelemetry-appender-tracing" -version = "0.5.0" +name = "sentry" +version = "0.31.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b84de945cb3a6f1e0d6317cbd998bbd0519ab00f4b790db67e0ff4fdcf7cedb6" +checksum = "0097a48cd1999d983909f07cb03b15241c5af29e5e679379efac1c06296abecc" dependencies = [ - "opentelemetry", - "tracing", - "tracing-core", - "tracing-subscriber 0.3.18", + "httpdate", + "native-tls", + "reqwest 0.11.22", + "sentry-backtrace", + "sentry-contexts", + "sentry-core", + "sentry-debug-images", + "sentry-panic", + "sentry-tracing", + "tokio", + "ureq", ] [[package]] -name = "opentelemetry-http" -version = "0.13.0" +name = "sentry-backtrace" +version = "0.31.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad31e9de44ee3538fb9d64fe3376c1362f406162434609e79aea2a41a0af78ab" +checksum = "18a7b80fa1dd6830a348d38a8d3a9761179047757b7dca29aef82db0118b9670" dependencies = [ - "async-trait", - "bytes", - "http 1.1.0", - "opentelemetry", - "reqwest 0.12.5", + "backtrace", + "once_cell", + "regex", + "sentry-core", ] [[package]] -name = "opentelemetry-otlp" -version = "0.17.0" +name = "sentry-contexts" +version = "0.31.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b925a602ffb916fb7421276b86756027b37ee708f9dce2dbdcc51739f07e727" +checksum = "7615dc588930f1fd2e721774f25844ae93add2dbe2d3c2f995ce5049af898147" dependencies = [ - "async-trait", - "futures-core", - "http 1.1.0", - "opentelemetry", - "opentelemetry-http", - "opentelemetry-proto", - "opentelemetry_sdk", - "prost 0.13.1", - "reqwest 0.12.5", - "thiserror", - "tokio", - "tonic", + "hostname", + "libc", + "os_info", + "rustc_version", + "sentry-core", + "uname", ] [[package]] -name = "opentelemetry-proto" -version = "0.7.0" +name = "sentry-core" +version = "0.31.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30ee9f20bff9c984511a02f082dc8ede839e4a9bf15cc2487c8d6fea5ad850d9" +checksum = "8f51264e4013ed9b16558cce43917b983fa38170de2ca480349ceb57d71d6053" dependencies = [ - "opentelemetry", - "opentelemetry_sdk", - "prost 0.13.1", - "tonic", + "once_cell", + "rand 0.8.5", + "sentry-types", + "serde", + "serde_json", ] [[package]] -name = "opentelemetry-semantic-conventions" -version = "0.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1cefe0543875379e47eb5f1e68ff83f45cc41366a92dfd0d073d513bf68e9a05" - -[[package]] -name = "opentelemetry_sdk" -version = "0.24.1" +name = "sentry-debug-images" +version = "0.31.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "692eac490ec80f24a17828d49b40b60f5aeaccdfe6a503f939713afd22bc28df" +checksum = "2fe6180fa564d40bb942c9f0084ffb5de691c7357ead6a2b7a3154fae9e401dd" dependencies = [ - "async-trait", - "futures-channel", - "futures-executor", - "futures-util", - "glob", + "findshlibs", "once_cell", - "opentelemetry", - "percent-encoding", - "rand 0.8.5", - "serde_json", - "thiserror", - "tokio", - "tokio-stream", + "sentry-core", ] [[package]] -name = "ordered-float" -version = "2.10.1" +name = "sentry-panic" +version = "0.31.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68f19d67e5a2795c94e73e0bb1cc1a7edeb2e28efd39e2e1c9b7a40c1108b11c" +checksum = "323160213bba549f9737317b152af116af35c0410f4468772ee9b606d3d6e0fa" dependencies = [ - "num-traits", + "sentry-backtrace", + "sentry-core", ] [[package]] -name = "os_info" -version = "3.7.0" +name = "sentry-tracing" +version = "0.31.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "006e42d5b888366f1880eda20371fedde764ed2213dc8496f49622fa0c99cd5e" +checksum = "38033822128e73f7b6ca74c1631cef8868890c6cb4008a291cf73530f87b4eac" dependencies = [ - "log", - "serde", - "winapi", + "sentry-backtrace", + "sentry-core", + "tracing-core", + "tracing-subscriber", ] [[package]] -name = "os_str_bytes" -version = "6.6.1" +name = "sentry-types" +version = "0.31.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2355d85b9a3786f481747ced0e0ff2ba35213a1f9bd406ed906554d7af805a1" +checksum = "0e663b3eb62ddfc023c9cf5432daf5f1a4f6acb1df4d78dd80b740b32dd1a740" +dependencies = [ + "debugid", + "hex", + "rand 0.8.5", + "serde", + "serde_json", + "thiserror", + "time", + "url", + "uuid", +] [[package]] -name = "overload" -version = "0.1.1" +name = "seq-macro" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" +checksum = "a3f0bf26fd526d2a95683cd0f87bf103b8539e2ca1ef48ce002d67aad59aa0b4" [[package]] -name = "p256" -version = "0.13.2" +name = "serde" +version = "1.0.210" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c9863ad85fa8f4460f9c48cb909d38a0d689dba1f6f6988a5e3e0d31071bcd4b" +checksum = "c8e3592472072e6e22e0a54d5904d9febf8508f65fb8552499a1abc7d1078c3a" dependencies = [ - "ecdsa 0.16.9", - "elliptic-curve 0.13.8", - "primeorder", - "sha2 0.10.8", + "serde_derive", ] [[package]] -name = "pairing_ce" -version = "0.28.6" +name = "serde-value" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "843b5b6fb63f00460f611dbc87a50bbbb745f0dfe5cbf67ca89299c79098640e" +checksum = "f3a1a3341211875ef120e117ea7fd5228530ae7e7036a779fdc9117be6b3282c" dependencies = [ - "byteorder", - "cfg-if 1.0.0", - "ff_ce", - "rand 0.4.6", + "ordered-float", "serde", ] [[package]] -name = "parity-scale-codec" -version = "3.6.12" +name = "serde_bytes" +version = "0.11.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "306800abfa29c7f16596b5970a588435e3d5b3149683d00c12b699cc19f895ee" +checksum = "387cc504cb06bb40a96c8e04e951fe01854cf6bc921053c954e4a606d9675c6a" dependencies = [ - "arrayvec 0.7.4", - "bitvec", - "byte-slice-cast", - "bytes", - "impl-trait-for-tuples", - "parity-scale-codec-derive", "serde", ] [[package]] -name = "parity-scale-codec-derive" -version = "3.6.12" +name = "serde_derive" +version = "1.0.210" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d830939c76d294956402033aee57a6da7b438f2294eb94864c37b0569053a42c" +checksum = "243902eda00fad750862fc144cea25caca5e20d615af0a81bee94ca738f1df1f" dependencies = [ - "proc-macro-crate 3.1.0", "proc-macro2 1.0.86", - "quote 1.0.37", - "syn 1.0.109", + "quote 1.0.36", + "syn 2.0.72", ] [[package]] -name = "parity-wasm" -version = "0.45.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1ad0aff30c1da14b1254fcb2af73e1fa9a28670e584a626f53a369d0e157304" - -[[package]] -name = "parking" -version = "2.2.0" +name = "serde_json" +version = "1.0.128" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb813b8af86854136c6922af0598d719255ecb2179515e6e7730d468f05c9cae" +checksum = "6ff5456707a1de34e7e37f2a6fd3d3f808c318259cbd01ab6377795054b483d8" +dependencies = [ + "itoa", + "memchr", + "ryu", + "serde", +] [[package]] -name = "parking_lot" -version = "0.12.1" +name = "serde_path_to_error" +version = "0.1.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" +checksum = "4beec8bce849d58d06238cb50db2e1c417cfeafa4c63f692b15c82b7c80f8335" dependencies = [ - "lock_api", - "parking_lot_core", + "itoa", + "serde", ] [[package]] -name = "parking_lot_core" -version = "0.9.9" +name = "serde_urlencoded" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c42a9226546d68acdd9c0a280d17ce19bfe27a46bf68784e4066115788d008e" +checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" dependencies = [ - "cfg-if 1.0.0", - "libc", - "redox_syscall", - "smallvec 1.13.1", - "windows-targets 0.48.5", + "form_urlencoded", + "itoa", + "ryu", + "serde", ] [[package]] -name = "paste" -version = "1.0.14" +name = "serde_with" +version = "1.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de3145af08024dea9fa9914f381a17b8fc6034dfb00f3a84013f7ff43f29ed4c" +checksum = "678b5a069e50bf00ecd22d0cd8ddf7c236f68581b03db652061ed5eb13a312ff" +dependencies = [ + "base64 0.13.1", + "hex", + "serde", + "serde_with_macros", +] [[package]] -name = "pbkdf2" -version = "0.8.0" +name = "serde_with_macros" +version = "1.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d95f5254224e617595d2cc3cc73ff0a5eaf2637519e25f03388154e9378b6ffa" +checksum = "e182d6ec6f05393cc0e5ed1bf81ad6db3a8feedf8ee515ecdd369809bcce8082" dependencies = [ - "crypto-mac 0.11.0", + "darling 0.13.4", + "proc-macro2 1.0.86", + "quote 1.0.36", + "syn 1.0.109", ] [[package]] -name = "pbkdf2" -version = "0.12.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8ed6a7761f76e3b9f92dfb0a60a6a6477c61024b775147ff0973a02653abaf2" -dependencies = [ - "digest 0.10.7", -] - -[[package]] -name = "peeking_take_while" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19b17cddbe7ec3f8bc800887bab5e717348c95ea2ca0b1bf0837fb964dc67099" - -[[package]] -name = "pem" -version = "3.0.4" +name = "serde_yaml" +version = "0.9.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e459365e590736a54c3fa561947c84837534b8e9af6fc5bf781307e82658fae" +checksum = "1a49e178e4452f45cb61d0cd8cebc1b0fafd3e41929e996cef79aa3aca91f574" dependencies = [ - "base64 0.22.1", + "indexmap 2.1.0", + "itoa", + "ryu", "serde", + "unsafe-libyaml", ] [[package]] -name = "pem-rfc7468" -version = "0.7.0" +name = "sha-1" +version = "0.9.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88b39c9bfcfc231068454382784bb460aae594343fb030d46e9f50a645418412" +checksum = "99cd6713db3cf16b6c84e06321e049a9b9f699826e16096d23bbcc44d15d51a6" dependencies = [ - "base64ct", + "block-buffer 0.9.0", + "cfg-if", + "cpufeatures", + "digest 0.9.0", + "opaque-debug", ] [[package]] -name = "percent-encoding" -version = "2.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" - -[[package]] -name = "pest" -version = "2.7.6" +name = "sha1" +version = "0.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f200d8d83c44a45b21764d1916299752ca035d15ecd46faca3e9a2a2bf6ad06" +checksum = "e3bf829a2d51ab4a5ddf1352d8470c140cadc8301b2ae1789db023f01cedd6ba" dependencies = [ - "memchr", - "thiserror", - "ucd-trie", + "cfg-if", + "cpufeatures", + "digest 0.10.7", ] [[package]] -name = "pest_derive" -version = "2.7.6" +name = "sha2" +version = "0.9.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bcd6ab1236bbdb3a49027e920e693192ebfe8913f6d60e294de57463a493cfde" +checksum = "4d58a1e1bf39749807d89cf2d98ac2dfa0ff1cb3faa38fbb64dd88ac8013d800" dependencies = [ - "pest", - "pest_generator", + "block-buffer 0.9.0", + "cfg-if", + "cpufeatures", + "digest 0.9.0", + "opaque-debug", ] [[package]] -name = "pest_generator" -version = "2.7.6" +name = "sha2" +version = "0.10.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a31940305ffc96863a735bef7c7994a00b325a7138fdbc5bda0f1a0476d3275" +checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" dependencies = [ - "pest", - "pest_meta", - "proc-macro2 1.0.86", - "quote 1.0.37", - "syn 2.0.72", + "cfg-if", + "cpufeatures", + "digest 0.10.7", ] [[package]] -name = "pest_meta" -version = "2.7.6" +name = "sha2_ce" +version = "0.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7ff62f5259e53b78d1af898941cdcdccfae7385cf7d793a6e55de5d05bb4b7d" +checksum = "eca2daa77078f4ddff27e75c4bf59e4c2697525f56dbb3c842d34a5d1f2b04a2" dependencies = [ - "once_cell", - "pest", - "sha2 0.10.8", + "cfg-if", + "cpufeatures", + "digest 0.10.7", ] [[package]] -name = "petgraph" -version = "0.6.4" +name = "sha3" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1d3afd2628e69da2be385eb6f2fd57c8ac7977ceeff6dc166ff1657b0e386a9" +checksum = "f81199417d4e5de3f04b1e871023acea7389672c4135918f05aa9cbf2f2fa809" dependencies = [ - "fixedbitset", - "indexmap 2.1.0", + "block-buffer 0.9.0", + "digest 0.9.0", + "keccak", + "opaque-debug", ] [[package]] -name = "pharos" -version = "0.5.3" +name = "sha3" +version = "0.10.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9567389417feee6ce15dd6527a8a1ecac205ef62c2932bcf3d9f6fc5b78b414" +checksum = "75872d278a8f37ef87fa0ddbda7802605cb18344497949862c0d4dcb291eba60" dependencies = [ - "futures 0.3.30", - "rustc_version 0.4.0", + "digest 0.10.7", + "keccak", ] [[package]] -name = "pin-project" -version = "1.1.3" +name = "sha3_ce" +version = "0.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fda4ed1c6c173e3fc7a83629421152e01d7b1f9b7f65fb301e490e8cfc656422" +checksum = "34c9a08202c50378d8a07a5f458193a5f542d2828ac6640263dbc0c2533ea25e" dependencies = [ - "pin-project-internal", + "digest 0.10.7", + "keccak", ] [[package]] -name = "pin-project-internal" -version = "1.1.3" +name = "sharded-slab" +version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4359fd9c9171ec6e8c62926d6faaf553a8dc3f64e1507e76da7911b4f6a04405" +checksum = "f40ca3c46823713e0d4209592e8d6e826aa57e928f09752619fc696c499637f6" dependencies = [ - "proc-macro2 1.0.86", - "quote 1.0.37", - "syn 2.0.72", + "lazy_static", ] [[package]] -name = "pin-project-lite" -version = "0.2.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58" - -[[package]] -name = "pin-utils" -version = "0.1.0" +name = "shlex" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" [[package]] -name = "piper" -version = "0.2.4" +name = "signal-hook-registry" +version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96c8c490f422ef9a4efd2cb5b42b76c8613d7e7dfc1caf667b8a3350a5acc066" +checksum = "d8229b473baa5980ac72ef434c4415e70c4b5e71b423043adb4ba059f89c99a1" dependencies = [ - "atomic-waker", - "fastrand", - "futures-io", + "libc", ] [[package]] -name = "pkcs1" -version = "0.7.5" +name = "signature" +version = "1.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8ffb9f10fa047879315e6625af03c164b16962a5368d724ed16323b68ace47f" +checksum = "74233d3b3b2f6d4b006dc19dee745e73e2a6bfb6f93607cd3b02bd5b00797d7c" dependencies = [ - "der 0.7.8", - "pkcs8 0.10.2", - "spki 0.7.2", + "digest 0.10.7", + "rand_core 0.6.4", ] [[package]] -name = "pkcs8" -version = "0.9.0" +name = "signature" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9eca2c590a5f85da82668fa685c09ce2888b9430e83299debf1f34b65fd4a4ba" +checksum = "77549399552de45a898a580c1b41d445bf730df867cc44e6c0233bbc4b8329de" dependencies = [ - "der 0.6.1", - "spki 0.6.0", + "digest 0.10.7", + "rand_core 0.6.4", ] [[package]] -name = "pkcs8" -version = "0.10.2" +name = "simdutf8" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f950b2377845cebe5cf8b5165cb3cc1a5e0fa5cfa3e1f7f55707d8fd82e0a7b7" -dependencies = [ - "der 0.7.8", - "spki 0.7.2", -] +checksum = "f27f6278552951f1f2b8cf9da965d10969b2efdea95a6ec47987ab46edfe263a" [[package]] -name = "pkg-config" -version = "0.3.27" +name = "similar" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26072860ba924cbfa98ea39c8c19b4dd6a4a25423dbdf219c1eca91aa0cf6964" +checksum = "2aeaf503862c419d66959f5d7ca015337d864e9c49485d771b732e2a20453597" [[package]] -name = "plotters" -version = "0.3.5" +name = "simple_asn1" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2c224ba00d7cadd4d5c660deaf2098e5e80e07846537c51f9cfa4be50c1fd45" +checksum = "adc4e5204eb1910f40f9cfa375f6f05b68c3abac4b6fd879c8ff5e7ae8a0a085" dependencies = [ + "num-bigint 0.4.6", "num-traits", - "plotters-backend", - "plotters-svg", - "wasm-bindgen", - "web-sys", + "thiserror", + "time", ] [[package]] -name = "plotters-backend" -version = "0.3.5" +name = "siphasher" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e76628b4d3a7581389a35d5b6e2139607ad7c75b17aed325f210aa91f4a9609" +checksum = "56199f7ddabf13fe5074ce809e7d3f42b42ae711800501b5b16ea82ad029c39d" [[package]] -name = "plotters-svg" -version = "0.3.5" +name = "sized-chunks" +version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38f6d39893cca0701371e3c27294f09797214b86f1fb951b89ade8ec04e2abab" +checksum = "16d69225bde7a69b235da73377861095455d298f2b970996eec25ddbb42b3d1e" dependencies = [ - "plotters-backend", + "bitmaps", + "typenum", ] [[package]] -name = "polkavm-common" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d9428a5cfcc85c5d7b9fc4b6a18c4b802d0173d768182a51cc7751640f08b92" - -[[package]] -name = "polkavm-derive" -version = "0.9.1" +name = "skeptic" +version = "0.13.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae8c4bea6f3e11cd89bb18bcdddac10bd9a24015399bd1c485ad68a985a19606" +checksum = "16d23b015676c90a0f01c197bfdc786c20342c73a0afdda9025adb0bc42940a8" dependencies = [ - "polkavm-derive-impl-macro", + "bytecount", + "cargo_metadata", + "error-chain", + "glob", + "pulldown-cmark", + "tempfile", + "walkdir", ] [[package]] -name = "polkavm-derive-impl" -version = "0.9.0" +name = "slab" +version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c4fdfc49717fb9a196e74a5d28e0bc764eb394a2c803eb11133a31ac996c60c" +checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" dependencies = [ - "polkavm-common", - "proc-macro2 1.0.86", - "quote 1.0.37", - "syn 2.0.72", + "autocfg", ] [[package]] -name = "polkavm-derive-impl-macro" -version = "0.9.0" +name = "smallvec" +version = "1.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ba81f7b5faac81e528eb6158a6f3c9e0bb1008e0ffa19653bc8dea925ecb429" +checksum = "e6ecd384b10a64542d77071bd64bd7b231f4ed5940fba55e98c3de13824cf3d7" dependencies = [ - "polkavm-derive-impl", - "syn 2.0.72", + "serde", ] [[package]] -name = "polling" -version = "3.7.3" +name = "smol" +version = "2.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc2790cd301dec6cd3b7a025e4815cf825724a51c98dccfe6a3e55f05ffb6511" +checksum = "a33bd3e260892199c3ccfc487c88b2da2265080acb316cd920da72fdfd7c599f" dependencies = [ - "cfg-if 1.0.0", - "concurrent-queue", - "hermit-abi 0.4.0", - "pin-project-lite", - "rustix 0.38.34", - "tracing", - "windows-sys 0.59.0", + "async-channel", + "async-executor", + "async-fs", + "async-io", + "async-lock", + "async-net", + "async-process", + "blocking", + "futures-lite", ] [[package]] -name = "poly1305" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8159bd90725d2df49889a078b54f4f79e87f1f8a8444194cdca81d38f5393abf" -dependencies = [ - "cpufeatures", - "opaque-debug 0.3.0", - "universal-hash", -] - -[[package]] -name = "polyval" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d52cff9d1d4dee5fe6d03729099f4a310a41179e0a10dbf542039873f2e826fb" -dependencies = [ - "cfg-if 1.0.0", - "cpufeatures", - "opaque-debug 0.3.0", - "universal-hash", -] - -[[package]] -name = "powerfmt" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" - -[[package]] -name = "ppv-lite86" -version = "0.2.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" - -[[package]] -name = "pretty_assertions" -version = "1.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af7cee1a6c8a5b9208b3cb1061f10c0cb689087b3d8ce85fb9d2dd7a29b6ba66" -dependencies = [ - "diff", - "yansi", -] - -[[package]] -name = "prettyplease" -version = "0.2.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae005bd773ab59b4725093fd7df83fd7892f7d8eafb48dbd7de6e024e4215f9d" -dependencies = [ - "proc-macro2 1.0.86", - "syn 2.0.72", -] - -[[package]] -name = "primeorder" -version = "0.13.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "353e1ca18966c16d9deb1c69278edbc5f194139612772bd9537af60ac231e1e6" -dependencies = [ - "elliptic-curve 0.13.8", -] - -[[package]] -name = "primitive-types" -version = "0.12.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b34d9fd68ae0b74a41b21c03c2f62847aa0ffea044eee893b4c140b37e244e2" -dependencies = [ - "fixed-hash", - "impl-codec", - "impl-rlp", - "impl-serde", - "scale-info", - "uint", -] - -[[package]] -name = "proc-macro-crate" -version = "1.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f4c021e1093a56626774e81216a4ce732a735e5bad4868a03f3ed65ca0c3919" -dependencies = [ - "once_cell", - "toml_edit 0.19.15", -] - -[[package]] -name = "proc-macro-crate" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e8366a6159044a37876a2b9817124296703c586a5c92e2c53751fa06d8d43e8" -dependencies = [ - "toml_edit 0.20.2", -] - -[[package]] -name = "proc-macro-crate" -version = "3.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d37c51ca738a55da99dc0c4a34860fd675453b8b36209178c2249bb13651284" -dependencies = [ - "toml_edit 0.21.1", -] - -[[package]] -name = "proc-macro-error" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" -dependencies = [ - "proc-macro-error-attr", - "proc-macro2 1.0.86", - "quote 1.0.37", - "syn 1.0.109", - "version_check", -] - -[[package]] -name = "proc-macro-error-attr" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" -dependencies = [ - "proc-macro2 1.0.86", - "quote 1.0.37", - "version_check", -] - -[[package]] -name = "proc-macro-hack" -version = "0.5.20+deprecated" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc375e1527247fe1a97d8b7156678dfe7c1af2fc075c9a4db3690ecd2a148068" - -[[package]] -name = "proc-macro-warning" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "834da187cfe638ae8abb0203f0b33e5ccdb02a28e7199f2f47b3e2754f50edca" -dependencies = [ - "proc-macro2 1.0.86", - "quote 1.0.37", - "syn 2.0.72", -] - -[[package]] -name = "proc-macro2" -version = "0.4.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf3d2011ab5c909338f7887f4fc896d35932e29146c12c8d01da6b22a80ba759" -dependencies = [ - "unicode-xid 0.1.0", -] - -[[package]] -name = "proc-macro2" -version = "1.0.86" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "prometheus" -version = "0.13.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d33c28a30771f7f96db69893f78b857f7450d7e0237e9c8fc6427a81bae7ed1" -dependencies = [ - "cfg-if 1.0.0", - "fnv", - "lazy_static", - "memchr", - "parking_lot", - "thiserror", -] - -[[package]] -name = "prometheus-client" -version = "0.22.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1ca959da22a332509f2a73ae9e5f23f9dcfc31fd3a54d71f159495bd5909baa" -dependencies = [ - "dtoa", - "itoa", - "parking_lot", - "prometheus-client-derive-encode", -] - -[[package]] -name = "prometheus-client-derive-encode" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "440f724eba9f6996b75d63681b0a92b06947f1457076d503a4d2e2c8f56442b8" -dependencies = [ - "proc-macro2 1.0.86", - "quote 1.0.37", - "syn 2.0.72", -] - -[[package]] -name = "proptest" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4c2511913b88df1637da85cc8d96ec8e43a3f8bb8ccb71ee1ac240d6f3df58d" -dependencies = [ - "bit-set", - "bit-vec", - "bitflags 2.6.0", - "lazy_static", - "num-traits", - "rand 0.8.5", - "rand_chacha 0.3.1", - "rand_xorshift", - "regex-syntax 0.8.2", - "rusty-fork", - "tempfile", - "unarray", -] - -[[package]] -name = "prost" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4fdd22f3b9c31b53c060df4a0613a1c7f062d4115a2b984dd15b1858f7e340d" -dependencies = [ - "bytes", - "prost-derive 0.12.1", -] - -[[package]] -name = "prost" -version = "0.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e13db3d3fde688c61e2446b4d843bc27a7e8af269a69440c0308021dc92333cc" -dependencies = [ - "bytes", - "prost-derive 0.13.1", -] - -[[package]] -name = "prost-build" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8bdf592881d821b83d471f8af290226c8d51402259e9bb5be7f9f8bdebbb11ac" -dependencies = [ - "bytes", - "heck 0.4.1", - "itertools 0.10.5", - "log", - "multimap", - "once_cell", - "petgraph", - "prettyplease", - "prost 0.12.1", - "prost-types 0.12.1", - "regex", - "syn 2.0.72", - "tempfile", - "which", -] - -[[package]] -name = "prost-build" -version = "0.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5bb182580f71dd070f88d01ce3de9f4da5021db7115d2e1c3605a754153b77c1" -dependencies = [ - "bytes", - "heck 0.5.0", - "itertools 0.12.0", - "log", - "multimap", - "once_cell", - "petgraph", - "prettyplease", - "prost 0.13.1", - "prost-types 0.13.1", - "regex", - "syn 2.0.72", - "tempfile", -] - -[[package]] -name = "prost-derive" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "265baba7fabd416cf5078179f7d2cbeca4ce7a9041111900675ea7c4cb8a4c32" -dependencies = [ - "anyhow", - "itertools 0.10.5", - "proc-macro2 1.0.86", - "quote 1.0.37", - "syn 2.0.72", -] - -[[package]] -name = "prost-derive" -version = "0.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18bec9b0adc4eba778b33684b7ba3e7137789434769ee3ce3930463ef904cfca" -dependencies = [ - "anyhow", - "itertools 0.12.0", - "proc-macro2 1.0.86", - "quote 1.0.37", - "syn 2.0.72", -] - -[[package]] -name = "prost-reflect" -version = "0.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "057237efdb71cf4b3f9396302a3d6599a92fa94063ba537b66130980ea9909f3" -dependencies = [ - "base64 0.21.5", - "logos", - "miette", - "once_cell", - "prost 0.12.1", - "prost-types 0.12.1", - "serde", - "serde-value", -] - -[[package]] -name = "prost-types" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e081b29f63d83a4bc75cfc9f3fe424f9156cf92d8a4f0c9407cce9a1b67327cf" -dependencies = [ - "prost 0.12.1", -] - -[[package]] -name = "prost-types" -version = "0.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cee5168b05f49d4b0ca581206eb14a7b22fafd963efe729ac48eb03266e25cc2" -dependencies = [ - "prost 0.13.1", -] - -[[package]] -name = "proto_config" -version = "0.1.0" -dependencies = [ - "anyhow", - "da_config", - "prost 0.12.1", - "serde_json", - "serde_yaml", - "zksync_protobuf", - "zksync_protobuf_build", -] - -[[package]] -name = "protox" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00bb76c5f6221de491fe2c8f39b106330bbd9762c6511119c07940e10eb9ff11" -dependencies = [ - "bytes", - "miette", - "prost 0.12.1", - "prost-reflect", - "prost-types 0.12.1", - "protox-parse", - "thiserror", -] - -[[package]] -name = "protox-parse" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b4581f441c58863525a3e6bec7b8de98188cf75239a56c725a3e7288450a33f" -dependencies = [ - "logos", - "miette", - "prost-types 0.12.1", - "thiserror", -] - -[[package]] -name = "psm" -version = "0.1.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa37f80ca58604976033fae9515a8a2989fc13797d953f7c04fb8fa36a11f205" -dependencies = [ - "cc", -] - -[[package]] -name = "ptr_meta" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0738ccf7ea06b608c10564b31debd4f5bc5e197fc8bfe088f68ae5ce81e7a4f1" -dependencies = [ - "ptr_meta_derive", -] - -[[package]] -name = "ptr_meta_derive" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16b845dbfca988fa33db069c0e230574d15a3088f147a87b64c7589eb662c9ac" -dependencies = [ - "proc-macro2 1.0.86", - "quote 1.0.37", - "syn 1.0.109", -] - -[[package]] -name = "pulldown-cmark" -version = "0.9.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77a1a2f1f0a7ecff9c31abbe177637be0e97a0aef46cf8738ece09327985d998" -dependencies = [ - "bitflags 1.3.2", - "memchr", - "unicase", -] - -[[package]] -name = "quanta" -version = "0.9.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "20afe714292d5e879d8b12740aa223c6a88f118af41870e8b6196e39a02238a8" -dependencies = [ - "crossbeam-utils 0.8.20", - "libc", - "mach", - "once_cell", - "raw-cpuid", - "wasi 0.10.2+wasi-snapshot-preview1", - "web-sys", - "winapi", -] - -[[package]] -name = "quick-error" -version = "1.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" - -[[package]] -name = "quick-error" -version = "2.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a993555f31e5a609f617c12db6250dedcac1b0a85076912c436e6fc9b2c8e6a3" - -[[package]] -name = "quick-protobuf" -version = "0.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d6da84cc204722a989e01ba2f6e1e276e190f22263d0cb6ce8526fcdb0d2e1f" -dependencies = [ - "byteorder", -] - -[[package]] -name = "quote" -version = "0.6.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ce23b6b870e8f94f81fb0a363d65d86675884b34a09043c81e5562f11c1f8e1" -dependencies = [ - "proc-macro2 0.4.30", -] - -[[package]] -name = "quote" -version = "1.0.37" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af" -dependencies = [ - "proc-macro2 1.0.86", -] - -[[package]] -name = "radium" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc33ff2d4973d518d823d61aa239014831e521c75da58e3df4840d3f47749d09" - -[[package]] -name = "rand" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "552840b97013b1a26992c11eac34bdd778e464601a4c2054b5f0bff7c6761293" -dependencies = [ - "fuchsia-cprng", - "libc", - "rand_core 0.3.1", - "rdrand", - "winapi", -] - -[[package]] -name = "rand" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03" -dependencies = [ - "getrandom 0.1.16", - "libc", - "rand_chacha 0.2.2", - "rand_core 0.5.1", - "rand_hc", -] - -[[package]] -name = "rand" -version = "0.8.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" -dependencies = [ - "libc", - "rand_chacha 0.3.1", - "rand_core 0.6.4", -] - -[[package]] -name = "rand_chacha" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4c8ed856279c9737206bf725bf36935d8666ead7aa69b52be55af369d193402" -dependencies = [ - "ppv-lite86", - "rand_core 0.5.1", -] - -[[package]] -name = "rand_chacha" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" -dependencies = [ - "ppv-lite86", - "rand_core 0.6.4", -] - -[[package]] -name = "rand_core" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a6fdeb83b075e8266dcc8762c22776f6877a63111121f5f8c7411e5be7eed4b" -dependencies = [ - "rand_core 0.4.2", -] - -[[package]] -name = "rand_core" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c33a3c44ca05fa6f1807d8e6743f3824e8509beca625669633be0acbdf509dc" - -[[package]] -name = "rand_core" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" -dependencies = [ - "getrandom 0.1.16", -] - -[[package]] -name = "rand_core" -version = "0.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" -dependencies = [ - "getrandom 0.2.10", -] - -[[package]] -name = "rand_hc" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c" -dependencies = [ - "rand_core 0.5.1", -] - -[[package]] -name = "rand_xorshift" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d25bf25ec5ae4a3f1b92f929810509a2f53d7dca2f50b794ff57e3face536c8f" -dependencies = [ - "rand_core 0.6.4", -] - -[[package]] -name = "rand_xoshiro" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f97cdb2a36ed4183de61b2f824cc45c9f1037f28afe0a322e9fff4c108b5aaa" -dependencies = [ - "rand_core 0.6.4", -] - -[[package]] -name = "raw-cpuid" -version = "10.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c297679cb867470fa8c9f67dbba74a78d78e3e98d7cf2b08d6d71540f797332" -dependencies = [ - "bitflags 1.3.2", -] - -[[package]] -name = "rayon" -version = "1.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b418a60154510ca1a002a752ca9714984e21e4241e804d32555251faf8b78ffa" -dependencies = [ - "either", - "rayon-core", -] - -[[package]] -name = "rayon-core" -version = "1.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1465873a3dfdaa8ae7cb14b4383657caab0b3e8a0aa9ae8e04b044854c8dfce2" -dependencies = [ - "crossbeam-deque 0.8.5", - "crossbeam-utils 0.8.20", -] - -[[package]] -name = "rcgen" -version = "0.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54077e1872c46788540de1ea3d7f4ccb1983d12f9aa909b234468676c1a36779" -dependencies = [ - "pem", - "ring 0.17.7", - "rustls-pki-types", - "time", - "yasna", -] - -[[package]] -name = "rdrand" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "678054eb77286b51581ba43620cc911abf02758c91f93f479767aed0f90458b2" -dependencies = [ - "rand_core 0.3.1", -] - -[[package]] -name = "recvmsg" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3edd4d5d42c92f0a659926464d4cce56b562761267ecf0f469d85b7de384175" - -[[package]] -name = "redox_syscall" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" -dependencies = [ - "bitflags 1.3.2", -] - -[[package]] -name = "ref-cast" -version = "1.0.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ccf0a6f84d5f1d581da8b41b47ec8600871962f2a528115b542b362d4b744931" -dependencies = [ - "ref-cast-impl", -] - -[[package]] -name = "ref-cast-impl" -version = "1.0.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bcc303e793d3734489387d205e9b186fac9c6cfacedd98cbb2e8a5943595f3e6" -dependencies = [ - "proc-macro2 1.0.86", - "quote 1.0.37", - "syn 2.0.72", -] - -[[package]] -name = "regex" -version = "1.10.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4219d74c6b67a3654a9fbebc4b419e22126d13d2f3c4a07ee0cb61ff79a79619" -dependencies = [ - "aho-corasick", - "memchr", - "regex-automata 0.4.7", - "regex-syntax 0.8.2", -] - -[[package]] -name = "regex-automata" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132" -dependencies = [ - "regex-syntax 0.6.29", -] - -[[package]] -name = "regex-automata" -version = "0.4.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38caf58cc5ef2fed281f89292ef23f6365465ed9a41b7a7754eb4e26496c92df" -dependencies = [ - "aho-corasick", - "memchr", - "regex-syntax 0.8.2", -] - -[[package]] -name = "regex-syntax" -version = "0.6.29" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" - -[[package]] -name = "regex-syntax" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" - -[[package]] -name = "rend" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2571463863a6bd50c32f94402933f03457a3fbaf697a707c5be741e459f08fd" -dependencies = [ - "bytecheck", -] - -[[package]] -name = "reqwest" -version = "0.11.22" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "046cd98826c46c2ac8ddecae268eb5c2e58628688a5fc7a2643704a73faba95b" -dependencies = [ - "base64 0.21.5", - "bytes", - "encoding_rs", - "futures-core", - "futures-util", - "h2 0.3.26", - "http 0.2.9", - "http-body 0.4.6", - "hyper 0.14.29", - "hyper-tls 0.5.0", - "ipnet", - "js-sys", - "log", - "mime", - "native-tls", - "once_cell", - "percent-encoding", - "pin-project-lite", - "serde", - "serde_json", - "serde_urlencoded", - "system-configuration", - "tokio", - "tokio-native-tls", - "tower-service", - "url", - "wasm-bindgen", - "wasm-bindgen-futures", - "web-sys", - "winreg 0.50.0", -] - -[[package]] -name = "reqwest" -version = "0.12.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7d6d2a27d57148378eb5e111173f4276ad26340ecc5c49a4a2152167a2d6a37" -dependencies = [ - "base64 0.22.1", - "bytes", - "encoding_rs", - "futures-channel", - "futures-core", - "futures-util", - "h2 0.4.5", - "http 1.1.0", - "http-body 1.0.0", - "http-body-util", - "hyper 1.3.1", - "hyper-rustls 0.27.2", - "hyper-tls 0.6.0", - "hyper-util", - "ipnet", - "js-sys", - "log", - "mime", - "mime_guess", - "native-tls", - "once_cell", - "percent-encoding", - "pin-project-lite", - "rustls-pemfile 2.0.0", - "serde", - "serde_json", - "serde_urlencoded", - "sync_wrapper 1.0.1", - "system-configuration", - "tokio", - "tokio-native-tls", - "tokio-util", - "tower-service", - "url", - "wasm-bindgen", - "wasm-bindgen-futures", - "wasm-streams", - "web-sys", - "winreg 0.52.0", -] - -[[package]] -name = "reqwest-middleware" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39346a33ddfe6be00cbc17a34ce996818b97b230b87229f10114693becca1268" -dependencies = [ - "anyhow", - "async-trait", - "http 1.1.0", - "reqwest 0.12.5", - "serde", - "thiserror", - "tower-service", -] - -[[package]] -name = "rescue_poseidon" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ada2124f92cf32b813e50f6f7d9e92f05addc321edb8b68f9b4e2bb6e0d5af8b" -dependencies = [ - "addchain", - "arrayvec 0.7.4", - "blake2 0.10.6", - "byteorder", - "franklin-crypto", - "num-bigint 0.3.3", - "num-integer", - "num-iter", - "num-traits", - "rand 0.4.6", - "serde", - "sha3 0.9.1", - "smallvec 1.13.1", -] - -[[package]] -name = "rfc6979" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7743f17af12fa0b03b803ba12cd6a8d9483a587e89c69445e3909655c0b9fabb" -dependencies = [ - "crypto-bigint 0.4.9", - "hmac 0.12.1", - "zeroize", -] - -[[package]] -name = "rfc6979" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8dd2a808d456c4a54e300a23e9f5a67e122c3024119acbfd73e3bf664491cb2" -dependencies = [ - "hmac 0.12.1", - "subtle", -] - -[[package]] -name = "ring" -version = "0.1.0" -source = "git+https://github.com/w3f/ring-proof#31658d1f5b88e106c969557c36c821aff46b2236" -dependencies = [ - "ark-ec", - "ark-ff 0.4.2", - "ark-poly", - "ark-serialize 0.4.2", - "ark-std 0.4.0", - "ark-transcript 0.0.2 (git+https://github.com/w3f/ring-vrf)", - "arrayvec 0.7.4", - "blake2 0.10.6", - "common", - "fflonk", -] - -[[package]] -name = "ring" -version = "0.17.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "688c63d65483050968b2a8937f7995f443e27041a0f7700aa59b0822aedebb74" -dependencies = [ - "cc", - "getrandom 0.2.10", - "libc", - "spin", - "untrusted", - "windows-sys 0.48.0", -] - -[[package]] -name = "rkyv" -version = "0.7.43" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "527a97cdfef66f65998b5f3b637c26f5a5ec09cc52a3f9932313ac645f4190f5" -dependencies = [ - "bitvec", - "bytecheck", - "bytes", - "hashbrown 0.12.3", - "ptr_meta", - "rend", - "rkyv_derive", - "seahash", - "tinyvec", - "uuid", -] - -[[package]] -name = "rkyv_derive" -version = "0.7.43" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5c462a1328c8e67e4d6dbad1eb0355dd43e8ab432c6e227a43657f16ade5033" -dependencies = [ - "proc-macro2 1.0.86", - "quote 1.0.37", - "syn 1.0.109", -] - -[[package]] -name = "rlp" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb919243f34364b6bd2fc10ef797edbfa75f33c252e7998527479c6d6b47e1ec" -dependencies = [ - "bytes", - "rustc-hex", -] - -[[package]] -name = "rocksdb" -version = "0.21.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb6f170a4041d50a0ce04b0d2e14916d6ca863ea2e422689a5b694395d299ffe" -dependencies = [ - "libc", - "librocksdb-sys", -] - -[[package]] -name = "route-recognizer" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "afab94fb28594581f62d981211a9a4d53cc8130bbcbbb89a0440d9b8e81a7746" - -[[package]] -name = "rsa" -version = "0.9.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af6c4b23d99685a1408194da11270ef8e9809aff951cc70ec9b17350b087e474" -dependencies = [ - "const-oid", - "digest 0.10.7", - "num-bigint-dig", - "num-integer", - "num-traits", - "pkcs1", - "pkcs8 0.10.2", - "rand_core 0.6.4", - "signature 2.2.0", - "spki 0.7.2", - "subtle", - "zeroize", -] - -[[package]] -name = "ruint" -version = "1.12.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c3cc4c2511671f327125da14133d0c5c5d137f006a1017a16f557bc85b16286" -dependencies = [ - "alloy-rlp", - "ark-ff 0.3.0", - "ark-ff 0.4.2", - "bytes", - "fastrlp", - "num-bigint 0.4.6", - "num-traits", - "parity-scale-codec", - "primitive-types", - "proptest", - "rand 0.8.5", - "rlp", - "ruint-macro", - "serde", - "valuable", - "zeroize", -] - -[[package]] -name = "ruint-macro" -version = "1.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48fd7bd8a6377e15ad9d42a8ec25371b94ddc67abe7c8b9127bec79bebaaae18" - -[[package]] -name = "rust_decimal" -version = "1.33.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06676aec5ccb8fc1da723cc8c0f9a46549f21ebb8753d3915c6c41db1e7f1dc4" -dependencies = [ - "arrayvec 0.7.4", - "borsh", - "bytes", - "num-traits", - "rand 0.8.5", - "rkyv", - "serde", - "serde_json", -] - -[[package]] -name = "rustc-demangle" -version = "0.1.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" - -[[package]] -name = "rustc-hash" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" - -[[package]] -name = "rustc-hex" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e75f6a532d0fd9f7f13144f392b6ad56a32696bfcd9c78f797f16bbb6f072d6" - -[[package]] -name = "rustc_version" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0dfe2087c51c460008730de8b57e6a320782fbfb312e1f4d520e6c6fae155ee" -dependencies = [ - "semver 0.11.0", -] - -[[package]] -name = "rustc_version" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" -dependencies = [ - "semver 1.0.20", -] - -[[package]] -name = "rustix" -version = "0.36.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "305efbd14fde4139eb501df5f136994bb520b033fa9fbdce287507dc23b8c7ed" -dependencies = [ - "bitflags 1.3.2", - "errno", - "io-lifetimes", - "libc", - "linux-raw-sys 0.1.4", - "windows-sys 0.45.0", -] - -[[package]] -name = "rustix" -version = "0.38.34" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f" -dependencies = [ - "bitflags 2.6.0", - "errno", - "libc", - "linux-raw-sys 0.4.14", - "windows-sys 0.52.0", -] - -[[package]] -name = "rustls" -version = "0.21.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f56a14d1f48b391359b22f731fd4bd7e43c97f3c50eee276f3aa09c94784d3e" -dependencies = [ - "log", - "ring 0.17.7", - "rustls-webpki 0.101.7", - "sct", -] - -[[package]] -name = "rustls" -version = "0.22.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf4ef73721ac7bcd79b2b315da7779d8fc09718c6b3d2d1b2d94850eb8c18432" -dependencies = [ - "log", - "ring 0.17.7", - "rustls-pki-types", - "rustls-webpki 0.102.4", - "subtle", - "zeroize", -] - -[[package]] -name = "rustls" -version = "0.23.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05cff451f60db80f490f3c182b77c35260baace73209e9cdbbe526bfe3a4d402" -dependencies = [ - "aws-lc-rs", - "log", - "once_cell", - "ring 0.17.7", - "rustls-pki-types", - "rustls-webpki 0.102.4", - "subtle", - "zeroize", -] - -[[package]] -name = "rustls-native-certs" -version = "0.6.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9aace74cb666635c918e9c12bc0d348266037aa8eb599b5cba565709a8dff00" -dependencies = [ - "openssl-probe", - "rustls-pemfile 1.0.4", - "schannel", - "security-framework", -] - -[[package]] -name = "rustls-native-certs" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f1fb85efa936c42c6d5fc28d2629bb51e4b2f4b8a5211e297d599cc5a093792" -dependencies = [ - "openssl-probe", - "rustls-pemfile 2.0.0", - "rustls-pki-types", - "schannel", - "security-framework", -] - -[[package]] -name = "rustls-pemfile" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c74cae0a4cf6ccbbf5f359f08efdf8ee7e1dc532573bf0db71968cb56b1448c" -dependencies = [ - "base64 0.21.5", -] - -[[package]] -name = "rustls-pemfile" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35e4980fa29e4c4b212ffb3db068a564cbf560e51d3944b7c88bd8bf5bec64f4" -dependencies = [ - "base64 0.21.5", - "rustls-pki-types", -] - -[[package]] -name = "rustls-pki-types" -version = "1.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "976295e77ce332211c0d24d92c0e83e50f5c5f046d11082cea19f3df13a3562d" - -[[package]] -name = "rustls-platform-verifier" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e3beb939bcd33c269f4bf946cc829fcd336370267c4a927ac0399c84a3151a1" -dependencies = [ - "core-foundation", - "core-foundation-sys", - "jni", - "log", - "once_cell", - "rustls 0.23.10", - "rustls-native-certs 0.7.0", - "rustls-platform-verifier-android", - "rustls-webpki 0.102.4", - "security-framework", - "security-framework-sys", - "webpki-roots", - "winapi", -] - -[[package]] -name = "rustls-platform-verifier-android" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84e217e7fdc8466b5b35d30f8c0a30febd29173df4a3a0c2115d306b9c4117ad" - -[[package]] -name = "rustls-webpki" -version = "0.101.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b6275d1ee7a1cd780b64aca7726599a1dbc893b1e64144529e55c3c2f745765" -dependencies = [ - "ring 0.17.7", - "untrusted", -] - -[[package]] -name = "rustls-webpki" -version = "0.102.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff448f7e92e913c4b7d4c6d8e4540a1724b319b4152b8aef6d4cf8339712b33e" -dependencies = [ - "aws-lc-rs", - "ring 0.17.7", - "rustls-pki-types", - "untrusted", -] - -[[package]] -name = "rustversion" -version = "1.0.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ffc183a10b4478d04cbbbfc96d0873219d962dd5accaff2ffbd4ceb7df837f4" - -[[package]] -name = "rusty-fork" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb3dcc6e454c328bb824492db107ab7c0ae8fcffe4ad210136ef014458c1bc4f" -dependencies = [ - "fnv", - "quick-error 1.2.3", - "tempfile", - "wait-timeout", -] - -[[package]] -name = "ruzstd" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58c4eb8a81997cf040a091d1f7e1938aeab6749d3a0dfa73af43cdc32393483d" -dependencies = [ - "byteorder", - "derive_more 0.99.18", - "twox-hash", -] - -[[package]] -name = "ryu" -version = "1.0.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ad4cc8da4ef723ed60bced201181d83791ad433213d8c24efffda1eec85d741" - -[[package]] -name = "same-file" -version = "1.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" -dependencies = [ - "winapi-util", -] - -[[package]] -name = "scale-bits" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "036575c29af9b6e4866ffb7fa055dbf623fe7a9cc159b33786de6013a6969d89" -dependencies = [ - "parity-scale-codec", - "scale-info", - "serde", -] - -[[package]] -name = "scale-decode" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7caaf753f8ed1ab4752c6afb20174f03598c664724e0e32628e161c21000ff76" -dependencies = [ - "derive_more 0.99.18", - "parity-scale-codec", - "primitive-types", - "scale-bits", - "scale-decode-derive", - "scale-info", - "smallvec 1.13.1", -] - -[[package]] -name = "scale-decode-derive" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3475108a1b62c7efd1b5c65974f30109a598b2f45f23c9ae030acb9686966db" -dependencies = [ - "darling 0.14.4", - "proc-macro-crate 1.3.1", - "proc-macro2 1.0.86", - "quote 1.0.37", - "syn 1.0.109", -] - -[[package]] -name = "scale-encode" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d70cb4b29360105483fac1ed567ff95d65224a14dd275b6303ed0a654c78de5" -dependencies = [ - "derive_more 0.99.18", - "parity-scale-codec", - "primitive-types", - "scale-bits", - "scale-encode-derive", - "scale-info", - "smallvec 1.13.1", -] - -[[package]] -name = "scale-encode-derive" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "995491f110efdc6bea96d6a746140e32bfceb4ea47510750a5467295a4707a25" -dependencies = [ - "darling 0.14.4", - "proc-macro-crate 1.3.1", - "proc-macro2 1.0.86", - "quote 1.0.37", - "syn 1.0.109", -] - -[[package]] -name = "scale-info" -version = "2.11.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eca070c12893629e2cc820a9761bedf6ce1dcddc9852984d1dc734b8bd9bd024" -dependencies = [ - "bitvec", - "cfg-if 1.0.0", - "derive_more 0.99.18", - "parity-scale-codec", - "scale-info-derive", - "serde", -] - -[[package]] -name = "scale-info-derive" -version = "2.11.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d35494501194174bda522a32605929eefc9ecf7e0a326c26db1fdd85881eb62" -dependencies = [ - "proc-macro-crate 3.1.0", - "proc-macro2 1.0.86", - "quote 1.0.37", - "syn 1.0.109", -] - -[[package]] -name = "scale-typegen" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00860983481ac590ac87972062909bef0d6a658013b592ccc0f2feb272feab11" -dependencies = [ - "proc-macro2 1.0.86", - "quote 1.0.37", - "scale-info", - "syn 2.0.72", - "thiserror", -] - -[[package]] -name = "scale-value" -version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58223c7691bf0bd46b43c9aea6f0472d1067f378d574180232358d7c6e0a8089" -dependencies = [ - "base58", - "blake2 0.10.6", - "derive_more 0.99.18", - "either", - "frame-metadata 15.1.0", - "parity-scale-codec", - "scale-bits", - "scale-decode", - "scale-encode", - "scale-info", - "serde", - "yap", -] - -[[package]] -name = "schannel" -version = "0.1.22" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c3733bf4cf7ea0880754e19cb5a462007c4a8c1914bff372ccc95b464f1df88" -dependencies = [ - "windows-sys 0.48.0", -] - -[[package]] -name = "schnellru" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c9a8ef13a93c54d20580de1e5c413e624e53121d42fc7e2c11d10ef7f8b02367" -dependencies = [ - "ahash 0.8.7", - "cfg-if 1.0.0", - "hashbrown 0.13.2", -] - -[[package]] -name = "schnorrkel" -version = "0.9.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "021b403afe70d81eea68f6ea12f6b3c9588e5d536a94c3bf80f15e7faa267862" -dependencies = [ - "arrayref", - "arrayvec 0.5.2", - "curve25519-dalek 2.1.3", - "getrandom 0.1.16", - "merlin 2.0.1", - "rand 0.7.3", - "rand_core 0.5.1", - "sha2 0.8.2", - "subtle", - "zeroize", -] - -[[package]] -name = "schnorrkel" -version = "0.11.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8de18f6d8ba0aad7045f5feae07ec29899c1112584a38509a84ad7b04451eaa0" -dependencies = [ - "aead", - "arrayref", - "arrayvec 0.7.4", - "curve25519-dalek 4.1.3", - "getrandom_or_panic", - "merlin 3.0.0", - "rand_core 0.6.4", - "serde_bytes", - "sha2 0.10.8", - "subtle", - "zeroize", -] - -[[package]] -name = "scopeguard" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" - -[[package]] -name = "sct" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da046153aa2352493d6cb7da4b6e5c0c057d8a1d0a9aa8560baffdd945acd414" -dependencies = [ - "ring 0.17.7", - "untrusted", -] - -[[package]] -name = "seahash" -version = "4.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c107b6f4780854c8b126e228ea8869f4d7b71260f962fefb57b996b8959ba6b" - -[[package]] -name = "sec1" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3be24c1842290c45df0a7bf069e0c268a747ad05a192f2fd7dcfdbc1cba40928" -dependencies = [ - "base16ct 0.1.1", - "der 0.6.1", - "generic-array 0.14.7", - "pkcs8 0.9.0", - "subtle", - "zeroize", -] - -[[package]] -name = "sec1" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3e97a565f76233a6003f9f5c54be1d9c5bdfa3eccfb189469f11ec4901c47dc" -dependencies = [ - "base16ct 0.2.0", - "der 0.7.8", - "generic-array 0.14.7", - "pkcs8 0.10.2", - "subtle", - "zeroize", -] - -[[package]] -name = "secp256k1" -version = "0.27.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25996b82292a7a57ed3508f052cfff8640d38d32018784acd714758b43da9c8f" -dependencies = [ - "secp256k1-sys 0.8.1", - "serde", -] - -[[package]] -name = "secp256k1" -version = "0.28.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d24b59d129cdadea20aea4fb2352fa053712e5d713eee47d700cd4b2bc002f10" -dependencies = [ - "secp256k1-sys 0.9.2", -] - -[[package]] -name = "secp256k1-sys" -version = "0.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70a129b9e9efbfb223753b9163c4ab3b13cff7fd9c7f010fbac25ab4099fa07e" -dependencies = [ - "cc", -] - -[[package]] -name = "secp256k1-sys" -version = "0.9.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5d1746aae42c19d583c3c1a8c646bfad910498e2051c551a7f2e3c0c9fbb7eb" -dependencies = [ - "cc", -] - -[[package]] -name = "secrecy" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9bd1c54ea06cfd2f6b63219704de0b9b4f72dcc2b8fdef820be6cd799780e91e" -dependencies = [ - "zeroize", -] - -[[package]] -name = "security-framework" -version = "2.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c627723fd09706bacdb5cf41499e95098555af3c3c29d014dc3c458ef6be11c0" -dependencies = [ - "bitflags 2.6.0", - "core-foundation", - "core-foundation-sys", - "libc", - "num-bigint 0.4.6", - "security-framework-sys", -] - -[[package]] -name = "security-framework-sys" -version = "2.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "317936bbbd05227752583946b9e66d7ce3b489f84e11a94a510b4437fef407d7" -dependencies = [ - "core-foundation-sys", - "libc", -] - -[[package]] -name = "semver" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f301af10236f6df4160f7c3f04eec6dbc70ace82d23326abad5edee88801c6b6" -dependencies = [ - "semver-parser", -] - -[[package]] -name = "semver" -version = "1.0.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "836fa6a3e1e547f9a2c4040802ec865b5d85f4014efe00555d7090a3dcaa1090" -dependencies = [ - "serde", -] - -[[package]] -name = "semver-parser" -version = "0.10.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00b0bef5b7f9e0df16536d3961cfb6e84331c065b4066afb39768d0e319411f7" -dependencies = [ - "pest", -] - -[[package]] -name = "send_wrapper" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f638d531eccd6e23b980caf34876660d38e265409d8e99b397ab71eb3612fad0" - -[[package]] -name = "send_wrapper" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd0b0ec5f1c1ca621c432a25813d8d60c88abe6d3e08a3eb9cf37d97a0fe3d73" - -[[package]] -name = "sentry" -version = "0.31.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0097a48cd1999d983909f07cb03b15241c5af29e5e679379efac1c06296abecc" -dependencies = [ - "httpdate", - "native-tls", - "reqwest 0.11.22", - "sentry-backtrace", - "sentry-contexts", - "sentry-core", - "sentry-debug-images", - "sentry-panic", - "sentry-tracing", - "tokio", - "ureq", -] - -[[package]] -name = "sentry-backtrace" -version = "0.31.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18a7b80fa1dd6830a348d38a8d3a9761179047757b7dca29aef82db0118b9670" -dependencies = [ - "backtrace", - "once_cell", - "regex", - "sentry-core", -] - -[[package]] -name = "sentry-contexts" -version = "0.31.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7615dc588930f1fd2e721774f25844ae93add2dbe2d3c2f995ce5049af898147" -dependencies = [ - "hostname", - "libc", - "os_info", - "rustc_version 0.4.0", - "sentry-core", - "uname", -] - -[[package]] -name = "sentry-core" -version = "0.31.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f51264e4013ed9b16558cce43917b983fa38170de2ca480349ceb57d71d6053" -dependencies = [ - "once_cell", - "rand 0.8.5", - "sentry-types", - "serde", - "serde_json", -] - -[[package]] -name = "sentry-debug-images" -version = "0.31.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2fe6180fa564d40bb942c9f0084ffb5de691c7357ead6a2b7a3154fae9e401dd" -dependencies = [ - "findshlibs", - "once_cell", - "sentry-core", -] - -[[package]] -name = "sentry-panic" -version = "0.31.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "323160213bba549f9737317b152af116af35c0410f4468772ee9b606d3d6e0fa" -dependencies = [ - "sentry-backtrace", - "sentry-core", -] - -[[package]] -name = "sentry-tracing" -version = "0.31.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38033822128e73f7b6ca74c1631cef8868890c6cb4008a291cf73530f87b4eac" -dependencies = [ - "sentry-backtrace", - "sentry-core", - "tracing-core", - "tracing-subscriber 0.3.18", -] - -[[package]] -name = "sentry-types" -version = "0.31.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e663b3eb62ddfc023c9cf5432daf5f1a4f6acb1df4d78dd80b740b32dd1a740" -dependencies = [ - "debugid", - "hex", - "rand 0.8.5", - "serde", - "serde_json", - "thiserror", - "time", - "url", - "uuid", -] - -[[package]] -name = "seq-macro" -version = "0.3.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3f0bf26fd526d2a95683cd0f87bf103b8539e2ca1ef48ce002d67aad59aa0b4" - -[[package]] -name = "serde" -version = "1.0.210" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8e3592472072e6e22e0a54d5904d9febf8508f65fb8552499a1abc7d1078c3a" -dependencies = [ - "serde_derive", -] - -[[package]] -name = "serde-hex" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca37e3e4d1b39afd7ff11ee4e947efae85adfddf4841787bfa47c470e96dc26d" -dependencies = [ - "array-init", - "serde", - "smallvec 0.6.14", -] - -[[package]] -name = "serde-value" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3a1a3341211875ef120e117ea7fd5228530ae7e7036a779fdc9117be6b3282c" -dependencies = [ - "ordered-float", - "serde", -] - -[[package]] -name = "serde_bytes" -version = "0.11.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "387cc504cb06bb40a96c8e04e951fe01854cf6bc921053c954e4a606d9675c6a" -dependencies = [ - "serde", -] - -[[package]] -name = "serde_derive" -version = "1.0.210" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "243902eda00fad750862fc144cea25caca5e20d615af0a81bee94ca738f1df1f" -dependencies = [ - "proc-macro2 1.0.86", - "quote 1.0.37", - "syn 2.0.72", -] - -[[package]] -name = "serde_json" -version = "1.0.128" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ff5456707a1de34e7e37f2a6fd3d3f808c318259cbd01ab6377795054b483d8" -dependencies = [ - "itoa", - "memchr", - "ryu", - "serde", -] - -[[package]] -name = "serde_path_to_error" -version = "0.1.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4beec8bce849d58d06238cb50db2e1c417cfeafa4c63f692b15c82b7c80f8335" -dependencies = [ - "itoa", - "serde", -] - -[[package]] -name = "serde_spanned" -version = "0.6.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb5b1b31579f3811bf615c144393417496f152e12ac8b7663bf664f4a815306d" -dependencies = [ - "serde", -] - -[[package]] -name = "serde_urlencoded" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" -dependencies = [ - "form_urlencoded", - "itoa", - "ryu", - "serde", -] - -[[package]] -name = "serde_with" -version = "1.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "678b5a069e50bf00ecd22d0cd8ddf7c236f68581b03db652061ed5eb13a312ff" -dependencies = [ - "base64 0.13.1", - "hex", - "serde", - "serde_with_macros", -] - -[[package]] -name = "serde_with_macros" -version = "1.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e182d6ec6f05393cc0e5ed1bf81ad6db3a8feedf8ee515ecdd369809bcce8082" -dependencies = [ - "darling 0.13.4", - "proc-macro2 1.0.86", - "quote 1.0.37", - "syn 1.0.109", -] - -[[package]] -name = "serde_yaml" -version = "0.9.25" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a49e178e4452f45cb61d0cd8cebc1b0fafd3e41929e996cef79aa3aca91f574" -dependencies = [ - "indexmap 2.1.0", - "itoa", - "ryu", - "serde", - "unsafe-libyaml", -] - -[[package]] -name = "sha-1" -version = "0.9.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99cd6713db3cf16b6c84e06321e049a9b9f699826e16096d23bbcc44d15d51a6" -dependencies = [ - "block-buffer 0.9.0", - "cfg-if 1.0.0", - "cpufeatures", - "digest 0.9.0", - "opaque-debug 0.3.0", -] - -[[package]] -name = "sha1" -version = "0.10.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3bf829a2d51ab4a5ddf1352d8470c140cadc8301b2ae1789db023f01cedd6ba" -dependencies = [ - "cfg-if 1.0.0", - "cpufeatures", - "digest 0.10.7", -] - -[[package]] -name = "sha2" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a256f46ea78a0c0d9ff00077504903ac881a1dafdc20da66545699e7776b3e69" -dependencies = [ - "block-buffer 0.7.3", - "digest 0.8.1", - "fake-simd", - "opaque-debug 0.2.3", -] - -[[package]] -name = "sha2" -version = "0.9.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d58a1e1bf39749807d89cf2d98ac2dfa0ff1cb3faa38fbb64dd88ac8013d800" -dependencies = [ - "block-buffer 0.9.0", - "cfg-if 1.0.0", - "cpufeatures", - "digest 0.9.0", - "opaque-debug 0.3.0", -] - -[[package]] -name = "sha2" -version = "0.10.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" -dependencies = [ - "cfg-if 1.0.0", - "cpufeatures", - "digest 0.10.7", -] - -[[package]] -name = "sha2_ce" -version = "0.10.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eca2daa77078f4ddff27e75c4bf59e4c2697525f56dbb3c842d34a5d1f2b04a2" -dependencies = [ - "cfg-if 1.0.0", - "cpufeatures", - "digest 0.10.7", -] - -[[package]] -name = "sha3" -version = "0.9.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f81199417d4e5de3f04b1e871023acea7389672c4135918f05aa9cbf2f2fa809" -dependencies = [ - "block-buffer 0.9.0", - "digest 0.9.0", - "keccak", - "opaque-debug 0.3.0", -] - -[[package]] -name = "sha3" -version = "0.10.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75872d278a8f37ef87fa0ddbda7802605cb18344497949862c0d4dcb291eba60" -dependencies = [ - "digest 0.10.7", - "keccak", -] - -[[package]] -name = "sha3-asm" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c28efc5e327c837aa837c59eae585fc250715ef939ac32881bcc11677cd02d46" -dependencies = [ - "cc", - "cfg-if 1.0.0", -] - -[[package]] -name = "sha3_ce" -version = "0.10.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34c9a08202c50378d8a07a5f458193a5f542d2828ac6640263dbc0c2533ea25e" -dependencies = [ - "digest 0.10.7", - "keccak", -] - -[[package]] -name = "sharded-slab" -version = "0.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f40ca3c46823713e0d4209592e8d6e826aa57e928f09752619fc696c499637f6" -dependencies = [ - "lazy_static", -] - -[[package]] -name = "shlex" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" - -[[package]] -name = "signal-hook-registry" -version = "1.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8229b473baa5980ac72ef434c4415e70c4b5e71b423043adb4ba059f89c99a1" -dependencies = [ - "libc", -] - -[[package]] -name = "signature" -version = "1.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74233d3b3b2f6d4b006dc19dee745e73e2a6bfb6f93607cd3b02bd5b00797d7c" -dependencies = [ - "digest 0.10.7", - "rand_core 0.6.4", -] - -[[package]] -name = "signature" -version = "2.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77549399552de45a898a580c1b41d445bf730df867cc44e6c0233bbc4b8329de" -dependencies = [ - "digest 0.10.7", - "rand_core 0.6.4", -] - -[[package]] -name = "simdutf8" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f27f6278552951f1f2b8cf9da965d10969b2efdea95a6ec47987ab46edfe263a" - -[[package]] -name = "similar" -version = "2.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2aeaf503862c419d66959f5d7ca015337d864e9c49485d771b732e2a20453597" - -[[package]] -name = "simple-mermaid" -version = "0.1.0" -source = "git+https://github.com/kianenigma/simple-mermaid.git?rev=e48b187bcfd5cc75111acd9d241f1bd36604344b#e48b187bcfd5cc75111acd9d241f1bd36604344b" - -[[package]] -name = "simple_asn1" -version = "0.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adc4e5204eb1910f40f9cfa375f6f05b68c3abac4b6fd879c8ff5e7ae8a0a085" -dependencies = [ - "num-bigint 0.4.6", - "num-traits", - "thiserror", - "time", -] - -[[package]] -name = "siphasher" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56199f7ddabf13fe5074ce809e7d3f42b42ae711800501b5b16ea82ad029c39d" - -[[package]] -name = "sized-chunks" -version = "0.6.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16d69225bde7a69b235da73377861095455d298f2b970996eec25ddbb42b3d1e" -dependencies = [ - "bitmaps", - "typenum", -] - -[[package]] -name = "skeptic" -version = "0.13.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16d23b015676c90a0f01c197bfdc786c20342c73a0afdda9025adb0bc42940a8" -dependencies = [ - "bytecount", - "cargo_metadata", - "error-chain", - "glob", - "pulldown-cmark", - "tempfile", - "walkdir", -] - -[[package]] -name = "slab" -version = "0.4.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" -dependencies = [ - "autocfg", -] - -[[package]] -name = "smallvec" -version = "0.6.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b97fcaeba89edba30f044a10c6a3cc39df9c3f17d7cd829dd1446cab35f890e0" -dependencies = [ - "maybe-uninit", -] - -[[package]] -name = "smallvec" -version = "1.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6ecd384b10a64542d77071bd64bd7b231f4ed5940fba55e98c3de13824cf3d7" -dependencies = [ - "serde", -] - -[[package]] -name = "smol" -version = "2.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a33bd3e260892199c3ccfc487c88b2da2265080acb316cd920da72fdfd7c599f" -dependencies = [ - "async-channel", - "async-executor", - "async-fs", - "async-io", - "async-lock", - "async-net", - "async-process", - "blocking", - "futures-lite", -] - -[[package]] -name = "smoldot" -version = "0.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6d1eaa97d77be4d026a1e7ffad1bb3b78448763b357ea6f8188d3e6f736a9b9" -dependencies = [ - "arrayvec 0.7.4", - "async-lock", - "atomic-take", - "base64 0.21.5", - "bip39", - "blake2-rfc", - "bs58", - "chacha20", - "crossbeam-queue 0.3.11", - "derive_more 0.99.18", - "ed25519-zebra 4.0.3", - "either", - "event-listener 4.0.3", - "fnv", - "futures-lite", - "futures-util", - "hashbrown 0.14.5", - "hex", - "hmac 0.12.1", - "itertools 0.12.0", - "libm", - "libsecp256k1", - "merlin 3.0.0", - "no-std-net", - "nom", - "num-bigint 0.4.6", - "num-rational", - "num-traits", - "pbkdf2 0.12.2", - "pin-project", - "poly1305", - "rand 0.8.5", - "rand_chacha 0.3.1", - "ruzstd", - "schnorrkel 0.11.4", - "serde", - "serde_json", - "sha2 0.10.8", - "sha3 0.10.8", - "siphasher", - "slab", - "smallvec 1.13.1", - "soketto 0.7.1", - "twox-hash", - "wasmi", - "x25519-dalek", - "zeroize", -] - -[[package]] -name = "smoldot-light" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5496f2d116b7019a526b1039ec2247dd172b8670633b1a64a614c9ea12c9d8c7" -dependencies = [ - "async-channel", - "async-lock", - "base64 0.21.5", - "blake2-rfc", - "derive_more 0.99.18", - "either", - "event-listener 4.0.3", - "fnv", - "futures-channel", - "futures-lite", - "futures-util", - "hashbrown 0.14.5", - "hex", - "itertools 0.12.0", - "log", - "lru", - "no-std-net", - "parking_lot", - "pin-project", - "rand 0.8.5", - "rand_chacha 0.3.1", - "serde", - "serde_json", - "siphasher", - "slab", - "smol", - "smoldot", - "zeroize", -] - -[[package]] -name = "snapshots_creator" -version = "0.1.0" -dependencies = [ - "anyhow", - "futures 0.3.30", - "rand 0.8.5", - "structopt", - "tokio", - "tracing", - "vise", - "zksync_config", - "zksync_core_leftovers", - "zksync_dal", - "zksync_env_config", - "zksync_object_store", - "zksync_types", - "zksync_vlog", -] - -[[package]] -name = "snow" -version = "0.9.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "850948bee068e713b8ab860fe1adc4d109676ab4c3b621fd8147f06b261f2f85" -dependencies = [ - "aes-gcm", - "blake2 0.10.6", - "chacha20poly1305", - "curve25519-dalek 4.1.3", - "rand_core 0.6.4", - "rustc_version 0.4.0", - "sha2 0.10.8", - "subtle", -] - -[[package]] -name = "socket2" -version = "0.5.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b5fac59a5cb5dd637972e5fca70daf0523c9067fcdc4842f053dae04a18f8e9" -dependencies = [ - "libc", - "windows-sys 0.48.0", -] - -[[package]] -name = "soketto" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41d1c5305e39e09653383c2c7244f2f78b3bcae37cf50c64cb4789c9f5096ec2" -dependencies = [ - "base64 0.13.1", - "bytes", - "futures 0.3.30", - "httparse", - "log", - "rand 0.8.5", - "sha-1", -] - -[[package]] -name = "soketto" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37468c595637c10857701c990f93a40ce0e357cedb0953d1c26c8d8027f9bb53" -dependencies = [ - "base64 0.22.1", - "bytes", - "futures 0.3.30", - "http 1.1.0", - "httparse", - "log", - "rand 0.8.5", - "sha1", -] - -[[package]] -name = "sp-api" -version = "26.0.0" -source = "git+https://github.com/availproject/polkadot-sdk.git?tag=polkadot-1.7.1-patch-8#fdbd3a9cb323c191bc90bacf79112800c64c6d8a" -dependencies = [ - "hash-db", - "log", - "parity-scale-codec", - "scale-info", - "sp-api-proc-macro", - "sp-core", - "sp-externalities 0.25.0 (git+https://github.com/availproject/polkadot-sdk.git?tag=polkadot-1.7.1-patch-8)", - "sp-metadata-ir", - "sp-runtime", - "sp-state-machine", - "sp-std 14.0.0 (git+https://github.com/availproject/polkadot-sdk.git?tag=polkadot-1.7.1-patch-8)", - "sp-trie", - "sp-version", - "thiserror", -] - -[[package]] -name = "sp-api-proc-macro" -version = "15.0.0" -source = "git+https://github.com/availproject/polkadot-sdk.git?tag=polkadot-1.7.1-patch-8#fdbd3a9cb323c191bc90bacf79112800c64c6d8a" -dependencies = [ - "Inflector", - "blake2 0.10.6", - "expander", - "proc-macro-crate 3.1.0", - "proc-macro2 1.0.86", - "quote 1.0.37", - "syn 2.0.72", -] - -[[package]] -name = "sp-application-crypto" -version = "30.0.0" -source = "git+https://github.com/availproject/polkadot-sdk.git?tag=polkadot-1.7.1-patch-8#fdbd3a9cb323c191bc90bacf79112800c64c6d8a" -dependencies = [ - "parity-scale-codec", - "scale-info", - "serde", - "sp-core", - "sp-io", - "sp-std 14.0.0 (git+https://github.com/availproject/polkadot-sdk.git?tag=polkadot-1.7.1-patch-8)", -] - -[[package]] -name = "sp-arithmetic" -version = "23.0.0" -source = "git+https://github.com/availproject/polkadot-sdk.git?tag=polkadot-1.7.1-patch-8#fdbd3a9cb323c191bc90bacf79112800c64c6d8a" -dependencies = [ - "integer-sqrt", - "num-traits", - "parity-scale-codec", - "scale-info", - "serde", - "sp-std 14.0.0 (git+https://github.com/availproject/polkadot-sdk.git?tag=polkadot-1.7.1-patch-8)", - "static_assertions", -] - -[[package]] -name = "sp-ark-bls12-381" -version = "0.4.2" -source = "git+https://github.com/paritytech/arkworks-substrate#caa2eed74beb885dd07c7db5f916f2281dad818f" -dependencies = [ - "ark-bls12-381-ext", - "sp-crypto-ec-utils", -] - -[[package]] -name = "sp-ark-ed-on-bls12-381-bandersnatch" -version = "0.4.2" -source = "git+https://github.com/paritytech/arkworks-substrate#caa2eed74beb885dd07c7db5f916f2281dad818f" -dependencies = [ - "ark-ed-on-bls12-381-bandersnatch-ext", - "sp-crypto-ec-utils", -] - -[[package]] -name = "sp-core" -version = "28.0.0" -source = "git+https://github.com/availproject/polkadot-sdk.git?tag=polkadot-1.7.1-patch-8#fdbd3a9cb323c191bc90bacf79112800c64c6d8a" -dependencies = [ - "array-bytes", - "bandersnatch_vrfs", - "bip39", - "bitflags 1.3.2", - "blake2 0.10.6", - "bounded-collections", - "bs58", - "dyn-clonable", - "ed25519-zebra 3.1.0", - "futures 0.3.30", - "hash-db", - "hash256-std-hasher", - "impl-serde", - "itertools 0.10.5", - "libsecp256k1", - "log", - "merlin 3.0.0", - "parity-scale-codec", - "parking_lot", - "paste", - "primitive-types", - "rand 0.8.5", - "scale-info", - "schnorrkel 0.11.4", - "secp256k1 0.28.2", - "secrecy", - "serde", - "sp-crypto-hashing", - "sp-debug-derive 14.0.0 (git+https://github.com/availproject/polkadot-sdk.git?tag=polkadot-1.7.1-patch-8)", - "sp-externalities 0.25.0 (git+https://github.com/availproject/polkadot-sdk.git?tag=polkadot-1.7.1-patch-8)", - "sp-runtime-interface 24.0.0 (git+https://github.com/availproject/polkadot-sdk.git?tag=polkadot-1.7.1-patch-8)", - "sp-std 14.0.0 (git+https://github.com/availproject/polkadot-sdk.git?tag=polkadot-1.7.1-patch-8)", - "sp-storage 19.0.0 (git+https://github.com/availproject/polkadot-sdk.git?tag=polkadot-1.7.1-patch-8)", - "ss58-registry", - "substrate-bip39", - "thiserror", - "tracing", - "w3f-bls", - "zeroize", -] - -[[package]] -name = "sp-core-hashing" -version = "15.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e0f4990add7b2cefdeca883c0efa99bb4d912cb2196120e1500c0cc099553b0" -dependencies = [ - "blake2b_simd", - "byteorder", - "digest 0.10.7", - "sha2 0.10.8", - "sha3 0.10.8", - "twox-hash", -] - -[[package]] -name = "sp-crypto-ec-utils" -version = "0.10.0" -source = "git+https://github.com/paritytech/polkadot-sdk#ea5fb02e9ae819771c05e1792de30b1352175ea3" -dependencies = [ - "ark-bls12-377", - "ark-bls12-377-ext", - "ark-bls12-381", - "ark-bls12-381-ext", - "ark-bw6-761", - "ark-bw6-761-ext", - "ark-ec", - "ark-ed-on-bls12-377", - "ark-ed-on-bls12-377-ext", - "ark-ed-on-bls12-381-bandersnatch", - "ark-ed-on-bls12-381-bandersnatch-ext", - "ark-scale", - "sp-runtime-interface 24.0.0 (git+https://github.com/paritytech/polkadot-sdk)", -] - -[[package]] -name = "sp-crypto-hashing" -version = "0.0.0" -source = "git+https://github.com/availproject/polkadot-sdk.git?tag=polkadot-1.7.1-patch-8#fdbd3a9cb323c191bc90bacf79112800c64c6d8a" -dependencies = [ - "blake2b_simd", - "byteorder", - "digest 0.10.7", - "sha2 0.10.8", - "sha3 0.10.8", - "twox-hash", -] - -[[package]] -name = "sp-crypto-hashing-proc-macro" -version = "0.0.0" -source = "git+https://github.com/availproject/polkadot-sdk.git?tag=polkadot-1.7.1-patch-8#fdbd3a9cb323c191bc90bacf79112800c64c6d8a" -dependencies = [ - "quote 1.0.37", - "sp-crypto-hashing", - "syn 2.0.72", -] - -[[package]] -name = "sp-debug-derive" -version = "14.0.0" -source = "git+https://github.com/availproject/polkadot-sdk.git?tag=polkadot-1.7.1-patch-8#fdbd3a9cb323c191bc90bacf79112800c64c6d8a" -dependencies = [ - "proc-macro2 1.0.86", - "quote 1.0.37", - "syn 2.0.72", -] - -[[package]] -name = "sp-debug-derive" -version = "14.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk#ea5fb02e9ae819771c05e1792de30b1352175ea3" -dependencies = [ - "proc-macro2 1.0.86", - "quote 1.0.37", - "syn 2.0.72", -] - -[[package]] -name = "sp-externalities" -version = "0.25.0" -source = "git+https://github.com/availproject/polkadot-sdk.git?tag=polkadot-1.7.1-patch-8#fdbd3a9cb323c191bc90bacf79112800c64c6d8a" -dependencies = [ - "environmental", - "parity-scale-codec", - "sp-std 14.0.0 (git+https://github.com/availproject/polkadot-sdk.git?tag=polkadot-1.7.1-patch-8)", - "sp-storage 19.0.0 (git+https://github.com/availproject/polkadot-sdk.git?tag=polkadot-1.7.1-patch-8)", -] - -[[package]] -name = "sp-externalities" -version = "0.25.0" -source = "git+https://github.com/paritytech/polkadot-sdk#ea5fb02e9ae819771c05e1792de30b1352175ea3" -dependencies = [ - "environmental", - "parity-scale-codec", - "sp-storage 19.0.0 (git+https://github.com/paritytech/polkadot-sdk)", -] - -[[package]] -name = "sp-genesis-builder" -version = "0.7.0" -source = "git+https://github.com/availproject/polkadot-sdk.git?tag=polkadot-1.7.1-patch-8#fdbd3a9cb323c191bc90bacf79112800c64c6d8a" -dependencies = [ - "serde_json", - "sp-api", - "sp-runtime", - "sp-std 14.0.0 (git+https://github.com/availproject/polkadot-sdk.git?tag=polkadot-1.7.1-patch-8)", -] - -[[package]] -name = "sp-inherents" -version = "26.0.0" -source = "git+https://github.com/availproject/polkadot-sdk.git?tag=polkadot-1.7.1-patch-8#fdbd3a9cb323c191bc90bacf79112800c64c6d8a" -dependencies = [ - "async-trait", - "impl-trait-for-tuples", - "parity-scale-codec", - "scale-info", - "sp-runtime", - "sp-std 14.0.0 (git+https://github.com/availproject/polkadot-sdk.git?tag=polkadot-1.7.1-patch-8)", - "thiserror", -] - -[[package]] -name = "sp-io" -version = "30.0.0" -source = "git+https://github.com/availproject/polkadot-sdk.git?tag=polkadot-1.7.1-patch-8#fdbd3a9cb323c191bc90bacf79112800c64c6d8a" -dependencies = [ - "bytes", - "ed25519-dalek", - "libsecp256k1", - "log", - "parity-scale-codec", - "rustversion", - "secp256k1 0.28.2", - "sp-core", - "sp-crypto-hashing", - "sp-externalities 0.25.0 (git+https://github.com/availproject/polkadot-sdk.git?tag=polkadot-1.7.1-patch-8)", - "sp-keystore", - "sp-runtime-interface 24.0.0 (git+https://github.com/availproject/polkadot-sdk.git?tag=polkadot-1.7.1-patch-8)", - "sp-state-machine", - "sp-std 14.0.0 (git+https://github.com/availproject/polkadot-sdk.git?tag=polkadot-1.7.1-patch-8)", - "sp-tracing 16.0.0 (git+https://github.com/availproject/polkadot-sdk.git?tag=polkadot-1.7.1-patch-8)", - "sp-trie", - "tracing", - "tracing-core", -] - -[[package]] -name = "sp-keystore" -version = "0.34.0" -source = "git+https://github.com/availproject/polkadot-sdk.git?tag=polkadot-1.7.1-patch-8#fdbd3a9cb323c191bc90bacf79112800c64c6d8a" -dependencies = [ - "parity-scale-codec", - "parking_lot", - "sp-core", - "sp-externalities 0.25.0 (git+https://github.com/availproject/polkadot-sdk.git?tag=polkadot-1.7.1-patch-8)", - "thiserror", -] - -[[package]] -name = "sp-metadata-ir" -version = "0.6.0" -source = "git+https://github.com/availproject/polkadot-sdk.git?tag=polkadot-1.7.1-patch-8#fdbd3a9cb323c191bc90bacf79112800c64c6d8a" -dependencies = [ - "frame-metadata 16.0.0", - "parity-scale-codec", - "scale-info", - "sp-std 14.0.0 (git+https://github.com/availproject/polkadot-sdk.git?tag=polkadot-1.7.1-patch-8)", -] - -[[package]] -name = "sp-panic-handler" -version = "13.0.0" -source = "git+https://github.com/availproject/polkadot-sdk.git?tag=polkadot-1.7.1-patch-8#fdbd3a9cb323c191bc90bacf79112800c64c6d8a" -dependencies = [ - "backtrace", - "lazy_static", - "regex", -] - -[[package]] -name = "sp-runtime" -version = "31.0.1" -source = "git+https://github.com/availproject/polkadot-sdk.git?tag=polkadot-1.7.1-patch-8#fdbd3a9cb323c191bc90bacf79112800c64c6d8a" +name = "smoldot" +version = "0.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6d1eaa97d77be4d026a1e7ffad1bb3b78448763b357ea6f8188d3e6f736a9b9" dependencies = [ - "docify", + "arrayvec 0.7.4", + "async-lock", + "atomic-take", + "base64 0.21.5", + "bip39", + "blake2-rfc", + "bs58", + "chacha20", + "crossbeam-queue", + "derive_more 0.99.18", + "ed25519-zebra", "either", - "hash256-std-hasher", - "impl-trait-for-tuples", - "log", - "parity-scale-codec", - "paste", + "event-listener 4.0.3", + "fnv", + "futures-lite", + "futures-util", + "hashbrown 0.14.5", + "hex", + "hmac 0.12.1", + "itertools 0.12.0", + "libm", + "libsecp256k1", + "merlin", + "no-std-net", + "nom", + "num-bigint 0.4.6", + "num-rational", + "num-traits", + "pbkdf2", + "pin-project", + "poly1305", "rand 0.8.5", - "scale-info", - "serde", - "simple-mermaid", - "sp-application-crypto", - "sp-arithmetic", - "sp-core", - "sp-io", - "sp-std 14.0.0 (git+https://github.com/availproject/polkadot-sdk.git?tag=polkadot-1.7.1-patch-8)", - "sp-weights", -] - -[[package]] -name = "sp-runtime-interface" -version = "24.0.0" -source = "git+https://github.com/availproject/polkadot-sdk.git?tag=polkadot-1.7.1-patch-8#fdbd3a9cb323c191bc90bacf79112800c64c6d8a" -dependencies = [ - "bytes", - "impl-trait-for-tuples", - "parity-scale-codec", - "primitive-types", - "sp-externalities 0.25.0 (git+https://github.com/availproject/polkadot-sdk.git?tag=polkadot-1.7.1-patch-8)", - "sp-runtime-interface-proc-macro 17.0.0 (git+https://github.com/availproject/polkadot-sdk.git?tag=polkadot-1.7.1-patch-8)", - "sp-std 14.0.0 (git+https://github.com/availproject/polkadot-sdk.git?tag=polkadot-1.7.1-patch-8)", - "sp-storage 19.0.0 (git+https://github.com/availproject/polkadot-sdk.git?tag=polkadot-1.7.1-patch-8)", - "sp-tracing 16.0.0 (git+https://github.com/availproject/polkadot-sdk.git?tag=polkadot-1.7.1-patch-8)", - "sp-wasm-interface 20.0.0 (git+https://github.com/availproject/polkadot-sdk.git?tag=polkadot-1.7.1-patch-8)", - "static_assertions", -] - -[[package]] -name = "sp-runtime-interface" -version = "24.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk#ea5fb02e9ae819771c05e1792de30b1352175ea3" -dependencies = [ - "bytes", - "impl-trait-for-tuples", - "parity-scale-codec", - "polkavm-derive", - "primitive-types", - "sp-externalities 0.25.0 (git+https://github.com/paritytech/polkadot-sdk)", - "sp-runtime-interface-proc-macro 17.0.0 (git+https://github.com/paritytech/polkadot-sdk)", - "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk)", - "sp-storage 19.0.0 (git+https://github.com/paritytech/polkadot-sdk)", - "sp-tracing 16.0.0 (git+https://github.com/paritytech/polkadot-sdk)", - "sp-wasm-interface 20.0.0 (git+https://github.com/paritytech/polkadot-sdk)", - "static_assertions", -] - -[[package]] -name = "sp-runtime-interface-proc-macro" -version = "17.0.0" -source = "git+https://github.com/availproject/polkadot-sdk.git?tag=polkadot-1.7.1-patch-8#fdbd3a9cb323c191bc90bacf79112800c64c6d8a" -dependencies = [ - "Inflector", - "expander", - "proc-macro-crate 3.1.0", - "proc-macro2 1.0.86", - "quote 1.0.37", - "syn 2.0.72", -] - -[[package]] -name = "sp-runtime-interface-proc-macro" -version = "17.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk#ea5fb02e9ae819771c05e1792de30b1352175ea3" -dependencies = [ - "Inflector", - "expander", - "proc-macro-crate 3.1.0", - "proc-macro2 1.0.86", - "quote 1.0.37", - "syn 2.0.72", -] - -[[package]] -name = "sp-staking" -version = "26.0.0" -source = "git+https://github.com/availproject/polkadot-sdk.git?tag=polkadot-1.7.1-patch-8#fdbd3a9cb323c191bc90bacf79112800c64c6d8a" -dependencies = [ - "impl-trait-for-tuples", - "parity-scale-codec", - "scale-info", + "rand_chacha", + "ruzstd", + "schnorrkel", "serde", - "sp-core", - "sp-runtime", - "sp-std 14.0.0 (git+https://github.com/availproject/polkadot-sdk.git?tag=polkadot-1.7.1-patch-8)", + "serde_json", + "sha2 0.10.8", + "sha3 0.10.8", + "siphasher", + "slab", + "smallvec", + "soketto 0.7.1", + "twox-hash", + "wasmi", + "x25519-dalek", + "zeroize", ] [[package]] -name = "sp-state-machine" -version = "0.35.0" -source = "git+https://github.com/availproject/polkadot-sdk.git?tag=polkadot-1.7.1-patch-8#fdbd3a9cb323c191bc90bacf79112800c64c6d8a" +name = "smoldot-light" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5496f2d116b7019a526b1039ec2247dd172b8670633b1a64a614c9ea12c9d8c7" dependencies = [ - "hash-db", + "async-channel", + "async-lock", + "base64 0.21.5", + "blake2-rfc", + "derive_more 0.99.18", + "either", + "event-listener 4.0.3", + "fnv", + "futures-channel", + "futures-lite", + "futures-util", + "hashbrown 0.14.5", + "hex", + "itertools 0.12.0", "log", - "parity-scale-codec", + "lru", + "no-std-net", "parking_lot", + "pin-project", "rand 0.8.5", - "smallvec 1.13.1", - "sp-core", - "sp-externalities 0.25.0 (git+https://github.com/availproject/polkadot-sdk.git?tag=polkadot-1.7.1-patch-8)", - "sp-panic-handler", - "sp-std 14.0.0 (git+https://github.com/availproject/polkadot-sdk.git?tag=polkadot-1.7.1-patch-8)", - "sp-trie", - "thiserror", - "tracing", - "trie-db", -] - -[[package]] -name = "sp-std" -version = "14.0.0" -source = "git+https://github.com/availproject/polkadot-sdk.git?tag=polkadot-1.7.1-patch-8#fdbd3a9cb323c191bc90bacf79112800c64c6d8a" - -[[package]] -name = "sp-std" -version = "14.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk#ea5fb02e9ae819771c05e1792de30b1352175ea3" - -[[package]] -name = "sp-storage" -version = "19.0.0" -source = "git+https://github.com/availproject/polkadot-sdk.git?tag=polkadot-1.7.1-patch-8#fdbd3a9cb323c191bc90bacf79112800c64c6d8a" -dependencies = [ - "impl-serde", - "parity-scale-codec", - "ref-cast", - "serde", - "sp-debug-derive 14.0.0 (git+https://github.com/availproject/polkadot-sdk.git?tag=polkadot-1.7.1-patch-8)", - "sp-std 14.0.0 (git+https://github.com/availproject/polkadot-sdk.git?tag=polkadot-1.7.1-patch-8)", -] - -[[package]] -name = "sp-storage" -version = "19.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk#ea5fb02e9ae819771c05e1792de30b1352175ea3" -dependencies = [ - "impl-serde", - "parity-scale-codec", - "ref-cast", + "rand_chacha", "serde", - "sp-debug-derive 14.0.0 (git+https://github.com/paritytech/polkadot-sdk)", -] - -[[package]] -name = "sp-tracing" -version = "16.0.0" -source = "git+https://github.com/availproject/polkadot-sdk.git?tag=polkadot-1.7.1-patch-8#fdbd3a9cb323c191bc90bacf79112800c64c6d8a" -dependencies = [ - "parity-scale-codec", - "sp-std 14.0.0 (git+https://github.com/availproject/polkadot-sdk.git?tag=polkadot-1.7.1-patch-8)", - "tracing", - "tracing-core", - "tracing-subscriber 0.2.25", -] - -[[package]] -name = "sp-tracing" -version = "16.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk#ea5fb02e9ae819771c05e1792de30b1352175ea3" -dependencies = [ - "parity-scale-codec", - "tracing", - "tracing-core", - "tracing-subscriber 0.3.18", + "serde_json", + "siphasher", + "slab", + "smol", + "smoldot", + "zeroize", ] [[package]] -name = "sp-trie" -version = "29.0.0" -source = "git+https://github.com/availproject/polkadot-sdk.git?tag=polkadot-1.7.1-patch-8#fdbd3a9cb323c191bc90bacf79112800c64c6d8a" +name = "snapshots_creator" +version = "0.1.0" dependencies = [ - "ahash 0.8.7", - "hash-db", - "lazy_static", - "memory-db", - "nohash-hasher", - "parity-scale-codec", - "parking_lot", + "anyhow", + "futures 0.3.30", "rand 0.8.5", - "scale-info", - "schnellru", - "sp-core", - "sp-externalities 0.25.0 (git+https://github.com/availproject/polkadot-sdk.git?tag=polkadot-1.7.1-patch-8)", - "sp-std 14.0.0 (git+https://github.com/availproject/polkadot-sdk.git?tag=polkadot-1.7.1-patch-8)", - "thiserror", + "structopt", + "tokio", "tracing", - "trie-db", - "trie-root", + "vise", + "zksync_config", + "zksync_core_leftovers", + "zksync_dal", + "zksync_env_config", + "zksync_object_store", + "zksync_types", + "zksync_vlog", ] [[package]] -name = "sp-version" -version = "29.0.0" -source = "git+https://github.com/availproject/polkadot-sdk.git?tag=polkadot-1.7.1-patch-8#fdbd3a9cb323c191bc90bacf79112800c64c6d8a" +name = "snow" +version = "0.9.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "850948bee068e713b8ab860fe1adc4d109676ab4c3b621fd8147f06b261f2f85" dependencies = [ - "impl-serde", - "parity-scale-codec", - "parity-wasm", - "scale-info", - "serde", - "sp-crypto-hashing-proc-macro", - "sp-runtime", - "sp-std 14.0.0 (git+https://github.com/availproject/polkadot-sdk.git?tag=polkadot-1.7.1-patch-8)", - "sp-version-proc-macro", - "thiserror", + "aes-gcm", + "blake2 0.10.6", + "chacha20poly1305", + "curve25519-dalek", + "rand_core 0.6.4", + "rustc_version", + "sha2 0.10.8", + "subtle", ] [[package]] -name = "sp-version-proc-macro" -version = "13.0.0" -source = "git+https://github.com/availproject/polkadot-sdk.git?tag=polkadot-1.7.1-patch-8#fdbd3a9cb323c191bc90bacf79112800c64c6d8a" +name = "socket2" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b5fac59a5cb5dd637972e5fca70daf0523c9067fcdc4842f053dae04a18f8e9" dependencies = [ - "parity-scale-codec", - "proc-macro2 1.0.86", - "quote 1.0.37", - "syn 2.0.72", + "libc", + "windows-sys 0.48.0", ] [[package]] -name = "sp-wasm-interface" -version = "20.0.0" -source = "git+https://github.com/availproject/polkadot-sdk.git?tag=polkadot-1.7.1-patch-8#fdbd3a9cb323c191bc90bacf79112800c64c6d8a" +name = "soketto" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41d1c5305e39e09653383c2c7244f2f78b3bcae37cf50c64cb4789c9f5096ec2" dependencies = [ - "anyhow", - "impl-trait-for-tuples", + "base64 0.13.1", + "bytes", + "futures 0.3.30", + "httparse", "log", - "parity-scale-codec", - "sp-std 14.0.0 (git+https://github.com/availproject/polkadot-sdk.git?tag=polkadot-1.7.1-patch-8)", - "wasmtime", + "rand 0.8.5", + "sha-1", ] [[package]] -name = "sp-wasm-interface" -version = "20.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk#ea5fb02e9ae819771c05e1792de30b1352175ea3" +name = "soketto" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "37468c595637c10857701c990f93a40ce0e357cedb0953d1c26c8d8027f9bb53" dependencies = [ - "anyhow", - "impl-trait-for-tuples", + "base64 0.22.1", + "bytes", + "futures 0.3.30", + "http 1.1.0", + "httparse", "log", - "parity-scale-codec", + "rand 0.8.5", + "sha1", ] [[package]] -name = "sp-weights" -version = "27.0.0" -source = "git+https://github.com/availproject/polkadot-sdk.git?tag=polkadot-1.7.1-patch-8#fdbd3a9cb323c191bc90bacf79112800c64c6d8a" +name = "sp-core-hashing" +version = "15.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e0f4990add7b2cefdeca883c0efa99bb4d912cb2196120e1500c0cc099553b0" dependencies = [ - "bounded-collections", - "parity-scale-codec", - "scale-info", - "serde", - "smallvec 1.13.1", - "sp-arithmetic", - "sp-debug-derive 14.0.0 (git+https://github.com/availproject/polkadot-sdk.git?tag=polkadot-1.7.1-patch-8)", - "sp-std 14.0.0 (git+https://github.com/availproject/polkadot-sdk.git?tag=polkadot-1.7.1-patch-8)", + "blake2b_simd", + "byteorder", + "digest 0.10.7", + "sha2 0.10.8", + "sha3 0.10.8", + "twox-hash", ] [[package]] @@ -10274,7 +7002,7 @@ dependencies = [ "bytes", "chrono", "crc", - "crossbeam-queue 0.3.11", + "crossbeam-queue", "either", "event-listener 5.3.1", "futures-channel", @@ -10297,7 +7025,7 @@ dependencies = [ "serde", "serde_json", "sha2 0.10.8", - "smallvec 1.13.1", + "smallvec", "sqlformat", "thiserror", "tokio", @@ -10313,7 +7041,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2f998a9defdbd48ed005a89362bd40dd2117502f15294f61c8d47034107dbbdc" dependencies = [ "proc-macro2 1.0.86", - "quote 1.0.37", + "quote 1.0.36", "sqlx-core", "sqlx-macros-core", "syn 2.0.72", @@ -10331,7 +7059,7 @@ dependencies = [ "hex", "once_cell", "proc-macro2 1.0.86", - "quote 1.0.37", + "quote 1.0.36", "serde", "serde_json", "sha2 0.10.8", @@ -10366,7 +7094,7 @@ dependencies = [ "futures-core", "futures-io", "futures-util", - "generic-array 0.14.7", + "generic-array", "hex", "hkdf", "hmac 0.12.1", @@ -10382,7 +7110,7 @@ dependencies = [ "serde", "sha1", "sha2 0.10.8", - "smallvec 1.13.1", + "smallvec", "sqlx-core", "stringprep", "thiserror", @@ -10425,7 +7153,7 @@ dependencies = [ "serde", "serde_json", "sha2 0.10.8", - "smallvec 1.13.1", + "smallvec", "sqlx-core", "stringprep", "thiserror", @@ -10457,21 +7185,6 @@ dependencies = [ "url", ] -[[package]] -name = "ss58-registry" -version = "1.50.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43fce22ed1df64d04b262351c8f9d5c6da4f76f79f25ad15529792f893fad25d" -dependencies = [ - "Inflector", - "num-format", - "proc-macro2 1.0.86", - "quote 1.0.37", - "serde", - "serde_json", - "unicode-xid 0.2.4", -] - [[package]] name = "stable_deref_trait" version = "1.2.0" @@ -10533,7 +7246,7 @@ dependencies = [ "heck 0.3.3", "proc-macro-error", "proc-macro2 1.0.86", - "quote 1.0.37", + "quote 1.0.36", "syn 1.0.109", ] @@ -10554,36 +7267,11 @@ checksum = "4c6bee85a5a24955dc440386795aa378cd9cf82acd5f764469152d2270e581be" dependencies = [ "heck 0.5.0", "proc-macro2 1.0.86", - "quote 1.0.37", + "quote 1.0.36", "rustversion", "syn 2.0.72", ] -[[package]] -name = "substrate-bip39" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a7590dc041b9bc2825e52ce5af8416c73dbe9d0654402bfd4b4941938b94d8f" -dependencies = [ - "hmac 0.11.0", - "pbkdf2 0.8.0", - "schnorrkel 0.11.4", - "sha2 0.9.9", - "zeroize", -] - -[[package]] -name = "substrate-prometheus-endpoint" -version = "0.17.0" -source = "git+https://github.com/availproject/polkadot-sdk.git?tag=polkadot-1.7.1-patch-8#fdbd3a9cb323c191bc90bacf79112800c64c6d8a" -dependencies = [ - "hyper 0.14.29", - "log", - "prometheus", - "thiserror", - "tokio", -] - [[package]] name = "subtle" version = "2.5.0" @@ -10638,7 +7326,7 @@ dependencies = [ "jsonrpsee 0.21.0", "parity-scale-codec", "proc-macro2 1.0.86", - "quote 1.0.37", + "quote 1.0.36", "scale-info", "scale-typegen", "subxt-metadata", @@ -10673,7 +7361,7 @@ dependencies = [ "darling 0.20.10", "parity-scale-codec", "proc-macro-error", - "quote 1.0.37", + "quote 1.0.36", "scale-typegen", "subxt-codegen", "syn 2.0.72", @@ -10702,10 +7390,9 @@ dependencies = [ "hex", "hmac 0.12.1", "parity-scale-codec", - "pbkdf2 0.12.2", + "pbkdf2", "regex", - "schnorrkel 0.11.4", - "secp256k1 0.28.2", + "schnorrkel", "secrecy", "sha2 0.10.8", "sp-core-hashing", @@ -10732,7 +7419,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" dependencies = [ "proc-macro2 1.0.86", - "quote 1.0.37", + "quote 1.0.36", "unicode-ident", ] @@ -10743,22 +7430,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dc4b9b9bf2add8093d3f2c0204471e951b2285580335de42f9d2534f3ae7a8af" dependencies = [ "proc-macro2 1.0.86", - "quote 1.0.37", + "quote 1.0.36", "unicode-ident", ] -[[package]] -name = "syn-solidity" -version = "0.7.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c837dc8852cb7074e46b444afb81783140dab12c58867b49fb3898fbafedf7ea" -dependencies = [ - "paste", - "proc-macro2 1.0.86", - "quote 1.0.37", - "syn 2.0.72", -] - [[package]] name = "syn_derive" version = "0.1.8" @@ -10767,7 +7442,7 @@ checksum = "1329189c02ff984e9736652b1631330da25eaa6bc639089ed4915d25446cbe7b" dependencies = [ "proc-macro-error", "proc-macro2 1.0.86", - "quote 1.0.37", + "quote 1.0.36", "syn 2.0.72", ] @@ -10830,21 +7505,15 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" -[[package]] -name = "target-lexicon" -version = "0.12.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61c41af27dd6d1e27b1b16b489db798443478cef1f06a660c96db617ba5de3b1" - [[package]] name = "tempfile" version = "3.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "85b77fafb263dd9d05cbeac119526425676db3784113aa9295c88498cbf8bff1" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "fastrand", - "rustix 0.38.34", + "rustix", "windows-sys 0.52.0", ] @@ -10873,7 +7542,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2cfbe7811249c4c914b06141b8ac0f2cee2733fb883d05eb19668a45fc60c3d5" dependencies = [ "proc-macro2 1.0.86", - "quote 1.0.37", + "quote 1.0.36", "syn 2.0.72", ] @@ -10894,7 +7563,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c8f546451eaa38373f549093fe9fd05e7d2bade739e2ddf834b9968621d60107" dependencies = [ "proc-macro2 1.0.86", - "quote 1.0.37", + "quote 1.0.36", "syn 2.0.72", ] @@ -10929,37 +7598,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a4558b58466b9ad7ca0f102865eccc95938dca1a74a856f2b57b6629050da261" dependencies = [ "proc-macro2 1.0.86", - "quote 1.0.37", + "quote 1.0.36", "syn 2.0.72", ] -[[package]] -name = "thiserror-impl-no-std" -version = "2.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58e6318948b519ba6dc2b442a6d0b904ebfb8d411a3ad3e07843615a72249758" -dependencies = [ - "proc-macro2 1.0.86", - "quote 1.0.37", - "syn 1.0.109", -] - -[[package]] -name = "thiserror-no-std" -version = "2.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3ad459d94dd517257cc96add8a43190ee620011bb6e6cdc82dafd97dfafafea" -dependencies = [ - "thiserror-impl-no-std", -] - [[package]] name = "thread_local" version = "1.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3fdd6f064ccff2d6567adcb3873ca630700f00b5ad3f060c25b5dcfd9a4ce152" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "once_cell", ] @@ -11104,7 +7753,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752" dependencies = [ "proc-macro2 1.0.86", - "quote 1.0.37", + "quote 1.0.36", "syn 2.0.72", ] @@ -11162,22 +7811,6 @@ dependencies = [ "tokio-util", ] -[[package]] -name = "tokio-tungstenite" -version = "0.23.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6989540ced10490aaf14e6bad2e3d33728a2813310a0c71d1574304c49631cd" -dependencies = [ - "futures-util", - "log", - "rustls 0.23.10", - "rustls-pki-types", - "tokio", - "tokio-rustls 0.26.0", - "tungstenite", - "webpki-roots", -] - [[package]] name = "tokio-util" version = "0.7.12" @@ -11192,26 +7825,11 @@ dependencies = [ "tokio", ] -[[package]] -name = "toml" -version = "0.8.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac2caab0bf757388c6c0ae23b3293fdb463fee59434529014f85e3263b995c28" -dependencies = [ - "serde", - "serde_spanned", - "toml_datetime", - "toml_edit 0.22.16", -] - [[package]] name = "toml_datetime" version = "0.6.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4badfd56924ae69bcc9039335b2e017639ce3f9b001c393c1b2d1ef846ce2cbf" -dependencies = [ - "serde", -] [[package]] name = "toml_edit" @@ -11221,7 +7839,7 @@ checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" dependencies = [ "indexmap 2.1.0", "toml_datetime", - "winnow 0.5.17", + "winnow", ] [[package]] @@ -11232,7 +7850,7 @@ checksum = "396e4d48bbb2b7554c944bde63101b5ae446cff6ec4a24227428f15eb72ef338" dependencies = [ "indexmap 2.1.0", "toml_datetime", - "winnow 0.5.17", + "winnow", ] [[package]] @@ -11243,20 +7861,7 @@ checksum = "6a8534fd7f78b5405e860340ad6575217ce99f38d4d5c8f2442cb5ecb50090e1" dependencies = [ "indexmap 2.1.0", "toml_datetime", - "winnow 0.5.17", -] - -[[package]] -name = "toml_edit" -version = "0.22.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "278f3d518e152219c994ce877758516bca5e118eaed6996192a774fb9fbf0788" -dependencies = [ - "indexmap 2.1.0", - "serde", - "serde_spanned", - "toml_datetime", - "winnow 0.6.18", + "winnow", ] [[package]] @@ -11280,11 +7885,8 @@ dependencies = [ "percent-encoding", "pin-project", "prost 0.13.1", - "rustls-native-certs 0.7.0", - "rustls-pemfile 2.0.0", "socket2", "tokio", - "tokio-rustls 0.26.0", "tokio-stream", "tower", "tower-layer", @@ -11292,39 +7894,6 @@ dependencies = [ "tracing", ] -[[package]] -name = "tonic-build" -version = "0.12.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe4ee8877250136bd7e3d2331632810a4df4ea5e004656990d8d66d2f5ee8a67" -dependencies = [ - "prettyplease", - "proc-macro2 1.0.86", - "prost-build 0.13.1", - "quote 1.0.37", - "syn 2.0.72", -] - -[[package]] -name = "tonic-web" -version = "0.12.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b904b18f914fe88913a9f0d750065b39c9c497e4b2aa05148f2c29a724145541" -dependencies = [ - "base64 0.22.1", - "bytes", - "http 1.1.0", - "http-body 1.0.0", - "http-body-util", - "pin-project", - "tokio-stream", - "tonic", - "tower-http", - "tower-layer", - "tower-service", - "tracing", -] - [[package]] name = "tower" version = "0.4.13" @@ -11393,7 +7962,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2 1.0.86", - "quote 1.0.37", + "quote 1.0.36", "syn 2.0.72", ] @@ -11439,11 +8008,11 @@ dependencies = [ "once_cell", "opentelemetry", "opentelemetry_sdk", - "smallvec 1.13.1", + "smallvec", "tracing", "tracing-core", "tracing-log 0.2.0", - "tracing-subscriber 0.3.18", + "tracing-subscriber", "web-time", ] @@ -11459,70 +8028,26 @@ dependencies = [ [[package]] name = "tracing-subscriber" -version = "0.2.25" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e0d2eaa99c3c2e41547cfa109e910a68ea03823cccad4a0525dcbc9b01e8c71" -dependencies = [ - "ansi_term", - "chrono", - "lazy_static", - "matchers 0.0.1", - "regex", - "serde", - "serde_json", - "sharded-slab", - "smallvec 1.13.1", - "thread_local", - "tracing", - "tracing-core", - "tracing-log 0.1.4", - "tracing-serde", -] - -[[package]] -name = "tracing-subscriber" -version = "0.3.18" +version = "0.3.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad0f048c97dbd9faa9b7df56362b8ebcaa52adb06b498c050d2f4e32f90a7a8b" +checksum = "30a651bc37f915e81f087d86e62a18eec5f79550c7faff886f7090b4ea757c77" dependencies = [ - "matchers 0.1.0", + "matchers", "nu-ansi-term", "once_cell", "regex", "serde", "serde_json", "sharded-slab", - "smallvec 1.13.1", + "smallvec", "thread_local", "time", "tracing", "tracing-core", - "tracing-log 0.2.0", + "tracing-log 0.1.4", "tracing-serde", ] -[[package]] -name = "trie-db" -version = "0.28.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff28e0f815c2fea41ebddf148e008b077d2faddb026c9555b29696114d602642" -dependencies = [ - "hash-db", - "hashbrown 0.13.2", - "log", - "rustc-hex", - "smallvec 1.13.1", -] - -[[package]] -name = "trie-root" -version = "0.18.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4ed310ef5ab98f5fa467900ed906cb9232dd5376597e00fd4cba2a449d06c0b" -dependencies = [ - "hash-db", -] - [[package]] name = "triomphe" version = "0.1.9" @@ -11550,44 +8075,23 @@ dependencies = [ "termcolor", ] -[[package]] -name = "tt-call" -version = "1.0.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4f195fd851901624eee5a58c4bb2b4f06399148fcd0ed336e6f1cb60a9881df" - -[[package]] -name = "tungstenite" -version = "0.23.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e2e2ce1e47ed2994fd43b04c8f618008d4cabdd5ee34027cf14f9d918edd9c8" -dependencies = [ - "byteorder", - "bytes", - "data-encoding", - "http 1.1.0", - "httparse", - "log", - "rand 0.8.5", - "rustls 0.23.10", - "rustls-pki-types", - "sha1", - "thiserror", - "utf-8", -] - [[package]] name = "twox-hash" version = "1.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "97fee6b57c6a41524a810daee9286c02d7752c4253064d0b05472833a438f675" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "digest 0.10.7", - "rand 0.8.5", "static_assertions", ] +[[package]] +name = "typemap_rev" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74b08b0c1257381af16a5c3605254d529d3e7e109f3c62befc5d168968192998" + [[package]] name = "typenum" version = "1.17.0" @@ -11621,12 +8125,6 @@ dependencies = [ "libc", ] -[[package]] -name = "unarray" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eaea85b334db583fe3274d12b4cd1880032beab409c0d774be044d4480ab9a94" - [[package]] name = "unicase" version = "2.7.0" @@ -11703,7 +8201,7 @@ version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5ad948c1cb799b1a70f836077721a92a35ac177d4daddf4c20a633786d4cf618" dependencies = [ - "quote 1.0.37", + "quote 1.0.36", "syn 1.0.109", ] @@ -11750,12 +8248,6 @@ version = "2.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "daf8dba3b7eb870caf1ddeed7bc9d2a049f3cfdfae7cb521b087cc33ae4c49da" -[[package]] -name = "utf-8" -version = "0.7.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9" - [[package]] name = "utf8parse" version = "0.2.1" @@ -11842,7 +8334,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6a511871dc5de990a3b2a0e715facfbc5da848c0c0395597a1415029fb7c250a" dependencies = [ "proc-macro2 1.0.86", - "quote 1.0.37", + "quote 1.0.36", "syn 2.0.72", ] @@ -11865,48 +8357,15 @@ dependencies = [ ] [[package]] -name = "vm2" -version = "0.1.0" -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", -] - -[[package]] -name = "w3f-bls" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c5da5fa2c6afa2c9158eaa7cd9aee249765eb32b5fb0c63ad8b9e79336a47ec" -dependencies = [ - "ark-bls12-377", - "ark-bls12-381", - "ark-ec", - "ark-ff 0.4.2", - "ark-serialize 0.4.2", - "ark-serialize-derive", - "arrayref", - "constcat", - "digest 0.10.7", - "rand 0.8.5", - "rand_chacha 0.3.1", - "rand_core 0.6.4", - "sha2 0.10.8", - "sha3 0.10.8", - "thiserror", - "zeroize", -] - -[[package]] -name = "wait-timeout" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f200f5b12eb75f8c1ed65abd4b2db8a6e1b138a20de009dacee265a2498f3f6" +name = "vm2" +version = "0.1.0" +source = "git+https://github.com/matter-labs/vm2.git?rev=4ef15d46410ffc11744771a3a6c7c09dd9470c90#4ef15d46410ffc11744771a3a6c7c09dd9470c90" dependencies = [ - "libc", + "enum_dispatch", + "eravm-stable-interface", + "primitive-types", + "zk_evm_abstractions 0.150.5", + "zkevm_opcode_defs 0.150.5", ] [[package]] @@ -11928,12 +8387,6 @@ dependencies = [ "try-lock", ] -[[package]] -name = "wasi" -version = "0.9.0+wasi-snapshot-preview1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" - [[package]] name = "wasi" version = "0.10.2+wasi-snapshot-preview1" @@ -11958,7 +8411,7 @@ version = "0.2.87" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7706a72ab36d8cb1f80ffbf0e071533974a60d0a308d01a5d0375bf60499a342" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "wasm-bindgen-macro", ] @@ -11972,7 +8425,7 @@ dependencies = [ "log", "once_cell", "proc-macro2 1.0.86", - "quote 1.0.37", + "quote 1.0.36", "syn 2.0.72", "wasm-bindgen-shared", ] @@ -11983,7 +8436,7 @@ version = "0.4.37" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c02dbc21516f9f1f04f187958890d7e6026df8d16540b7ad9492bc34a67cea03" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "js-sys", "wasm-bindgen", "web-sys", @@ -11995,7 +8448,7 @@ version = "0.2.87" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dee495e55982a3bd48105a7b947fd2a9b4a8ae3010041b9e0faab3f9cd028f1d" dependencies = [ - "quote 1.0.37", + "quote 1.0.36", "wasm-bindgen-macro-support", ] @@ -12006,7 +8459,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" dependencies = [ "proc-macro2 1.0.86", - "quote 1.0.37", + "quote 1.0.36", "syn 2.0.72", "wasm-bindgen-backend", "wasm-bindgen-shared", @@ -12037,7 +8490,7 @@ version = "0.31.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "77a8281d1d660cdf54c76a3efa9ddd0c270cada1383a995db3ccb43d166456c7" dependencies = [ - "smallvec 1.13.1", + "smallvec", "spin", "wasmi_arena", "wasmi_core", @@ -12062,16 +8515,6 @@ dependencies = [ "paste", ] -[[package]] -name = "wasmparser" -version = "0.102.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48134de3d7598219ab9eaf6b91b15d8e50d31da76b8519fe4ecfcec2cf35104b" -dependencies = [ - "indexmap 1.9.3", - "url", -] - [[package]] name = "wasmparser-nostd" version = "0.100.2" @@ -12081,138 +8524,6 @@ dependencies = [ "indexmap-nostd", ] -[[package]] -name = "wasmtime" -version = "8.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f907fdead3153cb9bfb7a93bbd5b62629472dc06dee83605358c64c52ed3dda9" -dependencies = [ - "anyhow", - "bincode", - "cfg-if 1.0.0", - "indexmap 1.9.3", - "libc", - "log", - "object 0.30.4", - "once_cell", - "paste", - "psm", - "serde", - "target-lexicon", - "wasmparser", - "wasmtime-environ", - "wasmtime-jit", - "wasmtime-runtime", - "windows-sys 0.45.0", -] - -[[package]] -name = "wasmtime-asm-macros" -version = "8.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3b9daa7c14cd4fa3edbf69de994408d5f4b7b0959ac13fa69d465f6597f810d" -dependencies = [ - "cfg-if 1.0.0", -] - -[[package]] -name = "wasmtime-environ" -version = "8.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a990198cee4197423045235bf89d3359e69bd2ea031005f4c2d901125955c949" -dependencies = [ - "anyhow", - "cranelift-entity", - "gimli 0.27.3", - "indexmap 1.9.3", - "log", - "object 0.30.4", - "serde", - "target-lexicon", - "thiserror", - "wasmparser", - "wasmtime-types", -] - -[[package]] -name = "wasmtime-jit" -version = "8.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0de48df552cfca1c9b750002d3e07b45772dd033b0b206d5c0968496abf31244" -dependencies = [ - "addr2line 0.19.0", - "anyhow", - "bincode", - "cfg-if 1.0.0", - "cpp_demangle", - "gimli 0.27.3", - "log", - "object 0.30.4", - "rustc-demangle", - "serde", - "target-lexicon", - "wasmtime-environ", - "wasmtime-jit-icache-coherence", - "wasmtime-runtime", - "windows-sys 0.45.0", -] - -[[package]] -name = "wasmtime-jit-debug" -version = "8.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e0554b84c15a27d76281d06838aed94e13a77d7bf604bbbaf548aa20eb93846" -dependencies = [ - "once_cell", -] - -[[package]] -name = "wasmtime-jit-icache-coherence" -version = "8.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aecae978b13f7f67efb23bd827373ace4578f2137ec110bbf6a4a7cde4121bbd" -dependencies = [ - "cfg-if 1.0.0", - "libc", - "windows-sys 0.45.0", -] - -[[package]] -name = "wasmtime-runtime" -version = "8.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "658cf6f325232b6760e202e5255d823da5e348fdea827eff0a2a22319000b441" -dependencies = [ - "anyhow", - "cc", - "cfg-if 1.0.0", - "indexmap 1.9.3", - "libc", - "log", - "mach", - "memfd", - "memoffset 0.8.0", - "paste", - "rand 0.8.5", - "rustix 0.36.17", - "wasmtime-asm-macros", - "wasmtime-environ", - "wasmtime-jit-debug", - "windows-sys 0.45.0", -] - -[[package]] -name = "wasmtime-types" -version = "8.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4f6fffd2a1011887d57f07654dd112791e872e3ff4a2e626aee8059ee17f06f" -dependencies = [ - "cranelift-entity", - "serde", - "thiserror", - "wasmparser", -] - [[package]] name = "web-sys" version = "0.3.64" @@ -12251,7 +8562,7 @@ dependencies = [ "either", "home", "once_cell", - "rustix 0.38.34", + "rustix", ] [[package]] @@ -12264,12 +8575,6 @@ dependencies = [ "wasite", ] -[[package]] -name = "widestring" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7219d36b6eac893fa81e84ebe06485e7dcbb616177469b142df14f1f4deb1311" - [[package]] name = "winapi" version = "0.3.9" @@ -12533,22 +8838,13 @@ dependencies = [ "memchr", ] -[[package]] -name = "winnow" -version = "0.6.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68a9bda4691f099d435ad181000724da8e5899daa10713c2d432552b9ccd3a6f" -dependencies = [ - "memchr", -] - [[package]] name = "winreg" version = "0.50.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "524e57b2c537c0f9b1e69f1965311ec12182b4122e45035b1508cd24d2adadb1" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "windows-sys 0.48.0", ] @@ -12558,29 +8854,10 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a277a57398d4bfa075df44f501a17cfdf8542d224f0d36095a2adc7aee4ef0a5" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "windows-sys 0.48.0", ] -[[package]] -name = "ws_stream_wasm" -version = "0.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7999f5f4217fe3818726b66257a4475f71e74ffd190776ad053fa159e50737f5" -dependencies = [ - "async_io_stream", - "futures 0.3.30", - "js-sys", - "log", - "pharos", - "rustc_version 0.4.0", - "send_wrapper 0.6.0", - "thiserror", - "wasm-bindgen", - "wasm-bindgen-futures", - "web-sys", -] - [[package]] name = "wyz" version = "0.5.1" @@ -12596,7 +8873,7 @@ version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c7e468321c81fb07fa7f4c636c3972b9100f0346e5b6a9f2bd0603a52f7ed277" dependencies = [ - "curve25519-dalek 4.1.3", + "curve25519-dalek", "rand_core 0.6.4", "serde", "zeroize", @@ -12623,15 +8900,6 @@ version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ff4524214bc4629eba08d78ceb1d6507070cc0bcbbed23af74e19e6e924a24cf" -[[package]] -name = "yasna" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e17bb3549cc1321ae1296b9cdc2698e2b6cb1992adfa19a8c72e5b7a738f44cd" -dependencies = [ - "time", -] - [[package]] name = "zerocopy" version = "0.7.31" @@ -12648,7 +8916,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b3c129550b3e6de3fd0ba67ba5c81818f9805e58b8d7fee80a3a59d2c9fc601a" dependencies = [ "proc-macro2 1.0.86", - "quote 1.0.37", + "quote 1.0.36", "syn 2.0.72", ] @@ -12668,7 +8936,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2 1.0.86", - "quote 1.0.37", + "quote 1.0.36", "syn 2.0.72", ] @@ -12740,9 +9008,9 @@ dependencies = [ [[package]] name = "zk_evm" -version = "0.150.4" +version = "0.150.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2dbb0ed38d61fbd04bd7575755924d1303e129c04c909abba7f5bfcc6260bcf" +checksum = "5a6e69931f24db5cf333b714721e8d80ff88bfdb7da8c3dc7882612ffddb8d27" dependencies = [ "anyhow", "lazy_static", @@ -12750,7 +9018,7 @@ dependencies = [ "serde", "serde_json", "static_assertions", - "zk_evm_abstractions 0.150.4", + "zk_evm_abstractions 0.150.5", ] [[package]] @@ -12781,15 +9049,15 @@ dependencies = [ [[package]] name = "zk_evm_abstractions" -version = "0.150.4" +version = "0.150.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31460aacfe65b39ac484a2a2e0bbb02baf141f65264bf48e1e4f59ab375fe933" +checksum = "93d6b0720261ab55490fe3a96e96de30d5d7b277940b52ea7f52dbf564eb1748" dependencies = [ "anyhow", "num_enum 0.6.1", "serde", "static_assertions", - "zkevm_opcode_defs 0.150.4", + "zkevm_opcode_defs 0.150.5", ] [[package]] @@ -12810,7 +9078,7 @@ dependencies = [ "seq-macro", "serde", "serde_json", - "smallvec 1.13.1", + "smallvec", "zkevm_opcode_defs 0.132.0", ] @@ -12832,19 +9100,18 @@ dependencies = [ "seq-macro", "serde", "serde_json", - "smallvec 1.13.1", + "smallvec", "zkevm_opcode_defs 0.141.0", ] [[package]] name = "zkevm_circuits" -version = "0.150.4" +version = "0.150.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "abdfaa95dfe0878fda219dd17a6cc8c28711e2067785910c0e06d3ffdca78629" +checksum = "784fa7cfb51e17c5ced112bca43da30b3468b2347b7af0427ad9638759fb140e" dependencies = [ "arrayvec 0.7.4", "boojum", - "cs_derive", "derivative", "hex", "itertools 0.10.5", @@ -12852,8 +9119,9 @@ dependencies = [ "rand 0.8.5", "seq-macro", "serde", - "smallvec 1.13.1", - "zkevm_opcode_defs 0.150.4", + "smallvec", + "zkevm_opcode_defs 0.150.5", + "zksync_cs_derive", ] [[package]] @@ -12900,9 +9168,9 @@ dependencies = [ [[package]] name = "zkevm_opcode_defs" -version = "0.150.4" +version = "0.150.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb7c5c7b4481a646f8696b08cee64a8dec097509a6378d18242f81022f327f1e" +checksum = "79055eae1b6c1ab80793ed9d77d2964c9c896afa4b5dfed278cf58cd10acfe8f" dependencies = [ "bitflags 2.6.0", "blake2 0.10.6", @@ -12957,6 +9225,29 @@ dependencies = [ "url", ] +[[package]] +name = "zksync_bellman" +version = "0.30.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ffa03efe9bdb137a4b36b97d1a74237e18c9ae42b755163d903a9d48c1a5d80" +dependencies = [ + "arrayvec 0.7.4", + "bit-vec", + "blake2s_simd", + "byteorder", + "cfg-if", + "crossbeam", + "futures 0.3.30", + "hex", + "lazy_static", + "num_cpus", + "rand 0.4.6", + "serde", + "smallvec", + "tiny-keccak 1.5.0", + "zksync_pairing", +] + [[package]] name = "zksync_block_reverter" version = "0.1.0" @@ -12986,7 +9277,6 @@ name = "zksync_circuit_breaker" version = "0.1.0" dependencies = [ "anyhow", - "assert_matches", "async-trait", "thiserror", "tokio", @@ -13001,9 +9291,9 @@ name = "zksync_commitment_generator" version = "0.1.0" dependencies = [ "anyhow", - "circuit_sequencer_api 0.140.0", - "circuit_sequencer_api 0.141.1", - "circuit_sequencer_api 0.150.4", + "circuit_sequencer_api 0.140.3", + "circuit_sequencer_api 0.141.2", + "circuit_sequencer_api 0.150.5", "futures 0.3.30", "itertools 0.10.5", "num_cpus", @@ -13015,7 +9305,7 @@ dependencies = [ "vise", "zk_evm 0.133.0", "zk_evm 0.141.0", - "zk_evm 0.150.4", + "zk_evm 0.150.5", "zksync_contracts", "zksync_dal", "zksync_eth_client", @@ -13031,9 +9321,9 @@ dependencies = [ [[package]] name = "zksync_concurrency" -version = "0.1.0-rc.11" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0e31a9fc9a390b440cd12bbe040330dc64f64697a8a8ecbc3beb98cd0747909" +checksum = "c1c8cf6c689ab5922b52d81b775cd2d9cffbfc8fb8da65985e11b06546dfb3bf" dependencies = [ "anyhow", "once_cell", @@ -13044,7 +9334,7 @@ dependencies = [ "time", "tokio", "tracing", - "tracing-subscriber 0.3.18", + "tracing-subscriber", "vise", ] @@ -13068,9 +9358,9 @@ dependencies = [ [[package]] name = "zksync_consensus_bft" -version = "0.1.0-rc.11" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e22e3bfe96fa30a57313e774a5e8c74ffee884abff57ecacc10e8832315ee8a2" +checksum = "45c409ae915056cf9cadd9304dbc8718fa38edfcb346d06e5b3582dcd2489ef9" dependencies = [ "anyhow", "async-trait", @@ -13090,9 +9380,9 @@ dependencies = [ [[package]] name = "zksync_consensus_crypto" -version = "0.1.0-rc.11" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "efb7ff3ec44b7b92fd4e28d9d92b83d61dc74125ccfc90bcfb27a5750d8a8580" +checksum = "cc7baced4e811015038322dad10239f2d631d9e339e8d6b7b6e6b146bee30f41" dependencies = [ "anyhow", "blst", @@ -13103,7 +9393,6 @@ dependencies = [ "k256 0.13.3", "num-bigint 0.4.6", "num-traits", - "pairing_ce", "rand 0.4.6", "rand 0.8.5", "sha3 0.10.8", @@ -13114,13 +9403,14 @@ dependencies = [ [[package]] name = "zksync_consensus_executor" -version = "0.1.0-rc.11" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7fcde1275970a6b8a33ea2ade5cc994d6392f95509ce374e0e7a26cde4cd6db" +checksum = "6b018b8a76fc2cbecb51683ce97532501c45d44cbc8bb856d1956e5998259335" dependencies = [ "anyhow", "async-trait", "rand 0.8.5", + "semver", "tracing", "vise", "zksync_concurrency", @@ -13135,9 +9425,9 @@ dependencies = [ [[package]] name = "zksync_consensus_network" -version = "0.1.0-rc.11" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6ee48bee7dae8adb2769c7315adde1780832d05ecb6a77c08cdda53a315992a" +checksum = "f5bb2988e41af3083cebfc11f47f2615adae8d829bf9237aa084dede9629a687" dependencies = [ "anyhow", "async-trait", @@ -13152,6 +9442,7 @@ dependencies = [ "pin-project", "prost 0.12.1", "rand 0.8.5", + "semver", "snow", "thiserror", "tls-listener", @@ -13170,9 +9461,9 @@ dependencies = [ [[package]] name = "zksync_consensus_roles" -version = "0.1.0-rc.11" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72223c0b20621775db51bcc4b043addafeaf784d444af2ad4bc8bcdee477367c" +checksum = "0aab4ddf62f6001903c5fe9f65afb1bdc42464928c9d1c6ce52e4d7e9944f5dc" dependencies = [ "anyhow", "bit-vec", @@ -13192,9 +9483,9 @@ dependencies = [ [[package]] name = "zksync_consensus_storage" -version = "0.1.0-rc.11" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41d1750ad93f7e3a0c2f5880f9bcc1244a3b46d3e6c124c4f65f545032b87464" +checksum = "7b9dbcb923fa201af03f49f70c11a923b416915d2ddf8b2de3a2e861f22898a4" dependencies = [ "anyhow", "async-trait", @@ -13212,9 +9503,9 @@ dependencies = [ [[package]] name = "zksync_consensus_utils" -version = "0.1.0-rc.11" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2ff679f8b5f671d887a750b8107f3b5c01fd6085f68eef37ab01de8d2bd0736b" +checksum = "29e69dffc0fbc7c096548c997f5ca157a490b34b3d49fd524fa3d51840f7fb22" dependencies = [ "anyhow", "rand 0.8.5", @@ -13239,7 +9530,6 @@ dependencies = [ "zksync_contracts", "zksync_dal", "zksync_eth_client", - "zksync_eth_sender", "zksync_health_check", "zksync_l1_contract_interface", "zksync_node_genesis", @@ -13295,7 +9585,7 @@ dependencies = [ "hex", "lazy_static", "regex", - "semver 1.0.20", + "semver", "serde", "serde_json", "tempfile", @@ -13306,7 +9596,6 @@ dependencies = [ "zksync_config", "zksync_contracts", "zksync_dal", - "zksync_env_config", "zksync_queued_job_processor", "zksync_types", "zksync_utils", @@ -13334,9 +9623,7 @@ dependencies = [ "serde_yaml", "tokio", "zksync_config", - "zksync_dal", "zksync_env_config", - "zksync_node_genesis", "zksync_protobuf", "zksync_protobuf_config", ] @@ -13349,7 +9636,7 @@ dependencies = [ "blake2 0.10.6", "hex", "rand 0.8.5", - "secp256k1 0.27.0", + "secp256k1", "serde", "serde_json", "sha2 0.10.8", @@ -13358,6 +9645,18 @@ dependencies = [ "zksync_utils", ] +[[package]] +name = "zksync_cs_derive" +version = "0.30.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5939e2df4288c263c706ff18ac718e984149223ad4289d6d957d767dcfc04c81" +dependencies = [ + "proc-macro-error", + "proc-macro2 1.0.86", + "quote 1.0.36", + "syn 1.0.109", +] + [[package]] name = "zksync_da_client" version = "0.1.0" @@ -13365,8 +9664,35 @@ dependencies = [ "anyhow", "async-trait", "serde", +] + +[[package]] +name = "zksync_da_clients" +version = "0.1.0" +dependencies = [ + "anyhow", + "async-trait", + "base58", + "blake2 0.10.6", + "blake2b_simd", + "flate2", + "futures 0.3.30", + "hex", + "http 1.1.0", + "jsonrpsee 0.23.2", + "parity-scale-codec", + "reqwest 0.12.5", + "scale-encode", + "serde", + "serde_json", + "subxt-metadata", + "subxt-signer", + "tokio", "tracing", "zksync_config", + "zksync_da_client", + "zksync_env_config", + "zksync_object_store", "zksync_types", ] @@ -13438,24 +9764,6 @@ dependencies = [ "tracing", "vise", "zksync_basic_types", - "zksync_health_check", -] - -[[package]] -name = "zksync_default_da_clients" -version = "0.1.0" -dependencies = [ - "anyhow", - "async-trait", - "flate2", - "serde", - "tracing", - "zksync_config", - "zksync_da_client", - "zksync_env_config", - "zksync_node_framework", - "zksync_object_store", - "zksync_types", ] [[package]] @@ -13561,8 +9869,7 @@ dependencies = [ "clap 4.4.6", "envy", "futures 0.3.30", - "rustc_version 0.4.0", - "semver 1.0.20", + "rustc_version", "serde", "serde_json", "tempfile", @@ -13644,6 +9951,34 @@ dependencies = [ "zksync_prover_interface", ] +[[package]] +name = "zksync_ff" +version = "0.30.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9524b06780b5e164e84b38840c7c428c739f051f35af6efc4d1285f629ceb88e" +dependencies = [ + "byteorder", + "hex", + "rand 0.4.6", + "serde", + "zksync_ff_derive", +] + +[[package]] +name = "zksync_ff_derive" +version = "0.30.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f91e58e75d65877f09f83bc3dca8f054847ae7ec4f3e64bfa610a557edd8e8e" +dependencies = [ + "num-bigint 0.4.6", + "num-integer", + "num-traits", + "proc-macro2 1.0.86", + "quote 1.0.36", + "serde", + "syn 1.0.109", +] + [[package]] name = "zksync_health_check" version = "0.1.0" @@ -13676,9 +10011,9 @@ dependencies = [ [[package]] name = "zksync_kzg" -version = "0.150.4" +version = "0.150.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9949f48ea1a9f9a0e73242d4d1e87e681095181827486b3fcc2cf93e5aa03280" +checksum = "edb8a9c76c172a6d639855ee342b9a670e3ba472f5ae302f771b1c3ee777dc88" dependencies = [ "boojum", "derivative", @@ -13688,7 +10023,7 @@ dependencies = [ "serde", "serde_json", "serde_with", - "zkevm_circuits 0.150.4", + "zkevm_circuits 0.150.5", ] [[package]] @@ -13748,7 +10083,7 @@ dependencies = [ "thiserror", "thread_local", "tracing", - "tracing-subscriber 0.3.18", + "tracing-subscriber", "vise", "zksync_crypto_primitives", "zksync_prover_interface", @@ -13809,11 +10144,11 @@ version = "0.1.0" dependencies = [ "anyhow", "assert_matches", - "circuit_sequencer_api 0.133.0", - "circuit_sequencer_api 0.140.0", - "circuit_sequencer_api 0.141.1", - "circuit_sequencer_api 0.142.0", - "circuit_sequencer_api 0.150.4", + "circuit_sequencer_api 0.133.1", + "circuit_sequencer_api 0.140.3", + "circuit_sequencer_api 0.141.2", + "circuit_sequencer_api 0.142.2", + "circuit_sequencer_api 0.150.5", "ethabi", "hex", "itertools 0.10.5", @@ -13828,7 +10163,7 @@ dependencies = [ "zk_evm 0.133.0", "zk_evm 0.140.0", "zk_evm 0.141.0", - "zk_evm 0.150.4", + "zk_evm 0.150.5", "zksync_contracts", "zksync_eth_signer", "zksync_system_constants", @@ -13886,6 +10221,7 @@ dependencies = [ "zksync_system_constants", "zksync_types", "zksync_utils", + "zksync_vm_executor", "zksync_web3_decl", ] @@ -13895,8 +10231,10 @@ version = "0.1.0" dependencies = [ "anyhow", "async-trait", + "hex", "rand 0.8.5", "secrecy", + "semver", "tempfile", "test-casing", "thiserror", @@ -13921,11 +10259,13 @@ dependencies = [ "zksync_node_sync", "zksync_node_test_utils", "zksync_protobuf", + "zksync_state", "zksync_state_keeper", "zksync_system_constants", "zksync_test_account", "zksync_types", "zksync_utils", + "zksync_vm_interface", "zksync_web3_decl", ] @@ -13939,7 +10279,6 @@ dependencies = [ "chrono", "serde", "serde_json", - "test-casing", "test-log", "tokio", "tracing", @@ -13966,7 +10305,6 @@ dependencies = [ "zksync_config", "zksync_dal", "zksync_eth_client", - "zksync_node_test_utils", "zksync_types", "zksync_utils", "zksync_web3_decl", @@ -13982,6 +10320,7 @@ dependencies = [ "ctrlc", "futures 0.3.30", "pin-project-lite", + "semver", "thiserror", "tokio", "tracing", @@ -13996,10 +10335,10 @@ dependencies = [ "zksync_contract_verification_server", "zksync_contracts", "zksync_da_client", + "zksync_da_clients", "zksync_da_dispatcher", "zksync_dal", "zksync_db_connection", - "zksync_env_config", "zksync_eth_client", "zksync_eth_sender", "zksync_eth_watch", @@ -14018,7 +10357,6 @@ dependencies = [ "zksync_node_sync", "zksync_object_store", "zksync_proof_data_handler", - "zksync_protobuf_config", "zksync_queued_job_processor", "zksync_reorg_detector", "zksync_state", @@ -14038,7 +10376,7 @@ name = "zksync_node_framework_derive" version = "0.1.0" dependencies = [ "proc-macro2 1.0.86", - "quote 1.0.37", + "quote 1.0.36", "syn 2.0.72", ] @@ -14158,6 +10496,19 @@ dependencies = [ "zksync_types", ] +[[package]] +name = "zksync_pairing" +version = "0.30.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8412ae5574472fa567a097e183f9a01974b99dd0b5da3bfa1bbe6c57c579aa2" +dependencies = [ + "byteorder", + "cfg-if", + "rand 0.4.6", + "serde", + "zksync_ff", +] + [[package]] name = "zksync_proof_data_handler" version = "0.1.0" @@ -14178,15 +10529,14 @@ dependencies = [ "zksync_multivm", "zksync_object_store", "zksync_prover_interface", - "zksync_tee_verifier", "zksync_types", ] [[package]] name = "zksync_protobuf" -version = "0.1.0-rc.11" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4f6ba3bf0aac20de18b4ae18a22d8c81b83f8f72e8fdec1c879525ecdacd2f5" +checksum = "df5467dfe2f845ca1fd6ceec623bbd32187589793d3c4023dcd2f5172369d198" dependencies = [ "anyhow", "bit-vec", @@ -14205,18 +10555,18 @@ dependencies = [ [[package]] name = "zksync_protobuf_build" -version = "0.1.0-rc.11" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7798c248b9a64505f0586bd5fadad6b26c999be4a8dec6b1a86b10b3888169c5" +checksum = "33d35280660b11be2a4ebdf531184eb729acebfdc3368d27176ec104f8bf9c5f" dependencies = [ "anyhow", "heck 0.5.0", "prettyplease", "proc-macro2 1.0.86", - "prost-build 0.12.1", + "prost-build", "prost-reflect", "protox", - "quote 1.0.37", + "quote 1.0.36", "syn 2.0.72", ] @@ -14245,7 +10595,7 @@ version = "0.1.0" dependencies = [ "bincode", "chrono", - "circuit_sequencer_api 0.150.4", + "circuit_sequencer_api 0.150.5", "serde", "serde_json", "serde_with", @@ -14294,10 +10644,7 @@ name = "zksync_server" version = "0.1.0" dependencies = [ "anyhow", - "avail_client", - "celestia_client", "clap 4.4.6", - "eigen_da_client", "futures 0.3.30", "serde_json", "tikv-jemallocator", @@ -14309,7 +10656,7 @@ dependencies = [ "zksync_consensus_executor", "zksync_consensus_roles", "zksync_core_leftovers", - "zksync_default_da_clients", + "zksync_da_clients", "zksync_env_config", "zksync_eth_client", "zksync_metadata_calculator", @@ -14327,7 +10674,7 @@ dependencies = [ name = "zksync_shared_metrics" version = "0.1.0" dependencies = [ - "rustc_version 0.4.0", + "rustc_version", "tracing", "vise", "zksync_dal", @@ -14359,9 +10706,9 @@ dependencies = [ [[package]] name = "zksync_solidity_vk_codegen" -version = "0.1.0" +version = "0.30.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6bac71750012656b207e8cdb67415823318909077d8c8e235111f0d2feeeeeda" +checksum = "b310ab8a21681270e73f177ddf7974cabb7a96f0624ab8b008fd6ee1f9b4f687" dependencies = [ "ethereum-types", "franklin-crypto", @@ -14468,7 +10815,7 @@ dependencies = [ "async-trait", "envy", "reqwest 0.12.5", - "secp256k1 0.27.0", + "secp256k1", "serde", "thiserror", "tokio", @@ -14495,13 +10842,10 @@ dependencies = [ "zksync_config", "zksync_contracts", "zksync_crypto_primitives", - "zksync_dal", - "zksync_db_connection", "zksync_merkle_tree", "zksync_multivm", "zksync_object_store", "zksync_prover_interface", - "zksync_queued_job_processor", "zksync_types", "zksync_utils", ] @@ -14557,7 +10901,7 @@ dependencies = [ "once_cell", "prost 0.12.1", "rlp", - "secp256k1 0.27.0", + "secp256k1", "serde", "serde_json", "strum", @@ -14580,11 +10924,11 @@ name = "zksync_utils" version = "0.1.0" dependencies = [ "anyhow", + "assert_matches", "bigdecimal", "bincode", "futures 0.3.30", "hex", - "itertools 0.10.5", "num", "once_cell", "rand 0.8.5", @@ -14618,7 +10962,7 @@ dependencies = [ "tokio", "tracing", "tracing-opentelemetry", - "tracing-subscriber 0.3.18", + "tracing-subscriber", "url", "vise", "vise-exporter", @@ -14638,6 +10982,7 @@ dependencies = [ "zksync_dal", "zksync_multivm", "zksync_types", + "zksync_utils", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index 7f34685f539..400cf9ab799 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -6,6 +6,7 @@ members = [ "core/bin/external_node", "core/bin/merkle_tree_consistency_checker", "core/bin/snapshots_creator", + "core/bin/selector_generator", "core/bin/system-constants-generator", "core/bin/verified_sources_fetcher", "core/bin/zksync_server", @@ -38,6 +39,7 @@ members = [ "core/node/base_token_adjuster", "core/node/external_proof_integration_api", "core/node/logs_bloom_backfill", + "core/node/da_clients", # Libraries "core/lib/db_connection", "core/lib/zksync_core_leftovers", @@ -50,7 +52,6 @@ members = [ "core/lib/dal", "core/lib/env_config", "core/lib/da_client", - "core/lib/default_da_clients", "core/lib/eth_client", "core/lib/eth_signer", "core/lib/l1_contract_interface", @@ -120,6 +121,7 @@ envy = "0.4" ethabi = "18.0.0" flate2 = "1.0.28" futures = "0.3" +glob = "0.3" google-cloud-auth = "0.16.0" google-cloud-storage = "0.20.0" governor = "0.4.2" @@ -196,6 +198,15 @@ trybuild = "1.0" vise = "0.2.0" vise-exporter = "0.2.0" +# DA clients' dependencies +# Avail +base58 = "0.2.0" +scale-encode = "0.5.0" +blake2b_simd = "1.0.2" +subxt-metadata = "0.34.0" +parity-scale-codec = { version = "3.6.9", default-features = false } +subxt-signer = { version = "0.34", default-features = false } + # Here and below: # We *always* pin the latest version of protocol to disallow accidental changes in the execution logic. # However, for the historical version of protocol crates, we have lax requirements. Otherwise, @@ -204,30 +215,30 @@ circuit_sequencer_api_1_3_3 = { package = "circuit_sequencer_api", version = "0. circuit_sequencer_api_1_4_0 = { package = "circuit_sequencer_api", version = "0.140" } circuit_sequencer_api_1_4_1 = { package = "circuit_sequencer_api", version = "0.141" } circuit_sequencer_api_1_4_2 = { package = "circuit_sequencer_api", version = "0.142" } -circuit_sequencer_api_1_5_0 = { package = "circuit_sequencer_api", version = "=0.150.4" } -crypto_codegen = { package = "zksync_solidity_vk_codegen", version = "=0.1.0" } -kzg = { package = "zksync_kzg", version = "=0.150.4" } +circuit_sequencer_api_1_5_0 = { package = "circuit_sequencer_api", version = "=0.150.5" } +crypto_codegen = { package = "zksync_solidity_vk_codegen", version = "=0.30.1" } +kzg = { package = "zksync_kzg", version = "=0.150.5" } zk_evm = { version = "=0.133.0" } zk_evm_1_3_1 = { package = "zk_evm", version = "0.131.0-rc.2" } -zk_evm_1_3_3 = { package = "zk_evm", version = "0.133.0" } -zk_evm_1_4_0 = { package = "zk_evm", version = "0.140.0" } -zk_evm_1_4_1 = { package = "zk_evm", version = "0.141.0" } -zk_evm_1_5_0 = { package = "zk_evm", version = "=0.150.4" } +zk_evm_1_3_3 = { package = "zk_evm", version = "0.133" } +zk_evm_1_4_0 = { package = "zk_evm", version = "0.140" } +zk_evm_1_4_1 = { package = "zk_evm", version = "0.141" } +zk_evm_1_5_0 = { package = "zk_evm", version = "=0.150.5" } # New VM; pinned to a specific commit because of instability vm2 = { git = "https://github.com/matter-labs/vm2.git", rev = "4ef15d46410ffc11744771a3a6c7c09dd9470c90" } # Consensus dependencies. -zksync_concurrency = "=0.1.0-rc.11" -zksync_consensus_bft = "=0.1.0-rc.11" -zksync_consensus_crypto = "=0.1.0-rc.11" -zksync_consensus_executor = "=0.1.0-rc.11" -zksync_consensus_network = "=0.1.0-rc.11" -zksync_consensus_roles = "=0.1.0-rc.11" -zksync_consensus_storage = "=0.1.0-rc.11" -zksync_consensus_utils = "=0.1.0-rc.11" -zksync_protobuf = "=0.1.0-rc.11" -zksync_protobuf_build = "=0.1.0-rc.11" +zksync_concurrency = "=0.1.1" +zksync_consensus_bft = "=0.1.1" +zksync_consensus_crypto = "=0.1.1" +zksync_consensus_executor = "=0.1.1" +zksync_consensus_network = "=0.1.1" +zksync_consensus_roles = "=0.1.1" +zksync_consensus_storage = "=0.1.1" +zksync_consensus_utils = "=0.1.1" +zksync_protobuf = "=0.1.1" +zksync_protobuf_build = "=0.1.1" # "Local" dependencies zksync_multivm = { version = "0.1.0", path = "core/lib/multivm" } @@ -245,7 +256,6 @@ zksync_db_connection = { version = "0.1.0", path = "core/lib/db_connection" } zksync_env_config = { version = "0.1.0", path = "core/lib/env_config" } zksync_eth_client = { version = "0.1.0", path = "core/lib/eth_client" } zksync_da_client = { version = "0.1.0", path = "core/lib/da_client" } -zksync_default_da_clients = { version = "0.1.0", path = "core/lib/default_da_clients" } zksync_eth_signer = { version = "0.1.0", path = "core/lib/eth_signer" } zksync_health_check = { version = "0.1.0", path = "core/lib/health_check" } zksync_l1_contract_interface = { version = "0.1.0", path = "core/lib/l1_contract_interface" } @@ -279,6 +289,7 @@ zksync_commitment_generator = { version = "0.1.0", path = "core/node/commitment_ zksync_house_keeper = { version = "0.1.0", path = "core/node/house_keeper" } zksync_node_genesis = { version = "0.1.0", path = "core/node/genesis" } zksync_da_dispatcher = { version = "0.1.0", path = "core/node/da_dispatcher" } +zksync_da_clients = { version = "0.1.0", path = "core/node/da_clients" } zksync_eth_sender = { version = "0.1.0", path = "core/node/eth_sender" } zksync_node_db_pruner = { version = "0.1.0", path = "core/node/db_pruner" } zksync_node_fee_model = { version = "0.1.0", path = "core/node/fee_model" } @@ -298,9 +309,3 @@ zksync_tee_verifier_input_producer = { version = "0.1.0", path = "core/node/tee_ zksync_base_token_adjuster = { version = "0.1.0", path = "core/node/base_token_adjuster" } zksync_logs_bloom_backfill = { version = "0.1.0", path = "core/node/logs_bloom_backfill" } -# these are used in hyperchain-da, which causes ambiguity in the dependency resolution, so we use native ones explicitly -[patch."https://github.com/matter-labs/zksync-era"] -zksync_node_framework = { path = "core/node/node_framework" } -zksync_env_config = { path = "core/lib/env_config" } -zksync_da_client = { path = "core/lib/da_client" } - diff --git a/contracts b/contracts index d3687694f71..73b20c4b972 160000 --- a/contracts +++ b/contracts @@ -1 +1 @@ -Subproject commit d3687694f71d83fa286b9c186b4c3ea173028f83 +Subproject commit 73b20c4b972f575613b4054d238332f93f2685cc diff --git a/core/bin/contract-verifier/src/main.rs b/core/bin/contract-verifier/src/main.rs index 36640049e44..a8162de13e9 100644 --- a/core/bin/contract-verifier/src/main.rs +++ b/core/bin/contract-verifier/src/main.rs @@ -9,14 +9,14 @@ use zksync_contract_verifier_lib::ContractVerifier; use zksync_core_leftovers::temp_config_store::{load_database_secrets, load_general_config}; use zksync_dal::{ConnectionPool, Core, CoreDal}; use zksync_queued_job_processor::JobProcessor; -use zksync_utils::{wait_for_tasks::ManagedTasks, workspace_dir_or_current_dir}; +use zksync_utils::{env::Workspace, wait_for_tasks::ManagedTasks}; use zksync_vlog::prometheus::PrometheusExporterConfig; async fn update_compiler_versions(connection_pool: &ConnectionPool) { let mut storage = connection_pool.connection().await.unwrap(); let mut transaction = storage.start_transaction().await.unwrap(); - let zksync_home = workspace_dir_or_current_dir(); + let zksync_home = Workspace::locate().core(); let zksolc_path = zksync_home.join("etc/zksolc-bin/"); let zksolc_versions: Vec = std::fs::read_dir(zksolc_path) diff --git a/core/bin/external_node/Cargo.toml b/core/bin/external_node/Cargo.toml index 498b11b279b..a1d3951ff3d 100644 --- a/core/bin/external_node/Cargo.toml +++ b/core/bin/external_node/Cargo.toml @@ -59,7 +59,6 @@ envy.workspace = true url.workspace = true clap = { workspace = true, features = ["derive"] } serde_json.workspace = true -semver.workspace = true tracing.workspace = true [dev-dependencies] diff --git a/core/bin/external_node/src/config/mod.rs b/core/bin/external_node/src/config/mod.rs index cd4e845b8f3..f8241deae26 100644 --- a/core/bin/external_node/src/config/mod.rs +++ b/core/bin/external_node/src/config/mod.rs @@ -1217,6 +1217,7 @@ pub(crate) struct ExternalNodeConfig { pub observability: ObservabilityENConfig, pub experimental: ExperimentalENConfig, pub consensus: Option, + pub consensus_secrets: Option, pub api_component: ApiComponentConfig, pub tree_component: TreeComponentConfig, pub remote: R, @@ -1240,6 +1241,8 @@ impl ExternalNodeConfig<()> { tree_component: envy::prefixed("EN_TREE_") .from_env::() .context("could not load external node config (tree component params)")?, + consensus_secrets: read_consensus_secrets() + .context("config::read_consensus_secrets()")?, remote: (), }) } @@ -1262,7 +1265,7 @@ impl ExternalNodeConfig<()> { .map(read_yaml_repr::) .transpose() .context("failed decoding consensus YAML config")?; - + let consensus_secrets = secrets_config.consensus.clone(); let required = RequiredENConfig::from_configs( &general_config, &external_node_config, @@ -1298,6 +1301,7 @@ impl ExternalNodeConfig<()> { consensus, api_component, tree_component, + consensus_secrets, remote: (), }) } @@ -1332,6 +1336,7 @@ impl ExternalNodeConfig<()> { consensus: self.consensus, tree_component: self.tree_component, api_component: self.api_component, + consensus_secrets: self.consensus_secrets, remote, }) } @@ -1348,6 +1353,7 @@ impl ExternalNodeConfig { observability: ObservabilityENConfig::default(), experimental: ExperimentalENConfig::mock(), consensus: None, + consensus_secrets: None, api_component: ApiComponentConfig { tree_api_remote_url: None, }, diff --git a/core/bin/external_node/src/node_builder.rs b/core/bin/external_node/src/node_builder.rs index c30cc1a432b..98e286c253a 100644 --- a/core/bin/external_node/src/node_builder.rs +++ b/core/bin/external_node/src/node_builder.rs @@ -56,11 +56,7 @@ use zksync_node_framework::{ }; use zksync_state::RocksdbStorageOptions; -use crate::{ - config::{self, ExternalNodeConfig}, - metrics::framework::ExternalNodeMetricsLayer, - Component, -}; +use crate::{config::ExternalNodeConfig, metrics::framework::ExternalNodeMetricsLayer, Component}; /// Builder for the external node. #[derive(Debug)] @@ -240,9 +236,14 @@ impl ExternalNodeBuilder { fn add_consensus_layer(mut self) -> anyhow::Result { let config = self.config.consensus.clone(); - let secrets = - config::read_consensus_secrets().context("config::read_consensus_secrets()")?; - let layer = ExternalNodeConsensusLayer { config, secrets }; + let secrets = self.config.consensus_secrets.clone(); + let layer = ExternalNodeConsensusLayer { + build_version: crate::metadata::SERVER_VERSION + .parse() + .context("CRATE_VERSION.parse()")?, + config, + secrets, + }; self.node.add_layer(layer); Ok(self) } diff --git a/core/bin/selector_generator/Cargo.toml b/core/bin/selector_generator/Cargo.toml new file mode 100644 index 00000000000..e0b0afe0ae2 --- /dev/null +++ b/core/bin/selector_generator/Cargo.toml @@ -0,0 +1,18 @@ +[package] +name = "selector_generator" +version = "0.1.0" +edition.workspace = true +authors.workspace = true +homepage.workspace = true +repository.workspace = true +license.workspace = true +keywords.workspace = true +categories.workspace = true +publish = false + +[dependencies] +serde = { workspace = true, features = ["derive"] } +serde_json.workspace = true +sha3.workspace = true +glob.workspace = true +clap = { workspace = true, features = ["derive"] } \ No newline at end of file diff --git a/core/bin/selector_generator/README.md b/core/bin/selector_generator/README.md new file mode 100644 index 00000000000..a954613c7e4 --- /dev/null +++ b/core/bin/selector_generator/README.md @@ -0,0 +1,13 @@ +# Generates the list of solidity selectors + +This tool generates a mapping from solidity selectors to function names. + +The output json file can be used by multiple tools to improve debugging and readability. + +By default, it appends the newly found selectors into the list. + +To run, first make sure that you have your contracts compiled and then run: + +``` +cargo run ../../../contracts ../../../etc/selector-generator-data/selectors.json +``` diff --git a/core/bin/selector_generator/src/main.rs b/core/bin/selector_generator/src/main.rs new file mode 100644 index 00000000000..ad6180413f1 --- /dev/null +++ b/core/bin/selector_generator/src/main.rs @@ -0,0 +1,105 @@ +use std::{ + collections::HashMap, + fs::{File, OpenOptions}, + io::{self}, +}; + +use clap::Parser; +use glob::glob; +use serde::{Deserialize, Serialize}; +use sha3::{Digest, Keccak256}; + +#[derive(Debug, Serialize, Deserialize)] +struct ABIEntry { + #[serde(rename = "type")] + entry_type: String, + name: Option, + inputs: Option>, +} + +#[derive(Debug, Serialize, Deserialize)] +struct ABIInput { + #[serde(rename = "type")] + input_type: String, +} + +#[derive(Debug, Parser)] +#[command(author, version, about, long_about = None)] +struct Cli { + contracts_dir: String, + output_file: String, +} + +/// Computes solidity selector for a given method and arguments. +fn compute_selector(name: &str, inputs: &[ABIInput]) -> String { + let signature = format!( + "{}({})", + name, + inputs + .iter() + .map(|i| i.input_type.clone()) + .collect::>() + .join(",") + ); + let mut hasher = Keccak256::new(); + hasher.update(signature); + format!("{:x}", hasher.finalize())[..8].to_string() +} + +/// Analyses all the JSON files, looking for 'abi' entries, and then computing the selectors for them. +fn process_files(directory: &str, output_file: &str) -> io::Result<()> { + let mut selectors: HashMap = match File::open(output_file) { + Ok(file) => serde_json::from_reader(file).unwrap_or_default(), + Err(_) => HashMap::new(), + }; + let selectors_before = selectors.len(); + let mut analyzed_files = 0; + + for entry in glob(&format!("{}/**/*.json", directory)).expect("Failed to read glob pattern") { + match entry { + Ok(path) => { + let file_path = path.clone(); + let file = File::open(path)?; + let json: Result = serde_json::from_reader(file); + + if let Ok(json) = json { + if let Some(abi) = json.get("abi").and_then(|v| v.as_array()) { + analyzed_files += 1; + for item in abi { + let entry: ABIEntry = serde_json::from_value(item.clone()).unwrap(); + if entry.entry_type == "function" { + if let (Some(name), Some(inputs)) = (entry.name, entry.inputs) { + let selector = compute_selector(&name, &inputs); + selectors.entry(selector).or_insert(name); + } + } + } + } + } else { + eprintln!("Error parsing file: {:?} - ignoring.", file_path) + } + } + Err(e) => eprintln!("Error reading file: {:?}", e), + } + } + println!( + "Analyzed {} files. Added {} selectors (before: {} after: {})", + analyzed_files, + selectors.len() - selectors_before, + selectors_before, + selectors.len() + ); + + let file = OpenOptions::new() + .write(true) + .create(true) + .truncate(true) + .open(output_file)?; + serde_json::to_writer_pretty(file, &selectors)?; + Ok(()) +} + +fn main() -> io::Result<()> { + let args = Cli::parse(); + process_files(&args.contracts_dir, &args.output_file) +} diff --git a/core/bin/system-constants-generator/src/main.rs b/core/bin/system-constants-generator/src/main.rs index 7ada4730224..cc2e031106b 100644 --- a/core/bin/system-constants-generator/src/main.rs +++ b/core/bin/system-constants-generator/src/main.rs @@ -17,7 +17,7 @@ use zksync_types::{ IntrinsicSystemGasConstants, ProtocolVersionId, GUARANTEED_PUBDATA_IN_TX, L1_GAS_PER_PUBDATA_BYTE, MAX_NEW_FACTORY_DEPS, REQUIRED_L1_TO_L2_GAS_PER_PUBDATA_BYTE, }; -use zksync_utils::workspace_dir_or_current_dir; +use zksync_utils::env::Workspace; // For configs we will use the default value of `800_000` to represent the rough amount of L1 gas // needed to cover the batch expenses. @@ -210,7 +210,7 @@ fn generate_rust_fee_constants(intrinsic_gas_constants: &IntrinsicSystemGasConst } fn save_file(path_in_repo: &str, content: String) { - let zksync_home = workspace_dir_or_current_dir(); + let zksync_home = Workspace::locate().core(); let fee_constants_path = zksync_home.join(path_in_repo); fs::write(fee_constants_path, content) diff --git a/core/bin/verified_sources_fetcher/README.md b/core/bin/verified_sources_fetcher/README.md new file mode 100644 index 00000000000..0abddb7a884 --- /dev/null +++ b/core/bin/verified_sources_fetcher/README.md @@ -0,0 +1,4 @@ +# Verified sources fetcher + +This tool downloads verified contract sources from SQL database from `contract_verification_requests` table. Then it +saves sources and compilation settings to files. diff --git a/core/bin/zksync_server/Cargo.toml b/core/bin/zksync_server/Cargo.toml index 1de14c29717..08939d2f121 100644 --- a/core/bin/zksync_server/Cargo.toml +++ b/core/bin/zksync_server/Cargo.toml @@ -21,7 +21,7 @@ zksync_utils.workspace = true zksync_types.workspace = true zksync_core_leftovers.workspace = true zksync_node_genesis.workspace = true -zksync_default_da_clients.workspace = true +zksync_da_clients.workspace = true # Consensus dependenices zksync_consensus_crypto.workspace = true @@ -44,14 +44,3 @@ zksync_node_api_server.workspace = true [target.'cfg(not(target_env = "msvc"))'.dependencies] tikv-jemallocator.workspace = true -# avail_client = { version = "0.1.0", git = "https://github.com/matter-labs/hyperchain-da", rev = "d8194ca6f1adcb26507252f21bcce704e35c18d6", optional = true } -# celestia_client = { version = "0.1.0", git = "https://github.com/matter-labs/hyperchain-da", rev = "d8194ca6f1adcb26507252f21bcce704e35c18d6", optional = true } -avail_client = { path = "../../../../hyperchain-da-eigenda/clients/implementations/avail", optional = true } -celestia_client = { path = "../../../../hyperchain-da-eigenda/clients/implementations/celestia", optional = true } -eigen_da_client = { path = "../../../../hyperchain-da-eigenda/clients/implementations/eigenda", optional = true } - -[features] -da-celestia = ["celestia_client"] -da-avail = ["avail_client"] -da-eigen = ["eigen_da_client"] - diff --git a/core/bin/zksync_server/src/main.rs b/core/bin/zksync_server/src/main.rs index 7e0ff0e4920..84898d6da06 100644 --- a/core/bin/zksync_server/src/main.rs +++ b/core/bin/zksync_server/src/main.rs @@ -17,9 +17,9 @@ use zksync_config::{ L1Secrets, ObservabilityConfig, PrometheusConfig, ProofDataHandlerConfig, ProtectiveReadsWriterConfig, Secrets, }, - ApiConfig, BaseTokenAdjusterConfig, ContractVerifierConfig, DADispatcherConfig, DBConfig, - EthConfig, EthWatchConfig, ExternalProofIntegrationApiConfig, GasAdjusterConfig, GenesisConfig, - ObjectStoreConfig, PostgresConfig, SnapshotsCreatorConfig, + ApiConfig, BaseTokenAdjusterConfig, ContractVerifierConfig, DAClientConfig, DADispatcherConfig, + DBConfig, EthConfig, EthWatchConfig, ExternalProofIntegrationApiConfig, GasAdjusterConfig, + GenesisConfig, ObjectStoreConfig, PostgresConfig, SnapshotsCreatorConfig, }; use zksync_core_leftovers::{ temp_config_store::{decode_yaml_repr, TempConfigStore}, @@ -199,6 +199,7 @@ fn load_env_config() -> anyhow::Result { gas_adjuster_config: GasAdjusterConfig::from_env().ok(), observability: ObservabilityConfig::from_env().ok(), snapshot_creator: SnapshotsCreatorConfig::from_env().ok(), + da_client_config: DAClientConfig::from_env().ok(), da_dispatcher_config: DADispatcherConfig::from_env().ok(), protective_reads_writer_config: ProtectiveReadsWriterConfig::from_env().ok(), basic_witness_input_producer_config: BasicWitnessInputProducerConfig::from_env().ok(), diff --git a/core/bin/zksync_server/src/node_builder.rs b/core/bin/zksync_server/src/node_builder.rs index 2b58100e9d4..19079aeadc6 100644 --- a/core/bin/zksync_server/src/node_builder.rs +++ b/core/bin/zksync_server/src/node_builder.rs @@ -3,14 +3,13 @@ use anyhow::Context; use zksync_config::{ - configs::{eth_sender::PubdataSendingMode, wallets::Wallets, GeneralConfig, Secrets}, + configs::{ + da_client::DAClient, eth_sender::PubdataSendingMode, wallets::Wallets, GeneralConfig, + Secrets, + }, ContractsConfig, GenesisConfig, }; use zksync_core_leftovers::Component; -use zksync_default_da_clients::{ - no_da::wiring_layer::NoDAClientWiringLayer, - object_store::{config::DAObjectStoreConfig, wiring_layer::ObjectStorageClientWiringLayer}, -}; use zksync_metadata_calculator::MetadataCalculatorConfig; use zksync_node_api_server::{ tx_sender::{ApiContracts, TxSenderConfig}, @@ -28,6 +27,10 @@ use zksync_node_framework::{ commitment_generator::CommitmentGeneratorLayer, consensus::MainNodeConsensusLayer, contract_verification_api::ContractVerificationApiLayer, + da_clients::{ + avail::AvailWiringLayer, eigen_da::EigenDAWiringLayer, no_da::NoDAClientWiringLayer, + object_store::ObjectStorageClientWiringLayer, + }, da_dispatcher::DataAvailabilityDispatcherLayer, eth_sender::{EthTxAggregatorLayer, EthTxManagerLayer}, eth_watch::EthWatchLayer, @@ -364,6 +367,7 @@ impl MainNodeBuilder { subscriptions_limit: Some(rpc_config.subscriptions_limit()), batch_request_size_limit: Some(rpc_config.max_batch_request_size()), response_body_size_limit: Some(rpc_config.max_response_body_size()), + with_extended_tracing: rpc_config.extended_api_tracing, ..Default::default() }; self.node.add_layer(Web3ServerLayer::http( @@ -500,40 +504,36 @@ impl MainNodeBuilder { } fn add_da_client_layer(mut self) -> anyhow::Result { - #[cfg(all(feature = "da-avail", feature = "da-celestia", feature = "da-eigen"))] - return Err(anyhow!("More than one DA client is enabled")); - - #[cfg(feature = "da-avail")] - self.node - .add_layer(avail_client::wiring_layer::AvailWiringLayer::new()); - #[cfg(feature = "da-celestia")] - self.node - .add_layer(celestia_client::wiring_layer::CelestiaWiringLayer); - #[cfg(feature = "da-eigen")] - self.node - .add_layer(eigen_da_client::wiring_layer::EigenDAWiringLayer); + let Some(da_client_config) = self.configs.da_client_config.clone() else { + tracing::warn!("No config for DA client, using the NoDA client"); + self.node.add_layer(NoDAClientWiringLayer); + return Ok(self); + }; - #[cfg(not(any(feature = "da-avail", feature = "da-celestia", feature = "da-eigen")))] - self.node.add_layer(NoDAClientWiringLayer); - Ok(self) - } + match da_client_config.client { + DAClient::Avail(config) => { + self.node.add_layer(AvailWiringLayer::new(config)); + } + DAClient::ObjectStore(config) => { + self.node + .add_layer(ObjectStorageClientWiringLayer::new(config)); + } + DAClient::EigenDA(config) => { + self.node.add_layer(EigenDAWiringLayer::new(config)); + } + } - #[allow(dead_code)] - fn add_object_storage_da_client_layer(mut self) -> anyhow::Result { - let object_store_config = DAObjectStoreConfig::from_env()?; - self.node - .add_layer(ObjectStorageClientWiringLayer::new(object_store_config.0)); Ok(self) } fn add_da_dispatcher_layer(mut self) -> anyhow::Result { - // let eth_sender_config = try_load_config!(self.configs.eth); - // if let Some(sender_config) = eth_sender_config.sender { - // if sender_config.pubdata_sending_mode != PubdataSendingMode::Custom { - // tracing::warn!("DA dispatcher is enabled, but the pubdata sending mode is not `Custom`. DA dispatcher will not be started."); - // return Ok(self); - // } - // } + let eth_sender_config = try_load_config!(self.configs.eth); + if let Some(sender_config) = eth_sender_config.sender { + if sender_config.pubdata_sending_mode != PubdataSendingMode::Custom { + tracing::warn!("DA dispatcher is enabled, but the pubdata sending mode is not `Custom`. DA dispatcher will not be started."); + return Ok(self); + } + } let state_keeper_config = try_load_config!(self.configs.state_keeper_config); let da_config = try_load_config!(self.configs.da_dispatcher_config); diff --git a/core/lib/basic_types/src/basic_fri_types.rs b/core/lib/basic_types/src/basic_fri_types.rs index 5969cca6b8c..9de9920e86f 100644 --- a/core/lib/basic_types/src/basic_fri_types.rs +++ b/core/lib/basic_types/src/basic_fri_types.rs @@ -152,6 +152,29 @@ impl AggregationRound { AggregationRound::Scheduler => None, } } + + /// Returns all the circuit IDs that correspond to a particular + /// aggregation round. + /// + /// For example, in aggregation round 0, the circuit ids should be 1 to 15 + 255 (EIP4844). + /// In aggregation round 1, the circuit ids should be 3 to 18. + /// In aggregation round 2, the circuit ids should be 2. + /// In aggregation round 3, the circuit ids should be 255. + /// In aggregation round 4, the circuit ids should be 1. + pub fn circuit_ids(self) -> Vec { + match self { + AggregationRound::BasicCircuits => (1..=15) + .chain(once(255)) + .map(|circuit_id| CircuitIdRoundTuple::new(circuit_id, self as u8)) + .collect(), + AggregationRound::LeafAggregation => (3..=18) + .map(|circuit_id| CircuitIdRoundTuple::new(circuit_id, self as u8)) + .collect(), + AggregationRound::NodeAggregation => vec![CircuitIdRoundTuple::new(2, self as u8)], + AggregationRound::RecursionTip => vec![CircuitIdRoundTuple::new(255, self as u8)], + AggregationRound::Scheduler => vec![CircuitIdRoundTuple::new(1, self as u8)], + } + } } impl std::fmt::Display for AggregationRound { @@ -265,33 +288,17 @@ impl CircuitProverStats { impl Default for CircuitProverStats { fn default() -> Self { - let mut stats = HashMap::new(); - for circuit in (1..=15).chain(once(255)) { - stats.insert( - CircuitIdRoundTuple::new(circuit, 0), - JobCountStatistics::default(), - ); - } - for circuit in 3..=18 { - stats.insert( - CircuitIdRoundTuple::new(circuit, 1), - JobCountStatistics::default(), - ); - } - stats.insert( - CircuitIdRoundTuple::new(2, 2), - JobCountStatistics::default(), - ); - stats.insert( - CircuitIdRoundTuple::new(255, 3), - JobCountStatistics::default(), - ); - stats.insert( - CircuitIdRoundTuple::new(1, 4), - JobCountStatistics::default(), - ); + let circuits_prover_stats = AggregationRound::ALL_ROUNDS + .into_iter() + .flat_map(|round| { + let circuit_ids = round.circuit_ids(); + circuit_ids.into_iter().map(|circuit_id_round_tuple| { + (circuit_id_round_tuple, JobCountStatistics::default()) + }) + }) + .collect(); Self { - circuits_prover_stats: stats, + circuits_prover_stats, } } } diff --git a/core/lib/circuit_breaker/Cargo.toml b/core/lib/circuit_breaker/Cargo.toml index 9bc00b475d4..926002e561c 100644 --- a/core/lib/circuit_breaker/Cargo.toml +++ b/core/lib/circuit_breaker/Cargo.toml @@ -19,6 +19,3 @@ tokio = { workspace = true, features = ["time"] } anyhow.workspace = true async-trait.workspace = true tracing.workspace = true - -[dev-dependencies] -assert_matches.workspace = true diff --git a/core/lib/config/src/configs/consensus.rs b/core/lib/config/src/configs/consensus.rs index 50885a6ec6f..759e1312833 100644 --- a/core/lib/config/src/configs/consensus.rs +++ b/core/lib/config/src/configs/consensus.rs @@ -1,7 +1,8 @@ use std::collections::{BTreeMap, BTreeSet}; -use secrecy::{ExposeSecret as _, Secret}; -use zksync_basic_types::L2ChainId; +use secrecy::ExposeSecret as _; +pub use secrecy::Secret; +use zksync_basic_types::{ethabi, L2ChainId}; use zksync_concurrency::{limiter, time}; /// `zksync_consensus_crypto::TextFmt` representation of `zksync_consensus_roles::validator::PublicKey`. @@ -89,6 +90,8 @@ pub struct GenesisSpec { /// Leader of the committee. Represents /// `zksync_consensus_roles::validator::LeaderSelectionMode::Sticky`. pub leader: ValidatorPublicKey, + /// Address of the registry contract. + pub registry_address: Option, } #[derive(Clone, Debug, PartialEq, Default)] diff --git a/core/lib/config/src/configs/da_client/avail.rs b/core/lib/config/src/configs/da_client/avail.rs new file mode 100644 index 00000000000..e8d11978791 --- /dev/null +++ b/core/lib/config/src/configs/da_client/avail.rs @@ -0,0 +1,11 @@ +use serde::Deserialize; + +#[derive(Clone, Debug, PartialEq, Deserialize)] +pub struct AvailConfig { + pub api_node_url: String, + pub bridge_api_url: String, + pub seed: String, + pub app_id: u32, + pub timeout: usize, + pub max_retries: usize, +} diff --git a/core/lib/config/src/configs/da_client/eigen_da.rs b/core/lib/config/src/configs/da_client/eigen_da.rs new file mode 100644 index 00000000000..b9222618dc0 --- /dev/null +++ b/core/lib/config/src/configs/da_client/eigen_da.rs @@ -0,0 +1,8 @@ +use serde::Deserialize; + +#[derive(Clone, Debug, PartialEq, Deserialize, Default)] +pub struct EigenDAConfig { + pub api_node_url: String, + pub custom_quorum_numbers: Option>, + pub account_id: Option, +} diff --git a/core/lib/config/src/configs/da_client/mod.rs b/core/lib/config/src/configs/da_client/mod.rs new file mode 100644 index 00000000000..a0fc524bf58 --- /dev/null +++ b/core/lib/config/src/configs/da_client/mod.rs @@ -0,0 +1,24 @@ +use eigen_da::EigenDAConfig; +use serde::Deserialize; + +use crate::{AvailConfig, ObjectStoreConfig}; + +pub mod avail; +pub mod eigen_da; + +pub const AVAIL_CLIENT_CONFIG_NAME: &str = "Avail"; +pub const OBJECT_STORE_CLIENT_CONFIG_NAME: &str = "ObjectStore"; +pub const EIGENDA_CLIENT_CONFIG_NAME: &str = "EigenDA"; + +#[derive(Debug, Clone, PartialEq)] +pub struct DAClientConfig { + pub client: DAClient, +} + +#[derive(Debug, Clone, PartialEq, Deserialize)] +#[serde(tag = "client")] +pub enum DAClient { + Avail(AvailConfig), + ObjectStore(ObjectStoreConfig), + EigenDA(EigenDAConfig), +} diff --git a/core/lib/config/src/configs/fri_prover.rs b/core/lib/config/src/configs/fri_prover.rs index f6a21beaa6d..32558dd2244 100644 --- a/core/lib/config/src/configs/fri_prover.rs +++ b/core/lib/config/src/configs/fri_prover.rs @@ -4,7 +4,7 @@ use serde::Deserialize; use crate::ObjectStoreConfig; -#[derive(Debug, Deserialize, Clone, PartialEq)] +#[derive(Debug, Deserialize, Clone, Copy, PartialEq)] pub enum SetupLoadMode { FromDisk, FromMemory, diff --git a/core/lib/config/src/configs/fri_prover_group.rs b/core/lib/config/src/configs/fri_prover_group.rs index 0fd752b5c28..294d4d1bbd4 100644 --- a/core/lib/config/src/configs/fri_prover_group.rs +++ b/core/lib/config/src/configs/fri_prover_group.rs @@ -1,7 +1,7 @@ use std::collections::HashSet; use serde::Deserialize; -use zksync_basic_types::basic_fri_types::CircuitIdRoundTuple; +use zksync_basic_types::basic_fri_types::{AggregationRound, CircuitIdRoundTuple}; /// Configuration for the grouping of specialized provers. #[derive(Debug, Deserialize, Clone, PartialEq)] @@ -81,6 +81,7 @@ impl FriProverGroupConfig { .flatten() .collect() } + /// check all_circuit ids present exactly once /// and For each aggregation round, check that the circuit ids are in the correct range. /// For example, in aggregation round 0, the circuit ids should be 1 to 15 + 255 (EIP4844). @@ -89,7 +90,6 @@ impl FriProverGroupConfig { /// In aggregation round 3, the circuit ids should be 255. /// In aggregation round 4, the circuit ids should be 1. pub fn validate(&self) -> anyhow::Result<()> { - let mut rounds: Vec> = vec![Vec::new(); 5]; let groups = [ &self.group_0, &self.group_1, @@ -107,110 +107,45 @@ impl FriProverGroupConfig { &self.group_13, &self.group_14, ]; - for group in groups { - for circuit_round in group { - let round = match rounds.get_mut(circuit_round.aggregation_round as usize) { - Some(round) => round, - None => anyhow::bail!( - "Invalid aggregation round {}.", - circuit_round.aggregation_round - ), - }; - round.push(circuit_round.clone()); - } - } - - for (round, round_data) in rounds.iter().enumerate() { - let circuit_ids: Vec = round_data.iter().map(|x| x.circuit_id).collect(); - let unique_circuit_ids: HashSet = circuit_ids.iter().copied().collect(); - let duplicates: HashSet = circuit_ids - .iter() - .filter(|id| circuit_ids.iter().filter(|x| x == id).count() > 1) - .copied() - .collect(); + let mut expected_circuit_ids: HashSet<_> = AggregationRound::ALL_ROUNDS + .into_iter() + .flat_map(|r| r.circuit_ids()) + .collect(); - let (missing_ids, not_in_range, expected_circuits_description) = match round { - 0 => { - let mut expected_range: Vec<_> = (1..=15).collect(); - expected_range.push(255); - let missing_ids: Vec<_> = expected_range - .iter() - .copied() - .filter(|id| !circuit_ids.contains(id)) - .collect(); - - let not_in_range: Vec<_> = circuit_ids - .iter() - .filter(|&id| !expected_range.contains(id)) - .collect(); - (missing_ids, not_in_range, "circuit IDs 1 to 15 and 255") - } - 1 => { - let expected_range: Vec<_> = (3..=18).collect(); - let missing_ids: Vec<_> = expected_range - .iter() - .copied() - .filter(|id| !circuit_ids.contains(id)) - .collect(); - let not_in_range: Vec<_> = circuit_ids - .iter() - .filter(|&id| !expected_range.contains(id)) - .collect(); - (missing_ids, not_in_range, "circuit IDs 3 to 18") - } - 2 => { - let expected_range: Vec<_> = vec![2]; - let missing_ids: Vec<_> = expected_range - .iter() - .copied() - .filter(|id| !circuit_ids.contains(id)) - .collect(); - let not_in_range: Vec<_> = circuit_ids - .iter() - .filter(|&id| !expected_range.contains(id)) - .collect(); - (missing_ids, not_in_range, "circuit ID 2") + let mut provided_circuit_ids = HashSet::new(); + for (group_id, group) in groups.iter().enumerate() { + for circuit_id_round in group.iter() { + // Make sure that it's a known circuit. + if !expected_circuit_ids.contains(circuit_id_round) { + anyhow::bail!( + "Group {} contains unexpected circuit id: {:?}", + group_id, + circuit_id_round + ); } - 3 => { - let expected_range: Vec<_> = vec![255]; - let missing_ids: Vec<_> = expected_range - .iter() - .copied() - .filter(|id| !circuit_ids.contains(id)) - .collect(); - let not_in_range: Vec<_> = circuit_ids - .iter() - .filter(|&id| !expected_range.contains(id)) - .collect(); - (missing_ids, not_in_range, "circuit ID 255") - } - 4 => { - let expected_range: Vec<_> = vec![1]; - let missing_ids: Vec<_> = expected_range - .iter() - .copied() - .filter(|id| !circuit_ids.contains(id)) - .collect(); - let not_in_range: Vec<_> = circuit_ids - .iter() - .filter(|&id| !expected_range.contains(id)) - .collect(); - (missing_ids, not_in_range, "circuit ID 1") - } - _ => { - anyhow::bail!("Unknown round {}", round); + // Remove this circuit from the expected set: later we will check that all circuits + // are present. + expected_circuit_ids.remove(circuit_id_round); + + // Make sure that the circuit is not duplicated. + if provided_circuit_ids.contains(circuit_id_round) { + anyhow::bail!( + "Group {} contains duplicate circuit id: {:?}", + group_id, + circuit_id_round + ); } - }; - if !missing_ids.is_empty() { - anyhow::bail!("Circuit IDs for round {round} are missing: {missing_ids:?}"); - } - if circuit_ids.len() != unique_circuit_ids.len() { - anyhow::bail!("Circuit IDs: {duplicates:?} should be unique for round {round}.",); - } - if !not_in_range.is_empty() { - anyhow::bail!("Aggregation round {round} should only contain {expected_circuits_description}. Ids out of range: {not_in_range:?}"); + provided_circuit_ids.insert(circuit_id_round.clone()); } } + // All the circuit IDs should have been removed from the expected set. + if !expected_circuit_ids.is_empty() { + anyhow::bail!( + "Some circuit ids are missing from the groups: {:?}", + expected_circuit_ids + ); + } + Ok(()) } } diff --git a/core/lib/config/src/configs/general.rs b/core/lib/config/src/configs/general.rs index 38ffd3d45fa..bb733510f77 100644 --- a/core/lib/config/src/configs/general.rs +++ b/core/lib/config/src/configs/general.rs @@ -3,6 +3,7 @@ use crate::{ base_token_adjuster::BaseTokenAdjusterConfig, chain::{CircuitBreakerConfig, MempoolConfig, OperationsManagerConfig, StateKeeperConfig}, consensus::ConsensusConfig, + da_client::DAClientConfig, da_dispatcher::DADispatcherConfig, fri_prover_group::FriProverGroupConfig, house_keeper::HouseKeeperConfig, @@ -41,6 +42,7 @@ pub struct GeneralConfig { pub eth: Option, pub snapshot_creator: Option, pub observability: Option, + pub da_client_config: Option, pub da_dispatcher_config: Option, pub protective_reads_writer_config: Option, pub basic_witness_input_producer_config: Option, diff --git a/core/lib/config/src/configs/mod.rs b/core/lib/config/src/configs/mod.rs index b213060f7ce..1ad503e0687 100644 --- a/core/lib/config/src/configs/mod.rs +++ b/core/lib/config/src/configs/mod.rs @@ -5,6 +5,7 @@ pub use self::{ commitment_generator::CommitmentGeneratorConfig, contract_verifier::ContractVerifierConfig, contracts::{ContractsConfig, EcosystemContracts}, + da_client::{avail::AvailConfig, DAClientConfig}, da_dispatcher::DADispatcherConfig, database::{DBConfig, PostgresConfig}, eth_sender::{EthConfig, GasAdjusterConfig}, @@ -38,6 +39,7 @@ mod commitment_generator; pub mod consensus; pub mod contract_verifier; pub mod contracts; +pub mod da_client; pub mod da_dispatcher; pub mod database; pub mod en_config; diff --git a/core/lib/config/src/lib.rs b/core/lib/config/src/lib.rs index ae8288fa72e..9191edc3982 100644 --- a/core/lib/config/src/lib.rs +++ b/core/lib/config/src/lib.rs @@ -1,9 +1,10 @@ #![allow(clippy::upper_case_acronyms, clippy::derive_partial_eq_without_eq)] pub use crate::configs::{ - ApiConfig, BaseTokenAdjusterConfig, ContractVerifierConfig, ContractsConfig, - DADispatcherConfig, DBConfig, EthConfig, EthWatchConfig, ExternalProofIntegrationApiConfig, - GasAdjusterConfig, GenesisConfig, ObjectStoreConfig, PostgresConfig, SnapshotsCreatorConfig, + ApiConfig, AvailConfig, BaseTokenAdjusterConfig, ContractVerifierConfig, ContractsConfig, + DAClientConfig, DADispatcherConfig, DBConfig, EthConfig, EthWatchConfig, + ExternalProofIntegrationApiConfig, GasAdjusterConfig, GenesisConfig, ObjectStoreConfig, + PostgresConfig, SnapshotsCreatorConfig, }; pub mod configs; diff --git a/core/lib/config/src/testonly.rs b/core/lib/config/src/testonly.rs index 028b5e38055..4a2858b9cbf 100644 --- a/core/lib/config/src/testonly.rs +++ b/core/lib/config/src/testonly.rs @@ -12,8 +12,12 @@ use zksync_basic_types::{ use zksync_consensus_utils::EncodeDist; use zksync_crypto_primitives::K256PrivateKey; -use crate::configs::{ - self, eth_sender::PubdataSendingMode, external_price_api_client::ForcedPriceClientConfig, +use crate::{ + configs::{ + self, da_client::DAClient::Avail, eth_sender::PubdataSendingMode, + external_price_api_client::ForcedPriceClientConfig, + }, + AvailConfig, }; trait Sample { @@ -243,17 +247,17 @@ impl Distribution for EncodeDist { default_upgrade_addr: rng.gen(), diamond_proxy_addr: rng.gen(), validator_timelock_addr: rng.gen(), - l1_erc20_bridge_proxy_addr: rng.gen(), - l2_erc20_bridge_addr: rng.gen(), - l1_shared_bridge_proxy_addr: rng.gen(), - l2_shared_bridge_addr: rng.gen(), - l1_weth_bridge_proxy_addr: rng.gen(), - l2_weth_bridge_addr: rng.gen(), - l2_testnet_paymaster_addr: rng.gen(), + l1_erc20_bridge_proxy_addr: self.sample_opt(|| rng.gen()), + l2_erc20_bridge_addr: self.sample_opt(|| rng.gen()), + l1_shared_bridge_proxy_addr: self.sample_opt(|| rng.gen()), + l2_shared_bridge_addr: self.sample_opt(|| rng.gen()), + l1_weth_bridge_proxy_addr: self.sample_opt(|| rng.gen()), + l2_weth_bridge_addr: self.sample_opt(|| rng.gen()), + l2_testnet_paymaster_addr: self.sample_opt(|| rng.gen()), l1_multicall3_addr: rng.gen(), - base_token_addr: rng.gen(), - chain_admin_addr: rng.gen(), ecosystem_contracts: self.sample(rng), + base_token_addr: self.sample_opt(|| rng.gen()), + chain_admin_addr: self.sample_opt(|| rng.gen()), } } } @@ -777,6 +781,7 @@ impl Distribution for EncodeDist { validators: self.sample_collect(rng), attesters: self.sample_collect(rng), leader: ValidatorPublicKey(self.sample(rng)), + registry_address: self.sample_opt(|| rng.gen()), } } } @@ -921,6 +926,21 @@ impl Distribution for EncodeDist { } } +impl Distribution for EncodeDist { + fn sample(&self, rng: &mut R) -> configs::da_client::DAClientConfig { + configs::da_client::DAClientConfig { + client: Avail(AvailConfig { + api_node_url: self.sample(rng), + bridge_api_url: self.sample(rng), + seed: self.sample(rng), + app_id: self.sample(rng), + timeout: self.sample(rng), + max_retries: self.sample(rng), + }), + } + } +} + impl Distribution for EncodeDist { fn sample(&self, rng: &mut R) -> configs::da_dispatcher::DADispatcherConfig { configs::da_dispatcher::DADispatcherConfig { @@ -1120,6 +1140,7 @@ impl Distribution for EncodeDist { eth: self.sample(rng), snapshot_creator: self.sample(rng), observability: self.sample(rng), + da_client_config: self.sample(rng), da_dispatcher_config: self.sample(rng), protective_reads_writer_config: self.sample(rng), basic_witness_input_producer_config: self.sample(rng), diff --git a/core/lib/contract_verifier/Cargo.toml b/core/lib/contract_verifier/Cargo.toml index 2803e3bb418..580982c9a70 100644 --- a/core/lib/contract_verifier/Cargo.toml +++ b/core/lib/contract_verifier/Cargo.toml @@ -13,7 +13,6 @@ categories.workspace = true [dependencies] zksync_types.workspace = true zksync_dal.workspace = true -zksync_env_config.workspace = true zksync_config.workspace = true zksync_contracts.workspace = true zksync_queued_job_processor.workspace = true diff --git a/core/lib/contract_verifier/src/lib.rs b/core/lib/contract_verifier/src/lib.rs index 82751d4c975..c8d9b89d834 100644 --- a/core/lib/contract_verifier/src/lib.rs +++ b/core/lib/contract_verifier/src/lib.rs @@ -1,6 +1,6 @@ use std::{ collections::HashMap, - path::Path, + path::{Path, PathBuf}, time::{Duration, Instant}, }; @@ -20,7 +20,7 @@ use zksync_types::{ }, Address, }; -use zksync_utils::workspace_dir_or_current_dir; +use zksync_utils::env::Workspace; use crate::{ error::ContractVerifierError, @@ -38,8 +38,8 @@ lazy_static! { static ref DEPLOYER_CONTRACT: Contract = zksync_contracts::deployer_contract(); } -fn home_path() -> &'static Path { - workspace_dir_or_current_dir() +fn home_path() -> PathBuf { + Workspace::locate().core() } #[derive(Debug)] diff --git a/core/lib/contracts/src/lib.rs b/core/lib/contracts/src/lib.rs index f10e557a642..f57649c9d69 100644 --- a/core/lib/contracts/src/lib.rs +++ b/core/lib/contracts/src/lib.rs @@ -16,7 +16,7 @@ use ethabi::{ }; use once_cell::sync::Lazy; use serde::{Deserialize, Serialize}; -use zksync_utils::{bytecode::hash_bytecode, bytes_to_be_words, workspace_dir_or_current_dir}; +use zksync_utils::{bytecode::hash_bytecode, bytes_to_be_words, env::Workspace}; pub mod test_contracts; @@ -64,8 +64,8 @@ const LOADNEXT_CONTRACT_FILE: &str = const LOADNEXT_SIMPLE_CONTRACT_FILE: &str = "etc/contracts-test-data/artifacts-zk/contracts/loadnext/loadnext_contract.sol/Foo.json"; -fn home_path() -> &'static Path { - workspace_dir_or_current_dir() +fn home_path() -> PathBuf { + Workspace::locate().core() } fn read_file_to_json_value(path: impl AsRef + std::fmt::Debug) -> serde_json::Value { diff --git a/core/lib/da_client/Cargo.toml b/core/lib/da_client/Cargo.toml index 589a077d4bf..a68d715eb57 100644 --- a/core/lib/da_client/Cargo.toml +++ b/core/lib/da_client/Cargo.toml @@ -12,9 +12,5 @@ categories.workspace = true [dependencies] serde = { workspace = true, features = ["derive"] } -tracing.workspace = true async-trait.workspace = true anyhow.workspace = true - -zksync_config.workspace = true -zksync_types.workspace = true diff --git a/core/lib/da_client/src/types.rs b/core/lib/da_client/src/types.rs index 2b15cbe905e..e7e4453d727 100644 --- a/core/lib/da_client/src/types.rs +++ b/core/lib/da_client/src/types.rs @@ -35,6 +35,12 @@ pub struct DispatchResponse { pub blob_id: String, } +impl From for DispatchResponse { + fn from(blob_id: String) -> Self { + DispatchResponse { blob_id } + } +} + /// `InclusionData` is the data needed to verify on L1 that a blob is included in the DA layer. #[derive(Default, Serialize)] pub struct InclusionData { diff --git a/core/lib/dal/.sqlx/query-14c0caee921199f799400dbea719ed36420c15081ff5f60da0a1c769c2dbc542.json b/core/lib/dal/.sqlx/query-14c0caee921199f799400dbea719ed36420c15081ff5f60da0a1c769c2dbc542.json deleted file mode 100644 index 3baa610d7d7..00000000000 --- a/core/lib/dal/.sqlx/query-14c0caee921199f799400dbea719ed36420c15081ff5f60da0a1c769c2dbc542.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "\n SELECT\n genesis\n FROM\n consensus_replica_state\n WHERE\n fake_key\n ", - "describe": { - "columns": [ - { - "ordinal": 0, - "name": "genesis", - "type_info": "Jsonb" - } - ], - "parameters": { - "Left": [] - }, - "nullable": [ - true - ] - }, - "hash": "14c0caee921199f799400dbea719ed36420c15081ff5f60da0a1c769c2dbc542" -} diff --git a/core/lib/dal/.sqlx/query-17c760825deaa18fc8862c950dc38ff77f5a0d5dfcc7c3f1519f882d2fa60634.json b/core/lib/dal/.sqlx/query-17c760825deaa18fc8862c950dc38ff77f5a0d5dfcc7c3f1519f882d2fa60634.json new file mode 100644 index 00000000000..28a1e54230d --- /dev/null +++ b/core/lib/dal/.sqlx/query-17c760825deaa18fc8862c950dc38ff77f5a0d5dfcc7c3f1519f882d2fa60634.json @@ -0,0 +1,26 @@ +{ + "db_name": "PostgreSQL", + "query": "\n SELECT\n genesis,\n global_config\n FROM\n consensus_replica_state\n WHERE\n fake_key\n ", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "genesis", + "type_info": "Jsonb" + }, + { + "ordinal": 1, + "name": "global_config", + "type_info": "Jsonb" + } + ], + "parameters": { + "Left": [] + }, + "nullable": [ + true, + true + ] + }, + "hash": "17c760825deaa18fc8862c950dc38ff77f5a0d5dfcc7c3f1519f882d2fa60634" +} diff --git a/core/lib/dal/.sqlx/query-f87c50d37f78d6b3c5a752ea88799a1f6ee5a046ece2ef949aee7ab3d2549975.json b/core/lib/dal/.sqlx/query-1f43731fa0736a91ba8da41f52b6b22abb03e2a9b2d3b53dc858e5c5a08bfb85.json similarity index 51% rename from core/lib/dal/.sqlx/query-f87c50d37f78d6b3c5a752ea88799a1f6ee5a046ece2ef949aee7ab3d2549975.json rename to core/lib/dal/.sqlx/query-1f43731fa0736a91ba8da41f52b6b22abb03e2a9b2d3b53dc858e5c5a08bfb85.json index 38b88c316ee..3817369ecc1 100644 --- a/core/lib/dal/.sqlx/query-f87c50d37f78d6b3c5a752ea88799a1f6ee5a046ece2ef949aee7ab3d2549975.json +++ b/core/lib/dal/.sqlx/query-1f43731fa0736a91ba8da41f52b6b22abb03e2a9b2d3b53dc858e5c5a08bfb85.json @@ -1,15 +1,16 @@ { "db_name": "PostgreSQL", - "query": "\n INSERT INTO\n consensus_replica_state (fake_key, genesis, state)\n VALUES\n (TRUE, $1, $2)\n ", + "query": "\n INSERT INTO\n consensus_replica_state (fake_key, global_config, genesis, state)\n VALUES\n (TRUE, $1, $2, $3)\n ", "describe": { "columns": [], "parameters": { "Left": [ + "Jsonb", "Jsonb", "Jsonb" ] }, "nullable": [] }, - "hash": "f87c50d37f78d6b3c5a752ea88799a1f6ee5a046ece2ef949aee7ab3d2549975" + "hash": "1f43731fa0736a91ba8da41f52b6b22abb03e2a9b2d3b53dc858e5c5a08bfb85" } diff --git a/core/lib/dal/.sqlx/query-d9d71913a116abf390c71f5229426306b02e328d7b1b69c495443bd2ca7f7510.json b/core/lib/dal/.sqlx/query-311d0357c22163b893dc91f2b080f2ede5e22b0bbd8bc910cb36a91ed992bde1.json similarity index 58% rename from core/lib/dal/.sqlx/query-d9d71913a116abf390c71f5229426306b02e328d7b1b69c495443bd2ca7f7510.json rename to core/lib/dal/.sqlx/query-311d0357c22163b893dc91f2b080f2ede5e22b0bbd8bc910cb36a91ed992bde1.json index a42fbe98ff2..cabe0a3dc55 100644 --- a/core/lib/dal/.sqlx/query-d9d71913a116abf390c71f5229426306b02e328d7b1b69c495443bd2ca7f7510.json +++ b/core/lib/dal/.sqlx/query-311d0357c22163b893dc91f2b080f2ede5e22b0bbd8bc910cb36a91ed992bde1.json @@ -1,6 +1,6 @@ { "db_name": "PostgreSQL", - "query": "\n INSERT INTO\n l1_batches_consensus (l1_batch_number, certificate, created_at, updated_at)\n VALUES\n ($1, $2, NOW(), NOW())\n ON CONFLICT (l1_batch_number) DO NOTHING\n ", + "query": "\n INSERT INTO\n l1_batches_consensus (l1_batch_number, certificate, updated_at, created_at)\n VALUES\n ($1, $2, NOW(), NOW())\n ", "describe": { "columns": [], "parameters": { @@ -11,5 +11,5 @@ }, "nullable": [] }, - "hash": "d9d71913a116abf390c71f5229426306b02e328d7b1b69c495443bd2ca7f7510" + "hash": "311d0357c22163b893dc91f2b080f2ede5e22b0bbd8bc910cb36a91ed992bde1" } diff --git a/core/lib/dal/.sqlx/query-65bbf852d677e1f00a04785374148aa4e4a804519bcf68e14c5bbb0f58939da1.json b/core/lib/dal/.sqlx/query-65bbf852d677e1f00a04785374148aa4e4a804519bcf68e14c5bbb0f58939da1.json new file mode 100644 index 00000000000..ec17f2e0b61 --- /dev/null +++ b/core/lib/dal/.sqlx/query-65bbf852d677e1f00a04785374148aa4e4a804519bcf68e14c5bbb0f58939da1.json @@ -0,0 +1,22 @@ +{ + "db_name": "PostgreSQL", + "query": "\n SELECT\n attesters\n FROM\n l1_batches_consensus_committees\n WHERE\n l1_batch_number = $1\n ", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "attesters", + "type_info": "Jsonb" + } + ], + "parameters": { + "Left": [ + "Int8" + ] + }, + "nullable": [ + false + ] + }, + "hash": "65bbf852d677e1f00a04785374148aa4e4a804519bcf68e14c5bbb0f58939da1" +} diff --git a/core/lib/dal/.sqlx/query-849d54b4cf9212010fb4e41ce8137978579ba22eec525912c4aeeb235c3b984c.json b/core/lib/dal/.sqlx/query-849d54b4cf9212010fb4e41ce8137978579ba22eec525912c4aeeb235c3b984c.json deleted file mode 100644 index 5130763af73..00000000000 --- a/core/lib/dal/.sqlx/query-849d54b4cf9212010fb4e41ce8137978579ba22eec525912c4aeeb235c3b984c.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "\n SELECT\n MAX(l1_batch_number) AS \"number\"\n FROM\n l1_batches_consensus\n ", - "describe": { - "columns": [ - { - "ordinal": 0, - "name": "number", - "type_info": "Int8" - } - ], - "parameters": { - "Left": [] - }, - "nullable": [ - null - ] - }, - "hash": "849d54b4cf9212010fb4e41ce8137978579ba22eec525912c4aeeb235c3b984c" -} diff --git a/core/lib/dal/.sqlx/query-883be3789994eac050df85056e4987e056c2bf423054e40236aba60f4d3b8a97.json b/core/lib/dal/.sqlx/query-883be3789994eac050df85056e4987e056c2bf423054e40236aba60f4d3b8a97.json new file mode 100644 index 00000000000..a59468bd516 --- /dev/null +++ b/core/lib/dal/.sqlx/query-883be3789994eac050df85056e4987e056c2bf423054e40236aba60f4d3b8a97.json @@ -0,0 +1,20 @@ +{ + "db_name": "PostgreSQL", + "query": "\n SELECT\n l1_batch_number\n FROM\n l1_batches_consensus\n ORDER BY\n l1_batch_number DESC\n LIMIT\n 1\n ", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "l1_batch_number", + "type_info": "Int8" + } + ], + "parameters": { + "Left": [] + }, + "nullable": [ + false + ] + }, + "hash": "883be3789994eac050df85056e4987e056c2bf423054e40236aba60f4d3b8a97" +} diff --git a/core/lib/dal/.sqlx/query-b313ab2b1e0a83136a202ea758c6d2b2e3f2497e6b5f26c72e220397cc0e62f7.json b/core/lib/dal/.sqlx/query-b313ab2b1e0a83136a202ea758c6d2b2e3f2497e6b5f26c72e220397cc0e62f7.json new file mode 100644 index 00000000000..356fd8e9d99 --- /dev/null +++ b/core/lib/dal/.sqlx/query-b313ab2b1e0a83136a202ea758c6d2b2e3f2497e6b5f26c72e220397cc0e62f7.json @@ -0,0 +1,15 @@ +{ + "db_name": "PostgreSQL", + "query": "\n INSERT INTO\n l1_batches_consensus_committees (l1_batch_number, attesters, updated_at)\n VALUES\n ($1, $2, NOW())\n ON CONFLICT (l1_batch_number) DO\n UPDATE\n SET\n l1_batch_number = $1,\n attesters = $2,\n updated_at = NOW()\n ", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Int8", + "Jsonb" + ] + }, + "nullable": [] + }, + "hash": "b313ab2b1e0a83136a202ea758c6d2b2e3f2497e6b5f26c72e220397cc0e62f7" +} diff --git a/core/lib/dal/migrations/20240829123456_add_l1_batches_consensus_committees.down.sql b/core/lib/dal/migrations/20240829123456_add_l1_batches_consensus_committees.down.sql new file mode 100644 index 00000000000..fee0b42079f --- /dev/null +++ b/core/lib/dal/migrations/20240829123456_add_l1_batches_consensus_committees.down.sql @@ -0,0 +1,3 @@ +ALTER TABLE consensus_replica_state DROP COLUMN global_config; + +DROP TABLE l1_batches_consensus_committees; diff --git a/core/lib/dal/migrations/20240829123456_add_l1_batches_consensus_committees.up.sql b/core/lib/dal/migrations/20240829123456_add_l1_batches_consensus_committees.up.sql new file mode 100644 index 00000000000..c31952b9646 --- /dev/null +++ b/core/lib/dal/migrations/20240829123456_add_l1_batches_consensus_committees.up.sql @@ -0,0 +1,8 @@ +ALTER TABLE consensus_replica_state + ADD COLUMN global_config JSONB NULL; + +CREATE TABLE l1_batches_consensus_committees ( + l1_batch_number BIGINT PRIMARY KEY REFERENCES l1_batches (number) ON DELETE CASCADE, + attesters JSONB NOT NULL, + updated_at TIMESTAMP NOT NULL +); diff --git a/core/lib/dal/src/consensus/mod.rs b/core/lib/dal/src/consensus/mod.rs index 658da6c7682..f0ef336bc54 100644 --- a/core/lib/dal/src/consensus/mod.rs +++ b/core/lib/dal/src/consensus/mod.rs @@ -22,6 +22,36 @@ use zksync_utils::{h256_to_u256, u256_to_h256}; use crate::models::{parse_h160, parse_h256}; +/// Global config of the consensus. +#[derive(Debug, PartialEq, Clone)] +pub struct GlobalConfig { + pub genesis: validator::Genesis, + pub registry_address: Option, +} + +impl ProtoFmt for GlobalConfig { + type Proto = proto::GlobalConfig; + + fn read(r: &Self::Proto) -> anyhow::Result { + Ok(Self { + genesis: read_required(&r.genesis).context("genesis")?, + registry_address: r + .registry_address + .as_ref() + .map(|a| parse_h160(a)) + .transpose() + .context("registry_address")?, + }) + } + + fn build(&self) -> Self::Proto { + Self::Proto { + genesis: Some(self.genesis.build()), + registry_address: self.registry_address.map(|a| a.as_bytes().to_vec()), + } + } +} + /// Global attestation status served by /// `attestationStatus` RPC. #[derive(Debug, PartialEq, Clone)] @@ -469,3 +499,24 @@ impl ProtoRepr for proto::Transaction { } } } + +impl ProtoRepr for proto::AttesterCommittee { + type Type = attester::Committee; + + fn read(&self) -> anyhow::Result { + let members: Vec<_> = self + .members + .iter() + .enumerate() + .map(|(i, m)| attester::WeightedAttester::read(m).context(i)) + .collect::>() + .context("members")?; + Self::Type::new(members) + } + + fn build(this: &Self::Type) -> Self { + Self { + members: this.iter().map(|x| x.build()).collect(), + } + } +} diff --git a/core/lib/dal/src/consensus/proto/mod.proto b/core/lib/dal/src/consensus/proto/mod.proto index ea0c12f1b5f..da9151f10f4 100644 --- a/core/lib/dal/src/consensus/proto/mod.proto +++ b/core/lib/dal/src/consensus/proto/mod.proto @@ -3,6 +3,7 @@ syntax = "proto3"; package zksync.dal; import "zksync/roles/validator.proto"; +import "zksync/roles/attester.proto"; message Payload { // zksync-era ProtocolVersionId @@ -117,6 +118,15 @@ message PaymasterParams { optional bytes paymaster_input = 2; // required } +message AttesterCommittee { + repeated roles.attester.WeightedAttester members = 1; // required +} + +message GlobalConfig { + optional roles.validator.Genesis genesis = 1; // required + optional bytes registry_address = 2; // optional; H160 +} + message AttestationStatus { optional roles.validator.GenesisHash genesis = 1; // required optional uint64 next_batch_to_attest = 2; // required diff --git a/core/lib/dal/src/consensus_dal.rs b/core/lib/dal/src/consensus_dal.rs index 8f05cb38177..2dca58e2a6a 100644 --- a/core/lib/dal/src/consensus_dal.rs +++ b/core/lib/dal/src/consensus_dal.rs @@ -1,5 +1,4 @@ use anyhow::Context as _; -use bigdecimal::Zero as _; use zksync_consensus_roles::{attester, validator}; use zksync_consensus_storage::{BlockStoreState, ReplicaState}; use zksync_db_connection::{ @@ -7,10 +6,10 @@ use zksync_db_connection::{ error::{DalError, DalResult, SqlxContext}, instrument::{InstrumentExt, Instrumented}, }; -use zksync_protobuf::ProtoFmt as _; +use zksync_protobuf::ProtoRepr as _; use zksync_types::L2BlockNumber; -pub use crate::consensus::{AttestationStatus, Payload}; +pub use crate::consensus::{proto, AttestationStatus, GlobalConfig, Payload}; use crate::{Core, CoreDal}; /// Storage access methods for `zksync_core::consensus` module. @@ -33,72 +32,77 @@ pub enum InsertCertificateError { } impl ConsensusDal<'_, '_> { - /// Fetches genesis. - pub async fn genesis(&mut self) -> DalResult> { - Ok(sqlx::query!( + /// Fetch consensus global config. + pub async fn global_config(&mut self) -> anyhow::Result> { + // global_config contains a superset of genesis information. + // genesis column is deprecated and will be removed once the main node + // is fully upgraded. + // For now we keep the information between both columns in sync. + let Some(row) = sqlx::query!( r#" SELECT - genesis + genesis, + global_config FROM consensus_replica_state WHERE fake_key "# ) - .try_map(|row| { - let Some(genesis) = row.genesis else { - return Ok(None); - }; - // Deserialize the json, but don't allow for unknown fields. - // We might encounter an unknown fields here in case if support for the previous - // consensus protocol version is removed before the migration to a new version - // is performed. The node should NOT operate in such a state. - Ok(Some( - validator::GenesisRaw::read( - &zksync_protobuf::serde::deserialize_proto_with_options( - &genesis, /*deny_unknown_fields=*/ true, - ) - .decode_column("genesis")?, - ) - .decode_column("genesis")? - .with_hash(), - )) - }) - .instrument("genesis") + .instrument("global_config") .fetch_optional(self.storage) .await? - .flatten()) + else { + return Ok(None); + }; + if let Some(global_config) = row.global_config { + return Ok(Some( + zksync_protobuf::serde::deserialize(&global_config).context("global_config")?, + )); + } + if let Some(genesis) = row.genesis { + let genesis: validator::Genesis = + zksync_protobuf::serde::deserialize(&genesis).context("genesis")?; + return Ok(Some(GlobalConfig { + genesis, + registry_address: None, + })); + } + Ok(None) } - /// Attempts to update the genesis. + /// Attempts to update the global config. /// Fails if the new genesis is invalid. /// Fails if the new genesis has different `chain_id`. /// Fails if the storage contains a newer genesis (higher fork number). - /// Noop if the new genesis is the same as the current one. + /// Noop if the new global config is the same as the current one. /// Resets the stored consensus state otherwise and purges all certificates. - pub async fn try_update_genesis(&mut self, genesis: &validator::Genesis) -> anyhow::Result<()> { + pub async fn try_update_global_config(&mut self, want: &GlobalConfig) -> anyhow::Result<()> { let mut txn = self.storage.start_transaction().await?; - if let Some(got) = txn.consensus_dal().genesis().await? { + if let Some(got) = txn.consensus_dal().global_config().await? { // Exit if the genesis didn't change. - if &got == genesis { + if &got == want { return Ok(()); } anyhow::ensure!( - got.chain_id == genesis.chain_id, + got.genesis.chain_id == want.genesis.chain_id, "changing chain_id is not allowed: old = {:?}, new = {:?}", - got.chain_id, - genesis.chain_id, + got.genesis.chain_id, + want.genesis.chain_id, ); anyhow::ensure!( - got.fork_number < genesis.fork_number, + got.genesis.fork_number < want.genesis.fork_number, "transition to a past fork is not allowed: old = {:?}, new = {:?}", - got.fork_number, - genesis.fork_number, + got.genesis.fork_number, + want.genesis.fork_number, ); - genesis.verify().context("genesis.verify()")?; + want.genesis.verify().context("genesis.verify()")?; } let genesis = - zksync_protobuf::serde::serialize(genesis, serde_json::value::Serializer).unwrap(); + zksync_protobuf::serde::serialize(&want.genesis, serde_json::value::Serializer) + .unwrap(); + let global_config = + zksync_protobuf::serde::serialize(want, serde_json::value::Serializer).unwrap(); let state = zksync_protobuf::serde::serialize( &ReplicaState::default(), serde_json::value::Serializer, @@ -131,14 +135,15 @@ impl ConsensusDal<'_, '_> { sqlx::query!( r#" INSERT INTO - consensus_replica_state (fake_key, genesis, state) + consensus_replica_state (fake_key, global_config, genesis, state) VALUES - (TRUE, $1, $2) + (TRUE, $1, $2, $3) "#, + global_config, genesis, state, ) - .instrument("try_update_genesis#INSERT INTO consenuss_replica_state") + .instrument("try_update_global_config#INSERT INTO consensus_replica_state") .execute(&mut txn) .await?; txn.commit().await?; @@ -154,25 +159,33 @@ impl ConsensusDal<'_, '_> { .start_transaction() .await .context("start_transaction")?; - let Some(old) = txn.consensus_dal().genesis().await.context("genesis()")? else { + let Some(old) = txn + .consensus_dal() + .global_config() + .await + .context("global_config()")? + else { return Ok(()); }; - let new = validator::GenesisRaw { - chain_id: old.chain_id, - fork_number: old.fork_number.next(), - first_block: txn - .consensus_dal() - .next_block() - .await - .context("next_block()")?, - - protocol_version: old.protocol_version, - validators: old.validators.clone(), - attesters: old.attesters.clone(), - leader_selection: old.leader_selection.clone(), - } - .with_hash(); - txn.consensus_dal().try_update_genesis(&new).await?; + let new = GlobalConfig { + genesis: validator::GenesisRaw { + chain_id: old.genesis.chain_id, + fork_number: old.genesis.fork_number.next(), + first_block: txn + .consensus_dal() + .next_block() + .await + .context("next_block()")?, + + protocol_version: old.genesis.protocol_version, + validators: old.genesis.validators.clone(), + attesters: old.genesis.attesters.clone(), + leader_selection: old.genesis.leader_selection.clone(), + } + .with_hash(), + registry_address: old.registry_address, + }; + txn.consensus_dal().try_update_global_config(&new).await?; txn.commit().await?; Ok(()) } @@ -259,7 +272,12 @@ impl ConsensusDal<'_, '_> { /// so it might NOT be the certificate for the last L2 block. pub async fn block_certificates_range(&mut self) -> anyhow::Result { // It cannot be older than genesis first block. - let mut start = self.genesis().await?.context("genesis()")?.first_block; + let mut start = self + .global_config() + .await? + .context("genesis()")? + .genesis + .first_block; start = start.max(self.first_block().await.context("first_block()")?); let row = sqlx::query!( r#" @@ -422,21 +440,96 @@ impl ConsensusDal<'_, '_> { Ok(()) } + /// Persist the attester committee for the given batch. + pub async fn upsert_attester_committee( + &mut self, + number: attester::BatchNumber, + committee: &attester::Committee, + ) -> anyhow::Result<()> { + let committee = proto::AttesterCommittee::build(committee); + let committee = + zksync_protobuf::serde::serialize_proto(&committee, serde_json::value::Serializer) + .unwrap(); + sqlx::query!( + r#" + INSERT INTO + l1_batches_consensus_committees (l1_batch_number, attesters, updated_at) + VALUES + ($1, $2, NOW()) + ON CONFLICT (l1_batch_number) DO + UPDATE + SET + l1_batch_number = $1, + attesters = $2, + updated_at = NOW() + "#, + i64::try_from(number.0).context("overflow")?, + committee + ) + .instrument("upsert_attester_committee") + .report_latency() + .execute(self.storage) + .await?; + Ok(()) + } + + /// Fetches the attester committee for the L1 batch with the given number. + pub async fn attester_committee( + &mut self, + n: attester::BatchNumber, + ) -> anyhow::Result> { + let Some(row) = sqlx::query!( + r#" + SELECT + attesters + FROM + l1_batches_consensus_committees + WHERE + l1_batch_number = $1 + "#, + i64::try_from(n.0)? + ) + .instrument("attester_committee") + .report_latency() + .fetch_optional(self.storage) + .await? + else { + return Ok(None); + }; + let raw = zksync_protobuf::serde::deserialize_proto(&row.attesters) + .context("deserialize_proto()")?; + Ok(Some( + proto::AttesterCommittee::read(&raw).context("read()")?, + )) + } + /// Inserts a certificate for the L1 batch. /// Noop if a certificate for the same L1 batch is already present. - /// No verification is performed - it cannot be performed due to circular dependency on + /// Verification against previously stored attester committee is performed. + /// Batch hash is not verified - it cannot be performed due to circular dependency on /// `zksync_l1_contract_interface`. pub async fn insert_batch_certificate( &mut self, cert: &attester::BatchQC, ) -> anyhow::Result<()> { - let res = sqlx::query!( + let cfg = self + .global_config() + .await + .context("global_config()")? + .context("genesis is missing")?; + let committee = self + .attester_committee(cert.message.number) + .await + .context("attester_committee()")? + .context("attester committee is missing")?; + cert.verify(cfg.genesis.hash(), &committee) + .context("cert.verify()")?; + sqlx::query!( r#" INSERT INTO - l1_batches_consensus (l1_batch_number, certificate, created_at, updated_at) + l1_batches_consensus (l1_batch_number, certificate, updated_at, created_at) VALUES ($1, $2, NOW(), NOW()) - ON CONFLICT (l1_batch_number) DO NOTHING "#, i64::try_from(cert.message.number.0).context("overflow")?, // Unwrap is ok, because serialization should always succeed. @@ -446,9 +539,6 @@ impl ConsensusDal<'_, '_> { .report_latency() .execute(self.storage) .await?; - if res.rows_affected().is_zero() { - tracing::debug!(l1_batch_number = ?cert.message.number, "duplicate batch certificate"); - } Ok(()) } @@ -457,24 +547,28 @@ impl ConsensusDal<'_, '_> { pub async fn last_batch_certificate_number( &mut self, ) -> anyhow::Result> { - let row = sqlx::query!( + let Some(row) = sqlx::query!( r#" SELECT - MAX(l1_batch_number) AS "number" + l1_batch_number FROM l1_batches_consensus + ORDER BY + l1_batch_number DESC + LIMIT + 1 "# ) .instrument("last_batch_certificate_number") .report_latency() - .fetch_one(self.storage) - .await?; - - let Some(n) = row.number else { + .fetch_optional(self.storage) + .await? + else { return Ok(None); }; + Ok(Some(attester::BatchNumber( - n.try_into().context("overflow")?, + row.l1_batch_number.try_into().context("overflow")?, ))) } @@ -529,7 +623,7 @@ impl ConsensusDal<'_, '_> { /// This is a main node only query. /// ENs should call the attestation_status RPC of the main node. pub async fn attestation_status(&mut self) -> anyhow::Result> { - let Some(genesis) = self.genesis().await.context("genesis()")? else { + let Some(cfg) = self.global_config().await.context("genesis()")? else { return Ok(None); }; let Some(next_batch_to_attest) = async { @@ -542,18 +636,21 @@ impl ConsensusDal<'_, '_> { return Ok(Some(last + 1)); } // Otherwise start with the batch containing the first block of the fork. - self.batch_of_block(genesis.first_block) + self.batch_of_block(cfg.genesis.first_block) .await .context("batch_of_block()") } .await? else { - tracing::info!(%genesis.first_block, "genesis block not found"); + tracing::info!(%cfg.genesis.first_block, "genesis block not found"); return Ok(None); }; Ok(Some(AttestationStatus { - genesis: genesis.hash(), - next_batch_to_attest, + genesis: cfg.genesis.hash(), + // We never attest batch 0 for technical reasons: + // * it is not supported to read state before batch 0. + // * the registry contract needs to be deployed before we can start operating on it + next_batch_to_attest: next_batch_to_attest.max(attester::BatchNumber(1)), })) } } @@ -563,8 +660,9 @@ mod tests { use rand::Rng as _; use zksync_consensus_roles::{attester, validator}; use zksync_consensus_storage::ReplicaState; - use zksync_types::{L1BatchNumber, ProtocolVersion}; + use zksync_types::ProtocolVersion; + use super::GlobalConfig; use crate::{ tests::{create_l1_batch_header, create_l2_block_header}, ConnectionPool, Core, CoreDal, @@ -575,19 +673,22 @@ mod tests { let rng = &mut rand::thread_rng(); let pool = ConnectionPool::::test_pool().await; let mut conn = pool.connection().await.unwrap(); - assert_eq!(None, conn.consensus_dal().genesis().await.unwrap()); + assert_eq!(None, conn.consensus_dal().global_config().await.unwrap()); for n in 0..3 { let setup = validator::testonly::Setup::new(rng, 3); let mut genesis = (*setup.genesis).clone(); genesis.fork_number = validator::ForkNumber(n); - let genesis = genesis.with_hash(); + let cfg = GlobalConfig { + genesis: genesis.with_hash(), + registry_address: Some(rng.gen()), + }; conn.consensus_dal() - .try_update_genesis(&genesis) + .try_update_global_config(&cfg) .await .unwrap(); assert_eq!( - genesis, - conn.consensus_dal().genesis().await.unwrap().unwrap() + cfg, + conn.consensus_dal().global_config().await.unwrap().unwrap() ); assert_eq!( ReplicaState::default(), @@ -597,8 +698,8 @@ mod tests { let want: ReplicaState = rng.gen(); conn.consensus_dal().set_replica_state(&want).await.unwrap(); assert_eq!( - genesis, - conn.consensus_dal().genesis().await.unwrap().unwrap() + cfg, + conn.consensus_dal().global_config().await.unwrap().unwrap() ); assert_eq!(want, conn.consensus_dal().replica_state().await.unwrap()); } @@ -608,14 +709,32 @@ mod tests { #[tokio::test] async fn test_batch_certificate() { let rng = &mut rand::thread_rng(); + let setup = validator::testonly::Setup::new(rng, 3); let pool = ConnectionPool::::test_pool().await; let mut conn = pool.connection().await.unwrap(); + let cfg = GlobalConfig { + genesis: setup.genesis.clone(), + registry_address: Some(rng.gen()), + }; + conn.consensus_dal() + .try_update_global_config(&cfg) + .await + .unwrap(); - let mut mock_batch_qc = |number: L1BatchNumber| { - let mut cert: attester::BatchQC = rng.gen(); - cert.message.number.0 = u64::from(number.0); - cert.signatures.add(rng.gen(), rng.gen()); - cert + let mut make_cert = |number: attester::BatchNumber| { + let m = attester::Batch { + genesis: setup.genesis.hash(), + hash: rng.gen(), + number, + }; + let mut sigs = attester::MultiSig::default(); + for k in &setup.attester_keys { + sigs.add(k.public(), k.sign_msg(m.clone()).sig); + } + attester::BatchQC { + message: m, + signatures: sigs, + } }; // Required for inserting l2 blocks @@ -627,8 +746,7 @@ mod tests { // Insert some mock L2 blocks and L1 batches let mut block_number = 0; let mut batch_number = 0; - let num_batches = 3; - for _ in 0..num_batches { + for _ in 0..3 { for _ in 0..3 { block_number += 1; let l2_block = create_l2_block_header(block_number); @@ -636,64 +754,56 @@ mod tests { } batch_number += 1; let l1_batch = create_l1_batch_header(batch_number); - conn.blocks_dal() .insert_mock_l1_batch(&l1_batch) .await .unwrap(); - conn.blocks_dal() .mark_l2_blocks_as_executed_in_l1_batch(l1_batch.number) .await .unwrap(); } - let l1_batch_number = L1BatchNumber(batch_number); + let n = attester::BatchNumber(batch_number.into()); // Insert a batch certificate for the last L1 batch. - let cert1 = mock_batch_qc(l1_batch_number); - + let want = make_cert(n); conn.consensus_dal() - .insert_batch_certificate(&cert1) + .upsert_attester_committee(n, setup.genesis.attesters.as_ref().unwrap()) .await .unwrap(); - - // Try insert duplicate batch certificate for the same batch. - let cert2 = mock_batch_qc(l1_batch_number); - conn.consensus_dal() - .insert_batch_certificate(&cert2) + .insert_batch_certificate(&want) .await .unwrap(); + // Reinserting a cert should fail. + assert!(conn + .consensus_dal() + .insert_batch_certificate(&make_cert(n)) + .await + .is_err()); + // Retrieve the latest certificate. - let number = conn + let got_n = conn .consensus_dal() .last_batch_certificate_number() .await .unwrap() .unwrap(); - - let cert = conn + let got = conn .consensus_dal() - .batch_certificate(number) + .batch_certificate(got_n) .await .unwrap() .unwrap(); - - assert_eq!(cert, cert1, "duplicates are ignored"); + assert_eq!(got, want); // Try insert batch certificate for non-existing batch - let cert3 = mock_batch_qc(l1_batch_number.next()); - conn.consensus_dal() - .insert_batch_certificate(&cert3) - .await - .expect_err("missing payload"); - - // Insert one more L1 batch without a certificate. - conn.blocks_dal() - .insert_mock_l1_batch(&create_l1_batch_header(batch_number + 1)) + assert!(conn + .consensus_dal() + .insert_batch_certificate(&make_cert(n.next())) .await - .unwrap(); + .is_err()); } } diff --git a/core/lib/db_connection/Cargo.toml b/core/lib/db_connection/Cargo.toml index fa5bb0b20af..fb535d58232 100644 --- a/core/lib/db_connection/Cargo.toml +++ b/core/lib/db_connection/Cargo.toml @@ -12,7 +12,6 @@ categories.workspace = true [dependencies] zksync_basic_types.workspace = true -zksync_health_check.workspace = true serde = { workspace = true, features = ["derive"] } serde_json.workspace = true diff --git a/core/lib/default_da_clients/Cargo.toml b/core/lib/default_da_clients/Cargo.toml deleted file mode 100644 index 737d209aed3..00000000000 --- a/core/lib/default_da_clients/Cargo.toml +++ /dev/null @@ -1,25 +0,0 @@ -[package] -name = "zksync_default_da_clients" -description = "ZKsync DA client implementations" -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] -serde = { workspace = true, features = ["derive"] } -tracing.workspace = true -async-trait.workspace = true -anyhow.workspace = true -flate2.workspace = true - -zksync_config.workspace = true -zksync_types.workspace = true -zksync_object_store.workspace = true -zksync_da_client.workspace = true -zksync_node_framework.workspace = true -zksync_env_config.workspace = true diff --git a/core/lib/default_da_clients/README.md b/core/lib/default_da_clients/README.md deleted file mode 100644 index 17ced715b26..00000000000 --- a/core/lib/default_da_clients/README.md +++ /dev/null @@ -1,11 +0,0 @@ -# Default DA Clients - -This crate contains the default implementations of the Data Availability clients. Default clients are maintained within -this repo because they are tightly coupled with the codebase, and would cause the circular dependency if they were to be -moved to the [hyperchain-da](https://github.com/matter-labs/hyperchain-da) repository. - -Currently, the following DataAvailability clients are implemented: - -- `NoDA client` that does not send or store any pubdata, it is needed to run the zkSync network in the "no-DA" mode - utilizing the DA framework. -- `Object Store client` that stores the pubdata in the Object Store(GCS). diff --git a/core/lib/default_da_clients/src/no_da/mod.rs b/core/lib/default_da_clients/src/no_da/mod.rs deleted file mode 100644 index 814cf30c2cb..00000000000 --- a/core/lib/default_da_clients/src/no_da/mod.rs +++ /dev/null @@ -1,2 +0,0 @@ -pub mod client; -pub mod wiring_layer; diff --git a/core/lib/default_da_clients/src/object_store/config.rs b/core/lib/default_da_clients/src/object_store/config.rs deleted file mode 100644 index 285c39827c7..00000000000 --- a/core/lib/default_da_clients/src/object_store/config.rs +++ /dev/null @@ -1,12 +0,0 @@ -use zksync_config::ObjectStoreConfig; -use zksync_env_config::envy_load; - -#[derive(Debug)] -pub struct DAObjectStoreConfig(pub ObjectStoreConfig); - -impl DAObjectStoreConfig { - pub fn from_env() -> anyhow::Result { - let config = envy_load("object_store", "DA_CLIENT_OBJECT_STORE_")?; - Ok(Self(config)) - } -} diff --git a/core/lib/default_da_clients/src/object_store/mod.rs b/core/lib/default_da_clients/src/object_store/mod.rs deleted file mode 100644 index 1600941b057..00000000000 --- a/core/lib/default_da_clients/src/object_store/mod.rs +++ /dev/null @@ -1,4 +0,0 @@ -pub mod client; -pub mod config; -mod types; -pub mod wiring_layer; diff --git a/core/lib/default_da_clients/src/object_store/types.rs b/core/lib/default_da_clients/src/object_store/types.rs deleted file mode 100644 index b8ec9303e71..00000000000 --- a/core/lib/default_da_clients/src/object_store/types.rs +++ /dev/null @@ -1,38 +0,0 @@ -use std::io::{Read, Write}; - -use flate2::{read::GzDecoder, write::GzEncoder, Compression}; -use zksync_object_store::{Bucket, StoredObject, _reexports::BoxedError}; -use zksync_types::L1BatchNumber; - -/// Used as a wrapper for the pubdata to be stored in the GCS. -#[derive(Debug)] -pub struct StorablePubdata { - pub data: Vec, -} - -impl StoredObject for StorablePubdata { - const BUCKET: Bucket = Bucket::DataAvailability; - type Key<'a> = L1BatchNumber; - - fn encode_key(key: Self::Key<'_>) -> String { - format!("l1_batch_{key}_pubdata.gzip") - } - - fn serialize(&self) -> Result, BoxedError> { - let mut encoder = GzEncoder::new(Vec::new(), Compression::default()); - encoder.write_all(&self.data[..])?; - encoder.finish().map_err(From::from) - } - - fn deserialize(bytes: Vec) -> Result { - let mut decoder = GzDecoder::new(&bytes[..]); - let mut decompressed_bytes = Vec::new(); - decoder - .read_to_end(&mut decompressed_bytes) - .map_err(BoxedError::from)?; - - Ok(Self { - data: decompressed_bytes, - }) - } -} diff --git a/core/lib/env_config/src/contracts.rs b/core/lib/env_config/src/contracts.rs index 3365f56add7..298c43b80cc 100644 --- a/core/lib/env_config/src/contracts.rs +++ b/core/lib/env_config/src/contracts.rs @@ -89,6 +89,7 @@ CONTRACTS_L2_ERC20_BRIDGE_ADDR="0x8656770FA78c830456B00B4fFCeE6b1De0e1b888" CONTRACTS_L1_WETH_BRIDGE_PROXY_ADDR="0x8656770FA78c830456B00B4fFCeE6b1De0e1b888" CONTRACTS_L2_WETH_BRIDGE_ADDR="0x8656770FA78c830456B00B4fFCeE6b1De0e1b888" CONTRACTS_L2_TESTNET_PAYMASTER_ADDR="FC073319977e314F251EAE6ae6bE76B0B3BAeeCF" +CONTRACTS_L2_CONSENSUS_REGISTRY_ADDR="D64e136566a9E04eb05B30184fF577F52682D182" CONTRACTS_L1_MULTICALL3_ADDR="0xcA11bde05977b3631167028862bE2a173976CA11" CONTRACTS_L1_SHARED_BRIDGE_PROXY_ADDR="0x8656770FA78c830456B00B4fFCeE6b1De0e1b888" CONTRACTS_L2_SHARED_BRIDGE_ADDR="0x8656770FA78c830456B00B4fFCeE6b1De0e1b888" diff --git a/core/lib/env_config/src/da_client.rs b/core/lib/env_config/src/da_client.rs new file mode 100644 index 00000000000..32c47dfc62b --- /dev/null +++ b/core/lib/env_config/src/da_client.rs @@ -0,0 +1,119 @@ +use zksync_config::configs::da_client::{ + DAClient, DAClientConfig, AVAIL_CLIENT_CONFIG_NAME, EIGENDA_CLIENT_CONFIG_NAME, + OBJECT_STORE_CLIENT_CONFIG_NAME, +}; + +use crate::{envy_load, FromEnv}; + +impl FromEnv for DAClientConfig { + fn from_env() -> anyhow::Result { + let client_tag = std::env::var("DA_CLIENT")?; + let client = match client_tag.as_str() { + AVAIL_CLIENT_CONFIG_NAME => DAClient::Avail(envy_load("da_avail_config", "DA_")?), + OBJECT_STORE_CLIENT_CONFIG_NAME => { + DAClient::ObjectStore(envy_load("da_object_store", "DA_")?) + } + EIGENDA_CLIENT_CONFIG_NAME => { + DAClient::EigenDA(envy_load("eigen_da_client", "EIGEN_DA_CLIENT_")?) + } + _ => anyhow::bail!("Unknown DA client name: {}", client_tag), + }; + + Ok(Self { client }) + } +} + +#[cfg(test)] +mod tests { + use zksync_config::{ + configs::{ + da_client::{DAClient, DAClient::ObjectStore}, + object_store::ObjectStoreMode::GCS, + }, + AvailConfig, DAClientConfig, ObjectStoreConfig, + }; + + use super::*; + use crate::test_utils::EnvMutex; + + static MUTEX: EnvMutex = EnvMutex::new(); + + fn expected_object_store_da_client_config(url: String, max_retries: u16) -> DAClientConfig { + DAClientConfig { + client: ObjectStore(ObjectStoreConfig { + mode: GCS { + bucket_base_url: url, + }, + max_retries, + local_mirror_path: None, + }), + } + } + + #[test] + fn from_env_object_store() { + let mut lock = MUTEX.lock(); + let config = r#" + DA_CLIENT="ObjectStore" + + DA_BUCKET_BASE_URL="sometestpath" + DA_MODE="GCS" + DA_MAX_RETRIES="5" + "#; + lock.set_env(config); + let actual = DAClientConfig::from_env().unwrap(); + assert_eq!( + actual, + expected_object_store_da_client_config("sometestpath".to_string(), 5) + ); + } + + fn expected_avail_da_layer_config( + api_node_url: &str, + bridge_api_url: &str, + seed: &str, + app_id: u32, + timeout: usize, + max_retries: usize, + ) -> DAClientConfig { + DAClientConfig { + client: DAClient::Avail(AvailConfig { + api_node_url: api_node_url.to_string(), + bridge_api_url: bridge_api_url.to_string(), + seed: seed.to_string(), + app_id, + timeout, + max_retries, + }), + } + } + + #[test] + fn from_env_avail_client() { + let mut lock = MUTEX.lock(); + let config = r#" + DA_CLIENT="Avail" + DA_API_NODE_URL="localhost:12345" + DA_BRIDGE_API_URL="localhost:54321" + DA_SEED="bottom drive obey lake curtain smoke basket hold race lonely fit walk" + DA_APP_ID="1" + DA_TIMEOUT="2" + DA_MAX_RETRIES="3" + "#; + + lock.set_env(config); + + let actual = DAClientConfig::from_env().unwrap(); + assert_eq!( + actual, + expected_avail_da_layer_config( + "localhost:12345", + "localhost:54321", + "bottom drive obey lake curtain smoke basket hold race lonely fit walk", + "1".parse::().unwrap(), + "2".parse::().unwrap(), + "3".parse::().unwrap(), + ) + ); + } +} diff --git a/core/lib/env_config/src/lib.rs b/core/lib/env_config/src/lib.rs index 8cfa7b58a31..b72c2c5d5b9 100644 --- a/core/lib/env_config/src/lib.rs +++ b/core/lib/env_config/src/lib.rs @@ -32,6 +32,8 @@ mod test_utils; mod vm_runner; mod wallets; +mod da_client; + pub trait FromEnv: Sized { fn from_env() -> anyhow::Result; } diff --git a/core/lib/multivm/src/tracers/mod.rs b/core/lib/multivm/src/tracers/mod.rs index 69501cf3988..35224d993a1 100644 --- a/core/lib/multivm/src/tracers/mod.rs +++ b/core/lib/multivm/src/tracers/mod.rs @@ -1,11 +1,6 @@ pub use self::{ - call_tracer::CallTracer, - multivm_dispatcher::TracerDispatcher, - prestate_tracer::PrestateTracer, - storage_invocation::StorageInvocations, - validator::{ - ValidationError, ValidationTracer, ValidationTracerParams, ViolatedValidationRule, - }, + call_tracer::CallTracer, multivm_dispatcher::TracerDispatcher, prestate_tracer::PrestateTracer, + storage_invocation::StorageInvocations, validator::ValidationTracer, }; mod call_tracer; diff --git a/core/lib/multivm/src/tracers/validator/mod.rs b/core/lib/multivm/src/tracers/validator/mod.rs index 307256792cf..a1573f24c66 100644 --- a/core/lib/multivm/src/tracers/validator/mod.rs +++ b/core/lib/multivm/src/tracers/validator/mod.rs @@ -11,10 +11,12 @@ use zksync_types::{ use zksync_utils::{be_bytes_to_safe_address, u256_to_account_address, u256_to_h256}; use self::types::{NewTrustedValidationItems, ValidationTracerMode}; -pub use self::types::{ValidationError, ValidationTracerParams, ViolatedValidationRule}; use crate::{ glue::tracers::IntoOldVmTracer, - interface::storage::{StoragePtr, WriteStorage}, + interface::{ + storage::{StoragePtr, WriteStorage}, + tracer::{ValidationParams, ViolatedValidationRule}, + }, }; mod types; @@ -50,7 +52,7 @@ type ValidationRoundResult = Result ValidationTracer { pub fn new( - params: ValidationTracerParams, + params: ValidationParams, vm_version: VmVersion, ) -> (Self, Arc>) { let result = Arc::new(OnceCell::new()); @@ -179,8 +181,8 @@ impl ValidationTracer { } } - pub fn params(&self) -> ValidationTracerParams { - ValidationTracerParams { + pub fn params(&self) -> ValidationParams { + ValidationParams { user_address: self.user_address, paymaster_address: self.paymaster_address, trusted_slots: self.trusted_slots.clone(), diff --git a/core/lib/multivm/src/tracers/validator/types.rs b/core/lib/multivm/src/tracers/validator/types.rs index 418d2b89350..b9d44227992 100644 --- a/core/lib/multivm/src/tracers/validator/types.rs +++ b/core/lib/multivm/src/tracers/validator/types.rs @@ -1,9 +1,4 @@ -use std::{collections::HashSet, fmt, fmt::Display}; - -use zksync_types::{Address, H256, U256}; -use zksync_utils::u256_to_h256; - -use crate::interface::Halt; +use zksync_types::{Address, H256}; #[derive(Debug, Clone, Eq, PartialEq, Copy)] #[allow(clippy::enum_variant_names)] @@ -21,72 +16,3 @@ pub(super) struct NewTrustedValidationItems { pub(super) new_allowed_slots: Vec, pub(super) new_trusted_addresses: Vec
, } - -#[derive(Debug, Clone)] -pub struct ValidationTracerParams { - pub user_address: Address, - pub paymaster_address: Address, - /// Slots that are trusted (i.e. the user can access them). - pub trusted_slots: HashSet<(Address, U256)>, - /// Trusted addresses (the user can access any slots on these addresses). - pub trusted_addresses: HashSet
, - /// Slots, that are trusted and the value of them is the new trusted address. - /// They are needed to work correctly with beacon proxy, where the address of the implementation is - /// stored in the beacon. - pub trusted_address_slots: HashSet<(Address, U256)>, - /// Number of computational gas that validation step is allowed to use. - pub computational_gas_limit: u32, -} - -#[derive(Debug, Clone)] -pub enum ViolatedValidationRule { - TouchedUnallowedStorageSlots(Address, U256), - CalledContractWithNoCode(Address), - TouchedUnallowedContext, - TookTooManyComputationalGas(u32), -} - -impl fmt::Display for ViolatedValidationRule { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - match self { - ViolatedValidationRule::TouchedUnallowedStorageSlots(contract, key) => write!( - f, - "Touched unallowed storage slots: address {}, key: {}", - hex::encode(contract), - hex::encode(u256_to_h256(*key)) - ), - ViolatedValidationRule::CalledContractWithNoCode(contract) => { - write!(f, "Called contract with no code: {}", hex::encode(contract)) - } - ViolatedValidationRule::TouchedUnallowedContext => { - write!(f, "Touched unallowed context") - } - ViolatedValidationRule::TookTooManyComputationalGas(gas_limit) => { - write!( - f, - "Took too many computational gas, allowed limit: {}", - gas_limit - ) - } - } - } -} - -#[derive(Debug, Clone)] -pub enum ValidationError { - FailedTx(Halt), - ViolatedRule(ViolatedValidationRule), -} - -impl Display for ValidationError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - match self { - Self::FailedTx(revert_reason) => { - write!(f, "Validation revert: {}", revert_reason) - } - Self::ViolatedRule(rule) => { - write!(f, "Violated validation rules: {}", rule) - } - } - } -} diff --git a/core/lib/multivm/src/tracers/validator/vm_1_4_1/mod.rs b/core/lib/multivm/src/tracers/validator/vm_1_4_1/mod.rs index 2beca41fb48..d1ddb2b44c8 100644 --- a/core/lib/multivm/src/tracers/validator/vm_1_4_1/mod.rs +++ b/core/lib/multivm/src/tracers/validator/vm_1_4_1/mod.rs @@ -9,13 +9,13 @@ use zksync_utils::{h256_to_account_address, u256_to_account_address, u256_to_h25 use crate::{ interface::{ storage::{StoragePtr, WriteStorage}, - tracer::{TracerExecutionStatus, TracerExecutionStopReason}, + tracer::{TracerExecutionStatus, TracerExecutionStopReason, ViolatedValidationRule}, Halt, }, tracers::{ dynamic::vm_1_4_1::DynTracer, validator::{ - types::{NewTrustedValidationItems, ValidationTracerMode, ViolatedValidationRule}, + types::{NewTrustedValidationItems, ValidationTracerMode}, ValidationRoundResult, ValidationTracer, }, }, @@ -88,7 +88,7 @@ impl ValidationTracer { Opcode::Context(context) => { match context { ContextOpcode::Meta => { - return Err(ViolatedValidationRule::TouchedUnallowedContext); + return Err(ViolatedValidationRule::TouchedDisallowedContext); } ContextOpcode::ErgsLeft => { // TODO (SMA-1168): implement the correct restrictions for the gas left opcode. @@ -102,7 +102,7 @@ impl ValidationTracer { let msg_sender = state.vm_local_state.callstack.current.msg_sender; if !self.is_allowed_storage_read(storage.clone(), this_address, key, msg_sender) { - return Err(ViolatedValidationRule::TouchedUnallowedStorageSlots( + return Err(ViolatedValidationRule::TouchedDisallowedStorageSlots( this_address, key, )); diff --git a/core/lib/multivm/src/tracers/validator/vm_1_4_2/mod.rs b/core/lib/multivm/src/tracers/validator/vm_1_4_2/mod.rs index 3394a6c3f2b..a51644ff9ea 100644 --- a/core/lib/multivm/src/tracers/validator/vm_1_4_2/mod.rs +++ b/core/lib/multivm/src/tracers/validator/vm_1_4_2/mod.rs @@ -9,13 +9,13 @@ use zksync_utils::{h256_to_account_address, u256_to_account_address, u256_to_h25 use crate::{ interface::{ storage::{StoragePtr, WriteStorage}, - tracer::{TracerExecutionStatus, TracerExecutionStopReason}, + tracer::{TracerExecutionStatus, TracerExecutionStopReason, ViolatedValidationRule}, Halt, }, tracers::{ dynamic::vm_1_4_1::DynTracer, validator::{ - types::{NewTrustedValidationItems, ValidationTracerMode, ViolatedValidationRule}, + types::{NewTrustedValidationItems, ValidationTracerMode}, ValidationRoundResult, ValidationTracer, }, }, @@ -88,7 +88,7 @@ impl ValidationTracer { Opcode::Context(context) => { match context { ContextOpcode::Meta => { - return Err(ViolatedValidationRule::TouchedUnallowedContext); + return Err(ViolatedValidationRule::TouchedDisallowedContext); } ContextOpcode::ErgsLeft => { // TODO (SMA-1168): implement the correct restrictions for the gas left opcode. @@ -102,7 +102,7 @@ impl ValidationTracer { let msg_sender = state.vm_local_state.callstack.current.msg_sender; if !self.is_allowed_storage_read(storage.clone(), this_address, key, msg_sender) { - return Err(ViolatedValidationRule::TouchedUnallowedStorageSlots( + return Err(ViolatedValidationRule::TouchedDisallowedStorageSlots( this_address, key, )); diff --git a/core/lib/multivm/src/tracers/validator/vm_boojum_integration/mod.rs b/core/lib/multivm/src/tracers/validator/vm_boojum_integration/mod.rs index 53b5bf04d2e..7f9767a5e63 100644 --- a/core/lib/multivm/src/tracers/validator/vm_boojum_integration/mod.rs +++ b/core/lib/multivm/src/tracers/validator/vm_boojum_integration/mod.rs @@ -9,13 +9,13 @@ use zksync_utils::{h256_to_account_address, u256_to_account_address, u256_to_h25 use crate::{ interface::{ storage::{StoragePtr, WriteStorage}, - tracer::{TracerExecutionStatus, TracerExecutionStopReason}, + tracer::{TracerExecutionStatus, TracerExecutionStopReason, ViolatedValidationRule}, Halt, }, tracers::{ dynamic::vm_1_4_0::DynTracer, validator::{ - types::{NewTrustedValidationItems, ValidationTracerMode, ViolatedValidationRule}, + types::{NewTrustedValidationItems, ValidationTracerMode}, ValidationRoundResult, ValidationTracer, }, }, @@ -88,7 +88,7 @@ impl ValidationTracer { Opcode::Context(context) => { match context { ContextOpcode::Meta => { - return Err(ViolatedValidationRule::TouchedUnallowedContext); + return Err(ViolatedValidationRule::TouchedDisallowedContext); } ContextOpcode::ErgsLeft => { // TODO (SMA-1168): implement the correct restrictions for the gas left opcode. @@ -102,7 +102,7 @@ impl ValidationTracer { let msg_sender = state.vm_local_state.callstack.current.msg_sender; if !self.is_allowed_storage_read(storage.clone(), this_address, key, msg_sender) { - return Err(ViolatedValidationRule::TouchedUnallowedStorageSlots( + return Err(ViolatedValidationRule::TouchedDisallowedStorageSlots( this_address, key, )); diff --git a/core/lib/multivm/src/tracers/validator/vm_latest/mod.rs b/core/lib/multivm/src/tracers/validator/vm_latest/mod.rs index e963c79f4e4..c206bd6fb2a 100644 --- a/core/lib/multivm/src/tracers/validator/vm_latest/mod.rs +++ b/core/lib/multivm/src/tracers/validator/vm_latest/mod.rs @@ -9,13 +9,13 @@ use zksync_utils::{h256_to_account_address, u256_to_account_address, u256_to_h25 use crate::{ interface::{ storage::{StoragePtr, WriteStorage}, - tracer::{TracerExecutionStatus, TracerExecutionStopReason}, + tracer::{TracerExecutionStatus, TracerExecutionStopReason, ViolatedValidationRule}, Halt, }, tracers::{ dynamic::vm_1_5_0::DynTracer, validator::{ - types::{NewTrustedValidationItems, ValidationTracerMode, ViolatedValidationRule}, + types::{NewTrustedValidationItems, ValidationTracerMode}, ValidationRoundResult, ValidationTracer, }, }, @@ -86,7 +86,7 @@ impl ValidationTracer { Opcode::Context(context) => { match context { ContextOpcode::Meta => { - return Err(ViolatedValidationRule::TouchedUnallowedContext); + return Err(ViolatedValidationRule::TouchedDisallowedContext); } ContextOpcode::ErgsLeft => { // TODO (SMA-1168): implement the correct restrictions for the gas left opcode. @@ -100,7 +100,7 @@ impl ValidationTracer { let msg_sender = state.vm_local_state.callstack.current.msg_sender; if !self.is_allowed_storage_read(storage.clone(), this_address, key, msg_sender) { - return Err(ViolatedValidationRule::TouchedUnallowedStorageSlots( + return Err(ViolatedValidationRule::TouchedDisallowedStorageSlots( this_address, key, )); diff --git a/core/lib/multivm/src/tracers/validator/vm_refunds_enhancement/mod.rs b/core/lib/multivm/src/tracers/validator/vm_refunds_enhancement/mod.rs index 6107125d14d..0badd7c5877 100644 --- a/core/lib/multivm/src/tracers/validator/vm_refunds_enhancement/mod.rs +++ b/core/lib/multivm/src/tracers/validator/vm_refunds_enhancement/mod.rs @@ -9,13 +9,13 @@ use zksync_utils::{h256_to_account_address, u256_to_account_address, u256_to_h25 use crate::{ interface::{ storage::{StoragePtr, WriteStorage}, - tracer::{TracerExecutionStatus, TracerExecutionStopReason}, + tracer::{TracerExecutionStatus, TracerExecutionStopReason, ViolatedValidationRule}, Halt, }, tracers::{ dynamic::vm_1_3_3::DynTracer, validator::{ - types::{NewTrustedValidationItems, ValidationTracerMode, ViolatedValidationRule}, + types::{NewTrustedValidationItems, ValidationTracerMode}, ValidationRoundResult, ValidationTracer, }, }, @@ -88,7 +88,7 @@ impl ValidationTracer { Opcode::Context(context) => { match context { ContextOpcode::Meta => { - return Err(ViolatedValidationRule::TouchedUnallowedContext); + return Err(ViolatedValidationRule::TouchedDisallowedContext); } ContextOpcode::ErgsLeft => { // TODO (SMA-1168): implement the correct restrictions for the gas left opcode. @@ -102,7 +102,7 @@ impl ValidationTracer { let msg_sender = state.vm_local_state.callstack.current.msg_sender; if !self.is_allowed_storage_read(storage.clone(), this_address, key, msg_sender) { - return Err(ViolatedValidationRule::TouchedUnallowedStorageSlots( + return Err(ViolatedValidationRule::TouchedDisallowedStorageSlots( this_address, key, )); diff --git a/core/lib/multivm/src/tracers/validator/vm_virtual_blocks/mod.rs b/core/lib/multivm/src/tracers/validator/vm_virtual_blocks/mod.rs index bb166bedcda..86a639915c9 100644 --- a/core/lib/multivm/src/tracers/validator/vm_virtual_blocks/mod.rs +++ b/core/lib/multivm/src/tracers/validator/vm_virtual_blocks/mod.rs @@ -9,12 +9,13 @@ use zksync_utils::{h256_to_account_address, u256_to_account_address, u256_to_h25 use crate::{ interface::{ storage::{StoragePtr, WriteStorage}, + tracer::ViolatedValidationRule, VmExecutionResultAndLogs, }, tracers::{ dynamic::vm_1_3_3::DynTracer, validator::{ - types::{NewTrustedValidationItems, ValidationTracerMode, ViolatedValidationRule}, + types::{NewTrustedValidationItems, ValidationTracerMode}, ValidationRoundResult, ValidationTracer, }, }, @@ -87,7 +88,7 @@ impl ValidationTracer { Opcode::Context(context) => { match context { ContextOpcode::Meta => { - return Err(ViolatedValidationRule::TouchedUnallowedContext); + return Err(ViolatedValidationRule::TouchedDisallowedContext); } ContextOpcode::ErgsLeft => { // TODO (SMA-1168): implement the correct restrictions for the gas left opcode. @@ -101,7 +102,7 @@ impl ValidationTracer { let msg_sender = state.vm_local_state.callstack.current.msg_sender; if !self.is_allowed_storage_read(storage.clone(), this_address, key, msg_sender) { - return Err(ViolatedValidationRule::TouchedUnallowedStorageSlots( + return Err(ViolatedValidationRule::TouchedDisallowedStorageSlots( this_address, key, )); diff --git a/core/lib/protobuf_config/src/consensus.rs b/core/lib/protobuf_config/src/consensus.rs index b57f033d0d2..f5eb5c5b2f1 100644 --- a/core/lib/protobuf_config/src/consensus.rs +++ b/core/lib/protobuf_config/src/consensus.rs @@ -6,7 +6,7 @@ use zksync_config::configs::consensus::{ }; use zksync_protobuf::{kB, read_optional, repr::ProtoRepr, required, ProtoFmt}; -use crate::{proto::consensus as proto, read_optional_repr}; +use crate::{parse_h160, proto::consensus as proto, read_optional_repr}; impl ProtoRepr for proto::WeightedValidator { type Type = WeightedValidator; @@ -65,6 +65,12 @@ impl ProtoRepr for proto::GenesisSpec { .collect::>() .context("attesters")?, leader: ValidatorPublicKey(required(&self.leader).context("leader")?.clone()), + registry_address: self + .registry_address + .as_ref() + .map(|x| parse_h160(x)) + .transpose() + .context("registry_address")?, }) } fn build(this: &Self::Type) -> Self { @@ -74,6 +80,7 @@ impl ProtoRepr for proto::GenesisSpec { validators: this.validators.iter().map(ProtoRepr::build).collect(), attesters: this.attesters.iter().map(ProtoRepr::build).collect(), leader: Some(this.leader.0.clone()), + registry_address: this.registry_address.map(|a| format!("{:?}", a)), } } } diff --git a/core/lib/protobuf_config/src/da_client.rs b/core/lib/protobuf_config/src/da_client.rs new file mode 100644 index 00000000000..ba6b8a0695b --- /dev/null +++ b/core/lib/protobuf_config/src/da_client.rs @@ -0,0 +1,83 @@ +use anyhow::Context; +use zksync_config::{ + configs::{ + da_client::{ + eigen_da::EigenDAConfig, + DAClient::{Avail, EigenDA, ObjectStore}, + }, + {self}, + }, + AvailConfig, +}; +use zksync_protobuf::{required, ProtoRepr}; + +use crate::proto::{da_client as proto, object_store as object_store_proto}; + +impl ProtoRepr for proto::DataAvailabilityClient { + type Type = configs::DAClientConfig; + + fn read(&self) -> anyhow::Result { + let config = required(&self.config).context("config")?; + + let client = match config { + proto::data_availability_client::Config::Avail(conf) => Avail(AvailConfig { + api_node_url: required(&conf.api_node_url) + .context("api_node_url")? + .clone(), + bridge_api_url: required(&conf.bridge_api_url) + .context("bridge_api_url")? + .clone(), + seed: required(&conf.seed).context("seed")?.clone(), + app_id: *required(&conf.app_id).context("app_id")?, + timeout: *required(&conf.timeout).context("timeout")? as usize, + max_retries: *required(&conf.max_retries).context("max_retries")? as usize, + }), + proto::data_availability_client::Config::ObjectStore(conf) => { + ObjectStore(object_store_proto::ObjectStore::read(conf)?) + } + proto::data_availability_client::Config::EigenDa(conf) => EigenDA(EigenDAConfig { + api_node_url: required(&conf.api_node_url) + .context("api_node_url")? + .clone(), + custom_quorum_numbers: Some(conf.custom_quorum_numbers.clone()), + account_id: conf.account_id.clone(), + }), + }; + + Ok(configs::DAClientConfig { client }) + } + + fn build(this: &Self::Type) -> Self { + match &this.client { + Avail(config) => Self { + config: Some(proto::data_availability_client::Config::Avail( + proto::AvailConfig { + api_node_url: Some(config.api_node_url.clone()), + bridge_api_url: Some(config.bridge_api_url.clone()), + seed: Some(config.seed.clone()), + app_id: Some(config.app_id), + timeout: Some(config.timeout as u64), + max_retries: Some(config.max_retries as u64), + }, + )), + }, + ObjectStore(config) => Self { + config: Some(proto::data_availability_client::Config::ObjectStore( + object_store_proto::ObjectStore::build(config), + )), + }, + EigenDA(config) => Self { + config: Some(proto::data_availability_client::Config::EigenDa( + proto::EigenDaConfig { + api_node_url: Some(config.api_node_url.clone()), + custom_quorum_numbers: config + .custom_quorum_numbers + .clone() + .unwrap_or_default(), + account_id: config.account_id.clone(), + }, + )), + }, + } + } +} diff --git a/core/lib/protobuf_config/src/general.rs b/core/lib/protobuf_config/src/general.rs index 87bca88db38..b73539a0897 100644 --- a/core/lib/protobuf_config/src/general.rs +++ b/core/lib/protobuf_config/src/general.rs @@ -28,6 +28,7 @@ impl ProtoRepr for proto::GeneralConfig { eth: read_optional_repr(&self.eth), snapshot_creator: read_optional_repr(&self.snapshot_creator), observability: read_optional_repr(&self.observability), + da_client_config: read_optional_repr(&self.da_client), da_dispatcher_config: read_optional_repr(&self.da_dispatcher), protective_reads_writer_config: read_optional_repr(&self.protective_reads_writer), basic_witness_input_producer_config: read_optional_repr( @@ -76,6 +77,7 @@ impl ProtoRepr for proto::GeneralConfig { eth: this.eth.as_ref().map(ProtoRepr::build), snapshot_creator: this.snapshot_creator.as_ref().map(ProtoRepr::build), observability: this.observability.as_ref().map(ProtoRepr::build), + da_client: this.da_client_config.as_ref().map(ProtoRepr::build), da_dispatcher: this.da_dispatcher_config.as_ref().map(ProtoRepr::build), protective_reads_writer: this .protective_reads_writer_config diff --git a/core/lib/protobuf_config/src/lib.rs b/core/lib/protobuf_config/src/lib.rs index f4d0188ea20..a4822edbe8e 100644 --- a/core/lib/protobuf_config/src/lib.rs +++ b/core/lib/protobuf_config/src/lib.rs @@ -29,6 +29,7 @@ mod pruning; mod secrets; mod snapshots_creator; +mod da_client; mod external_price_api_client; mod external_proof_integration_api; mod prover_job_monitor; diff --git a/core/lib/protobuf_config/src/proto/config/da_client.proto b/core/lib/protobuf_config/src/proto/config/da_client.proto new file mode 100644 index 00000000000..9db95bf811b --- /dev/null +++ b/core/lib/protobuf_config/src/proto/config/da_client.proto @@ -0,0 +1,29 @@ +syntax = "proto3"; + +package zksync.config.da_client; + +import "zksync/config/object_store.proto"; + +message AvailConfig { + optional string api_node_url = 1; + optional string bridge_api_url = 2; + optional string seed = 3; + optional uint32 app_id = 4; + optional uint64 timeout = 5; + optional uint64 max_retries = 6; +} + +message EigenDaConfig { + optional string api_node_url = 1; + repeated uint32 custom_quorum_numbers = 2; + optional string account_id = 3; +} + +message DataAvailabilityClient { + // oneof in protobuf allows for None + oneof config { + AvailConfig avail = 1; + object_store.ObjectStore object_store = 2; + EigenDaConfig eigen_da = 3; + } +} diff --git a/core/lib/protobuf_config/src/proto/config/general.proto b/core/lib/protobuf_config/src/proto/config/general.proto index 3595468949b..ee70b61b18b 100644 --- a/core/lib/protobuf_config/src/proto/config/general.proto +++ b/core/lib/protobuf_config/src/proto/config/general.proto @@ -25,6 +25,7 @@ import "zksync/config/external_price_api_client.proto"; import "zksync/config/external_proof_integration_api.proto"; import "zksync/core/consensus.proto"; import "zksync/config/prover_job_monitor.proto"; +import "zksync/config/da_client.proto"; message GeneralConfig { optional database.Postgres postgres = 1; @@ -60,4 +61,5 @@ message GeneralConfig { optional external_proof_integration_api.ExternalProofIntegrationApi external_proof_integration_api = 43; optional experimental.Vm experimental_vm = 44; optional prover_job_monitor.ProverJobMonitor prover_job_monitor = 45; + optional da_client.DataAvailabilityClient da_client = 46; } diff --git a/core/lib/protobuf_config/src/proto/core/consensus.proto b/core/lib/protobuf_config/src/proto/core/consensus.proto index c64c993be7c..835ead1ab65 100644 --- a/core/lib/protobuf_config/src/proto/core/consensus.proto +++ b/core/lib/protobuf_config/src/proto/core/consensus.proto @@ -56,6 +56,8 @@ message GenesisSpec { repeated WeightedValidator validators = 3; // must be non-empty; validator committee. optional string leader = 4; // required; ValidatorPublicKey repeated WeightedAttester attesters = 5; // can be empty; attester committee. + // Currently not in consensus genesis, but still a part of the global configuration. + optional string registry_address = 6; // optional; H160 } // Per peer connection RPC rate limits. diff --git a/core/lib/protobuf_config/src/tests.rs b/core/lib/protobuf_config/src/tests.rs index 695f404f64d..d653b9b92bf 100644 --- a/core/lib/protobuf_config/src/tests.rs +++ b/core/lib/protobuf_config/src/tests.rs @@ -42,6 +42,7 @@ fn test_encoding() { test_encode_all_formats::>(rng); test_encode_all_formats::>(rng); test_encode_all_formats::>(rng); + test_encode_all_formats::>(rng); test_encode_all_formats::>(rng); test_encode_all_formats::>(rng); test_encode_all_formats::>(rng); diff --git a/core/lib/tee_verifier/Cargo.toml b/core/lib/tee_verifier/Cargo.toml index a56f383bdba..6828eeef8b1 100644 --- a/core/lib/tee_verifier/Cargo.toml +++ b/core/lib/tee_verifier/Cargo.toml @@ -14,12 +14,9 @@ categories.workspace = true zksync_multivm.workspace = true zksync_config.workspace = true zksync_crypto_primitives.workspace = true -zksync_dal.workspace = true -zksync_db_connection.workspace = true zksync_merkle_tree.workspace = true zksync_object_store.workspace = true zksync_prover_interface.workspace = true -zksync_queued_job_processor.workspace = true zksync_types.workspace = true zksync_utils.workspace = true diff --git a/core/lib/types/src/api/en.rs b/core/lib/types/src/api/en.rs index bf26caddd07..9391c862757 100644 --- a/core/lib/types/src/api/en.rs +++ b/core/lib/types/src/api/en.rs @@ -44,10 +44,23 @@ pub struct SyncBlock { pub protocol_version: ProtocolVersionId, } +/// Global configuration of the consensus served by the main node to the external nodes. +/// In particular, it contains consensus genesis. +/// +/// The wrapped JSON value corresponds to `zksync_dal::consensus::GlobalConfig`. +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct ConsensusGlobalConfig(pub serde_json::Value); + +/// [DEPRECATED] Genesis served by the main node to the external nodes. +/// This type is deprecated since ConsensusGlobalConfig also contains genesis and is extensible. +/// +/// The wrapped JSON value corresponds to `zksync_consensus_roles::validator::Genesis`. #[derive(Debug, Clone, Serialize, Deserialize)] pub struct ConsensusGenesis(pub serde_json::Value); /// AttestationStatus maintained by the main node. /// Used for testing L1 batch signing by consensus attesters. +/// +/// The wrapped JSON value corresponds to `zksync_dal::consensus::AttestationStatus`. #[derive(Debug, Clone, Serialize, Deserialize)] pub struct AttestationStatus(pub serde_json::Value); diff --git a/core/lib/utils/Cargo.toml b/core/lib/utils/Cargo.toml index 5ec27380df5..b87b2ad9896 100644 --- a/core/lib/utils/Cargo.toml +++ b/core/lib/utils/Cargo.toml @@ -25,7 +25,6 @@ thiserror.workspace = true futures.workspace = true hex.workspace = true reqwest = { workspace = true, features = ["blocking"] } -itertools.workspace = true serde_json.workspace = true once_cell.workspace = true @@ -33,3 +32,4 @@ once_cell.workspace = true rand.workspace = true tokio = { workspace = true, features = ["macros", "rt"] } bincode.workspace = true +assert_matches.workspace = true diff --git a/core/lib/utils/src/env.rs b/core/lib/utils/src/env.rs index 0eddc6c2cd6..5ae07caf148 100644 --- a/core/lib/utils/src/env.rs +++ b/core/lib/utils/src/env.rs @@ -8,6 +8,87 @@ use once_cell::sync::OnceCell; static WORKSPACE: OnceCell> = OnceCell::new(); +/// Represents Cargo workspaces available in the repository. +#[derive(Debug, Clone, Copy)] +pub enum Workspace<'a> { + /// Workspace was not found. + /// Assumes that the code is running in a binary. + /// Will use the current directory as a fallback. + None, + /// Root folder. + Core(&'a Path), + /// `prover` folder. + Prover(&'a Path), + /// `toolbox` folder. + Toolbox(&'a Path), +} + +impl Workspace<'static> { + /// Find the location of the current workspace, if this code works in workspace + /// then it will return the correct folder if, it's binary e.g. in docker container + /// you have to use fallback to another directory + /// The code has been inspired by `insta` + /// `https://github.com/mitsuhiko/insta/blob/master/insta/src/env.rs` + pub fn locate() -> Self { + // Since `locate_workspace_inner()` should be deterministic, it makes little sense to call + // `OnceCell::get_or_try_init()` here; the repeated calls are just as unlikely to succeed as the initial call. + // Instead, we store `None` in the `OnceCell` if initialization failed. + let path: Option<&'static Path> = WORKSPACE + .get_or_init(|| { + let result = locate_workspace_inner(); + // If the workspace is not found, we store `None` in the `OnceCell`. + // It doesn't make sense to log it, since in most production cases the workspace + // is not present. + result.ok() + }) + .as_deref(); + path.map_or(Self::None, Self::from) + } +} + +impl<'a> Workspace<'a> { + const PROVER_DIRECTORY_NAME: &'static str = "prover"; + const TOOLBOX_DIRECTORY_NAME: &'static str = "zk_toolbox"; + + /// Returns the path of the core workspace. + /// For `Workspace::None`, considers the current directory to represent core workspace. + pub fn core(self) -> PathBuf { + match self { + Self::None => PathBuf::from("."), + Self::Core(path) => path.into(), + Self::Prover(path) | Self::Toolbox(path) => path.parent().unwrap().into(), + } + } + + /// Returns the path of the `prover` workspace. + pub fn prover(self) -> PathBuf { + match self { + Self::Prover(path) => path.into(), + _ => self.core().join(Self::PROVER_DIRECTORY_NAME), + } + } + + /// Returns the path of the `zk_toolbox`` workspace. + pub fn toolbox(self) -> PathBuf { + match self { + Self::Toolbox(path) => path.into(), + _ => self.core().join(Self::TOOLBOX_DIRECTORY_NAME), + } + } +} + +impl<'a> From<&'a Path> for Workspace<'a> { + fn from(path: &'a Path) -> Self { + if path.ends_with(Self::PROVER_DIRECTORY_NAME) { + Self::Prover(path) + } else if path.ends_with(Self::TOOLBOX_DIRECTORY_NAME) { + Self::Toolbox(path) + } else { + Self::Core(path) + } + } +} + fn locate_workspace_inner() -> anyhow::Result { let output = std::process::Command::new( std::env::var("CARGO") @@ -40,31 +121,86 @@ fn locate_workspace_inner() -> anyhow::Result { .to_path_buf()) } -/// Find the location of the current workspace, if this code works in workspace -/// then it will return the correct folder if, it's binary e.g. in docker container -/// you have to use fallback to another directory -/// The code has been inspired by `insta` -/// `https://github.com/mitsuhiko/insta/blob/master/insta/src/env.rs` -pub fn locate_workspace() -> Option<&'static Path> { - // Since `locate_workspace_inner()` should be deterministic, it makes little sense to call - // `OnceCell::get_or_try_init()` here; the repeated calls are just as unlikely to succeed as the initial call. - // Instead, we store `None` in the `OnceCell` if initialization failed. - WORKSPACE - .get_or_init(|| { - let result = locate_workspace_inner(); - if result.is_err() { - // `get_or_init()` is guaranteed to call the provided closure once per `OnceCell`; - // i.e., we won't spam logs here. - tracing::info!( - "locate_workspace() failed. You are using an already compiled version" - ); - } - result.ok() - }) - .as_deref() -} +#[cfg(test)] +mod tests { + use assert_matches::assert_matches; + + use super::*; + + /// Will reset the pwd on drop. + /// This is needed to make sure that even if the test fails, the env + /// for other tests is left intact. + struct PwdProtector(PathBuf); + + impl PwdProtector { + fn new() -> Self { + let pwd = std::env::current_dir().unwrap(); + Self(pwd) + } + } + + impl Drop for PwdProtector { + fn drop(&mut self) { + std::env::set_current_dir(self.0.clone()).unwrap(); + } + } + + #[test] + fn test_workspace_locate() { + let _pwd_protector = PwdProtector::new(); + + // Core. + + let workspace = Workspace::locate(); + assert_matches!(workspace, Workspace::Core(_)); + let core_path = workspace.core(); + // Check if prover and toolbox directories exist. + assert!(workspace.prover().exists()); + assert_matches!( + Workspace::from(workspace.prover().as_path()), + Workspace::Prover(_) + ); + assert!(workspace.toolbox().exists()); + assert_matches!( + Workspace::from(workspace.toolbox().as_path()), + Workspace::Toolbox(_) + ); + + // Prover. + + // We use `cargo-nextest` for running tests, which runs each test in parallel, + // so we can safely alter the global env, assuming that we will restore it after + // the test. + std::env::set_current_dir(workspace.prover()).unwrap(); + let workspace_path = locate_workspace_inner().unwrap(); + let workspace = Workspace::from(workspace_path.as_path()); + assert_matches!(workspace, Workspace::Prover(_)); + let prover_path = workspace.prover(); + assert_eq!(workspace.core(), core_path); + assert_matches!( + Workspace::from(workspace.core().as_path()), + Workspace::Core(_) + ); + assert!(workspace.toolbox().exists()); + assert_matches!( + Workspace::from(workspace.toolbox().as_path()), + Workspace::Toolbox(_) + ); -/// Returns [`locate_workspace()`] output with the "." fallback. -pub fn workspace_dir_or_current_dir() -> &'static Path { - locate_workspace().unwrap_or_else(|| Path::new(".")) + // Toolbox. + std::env::set_current_dir(workspace.toolbox()).unwrap(); + let workspace_path = locate_workspace_inner().unwrap(); + let workspace = Workspace::from(workspace_path.as_path()); + assert_matches!(workspace, Workspace::Toolbox(_)); + assert_eq!(workspace.core(), core_path); + assert_matches!( + Workspace::from(workspace.core().as_path()), + Workspace::Core(_) + ); + assert_eq!(workspace.prover(), prover_path); + assert_matches!( + Workspace::from(workspace.prover().as_path()), + Workspace::Prover(_) + ); + } } diff --git a/core/lib/utils/src/lib.rs b/core/lib/utils/src/lib.rs index 7f9304e3110..92a1d7a0c47 100644 --- a/core/lib/utils/src/lib.rs +++ b/core/lib/utils/src/lib.rs @@ -2,7 +2,7 @@ pub mod bytecode; mod convert; -mod env; +pub mod env; pub mod http_with_retries; pub mod misc; pub mod panic_extractor; @@ -10,4 +10,4 @@ mod serde_wrappers; pub mod time; pub mod wait_for_tasks; -pub use self::{convert::*, env::*, misc::*, serde_wrappers::*}; +pub use self::{convert::*, misc::*, serde_wrappers::*}; diff --git a/core/lib/vm_executor/Cargo.toml b/core/lib/vm_executor/Cargo.toml index 9471e263bf4..089c2a9bcca 100644 --- a/core/lib/vm_executor/Cargo.toml +++ b/core/lib/vm_executor/Cargo.toml @@ -15,6 +15,7 @@ zksync_contracts.workspace = true zksync_dal.workspace = true zksync_types.workspace = true zksync_multivm.workspace = true +zksync_utils.workspace = true async-trait.workspace = true once_cell.workspace = true diff --git a/core/lib/vm_executor/src/batch/factory.rs b/core/lib/vm_executor/src/batch/factory.rs index d0201458446..68a3769ee62 100644 --- a/core/lib/vm_executor/src/batch/factory.rs +++ b/core/lib/vm_executor/src/batch/factory.rs @@ -18,9 +18,9 @@ use zksync_types::{vm::FastVmMode, Transaction}; use super::{ executor::{Command, MainBatchExecutor}, - metrics::{TxExecutionStage, BATCH_TIP_METRICS, KEEPER_METRICS}, + metrics::{TxExecutionStage, BATCH_TIP_METRICS, EXECUTOR_METRICS, KEEPER_METRICS}, }; -use crate::batch::metrics::{InteractionType, EXECUTOR_METRICS}; +use crate::shared::InteractionType; /// 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). diff --git a/core/lib/vm_executor/src/batch/metrics.rs b/core/lib/vm_executor/src/batch/metrics.rs index 170ed471798..6851193e9be 100644 --- a/core/lib/vm_executor/src/batch/metrics.rs +++ b/core/lib/vm_executor/src/batch/metrics.rs @@ -5,6 +5,8 @@ use std::time::Duration; use vise::{Buckets, EncodeLabelSet, EncodeLabelValue, Family, Histogram, Metrics}; use zksync_multivm::interface::VmExecutionResultAndLogs; +use crate::shared::InteractionType; + #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, EncodeLabelValue, EncodeLabelSet)] #[metrics(label = "command", rename_all = "snake_case")] pub(super) enum ExecutorCommand { @@ -26,13 +28,6 @@ pub(super) enum TxExecutionStage { TxRollback, } -#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, EncodeLabelValue, EncodeLabelSet)] -#[metrics(label = "interaction", rename_all = "snake_case")] -pub(super) enum InteractionType { - GetValue, - SetValue, -} - /// Executor-related metrics. #[derive(Debug, Metrics)] #[metrics(prefix = "state_keeper")] diff --git a/core/lib/vm_executor/src/lib.rs b/core/lib/vm_executor/src/lib.rs index 24fb3d8f7ee..1a0fbb002df 100644 --- a/core/lib/vm_executor/src/lib.rs +++ b/core/lib/vm_executor/src/lib.rs @@ -6,4 +6,6 @@ pub use zksync_multivm::interface::executor as interface; pub mod batch; +pub mod oneshot; +mod shared; pub mod storage; diff --git a/core/lib/vm_executor/src/oneshot/metrics.rs b/core/lib/vm_executor/src/oneshot/metrics.rs new file mode 100644 index 00000000000..8a89ce0a9a4 --- /dev/null +++ b/core/lib/vm_executor/src/oneshot/metrics.rs @@ -0,0 +1,143 @@ +use std::time::Duration; + +use vise::{Buckets, EncodeLabelSet, EncodeLabelValue, Family, Histogram, Metrics}; +use zksync_multivm::interface::{storage::StorageViewMetrics, VmMemoryMetrics}; + +use crate::shared::InteractionType; + +#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, EncodeLabelValue, EncodeLabelSet)] +#[metrics(label = "type", rename_all = "snake_case")] +enum SizeType { + Inner, + History, +} + +const MEMORY_SIZE_BUCKETS: Buckets = Buckets::values(&[ + 1_000.0, + 10_000.0, + 100_000.0, + 500_000.0, + 1_000_000.0, + 5_000_000.0, + 10_000_000.0, + 50_000_000.0, + 100_000_000.0, + 500_000_000.0, + 1_000_000_000.0, +]); + +#[derive(Debug, Metrics)] +#[metrics(prefix = "runtime_context_memory")] +struct RuntimeContextMemoryMetrics { + #[metrics(buckets = MEMORY_SIZE_BUCKETS)] + event_sink_size: Family>, + #[metrics(buckets = MEMORY_SIZE_BUCKETS)] + memory_size: Family>, + #[metrics(buckets = MEMORY_SIZE_BUCKETS)] + decommitter_size: Family>, + #[metrics(buckets = MEMORY_SIZE_BUCKETS)] + storage_size: Family>, + #[metrics(buckets = MEMORY_SIZE_BUCKETS)] + storage_view_cache_size: Histogram, + #[metrics(buckets = MEMORY_SIZE_BUCKETS)] + full: Histogram, +} + +#[vise::register] +static MEMORY_METRICS: vise::Global = vise::Global::new(); + +const INTERACTION_AMOUNT_BUCKETS: Buckets = Buckets::exponential(10.0..=10_000_000.0, 10.0); + +#[derive(Debug, Metrics)] +#[metrics(prefix = "runtime_context_storage_interaction")] +struct RuntimeContextStorageMetrics { + #[metrics(buckets = INTERACTION_AMOUNT_BUCKETS)] + amount: Family>, + #[metrics(buckets = Buckets::LATENCIES)] + duration: Family>, + #[metrics(buckets = Buckets::LATENCIES)] + duration_per_unit: Family>, + #[metrics(buckets = Buckets::ZERO_TO_ONE)] + ratio: Histogram, +} + +#[vise::register] +static STORAGE_METRICS: vise::Global = vise::Global::new(); + +pub(super) fn report_vm_memory_metrics( + tx_id: &str, + memory_metrics: &VmMemoryMetrics, + vm_execution_took: Duration, + storage_metrics: StorageViewMetrics, +) { + MEMORY_METRICS.event_sink_size[&SizeType::Inner].observe(memory_metrics.event_sink_inner); + MEMORY_METRICS.event_sink_size[&SizeType::History].observe(memory_metrics.event_sink_history); + MEMORY_METRICS.memory_size[&SizeType::Inner].observe(memory_metrics.memory_inner); + MEMORY_METRICS.memory_size[&SizeType::History].observe(memory_metrics.memory_history); + MEMORY_METRICS.decommitter_size[&SizeType::Inner] + .observe(memory_metrics.decommittment_processor_inner); + MEMORY_METRICS.decommitter_size[&SizeType::History] + .observe(memory_metrics.decommittment_processor_history); + MEMORY_METRICS.storage_size[&SizeType::Inner].observe(memory_metrics.storage_inner); + MEMORY_METRICS.storage_size[&SizeType::History].observe(memory_metrics.storage_history); + + MEMORY_METRICS + .storage_view_cache_size + .observe(storage_metrics.cache_size); + MEMORY_METRICS + .full + .observe(memory_metrics.full_size() + storage_metrics.cache_size); + + let total_storage_invocations = storage_metrics.get_value_storage_invocations + + storage_metrics.set_value_storage_invocations; + let total_time_spent_in_storage = + storage_metrics.time_spent_on_get_value + storage_metrics.time_spent_on_set_value; + + STORAGE_METRICS.amount[&InteractionType::Missed] + .observe(storage_metrics.storage_invocations_missed); + STORAGE_METRICS.amount[&InteractionType::GetValue] + .observe(storage_metrics.get_value_storage_invocations); + STORAGE_METRICS.amount[&InteractionType::SetValue] + .observe(storage_metrics.set_value_storage_invocations); + STORAGE_METRICS.amount[&InteractionType::Total].observe(total_storage_invocations); + + STORAGE_METRICS.duration[&InteractionType::Missed] + .observe(storage_metrics.time_spent_on_storage_missed); + STORAGE_METRICS.duration[&InteractionType::GetValue] + .observe(storage_metrics.time_spent_on_get_value); + STORAGE_METRICS.duration[&InteractionType::SetValue] + .observe(storage_metrics.time_spent_on_set_value); + STORAGE_METRICS.duration[&InteractionType::Total].observe(total_time_spent_in_storage); + + if total_storage_invocations > 0 { + STORAGE_METRICS.duration_per_unit[&InteractionType::Total] + .observe(total_time_spent_in_storage.div_f64(total_storage_invocations as f64)); + } + if storage_metrics.storage_invocations_missed > 0 { + let duration_per_unit = storage_metrics + .time_spent_on_storage_missed + .div_f64(storage_metrics.storage_invocations_missed as f64); + STORAGE_METRICS.duration_per_unit[&InteractionType::Missed].observe(duration_per_unit); + } + + STORAGE_METRICS + .ratio + .observe(total_time_spent_in_storage.as_secs_f64() / vm_execution_took.as_secs_f64()); + + const STORAGE_INVOCATIONS_DEBUG_THRESHOLD: usize = 1_000; + + if total_storage_invocations > STORAGE_INVOCATIONS_DEBUG_THRESHOLD { + tracing::info!( + "Tx {tx_id} resulted in {total_storage_invocations} storage_invocations, {} new_storage_invocations, \ + {} get_value_storage_invocations, {} set_value_storage_invocations, \ + vm execution took {vm_execution_took:?}, storage interaction took {total_time_spent_in_storage:?} \ + (missed: {:?} get: {:?} set: {:?})", + storage_metrics.storage_invocations_missed, + storage_metrics.get_value_storage_invocations, + storage_metrics.set_value_storage_invocations, + storage_metrics.time_spent_on_storage_missed, + storage_metrics.time_spent_on_get_value, + storage_metrics.time_spent_on_set_value, + ); + } +} diff --git a/core/node/api_server/src/execution_sandbox/testonly.rs b/core/lib/vm_executor/src/oneshot/mock.rs similarity index 58% rename from core/node/api_server/src/execution_sandbox/testonly.rs rename to core/lib/vm_executor/src/oneshot/mock.rs index d9d60f52415..8f3a12603c1 100644 --- a/core/node/api_server/src/execution_sandbox/testonly.rs +++ b/core/lib/vm_executor/src/oneshot/mock.rs @@ -1,18 +1,18 @@ use std::fmt; use async_trait::async_trait; -#[cfg(test)] -use zksync_multivm::interface::ExecutionResult; use zksync_multivm::interface::{ - storage::ReadStorage, BytecodeCompressionError, OneshotEnv, TxExecutionMode, - VmExecutionResultAndLogs, + executor::{OneshotExecutor, TransactionValidator}, + storage::ReadStorage, + tracer::{ValidationError, ValidationParams}, + ExecutionResult, OneshotEnv, OneshotTracingParams, OneshotTransactionExecutionResult, + TxExecutionArgs, TxExecutionMode, VmExecutionResultAndLogs, }; -use zksync_types::Transaction; - -use super::{execute::TransactionExecutor, OneshotExecutor, TxExecutionArgs}; +use zksync_types::{l2::L2Tx, Transaction}; type TxResponseFn = dyn Fn(&Transaction, &OneshotEnv) -> VmExecutionResultAndLogs + Send + Sync; +/// Mock [`OneshotExecutor`] implementation. pub struct MockOneshotExecutor { call_responses: Box, tx_responses: Box, @@ -30,10 +30,7 @@ impl Default for MockOneshotExecutor { fn default() -> Self { Self { call_responses: Box::new(|tx, _| { - panic!( - "Unexpected call with data {}", - hex::encode(tx.execute.calldata()) - ); + panic!("Unexpected call with data {:?}", tx.execute.calldata()); }), tx_responses: Box::new(|tx, _| { panic!("Unexpect transaction call: {tx:?}"); @@ -43,23 +40,23 @@ impl Default for MockOneshotExecutor { } impl MockOneshotExecutor { - #[cfg(test)] - pub(crate) fn set_call_responses(&mut self, responses: F) + /// Sets call response closure used by this executor. + pub fn set_call_responses(&mut self, responses: F) where F: Fn(&Transaction, &OneshotEnv) -> ExecutionResult + 'static + Send + Sync, { self.call_responses = self.wrap_responses(responses); } - #[cfg(test)] - pub(crate) fn set_tx_responses(&mut self, responses: F) + /// Sets transaction response closure used by this executor. The closure will be called both for transaction execution / validation, + /// and for gas estimation. + pub fn set_tx_responses(&mut self, responses: F) where F: Fn(&Transaction, &OneshotEnv) -> ExecutionResult + 'static + Send + Sync, { self.tx_responses = self.wrap_responses(responses); } - #[cfg(test)] fn wrap_responses(&mut self, responses: F) -> Box where F: Fn(&Transaction, &OneshotEnv) -> ExecutionResult + 'static + Send + Sync, @@ -76,8 +73,8 @@ impl MockOneshotExecutor { ) } - #[cfg(test)] - pub(crate) fn set_tx_responses_with_logs(&mut self, responses: F) + /// Same as [`Self::set_tx_responses()`], but allows to customize returned VM logs etc. + pub fn set_full_tx_responses(&mut self, responses: F) where F: Fn(&Transaction, &OneshotEnv) -> VmExecutionResultAndLogs + 'static + Send + Sync, { @@ -99,34 +96,41 @@ impl OneshotExecutor for MockOneshotExecutor where S: ReadStorage + Send + 'static, { - type Tracers = (); - - async fn inspect_transaction( + async fn inspect_transaction_with_bytecode_compression( &self, _storage: S, env: OneshotEnv, args: TxExecutionArgs, - (): Self::Tracers, - ) -> anyhow::Result { - Ok(self.mock_inspect(env, args)) + _params: OneshotTracingParams, + ) -> anyhow::Result { + Ok(OneshotTransactionExecutionResult { + tx_result: Box::new(self.mock_inspect(env, args)), + compression_result: Ok(()), + call_traces: vec![], + }) } +} - async fn inspect_transaction_with_bytecode_compression( +#[async_trait] +impl TransactionValidator for MockOneshotExecutor +where + S: ReadStorage + Send + 'static, +{ + async fn validate_transaction( &self, _storage: S, env: OneshotEnv, - args: TxExecutionArgs, - (): Self::Tracers, - ) -> anyhow::Result<( - Result<(), BytecodeCompressionError>, - VmExecutionResultAndLogs, - )> { - Ok((Ok(()), self.mock_inspect(env, args))) - } -} - -impl From for TransactionExecutor { - fn from(executor: MockOneshotExecutor) -> Self { - Self::Mock(executor) + tx: L2Tx, + _validation_params: ValidationParams, + ) -> anyhow::Result> { + Ok( + match self + .mock_inspect(env, TxExecutionArgs::for_validation(tx)) + .result + { + ExecutionResult::Halt { reason } => Err(ValidationError::FailedTx(reason)), + ExecutionResult::Success { .. } | ExecutionResult::Revert { .. } => Ok(()), + }, + ) } } diff --git a/core/lib/vm_executor/src/oneshot/mod.rs b/core/lib/vm_executor/src/oneshot/mod.rs new file mode 100644 index 00000000000..cac8edfdfdf --- /dev/null +++ b/core/lib/vm_executor/src/oneshot/mod.rs @@ -0,0 +1,291 @@ +//! Oneshot VM executor. + +use std::{ + sync::Arc, + time::{Duration, Instant}, +}; + +use anyhow::Context; +use async_trait::async_trait; +use once_cell::sync::OnceCell; +use zksync_multivm::{ + interface::{ + executor::{OneshotExecutor, TransactionValidator}, + storage::{ReadStorage, StoragePtr, StorageView, WriteStorage}, + tracer::{ValidationError, ValidationParams}, + ExecutionResult, OneshotEnv, OneshotTracingParams, OneshotTransactionExecutionResult, + StoredL2BlockEnv, TxExecutionArgs, TxExecutionMode, VmExecutionMode, VmInterface, + }, + tracers::{CallTracer, StorageInvocations, ValidationTracer}, + utils::adjust_pubdata_price_for_tx, + vm_latest::HistoryDisabled, + zk_evm_latest::ethereum_types::U256, + MultiVMTracer, VmInstance, +}; +use zksync_types::{ + block::pack_block_info, + get_nonce_key, + l2::L2Tx, + utils::{decompose_full_nonce, nonces_to_full_nonce, storage_key_for_eth_balance}, + AccountTreeId, Nonce, StorageKey, Transaction, SYSTEM_CONTEXT_ADDRESS, + SYSTEM_CONTEXT_CURRENT_L2_BLOCK_INFO_POSITION, SYSTEM_CONTEXT_CURRENT_TX_ROLLING_HASH_POSITION, +}; +use zksync_utils::{h256_to_u256, u256_to_h256}; + +pub use self::mock::MockOneshotExecutor; + +mod metrics; +mod mock; + +/// Main [`OneshotExecutor`] implementation used by the API server. +#[derive(Debug, Default)] +pub struct MainOneshotExecutor { + missed_storage_invocation_limit: usize, + execution_latency_histogram: Option<&'static vise::Histogram>, +} + +impl MainOneshotExecutor { + /// Creates a new executor with the specified limit of cache misses for storage read operations (an anti-DoS measure). + /// The limit is applied for calls and gas estimations, but not during transaction validation. + pub fn new(missed_storage_invocation_limit: usize) -> Self { + Self { + missed_storage_invocation_limit, + execution_latency_histogram: None, + } + } + + /// Sets a histogram for measuring VM execution latency. + pub fn set_execution_latency_histogram( + &mut self, + histogram: &'static vise::Histogram, + ) { + self.execution_latency_histogram = Some(histogram); + } +} + +#[async_trait] +impl OneshotExecutor for MainOneshotExecutor +where + S: ReadStorage + Send + 'static, +{ + async fn inspect_transaction_with_bytecode_compression( + &self, + storage: S, + env: OneshotEnv, + args: TxExecutionArgs, + params: OneshotTracingParams, + ) -> anyhow::Result { + let missed_storage_invocation_limit = match env.system.execution_mode { + // storage accesses are not limited for tx validation + TxExecutionMode::VerifyExecute => usize::MAX, + TxExecutionMode::EthCall | TxExecutionMode::EstimateFee => { + self.missed_storage_invocation_limit + } + }; + let execution_latency_histogram = self.execution_latency_histogram; + + tokio::task::spawn_blocking(move || { + let mut tracers = vec![]; + let mut calls_result = Arc::>::default(); + if params.trace_calls { + tracers.push(CallTracer::new(calls_result.clone()).into_tracer_pointer()); + } + tracers.push( + StorageInvocations::new(missed_storage_invocation_limit).into_tracer_pointer(), + ); + + let executor = VmSandbox::new(storage, env, args, execution_latency_histogram); + let mut result = executor.apply(|vm, transaction| { + let (compression_result, tx_result) = vm + .inspect_transaction_with_bytecode_compression( + tracers.into(), + transaction, + true, + ); + OneshotTransactionExecutionResult { + tx_result: Box::new(tx_result), + compression_result: compression_result.map(drop), + call_traces: vec![], + } + }); + + result.call_traces = Arc::make_mut(&mut calls_result).take().unwrap_or_default(); + result + }) + .await + .context("VM execution panicked") + } +} + +#[async_trait] +impl TransactionValidator for MainOneshotExecutor +where + S: ReadStorage + Send + 'static, +{ + async fn validate_transaction( + &self, + storage: S, + env: OneshotEnv, + tx: L2Tx, + validation_params: ValidationParams, + ) -> anyhow::Result> { + anyhow::ensure!( + env.system.execution_mode == TxExecutionMode::VerifyExecute, + "Unexpected execution mode for tx validation: {:?} (expected `VerifyExecute`)", + env.system.execution_mode + ); + let execution_latency_histogram = self.execution_latency_histogram; + + tokio::task::spawn_blocking(move || { + let (validation_tracer, mut validation_result) = + ValidationTracer::::new( + validation_params, + env.system.version.into(), + ); + let tracers = vec![validation_tracer.into_tracer_pointer()]; + + let executor = VmSandbox::new( + storage, + env, + TxExecutionArgs::for_validation(tx), + execution_latency_histogram, + ); + let exec_result = executor.apply(|vm, transaction| { + vm.push_transaction(transaction); + vm.inspect(tracers.into(), VmExecutionMode::OneTx) + }); + let validation_result = Arc::make_mut(&mut validation_result) + .take() + .map_or(Ok(()), Err); + + match (exec_result.result, validation_result) { + (_, Err(violated_rule)) => Err(ValidationError::ViolatedRule(violated_rule)), + (ExecutionResult::Halt { reason }, _) => Err(ValidationError::FailedTx(reason)), + _ => Ok(()), + } + }) + .await + .context("VM execution panicked") + } +} + +#[derive(Debug)] +struct VmSandbox { + vm: Box>, + storage_view: StoragePtr>, + transaction: Transaction, + execution_latency_histogram: Option<&'static vise::Histogram>, +} + +impl VmSandbox { + /// This method is blocking. + fn new( + storage: S, + mut env: OneshotEnv, + execution_args: TxExecutionArgs, + execution_latency_histogram: Option<&'static vise::Histogram>, + ) -> Self { + let mut storage_view = StorageView::new(storage); + Self::setup_storage_view(&mut storage_view, &execution_args, env.current_block); + + let protocol_version = env.system.version; + if execution_args.adjust_pubdata_price { + env.l1_batch.fee_input = adjust_pubdata_price_for_tx( + env.l1_batch.fee_input, + execution_args.transaction.gas_per_pubdata_byte_limit(), + env.l1_batch.enforced_base_fee.map(U256::from), + protocol_version.into(), + ); + }; + + let storage_view = storage_view.to_rc_ptr(); + let vm = Box::new(VmInstance::new_with_specific_version( + env.l1_batch, + env.system, + storage_view.clone(), + protocol_version.into_api_vm_version(), + )); + + Self { + vm, + storage_view, + transaction: execution_args.transaction, + execution_latency_histogram, + } + } + + /// This method is blocking. + fn setup_storage_view( + storage_view: &mut StorageView, + execution_args: &TxExecutionArgs, + current_block: Option, + ) { + let storage_view_setup_started_at = Instant::now(); + if let Some(nonce) = execution_args.enforced_nonce { + let nonce_key = get_nonce_key(&execution_args.transaction.initiator_account()); + let full_nonce = storage_view.read_value(&nonce_key); + let (_, deployment_nonce) = decompose_full_nonce(h256_to_u256(full_nonce)); + let enforced_full_nonce = nonces_to_full_nonce(U256::from(nonce.0), deployment_nonce); + storage_view.set_value(nonce_key, u256_to_h256(enforced_full_nonce)); + } + + let payer = execution_args.transaction.payer(); + let balance_key = storage_key_for_eth_balance(&payer); + let mut current_balance = h256_to_u256(storage_view.read_value(&balance_key)); + current_balance += execution_args.added_balance; + storage_view.set_value(balance_key, u256_to_h256(current_balance)); + + // Reset L2 block info if necessary. + if let Some(current_block) = current_block { + let l2_block_info_key = StorageKey::new( + AccountTreeId::new(SYSTEM_CONTEXT_ADDRESS), + SYSTEM_CONTEXT_CURRENT_L2_BLOCK_INFO_POSITION, + ); + let l2_block_info = + pack_block_info(current_block.number.into(), current_block.timestamp); + storage_view.set_value(l2_block_info_key, u256_to_h256(l2_block_info)); + + let l2_block_txs_rolling_hash_key = StorageKey::new( + AccountTreeId::new(SYSTEM_CONTEXT_ADDRESS), + SYSTEM_CONTEXT_CURRENT_TX_ROLLING_HASH_POSITION, + ); + storage_view.set_value( + l2_block_txs_rolling_hash_key, + current_block.txs_rolling_hash, + ); + } + + let storage_view_setup_time = storage_view_setup_started_at.elapsed(); + // We don't want to emit too many logs. + if storage_view_setup_time > Duration::from_millis(10) { + tracing::debug!("Prepared the storage view (took {storage_view_setup_time:?})",); + } + } + + pub(super) fn apply(mut self, apply_fn: F) -> T + where + F: FnOnce(&mut VmInstance, Transaction) -> T, + { + let tx_id = format!( + "{:?}-{}", + self.transaction.initiator_account(), + self.transaction.nonce().unwrap_or(Nonce(0)) + ); + + let started_at = Instant::now(); + let result = apply_fn(&mut *self.vm, self.transaction); + let vm_execution_took = started_at.elapsed(); + + if let Some(histogram) = self.execution_latency_histogram { + histogram.observe(vm_execution_took); + } + let memory_metrics = self.vm.record_vm_memory_metrics(); + metrics::report_vm_memory_metrics( + &tx_id, + &memory_metrics, + vm_execution_took, + self.storage_view.as_ref().borrow_mut().metrics(), + ); + result + } +} diff --git a/core/lib/vm_executor/src/shared.rs b/core/lib/vm_executor/src/shared.rs new file mode 100644 index 00000000000..420005be05d --- /dev/null +++ b/core/lib/vm_executor/src/shared.rs @@ -0,0 +1,12 @@ +//! Functionality shared among different types of executors. + +use vise::{EncodeLabelSet, EncodeLabelValue}; + +#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, EncodeLabelValue, EncodeLabelSet)] +#[metrics(label = "interaction", rename_all = "snake_case")] +pub(crate) enum InteractionType { + Missed, + GetValue, + SetValue, + Total, +} diff --git a/core/lib/vm_interface/src/executor.rs b/core/lib/vm_interface/src/executor.rs index ee6665abfcb..119f975fecd 100644 --- a/core/lib/vm_interface/src/executor.rs +++ b/core/lib/vm_interface/src/executor.rs @@ -3,11 +3,13 @@ use std::fmt; use async_trait::async_trait; -use zksync_types::Transaction; +use zksync_types::{l2::L2Tx, Transaction}; use crate::{ - storage::StorageView, BatchTransactionExecutionResult, FinishedL1Batch, L1BatchEnv, L2BlockEnv, - SystemEnv, + storage::{ReadStorage, StorageView}, + tracer::{ValidationError, ValidationParams}, + BatchTransactionExecutionResult, FinishedL1Batch, L1BatchEnv, L2BlockEnv, OneshotEnv, + OneshotTracingParams, OneshotTransactionExecutionResult, SystemEnv, TxExecutionArgs, }; /// Factory of [`BatchExecutor`]s. @@ -42,3 +44,29 @@ pub trait BatchExecutor: 'static + Send + fmt::Debug { /// Finished the current L1 batch. async fn finish_batch(self: Box) -> anyhow::Result<(FinishedL1Batch, StorageView)>; } + +/// VM executor capable of executing isolated transactions / calls (as opposed to [batch execution](BatchExecutor)). +#[async_trait] +pub trait OneshotExecutor { + /// Executes a transaction or call with optional tracers. + async fn inspect_transaction_with_bytecode_compression( + &self, + storage: S, + env: OneshotEnv, + args: TxExecutionArgs, + tracing: OneshotTracingParams, + ) -> anyhow::Result; +} + +/// VM executor capable of validating transactions. +#[async_trait] +pub trait TransactionValidator: OneshotExecutor { + /// Validates the provided transaction. + async fn validate_transaction( + &self, + storage: S, + env: OneshotEnv, + tx: L2Tx, + validation_params: ValidationParams, + ) -> anyhow::Result>; +} diff --git a/core/lib/vm_interface/src/lib.rs b/core/lib/vm_interface/src/lib.rs index 315eb2bb36a..2b30f82e0ce 100644 --- a/core/lib/vm_interface/src/lib.rs +++ b/core/lib/vm_interface/src/lib.rs @@ -24,15 +24,16 @@ pub use crate::{ VmRevertReason, VmRevertReasonParsingError, }, inputs::{ - L1BatchEnv, L2BlockEnv, OneshotEnv, StoredL2BlockEnv, SystemEnv, TxExecutionMode, - VmExecutionMode, + L1BatchEnv, L2BlockEnv, OneshotEnv, OneshotTracingParams, StoredL2BlockEnv, SystemEnv, + TxExecutionArgs, TxExecutionMode, VmExecutionMode, }, outputs::{ BatchTransactionExecutionResult, BootloaderMemory, Call, CallType, CircuitStatistic, CompressedBytecodeInfo, CurrentExecutionState, DeduplicatedWritesMetrics, - ExecutionResult, FinishedL1Batch, L2Block, Refunds, TransactionExecutionMetrics, - TransactionExecutionResult, TxExecutionStatus, VmEvent, VmExecutionLogs, - VmExecutionMetrics, VmExecutionResultAndLogs, VmExecutionStatistics, VmMemoryMetrics, + ExecutionResult, FinishedL1Batch, L2Block, OneshotTransactionExecutionResult, Refunds, + TransactionExecutionMetrics, TransactionExecutionResult, TxExecutionStatus, VmEvent, + VmExecutionLogs, VmExecutionMetrics, VmExecutionResultAndLogs, VmExecutionStatistics, + VmMemoryMetrics, }, tracer, }, diff --git a/core/lib/vm_interface/src/types/inputs/mod.rs b/core/lib/vm_interface/src/types/inputs/mod.rs index 4801c4d88b5..24f58ae72f1 100644 --- a/core/lib/vm_interface/src/types/inputs/mod.rs +++ b/core/lib/vm_interface/src/types/inputs/mod.rs @@ -1,3 +1,7 @@ +use zksync_types::{ + l2::L2Tx, ExecuteTransactionCommon, Nonce, PackedEthSignature, Transaction, U256, +}; + pub use self::{ execution_mode::VmExecutionMode, l1_batch_env::L1BatchEnv, @@ -21,3 +25,71 @@ pub struct OneshotEnv { /// in the system context contract, which are set from `L1BatchEnv.first_l2_block` by default. pub current_block: Option, } + +/// Executor-independent arguments necessary to for oneshot transaction execution. +/// +/// # Developer guidelines +/// +/// Please don't add fields that duplicate `SystemEnv` or `L1BatchEnv` information, since both of these +/// are also provided to an executor. +#[derive(Debug)] +pub struct TxExecutionArgs { + /// Transaction / call itself. + pub transaction: Transaction, + /// Nonce override for the initiator account. + pub enforced_nonce: Option, + /// Balance added to the initiator account. + pub added_balance: U256, + /// If `true`, then the batch's L1 / pubdata gas price will be adjusted so that the transaction's gas per pubdata limit is <= + /// to the one in the block. This is often helpful in case we want the transaction validation to work regardless of the + /// current L1 prices for gas or pubdata. + pub adjust_pubdata_price: bool, +} + +impl TxExecutionArgs { + pub fn for_validation(tx: L2Tx) -> Self { + Self { + enforced_nonce: Some(tx.nonce()), + added_balance: U256::zero(), + adjust_pubdata_price: true, + transaction: tx.into(), + } + } + + pub fn for_eth_call(mut call: L2Tx) -> Self { + if call.common_data.signature.is_empty() { + call.common_data.signature = PackedEthSignature::default().serialize_packed().into(); + } + + Self { + enforced_nonce: None, + added_balance: U256::zero(), + adjust_pubdata_price: false, + transaction: call.into(), + } + } + + pub fn for_gas_estimate(transaction: Transaction) -> Self { + // For L2 transactions we need to explicitly put enough balance into the account of the users + // while for L1->L2 transactions the `to_mint` field plays this role + let added_balance = match &transaction.common_data { + ExecuteTransactionCommon::L2(data) => data.fee.gas_limit * data.fee.max_fee_per_gas, + ExecuteTransactionCommon::L1(_) => U256::zero(), + ExecuteTransactionCommon::ProtocolUpgrade(_) => U256::zero(), + }; + + Self { + enforced_nonce: transaction.nonce(), + added_balance, + adjust_pubdata_price: true, + transaction, + } + } +} + +/// Inputs and outputs for all tracers supported for oneshot transaction / call execution. +#[derive(Debug, Default)] +pub struct OneshotTracingParams { + /// Whether to trace contract calls. + pub trace_calls: bool, +} 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 d74d74652e2..6f9c02f0b58 100644 --- a/core/lib/vm_interface/src/types/outputs/execution_result.rs +++ b/core/lib/vm_interface/src/types/outputs/execution_result.rs @@ -11,7 +11,8 @@ use zksync_types::{ }; use crate::{ - CompressedBytecodeInfo, Halt, VmExecutionMetrics, VmExecutionStatistics, VmRevertReason, + BytecodeCompressionError, CompressedBytecodeInfo, Halt, VmExecutionMetrics, + VmExecutionStatistics, VmRevertReason, }; const L1_MESSAGE_EVENT_SIGNATURE: H256 = H256([ @@ -297,11 +298,14 @@ impl Call { } } -/// Mid-level transaction execution output returned by a batch executor. +/// Mid-level transaction execution output returned by a [batch executor](crate::executor::BatchExecutor). #[derive(Debug, Clone)] pub struct BatchTransactionExecutionResult { + /// VM result. pub tx_result: Box, + /// Compressed bytecodes used by the transaction. pub compressed_bytecodes: Vec, + /// Call traces (if requested; otherwise, empty). pub call_traces: Vec, } @@ -311,6 +315,17 @@ impl BatchTransactionExecutionResult { } } +/// Mid-level transaction execution output returned by a [oneshot executor](crate::executor::OneshotExecutor). +#[derive(Debug)] +pub struct OneshotTransactionExecutionResult { + /// VM result. + pub tx_result: Box, + /// Result of compressing bytecodes used by the transaction. + pub compression_result: Result<(), BytecodeCompressionError>, + /// Call traces (if requested; otherwise, empty). + pub call_traces: Vec, +} + /// High-level transaction execution result used by the API server sandbox etc. #[derive(Debug, Clone, PartialEq)] pub struct TransactionExecutionResult { diff --git a/core/lib/vm_interface/src/types/outputs/mod.rs b/core/lib/vm_interface/src/types/outputs/mod.rs index abefa59bbe7..1fa1cd5d168 100644 --- a/core/lib/vm_interface/src/types/outputs/mod.rs +++ b/core/lib/vm_interface/src/types/outputs/mod.rs @@ -1,9 +1,9 @@ pub use self::{ bytecode::CompressedBytecodeInfo, execution_result::{ - BatchTransactionExecutionResult, Call, CallType, ExecutionResult, Refunds, - TransactionExecutionResult, TxExecutionStatus, VmEvent, VmExecutionLogs, - VmExecutionResultAndLogs, + BatchTransactionExecutionResult, Call, CallType, ExecutionResult, + OneshotTransactionExecutionResult, Refunds, TransactionExecutionResult, TxExecutionStatus, + VmEvent, VmExecutionLogs, VmExecutionResultAndLogs, }, execution_state::{BootloaderMemory, CurrentExecutionState}, finished_l1batch::FinishedL1Batch, diff --git a/core/lib/vm_interface/src/types/tracer.rs b/core/lib/vm_interface/src/types/tracer.rs index 1b42b2eabbb..ba07772c7f2 100644 --- a/core/lib/vm_interface/src/types/tracer.rs +++ b/core/lib/vm_interface/src/types/tracer.rs @@ -1,3 +1,7 @@ +use std::{collections::HashSet, fmt}; + +use zksync_types::{Address, U256}; + use crate::Halt; #[derive(Debug, Clone, PartialEq)] @@ -37,3 +41,78 @@ pub enum VmExecutionStopReason { VmFinished, TracerRequestedStop(TracerExecutionStopReason), } + +/// Transaction validation parameters. +#[derive(Debug, Clone)] +pub struct ValidationParams { + pub user_address: Address, + pub paymaster_address: Address, + /// Slots that are trusted (i.e. the user can access them). + pub trusted_slots: HashSet<(Address, U256)>, + /// Trusted addresses (the user can access any slots on these addresses). + pub trusted_addresses: HashSet
, + /// Slots, that are trusted and the value of them is the new trusted address. + /// They are needed to work correctly with beacon proxy, where the address of the implementation is + /// stored in the beacon. + pub trusted_address_slots: HashSet<(Address, U256)>, + /// Number of computational gas that validation step is allowed to use. + pub computational_gas_limit: u32, +} + +/// Rules that can be violated when validating a transaction. +#[derive(Debug, Clone)] +pub enum ViolatedValidationRule { + /// The transaction touched disallowed storage slots during validation. + TouchedDisallowedStorageSlots(Address, U256), + /// The transaction called a contract without attached bytecode. + CalledContractWithNoCode(Address), + /// The transaction touched disallowed context. + TouchedDisallowedContext, + /// The transaction used too much gas during validation. + TookTooManyComputationalGas(u32), +} + +impl fmt::Display for ViolatedValidationRule { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + match self { + ViolatedValidationRule::TouchedDisallowedStorageSlots(contract, key) => write!( + f, + "Touched disallowed storage slots: address {contract:x}, key: {key:x}", + ), + ViolatedValidationRule::CalledContractWithNoCode(contract) => { + write!(f, "Called contract with no code: {contract:x}") + } + ViolatedValidationRule::TouchedDisallowedContext => { + write!(f, "Touched disallowed context") + } + ViolatedValidationRule::TookTooManyComputationalGas(gas_limit) => { + write!( + f, + "Took too many computational gas, allowed limit: {gas_limit}" + ) + } + } + } +} + +/// Errors returned when validating a transaction. +#[derive(Debug)] +pub enum ValidationError { + /// VM execution was halted during validation. + FailedTx(Halt), + /// Transaction violated one of account validation rules. + ViolatedRule(ViolatedValidationRule), +} + +impl fmt::Display for ValidationError { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + match self { + Self::FailedTx(revert_reason) => { + write!(f, "Validation revert: {}", revert_reason) + } + Self::ViolatedRule(rule) => { + write!(f, "Violated validation rules: {}", rule) + } + } + } +} diff --git a/core/lib/web3_decl/src/error.rs b/core/lib/web3_decl/src/error.rs index f42fe8de59d..3aa16a9ab77 100644 --- a/core/lib/web3_decl/src/error.rs +++ b/core/lib/web3_decl/src/error.rs @@ -60,6 +60,19 @@ pub struct EnrichedClientError { args: HashMap<&'static str, String>, } +/// Whether the error should be considered retriable. +pub fn is_retriable(err: &ClientError) -> bool { + match err { + ClientError::Transport(_) | ClientError::RequestTimeout => true, + ClientError::Call(err) => { + // At least some RPC providers use "internal error" in case of the server being overloaded + err.code() == ErrorCode::ServerIsBusy.code() + || err.code() == ErrorCode::InternalError.code() + } + _ => false, + } +} + /// Alias for a result with enriched client RPC error. pub type EnrichedClientResult = Result; @@ -87,15 +100,7 @@ impl EnrichedClientError { /// Whether the error should be considered retriable. pub fn is_retriable(&self) -> bool { - match self.as_ref() { - ClientError::Transport(_) | ClientError::RequestTimeout => true, - ClientError::Call(err) => { - // At least some RPC providers use "internal error" in case of the server being overloaded - err.code() == ErrorCode::ServerIsBusy.code() - || err.code() == ErrorCode::InternalError.code() - } - _ => false, - } + is_retriable(&self.inner_error) } } diff --git a/core/lib/web3_decl/src/namespaces/en.rs b/core/lib/web3_decl/src/namespaces/en.rs index dac774dd7bd..8a4d2db8c6f 100644 --- a/core/lib/web3_decl/src/namespaces/en.rs +++ b/core/lib/web3_decl/src/namespaces/en.rs @@ -25,6 +25,9 @@ pub trait EnNamespace { #[method(name = "consensusGenesis")] async fn consensus_genesis(&self) -> RpcResult>; + #[method(name = "consensusGlobalConfig")] + async fn consensus_global_config(&self) -> RpcResult>; + /// Lists all tokens created at or before the specified `block_number`. /// /// This method is used by EN after snapshot recovery in order to recover token records. diff --git a/core/lib/zksync_core_leftovers/Cargo.toml b/core/lib/zksync_core_leftovers/Cargo.toml index 4eab8823474..6aa6e6a8b43 100644 --- a/core/lib/zksync_core_leftovers/Cargo.toml +++ b/core/lib/zksync_core_leftovers/Cargo.toml @@ -11,12 +11,10 @@ keywords.workspace = true categories.workspace = true [dependencies] -zksync_dal.workspace = true zksync_config.workspace = true zksync_protobuf.workspace = true zksync_protobuf_config.workspace = true zksync_env_config.workspace = true -zksync_node_genesis.workspace = true anyhow.workspace = true tokio = { workspace = true, features = ["time"] } diff --git a/core/lib/zksync_core_leftovers/src/temp_config_store/mod.rs b/core/lib/zksync_core_leftovers/src/temp_config_store/mod.rs index 8224b03da07..2d6af705f48 100644 --- a/core/lib/zksync_core_leftovers/src/temp_config_store/mod.rs +++ b/core/lib/zksync_core_leftovers/src/temp_config_store/mod.rs @@ -18,8 +18,8 @@ use zksync_config::{ GeneralConfig, ObservabilityConfig, PrometheusConfig, ProofDataHandlerConfig, ProtectiveReadsWriterConfig, ProverJobMonitorConfig, PruningConfig, SnapshotRecoveryConfig, }, - ApiConfig, BaseTokenAdjusterConfig, ContractVerifierConfig, DADispatcherConfig, DBConfig, - EthConfig, EthWatchConfig, ExternalProofIntegrationApiConfig, GasAdjusterConfig, + ApiConfig, BaseTokenAdjusterConfig, ContractVerifierConfig, DAClientConfig, DADispatcherConfig, + DBConfig, EthConfig, EthWatchConfig, ExternalProofIntegrationApiConfig, GasAdjusterConfig, ObjectStoreConfig, PostgresConfig, SnapshotsCreatorConfig, }; use zksync_env_config::FromEnv; @@ -68,6 +68,7 @@ pub struct TempConfigStore { pub gas_adjuster_config: Option, pub observability: Option, pub snapshot_creator: Option, + pub da_client_config: Option, pub da_dispatcher_config: Option, pub protective_reads_writer_config: Option, pub basic_witness_input_producer_config: Option, @@ -105,6 +106,7 @@ impl TempConfigStore { eth: self.eth_sender_config.clone(), snapshot_creator: self.snapshot_creator.clone(), observability: self.observability.clone(), + da_client_config: self.da_client_config.clone(), da_dispatcher_config: self.da_dispatcher_config.clone(), protective_reads_writer_config: self.protective_reads_writer_config.clone(), basic_witness_input_producer_config: self.basic_witness_input_producer_config.clone(), @@ -188,6 +190,7 @@ fn load_env_config() -> anyhow::Result { gas_adjuster_config: GasAdjusterConfig::from_env().ok(), observability: ObservabilityConfig::from_env().ok(), snapshot_creator: SnapshotsCreatorConfig::from_env().ok(), + da_client_config: DAClientConfig::from_env().ok(), da_dispatcher_config: DADispatcherConfig::from_env().ok(), protective_reads_writer_config: ProtectiveReadsWriterConfig::from_env().ok(), basic_witness_input_producer_config: BasicWitnessInputProducerConfig::from_env().ok(), diff --git a/core/node/api_server/Cargo.toml b/core/node/api_server/Cargo.toml index f7d40210b48..040e2a94a11 100644 --- a/core/node/api_server/Cargo.toml +++ b/core/node/api_server/Cargo.toml @@ -29,6 +29,7 @@ zksync_utils.workspace = true zksync_protobuf.workspace = true zksync_mini_merkle_tree.workspace = true zksync_multivm.workspace = true +zksync_vm_executor.workspace = true vise.workspace = true anyhow.workspace = true diff --git a/core/node/api_server/src/execution_sandbox/apply.rs b/core/node/api_server/src/execution_sandbox/apply.rs index 8b5cf69822b..0fbf8abc3dd 100644 --- a/core/node/api_server/src/execution_sandbox/apply.rs +++ b/core/node/api_server/src/execution_sandbox/apply.rs @@ -9,19 +9,12 @@ use std::time::{Duration, Instant}; use anyhow::Context as _; -use async_trait::async_trait; use tokio::runtime::Handle; use zksync_dal::{Connection, Core, CoreDal, DalError}; use zksync_multivm::{ - interface::{ - storage::{ReadStorage, StoragePtr, StorageView, WriteStorage}, - BytecodeCompressionError, L1BatchEnv, L2BlockEnv, OneshotEnv, StoredL2BlockEnv, SystemEnv, - TxExecutionMode, VmExecutionMode, VmExecutionResultAndLogs, VmInterface, - }, - tracers::StorageInvocations, - utils::{adjust_pubdata_price_for_tx, get_eth_call_gas_limit}, - vm_latest::{constants::BATCH_COMPUTATIONAL_GAS_LIMIT, HistoryDisabled}, - MultiVMTracer, MultiVmTracerPointer, VmInstance, + interface::{L1BatchEnv, L2BlockEnv, OneshotEnv, StoredL2BlockEnv, SystemEnv}, + utils::get_eth_call_gas_limit, + vm_latest::constants::BATCH_COMPUTATIONAL_GAS_LIMIT, }; use zksync_state::PostgresStorage; use zksync_system_constants::{ @@ -30,18 +23,15 @@ use zksync_system_constants::{ }; use zksync_types::{ api, - block::{pack_block_info, unpack_block_info, L2BlockHasher}, + block::{unpack_block_info, L2BlockHasher}, fee_model::BatchFeeInput, - get_nonce_key, - utils::{decompose_full_nonce, nonces_to_full_nonce, storage_key_for_eth_balance}, - AccountTreeId, L1BatchNumber, L2BlockNumber, Nonce, ProtocolVersionId, StorageKey, Transaction, - H256, U256, + AccountTreeId, L1BatchNumber, L2BlockNumber, ProtocolVersionId, StorageKey, H256, U256, }; -use zksync_utils::{h256_to_u256, time::seconds_since_epoch, u256_to_h256}; +use zksync_utils::{h256_to_u256, time::seconds_since_epoch}; use super::{ - vm_metrics::{self, SandboxStage, SANDBOX_METRICS}, - ApiTracer, BlockArgs, OneshotExecutor, TxExecutionArgs, TxSetupArgs, + vm_metrics::{SandboxStage, SANDBOX_METRICS}, + BlockArgs, TxSetupArgs, }; pub(super) async fn prepare_env_and_storage( @@ -207,218 +197,6 @@ fn prepare_env( (system_env, l1_batch_env) } -// public for testing purposes -#[derive(Debug)] -pub(super) struct VmSandbox { - vm: Box>, - storage_view: StoragePtr>, - transaction: Transaction, -} - -impl VmSandbox { - /// This method is blocking. - pub fn new(storage: S, mut env: OneshotEnv, execution_args: TxExecutionArgs) -> Self { - let mut storage_view = StorageView::new(storage); - Self::setup_storage_view(&mut storage_view, &execution_args, env.current_block); - - let protocol_version = env.system.version; - if execution_args.adjust_pubdata_price { - env.l1_batch.fee_input = adjust_pubdata_price_for_tx( - env.l1_batch.fee_input, - execution_args.transaction.gas_per_pubdata_byte_limit(), - env.l1_batch.enforced_base_fee.map(U256::from), - protocol_version.into(), - ); - }; - - let storage_view = storage_view.to_rc_ptr(); - let vm = Box::new(VmInstance::new_with_specific_version( - env.l1_batch, - env.system, - storage_view.clone(), - protocol_version.into_api_vm_version(), - )); - - Self { - vm, - storage_view, - transaction: execution_args.transaction, - } - } - - /// This method is blocking. - fn setup_storage_view( - storage_view: &mut StorageView, - execution_args: &TxExecutionArgs, - current_block: Option, - ) { - let storage_view_setup_started_at = Instant::now(); - if let Some(nonce) = execution_args.enforced_nonce { - let nonce_key = get_nonce_key(&execution_args.transaction.initiator_account()); - let full_nonce = storage_view.read_value(&nonce_key); - let (_, deployment_nonce) = decompose_full_nonce(h256_to_u256(full_nonce)); - let enforced_full_nonce = nonces_to_full_nonce(U256::from(nonce.0), deployment_nonce); - storage_view.set_value(nonce_key, u256_to_h256(enforced_full_nonce)); - } - - let payer = execution_args.transaction.payer(); - let balance_key = storage_key_for_eth_balance(&payer); - let mut current_balance = h256_to_u256(storage_view.read_value(&balance_key)); - current_balance += execution_args.added_balance; - storage_view.set_value(balance_key, u256_to_h256(current_balance)); - - // Reset L2 block info if necessary. - if let Some(current_block) = current_block { - let l2_block_info_key = StorageKey::new( - AccountTreeId::new(SYSTEM_CONTEXT_ADDRESS), - SYSTEM_CONTEXT_CURRENT_L2_BLOCK_INFO_POSITION, - ); - let l2_block_info = - pack_block_info(current_block.number.into(), current_block.timestamp); - storage_view.set_value(l2_block_info_key, u256_to_h256(l2_block_info)); - - let l2_block_txs_rolling_hash_key = StorageKey::new( - AccountTreeId::new(SYSTEM_CONTEXT_ADDRESS), - SYSTEM_CONTEXT_CURRENT_TX_ROLLING_HASH_POSITION, - ); - storage_view.set_value( - l2_block_txs_rolling_hash_key, - current_block.txs_rolling_hash, - ); - } - - let storage_view_setup_time = storage_view_setup_started_at.elapsed(); - // We don't want to emit too many logs. - if storage_view_setup_time > Duration::from_millis(10) { - tracing::debug!("Prepared the storage view (took {storage_view_setup_time:?})",); - } - } - - fn wrap_tracers( - tracers: Vec, - env: &OneshotEnv, - missed_storage_invocation_limit: usize, - ) -> Vec, HistoryDisabled>> { - let storage_invocation_tracer = StorageInvocations::new(missed_storage_invocation_limit); - let protocol_version = env.system.version; - tracers - .into_iter() - .map(|tracer| tracer.into_boxed(protocol_version)) - .chain([storage_invocation_tracer.into_tracer_pointer()]) - .collect() - } - - pub(super) fn apply(mut self, apply_fn: F) -> T - where - F: FnOnce(&mut VmInstance, Transaction) -> T, - { - let tx_id = format!( - "{:?}-{}", - self.transaction.initiator_account(), - self.transaction.nonce().unwrap_or(Nonce(0)) - ); - - let execution_latency = SANDBOX_METRICS.sandbox[&SandboxStage::Execution].start(); - let result = apply_fn(&mut *self.vm, self.transaction); - let vm_execution_took = execution_latency.observe(); - - let memory_metrics = self.vm.record_vm_memory_metrics(); - vm_metrics::report_vm_memory_metrics( - &tx_id, - &memory_metrics, - vm_execution_took, - self.storage_view.as_ref().borrow_mut().metrics(), - ); - result - } -} - -/// Main [`OneshotExecutor`] implementation used by the API server. -#[derive(Debug, Default)] -pub struct MainOneshotExecutor { - missed_storage_invocation_limit: usize, -} - -impl MainOneshotExecutor { - /// Creates a new executor with the specified limit of cache misses for storage read operations (an anti-DoS measure). - /// The limit is applied for calls and gas estimations, but not during transaction validation. - pub fn new(missed_storage_invocation_limit: usize) -> Self { - Self { - missed_storage_invocation_limit, - } - } -} - -#[async_trait] -impl OneshotExecutor for MainOneshotExecutor -where - S: ReadStorage + Send + 'static, -{ - type Tracers = Vec; - - async fn inspect_transaction( - &self, - storage: S, - env: OneshotEnv, - args: TxExecutionArgs, - tracers: Self::Tracers, - ) -> anyhow::Result { - let missed_storage_invocation_limit = match env.system.execution_mode { - // storage accesses are not limited for tx validation - TxExecutionMode::VerifyExecute => usize::MAX, - TxExecutionMode::EthCall | TxExecutionMode::EstimateFee => { - self.missed_storage_invocation_limit - } - }; - - tokio::task::spawn_blocking(move || { - let tracers = VmSandbox::wrap_tracers(tracers, &env, missed_storage_invocation_limit); - let executor = VmSandbox::new(storage, env, args); - executor.apply(|vm, transaction| { - vm.push_transaction(transaction); - vm.inspect(tracers.into(), VmExecutionMode::OneTx) - }) - }) - .await - .context("VM execution panicked") - } - - async fn inspect_transaction_with_bytecode_compression( - &self, - storage: S, - env: OneshotEnv, - args: TxExecutionArgs, - tracers: Self::Tracers, - ) -> anyhow::Result<( - Result<(), BytecodeCompressionError>, - VmExecutionResultAndLogs, - )> { - let missed_storage_invocation_limit = match env.system.execution_mode { - // storage accesses are not limited for tx validation - TxExecutionMode::VerifyExecute => usize::MAX, - TxExecutionMode::EthCall | TxExecutionMode::EstimateFee => { - self.missed_storage_invocation_limit - } - }; - - tokio::task::spawn_blocking(move || { - let tracers = VmSandbox::wrap_tracers(tracers, &env, missed_storage_invocation_limit); - let executor = VmSandbox::new(storage, env, args); - executor.apply(|vm, transaction| { - let (bytecodes_result, exec_result) = vm - .inspect_transaction_with_bytecode_compression( - tracers.into(), - transaction, - true, - ); - (bytecodes_result.map(drop), exec_result) - }) - }) - .await - .context("VM execution panicked") - } -} - async fn read_stored_l2_block( connection: &mut Connection<'_, Core>, l2_block_number: L2BlockNumber, @@ -467,15 +245,6 @@ impl BlockArgs { ) } - fn is_estimate_like(&self) -> bool { - matches!( - self.block_id, - api::BlockId::Number(api::BlockNumber::Pending) - | api::BlockId::Number(api::BlockNumber::Latest) - | api::BlockId::Number(api::BlockNumber::Committed) - ) - } - pub(crate) async fn default_eth_call_gas( &self, connection: &mut Connection<'_, Core>, @@ -529,7 +298,7 @@ impl BlockArgs { .context("resolved L2 block disappeared from storage")? }; - let historical_fee_input = if !self.is_estimate_like() { + let historical_fee_input = if !self.resolves_to_latest_sealed_l2_block() { let l2_block_header = connection .blocks_dal() .get_l2_block_header(self.resolved_block_number) diff --git a/core/node/api_server/src/execution_sandbox/execute.rs b/core/node/api_server/src/execution_sandbox/execute.rs index 086a75c81de..d22d7de47d0 100644 --- a/core/node/api_server/src/execution_sandbox/execute.rs +++ b/core/node/api_server/src/execution_sandbox/execute.rs @@ -3,86 +3,27 @@ use async_trait::async_trait; use zksync_dal::{Connection, Core}; use zksync_multivm::interface::{ - storage::ReadStorage, BytecodeCompressionError, OneshotEnv, TransactionExecutionMetrics, - VmExecutionResultAndLogs, -}; -use zksync_types::{ - api::state_override::StateOverride, l2::L2Tx, ExecuteTransactionCommon, Nonce, - PackedEthSignature, Transaction, U256, + executor::{OneshotExecutor, TransactionValidator}, + storage::ReadStorage, + tracer::{ValidationError, ValidationParams}, + Call, OneshotEnv, OneshotTracingParams, OneshotTransactionExecutionResult, + TransactionExecutionMetrics, TxExecutionArgs, VmExecutionResultAndLogs, }; +use zksync_types::{api::state_override::StateOverride, l2::L2Tx}; +use zksync_vm_executor::oneshot::{MainOneshotExecutor, MockOneshotExecutor}; use super::{ - apply::{self, MainOneshotExecutor}, - storage::StorageWithOverrides, - testonly::MockOneshotExecutor, - vm_metrics, ApiTracer, BlockArgs, OneshotExecutor, TxSetupArgs, VmPermit, + apply, storage::StorageWithOverrides, vm_metrics, BlockArgs, TxSetupArgs, VmPermit, + SANDBOX_METRICS, }; - -/// Executor-independent arguments necessary to for oneshot transaction execution. -/// -/// # Developer guidelines -/// -/// Please don't add fields that duplicate `SystemEnv` or `L1BatchEnv` information, since both of these -/// are also provided to an executor. -#[derive(Debug)] -pub(crate) struct TxExecutionArgs { - /// Transaction / call itself. - pub transaction: Transaction, - /// Nonce override for the initiator account. - pub enforced_nonce: Option, - /// Balance added to the initiator account. - pub added_balance: U256, - /// If `true`, then the batch's L1 / pubdata gas price will be adjusted so that the transaction's gas per pubdata limit is <= - /// to the one in the block. This is often helpful in case we want the transaction validation to work regardless of the - /// current L1 prices for gas or pubdata. - pub adjust_pubdata_price: bool, -} - -impl TxExecutionArgs { - pub fn for_validation(tx: L2Tx) -> Self { - Self { - enforced_nonce: Some(tx.nonce()), - added_balance: U256::zero(), - adjust_pubdata_price: true, - transaction: tx.into(), - } - } - - pub fn for_eth_call(mut call: L2Tx) -> Self { - if call.common_data.signature.is_empty() { - call.common_data.signature = PackedEthSignature::default().serialize_packed().into(); - } - - Self { - enforced_nonce: None, - added_balance: U256::zero(), - adjust_pubdata_price: false, - transaction: call.into(), - } - } - - pub fn for_gas_estimate(transaction: Transaction) -> Self { - // For L2 transactions we need to explicitly put enough balance into the account of the users - // while for L1->L2 transactions the `to_mint` field plays this role - let added_balance = match &transaction.common_data { - ExecuteTransactionCommon::L2(data) => data.fee.gas_limit * data.fee.max_fee_per_gas, - ExecuteTransactionCommon::L1(_) => U256::zero(), - ExecuteTransactionCommon::ProtocolUpgrade(_) => U256::zero(), - }; - - Self { - enforced_nonce: transaction.nonce(), - added_balance, - adjust_pubdata_price: true, - transaction, - } - } -} +use crate::execution_sandbox::vm_metrics::SandboxStage; #[derive(Debug, Clone)] -pub(crate) struct TransactionExecutionOutput { +pub struct TransactionExecutionOutput { /// Output of the VM. pub vm: VmExecutionResultAndLogs, + /// Traced calls if requested. + pub call_traces: Vec, /// Execution metrics. pub metrics: TransactionExecutionMetrics, /// Were published bytecodes OK? @@ -91,7 +32,7 @@ pub(crate) struct TransactionExecutionOutput { /// Executor of transactions. #[derive(Debug)] -pub(crate) enum TransactionExecutor { +pub enum TransactionExecutor { Real(MainOneshotExecutor), #[doc(hidden)] // Intended for tests only Mock(MockOneshotExecutor), @@ -99,7 +40,10 @@ pub(crate) enum TransactionExecutor { impl TransactionExecutor { pub fn real(missed_storage_invocation_limit: usize) -> Self { - Self::Real(MainOneshotExecutor::new(missed_storage_invocation_limit)) + let mut executor = MainOneshotExecutor::new(missed_storage_invocation_limit); + executor + .set_execution_latency_histogram(&SANDBOX_METRICS.sandbox[&SandboxStage::Execution]); + Self::Real(executor) } /// This method assumes that (block with number `resolved_block_number` is present in DB) @@ -114,7 +58,7 @@ impl TransactionExecutor { connection: Connection<'static, Core>, block_args: BlockArgs, state_override: Option, - tracers: Vec, + tracing_params: OneshotTracingParams, ) -> anyhow::Result { let total_factory_deps = execution_args.transaction.execute.factory_deps.len() as u16; let (env, storage) = @@ -122,64 +66,91 @@ impl TransactionExecutor { let state_override = state_override.unwrap_or_default(); let storage = StorageWithOverrides::new(storage, &state_override); - let (published_bytecodes, execution_result) = self - .inspect_transaction_with_bytecode_compression(storage, env, execution_args, tracers) + let result = self + .inspect_transaction_with_bytecode_compression( + storage, + env, + execution_args, + tracing_params, + ) .await?; drop(vm_permit); let metrics = - vm_metrics::collect_tx_execution_metrics(total_factory_deps, &execution_result); + vm_metrics::collect_tx_execution_metrics(total_factory_deps, &result.tx_result); Ok(TransactionExecutionOutput { - vm: execution_result, + vm: *result.tx_result, + call_traces: result.call_traces, metrics, - are_published_bytecodes_ok: published_bytecodes.is_ok(), + are_published_bytecodes_ok: result.compression_result.is_ok(), }) } } +impl From for TransactionExecutor { + fn from(executor: MockOneshotExecutor) -> Self { + Self::Mock(executor) + } +} + #[async_trait] impl OneshotExecutor for TransactionExecutor where S: ReadStorage + Send + 'static, { - type Tracers = Vec; - - async fn inspect_transaction( + async fn inspect_transaction_with_bytecode_compression( &self, storage: S, env: OneshotEnv, args: TxExecutionArgs, - tracers: Self::Tracers, - ) -> anyhow::Result { + tracing_params: OneshotTracingParams, + ) -> anyhow::Result { match self { Self::Real(executor) => { executor - .inspect_transaction(storage, env, args, tracers) + .inspect_transaction_with_bytecode_compression( + storage, + env, + args, + tracing_params, + ) + .await + } + Self::Mock(executor) => { + executor + .inspect_transaction_with_bytecode_compression( + storage, + env, + args, + tracing_params, + ) .await } - Self::Mock(executor) => executor.inspect_transaction(storage, env, args, ()).await, } } +} - async fn inspect_transaction_with_bytecode_compression( +#[async_trait] +impl TransactionValidator for TransactionExecutor +where + S: ReadStorage + Send + 'static, +{ + async fn validate_transaction( &self, storage: S, env: OneshotEnv, - args: TxExecutionArgs, - tracers: Self::Tracers, - ) -> anyhow::Result<( - Result<(), BytecodeCompressionError>, - VmExecutionResultAndLogs, - )> { + tx: L2Tx, + validation_params: ValidationParams, + ) -> anyhow::Result> { match self { Self::Real(executor) => { executor - .inspect_transaction_with_bytecode_compression(storage, env, args, tracers) + .validate_transaction(storage, env, tx, validation_params) .await } Self::Mock(executor) => { executor - .inspect_transaction_with_bytecode_compression(storage, env, args, ()) + .validate_transaction(storage, env, tx, validation_params) .await } } diff --git a/core/node/api_server/src/execution_sandbox/mod.rs b/core/node/api_server/src/execution_sandbox/mod.rs index f2a3f0e5f8c..79c6123642c 100644 --- a/core/node/api_server/src/execution_sandbox/mod.rs +++ b/core/node/api_server/src/execution_sandbox/mod.rs @@ -4,23 +4,18 @@ use std::{ }; use anyhow::Context as _; -use async_trait::async_trait; use rand::{thread_rng, Rng}; use zksync_dal::{pruning_dal::PruningInfo, Connection, Core, CoreDal, DalError}; -use zksync_multivm::interface::{ - storage::ReadStorage, BytecodeCompressionError, OneshotEnv, TxExecutionMode, - VmExecutionResultAndLogs, -}; +use zksync_multivm::interface::TxExecutionMode; use zksync_state::PostgresStorageCaches; use zksync_types::{ api, fee_model::BatchFeeInput, AccountTreeId, Address, L1BatchNumber, L2BlockNumber, L2ChainId, }; +pub use self::execute::TransactionExecutor; // FIXME (PLA-1018): remove use self::vm_metrics::SandboxStage; pub(super) use self::{ error::SandboxExecutionError, - execute::{TransactionExecutor, TxExecutionArgs}, - tracers::ApiTracer, validate::ValidationError, vm_metrics::{SubmitTxStage, SANDBOX_METRICS}, }; @@ -31,10 +26,8 @@ mod apply; mod error; mod execute; mod storage; -pub mod testonly; #[cfg(test)] mod tests; -mod tracers; mod validate; mod vm_metrics; @@ -158,7 +151,7 @@ async fn get_pending_state( /// Arguments for VM execution necessary to set up storage and environment. #[derive(Debug, Clone)] -pub(crate) struct TxSetupArgs { +pub struct TxSetupArgs { pub execution_mode: TxExecutionMode, pub operator_account: AccountTreeId, pub fee_input: BatchFeeInput, @@ -184,7 +177,7 @@ impl TxSetupArgs { caches: PostgresStorageCaches::new(1, 1), validation_computational_gas_limit: u32::MAX, chain_id: L2ChainId::default(), - whitelisted_tokens_for_aa: Vec::new(), + whitelisted_tokens_for_aa: vec![], enforced_base_fee: None, } } @@ -215,7 +208,7 @@ impl BlockStartInfoInner { /// Information about first L1 batch / L2 block in the node storage. #[derive(Debug, Clone)] -pub(crate) struct BlockStartInfo { +pub struct BlockStartInfo { cached_pruning_info: Arc>, max_cache_age: Duration, } @@ -331,7 +324,7 @@ impl BlockStartInfo { } #[derive(Debug, thiserror::Error)] -pub(crate) enum BlockArgsError { +pub enum BlockArgsError { #[error("Block is pruned; first retained block is {0}")] Pruned(L2BlockNumber), #[error("Block is missing, but can appear in the future")] @@ -342,7 +335,7 @@ pub(crate) enum BlockArgsError { /// Information about a block provided to VM. #[derive(Debug, Clone, Copy)] -pub(crate) struct BlockArgs { +pub struct BlockArgs { block_id: api::BlockId, resolved_block_number: L2BlockNumber, l1_batch_timestamp_s: Option, @@ -417,28 +410,3 @@ impl BlockArgs { ) } } - -/// VM executor capable of executing isolated transactions / calls (as opposed to batch execution). -#[async_trait] -trait OneshotExecutor { - type Tracers: Default; - - async fn inspect_transaction( - &self, - storage: S, - env: OneshotEnv, - args: TxExecutionArgs, - tracers: Self::Tracers, - ) -> anyhow::Result; - - async fn inspect_transaction_with_bytecode_compression( - &self, - storage: S, - env: OneshotEnv, - args: TxExecutionArgs, - tracers: Self::Tracers, - ) -> anyhow::Result<( - Result<(), BytecodeCompressionError>, - VmExecutionResultAndLogs, - )>; -} diff --git a/core/node/api_server/src/execution_sandbox/tests.rs b/core/node/api_server/src/execution_sandbox/tests.rs index da593292e2e..35103779a49 100644 --- a/core/node/api_server/src/execution_sandbox/tests.rs +++ b/core/node/api_server/src/execution_sandbox/tests.rs @@ -1,16 +1,31 @@ //! Tests for the VM execution sandbox. +use std::collections::HashMap; + use assert_matches::assert_matches; +use test_casing::test_casing; use zksync_dal::ConnectionPool; +use zksync_multivm::{ + interface::{ + executor::{OneshotExecutor, TransactionValidator}, + tracer::ValidationError, + Halt, OneshotTracingParams, TxExecutionArgs, + }, + utils::derive_base_fee_and_gas_per_pubdata, +}; use zksync_node_genesis::{insert_genesis_batch, GenesisParams}; -use zksync_node_test_utils::{create_l2_block, create_l2_transaction, prepare_recovery_snapshot}; -use zksync_types::{api::state_override::StateOverride, Transaction}; - -use super::*; -use crate::{ - execution_sandbox::{apply::VmSandbox, storage::StorageWithOverrides}, - tx_sender::ApiContracts, +use zksync_node_test_utils::{create_l2_block, prepare_recovery_snapshot}; +use zksync_types::{ + api::state_override::{OverrideAccount, StateOverride}, + fee::Fee, + l2::L2Tx, + transaction_request::PaymasterParams, + K256PrivateKey, Nonce, ProtocolVersionId, Transaction, U256, }; +use zksync_vm_executor::oneshot::MainOneshotExecutor; + +use super::{storage::StorageWithOverrides, *}; +use crate::tx_sender::ApiContracts; #[tokio::test] async fn creating_block_args() { @@ -167,7 +182,7 @@ async fn creating_block_args_after_snapshot_recovery() { } #[tokio::test] -async fn instantiating_vm() { +async fn estimating_gas() { let pool = ConnectionPool::::test_pool().await; let mut connection = pool.connection().await.unwrap(); insert_genesis_batch(&mut connection, &GenesisParams::mock()) @@ -188,24 +203,104 @@ async fn instantiating_vm() { } async fn test_instantiating_vm(connection: Connection<'static, Core>, block_args: BlockArgs) { - let transaction = Transaction::from(create_l2_transaction(10, 100)); let estimate_gas_contracts = ApiContracts::load_from_disk().await.unwrap().estimate_gas; + let mut setup_args = TxSetupArgs::mock(TxExecutionMode::EstimateFee, estimate_gas_contracts); + let (base_fee, gas_per_pubdata) = derive_base_fee_and_gas_per_pubdata( + setup_args.fee_input, + ProtocolVersionId::latest().into(), + ); + setup_args.enforced_base_fee = Some(base_fee); + let transaction = Transaction::from(create_transfer(base_fee, gas_per_pubdata)); let execution_args = TxExecutionArgs::for_gas_estimate(transaction.clone()); - let (env, storage) = apply::prepare_env_and_storage( - connection, - TxSetupArgs::mock(TxExecutionMode::EstimateFee, estimate_gas_contracts), - &block_args, - ) - .await - .unwrap(); + let (env, storage) = apply::prepare_env_and_storage(connection, setup_args, &block_args) + .await + .unwrap(); let storage = StorageWithOverrides::new(storage, &StateOverride::default()); - tokio::task::spawn_blocking(move || { - VmSandbox::new(storage, env, execution_args).apply(|_, received_tx| { - assert_eq!(received_tx, transaction); - }); - }) - .await - .expect("VM execution panicked") + let tracing_params = OneshotTracingParams::default(); + let output = MainOneshotExecutor::new(usize::MAX) + .inspect_transaction_with_bytecode_compression(storage, env, execution_args, tracing_params) + .await + .unwrap(); + output.compression_result.unwrap(); + let tx_result = *output.tx_result; + assert!(!tx_result.result.is_failed(), "{tx_result:#?}"); +} + +fn create_transfer(fee_per_gas: u64, gas_per_pubdata: u64) -> L2Tx { + let fee = Fee { + gas_limit: 200_000.into(), + max_fee_per_gas: fee_per_gas.into(), + max_priority_fee_per_gas: 0_u64.into(), + gas_per_pubdata_limit: gas_per_pubdata.into(), + }; + L2Tx::new_signed( + Address::random(), + vec![], + Nonce(0), + fee, + U256::zero(), + L2ChainId::default(), + &K256PrivateKey::random(), + vec![], + PaymasterParams::default(), + ) + .unwrap() +} + +#[test_casing(2, [false, true])] +#[tokio::test] +async fn validating_transaction(set_balance: bool) { + let pool = ConnectionPool::::test_pool().await; + let mut connection = pool.connection().await.unwrap(); + insert_genesis_batch(&mut connection, &GenesisParams::mock()) + .await + .unwrap(); + + let block_args = BlockArgs::pending(&mut connection).await.unwrap(); + + let call_contracts = ApiContracts::load_from_disk().await.unwrap().eth_call; + let mut setup_args = TxSetupArgs::mock(TxExecutionMode::VerifyExecute, call_contracts); + let (base_fee, gas_per_pubdata) = derive_base_fee_and_gas_per_pubdata( + setup_args.fee_input, + ProtocolVersionId::latest().into(), + ); + setup_args.enforced_base_fee = Some(base_fee); + let transaction = create_transfer(base_fee, gas_per_pubdata); + + let validation_params = + validate::get_validation_params(&mut connection, &transaction, u32::MAX, &[]) + .await + .unwrap(); + let (env, storage) = apply::prepare_env_and_storage(connection, setup_args, &block_args) + .await + .unwrap(); + let state_override = if set_balance { + let account_override = OverrideAccount { + balance: Some(U256::from(1) << 128), + ..OverrideAccount::default() + }; + StateOverride::new(HashMap::from([( + transaction.initiator_account(), + account_override, + )])) + } else { + StateOverride::default() + }; + let storage = StorageWithOverrides::new(storage, &state_override); + + let validation_result = MainOneshotExecutor::new(usize::MAX) + .validate_transaction(storage, env, transaction, validation_params) + .await + .unwrap(); + if set_balance { + validation_result.expect("validation failed"); + } else { + assert_matches!( + validation_result.unwrap_err(), + ValidationError::FailedTx(Halt::ValidationFailed(reason)) + if reason.to_string().contains("Not enough balance") + ); + } } diff --git a/core/node/api_server/src/execution_sandbox/tracers.rs b/core/node/api_server/src/execution_sandbox/tracers.rs deleted file mode 100644 index 31384b7a089..00000000000 --- a/core/node/api_server/src/execution_sandbox/tracers.rs +++ /dev/null @@ -1,51 +0,0 @@ -use std::sync::Arc; - -use once_cell::sync::OnceCell; -use zksync_multivm::{ - interface::{storage::WriteStorage, Call}, - tracers::{CallTracer, ValidationTracer, ValidationTracerParams, ViolatedValidationRule}, - vm_latest::HistoryDisabled, - MultiVMTracer, MultiVmTracerPointer, -}; -use zksync_types::ProtocolVersionId; - -/// Custom tracers supported by the API sandbox. -#[derive(Debug)] -pub(crate) enum ApiTracer { - CallTracer(Arc>>), - Validation { - params: ValidationTracerParams, - result: Arc>, - }, -} - -impl ApiTracer { - pub fn validation( - params: ValidationTracerParams, - ) -> (Self, Arc>) { - let result = Arc::>::default(); - let this = Self::Validation { - params, - result: result.clone(), - }; - (this, result) - } - - pub(super) fn into_boxed( - self, - protocol_version: ProtocolVersionId, - ) -> MultiVmTracerPointer - where - S: WriteStorage, - { - match self { - Self::CallTracer(traces) => CallTracer::new(traces).into_tracer_pointer(), - Self::Validation { params, result } => { - let (mut tracer, _) = - ValidationTracer::::new(params, protocol_version.into()); - tracer.result = result; - tracer.into_tracer_pointer() - } - } - } -} diff --git a/core/node/api_server/src/execution_sandbox/validate.rs b/core/node/api_server/src/execution_sandbox/validate.rs index a95cf6c3a91..e9087e608ee 100644 --- a/core/node/api_server/src/execution_sandbox/validate.rs +++ b/core/node/api_server/src/execution_sandbox/validate.rs @@ -3,9 +3,9 @@ use std::collections::HashSet; use anyhow::Context as _; use tracing::Instrument; use zksync_dal::{Connection, Core, CoreDal}; -use zksync_multivm::{ - interface::ExecutionResult, - tracers::{ValidationError as RawValidationError, ValidationTracerParams}, +use zksync_multivm::interface::{ + executor::TransactionValidator, + tracer::{ValidationError as RawValidationError, ValidationParams}, }; use zksync_types::{ api::state_override::StateOverride, l2::L2Tx, Address, TRUSTED_ADDRESS_SLOTS, @@ -17,7 +17,7 @@ use super::{ execute::TransactionExecutor, storage::StorageWithOverrides, vm_metrics::{SandboxStage, EXECUTION_METRICS, SANDBOX_METRICS}, - ApiTracer, BlockArgs, OneshotExecutor, TxExecutionArgs, TxSetupArgs, VmPermit, + BlockArgs, TxSetupArgs, VmPermit, }; /// Validation error used by the sandbox. Besides validation errors returned by VM, it also includes an internal error @@ -42,7 +42,7 @@ impl TransactionExecutor { computational_gas_limit: u32, ) -> Result<(), ValidationError> { let total_latency = SANDBOX_METRICS.sandbox[&SandboxStage::ValidateInSandbox].start(); - let params = get_validation_params( + let validation_params = get_validation_params( &mut connection, &tx, computational_gas_limit, @@ -55,21 +55,14 @@ impl TransactionExecutor { apply::prepare_env_and_storage(connection, setup_args, &block_args).await?; let storage = StorageWithOverrides::new(storage, &StateOverride::default()); - let execution_args = TxExecutionArgs::for_validation(tx); - let (tracer, validation_result) = ApiTracer::validation(params); let stage_latency = SANDBOX_METRICS.sandbox[&SandboxStage::Validation].start(); - let result = self - .inspect_transaction(storage, env, execution_args, vec![tracer]) + let validation_result = self + .validate_transaction(storage, env, tx, validation_params) .instrument(tracing::debug_span!("validation")) .await?; drop(vm_permit); stage_latency.observe(); - let validation_result = match (result.result, validation_result.get()) { - (_, Some(rule)) => Err(RawValidationError::ViolatedRule(rule.clone())), - (ExecutionResult::Halt { reason }, _) => Err(RawValidationError::FailedTx(reason)), - (_, None) => Ok(()), - }; total_latency.observe(); validation_result.map_err(ValidationError::Vm) } @@ -78,12 +71,12 @@ impl TransactionExecutor { /// Some slots can be marked as "trusted". That is needed for slots which can not be /// trusted to change between validation and execution in general case, but /// sometimes we can safely rely on them to not change often. -async fn get_validation_params( +pub(super) async fn get_validation_params( connection: &mut Connection<'_, Core>, tx: &L2Tx, computational_gas_limit: u32, whitelisted_tokens_for_aa: &[Address], -) -> anyhow::Result { +) -> anyhow::Result { let method_latency = EXECUTION_METRICS.get_validation_params.start(); let user_address = tx.common_data.initiator_address; let paymaster_address = tx.common_data.paymaster_params.paymaster; @@ -122,7 +115,7 @@ async fn get_validation_params( span.exit(); method_latency.observe(); - Ok(ValidationTracerParams { + Ok(ValidationParams { user_address, paymaster_address, trusted_slots, diff --git a/core/node/api_server/src/execution_sandbox/vm_metrics.rs b/core/node/api_server/src/execution_sandbox/vm_metrics.rs index ffe87be899b..cbfe7e90bd0 100644 --- a/core/node/api_server/src/execution_sandbox/vm_metrics.rs +++ b/core/node/api_server/src/execution_sandbox/vm_metrics.rs @@ -4,77 +4,14 @@ use vise::{ Buckets, EncodeLabelSet, EncodeLabelValue, Family, Gauge, Histogram, LatencyObserver, Metrics, }; use zksync_multivm::{ - interface::{ - storage::StorageViewMetrics, TransactionExecutionMetrics, VmEvent, - VmExecutionResultAndLogs, VmMemoryMetrics, - }, + interface::{TransactionExecutionMetrics, VmEvent, VmExecutionResultAndLogs}, utils::StorageWritesDeduplicator, }; -use zksync_shared_metrics::InteractionType; use zksync_types::H256; use zksync_utils::bytecode::bytecode_len_in_bytes; use crate::utils::ReportFilter; -#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, EncodeLabelValue, EncodeLabelSet)] -#[metrics(label = "type", rename_all = "snake_case")] -enum SizeType { - Inner, - History, -} - -const MEMORY_SIZE_BUCKETS: Buckets = Buckets::values(&[ - 1_000.0, - 10_000.0, - 100_000.0, - 500_000.0, - 1_000_000.0, - 5_000_000.0, - 10_000_000.0, - 50_000_000.0, - 100_000_000.0, - 500_000_000.0, - 1_000_000_000.0, -]); - -#[derive(Debug, Metrics)] -#[metrics(prefix = "runtime_context_memory")] -struct RuntimeContextMemoryMetrics { - #[metrics(buckets = MEMORY_SIZE_BUCKETS)] - event_sink_size: Family>, - #[metrics(buckets = MEMORY_SIZE_BUCKETS)] - memory_size: Family>, - #[metrics(buckets = MEMORY_SIZE_BUCKETS)] - decommitter_size: Family>, - #[metrics(buckets = MEMORY_SIZE_BUCKETS)] - storage_size: Family>, - #[metrics(buckets = MEMORY_SIZE_BUCKETS)] - storage_view_cache_size: Histogram, - #[metrics(buckets = MEMORY_SIZE_BUCKETS)] - full: Histogram, -} - -#[vise::register] -static MEMORY_METRICS: vise::Global = vise::Global::new(); - -const INTERACTION_AMOUNT_BUCKETS: Buckets = Buckets::exponential(10.0..=10_000_000.0, 10.0); - -#[derive(Debug, Metrics)] -#[metrics(prefix = "runtime_context_storage_interaction")] -struct RuntimeContextStorageMetrics { - #[metrics(buckets = INTERACTION_AMOUNT_BUCKETS)] - amount: Family>, - #[metrics(buckets = Buckets::LATENCIES)] - duration: Family>, - #[metrics(buckets = Buckets::LATENCIES)] - duration_per_unit: Family>, - #[metrics(buckets = Buckets::ZERO_TO_ONE)] - ratio: Histogram, -} - -#[vise::register] -static STORAGE_METRICS: vise::Global = vise::Global::new(); - #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, EncodeLabelValue, EncodeLabelSet)] #[metrics(label = "stage", rename_all = "snake_case")] pub(super) enum SandboxStage { @@ -185,84 +122,6 @@ pub(super) struct ExecutionMetrics { #[vise::register] pub(super) static EXECUTION_METRICS: vise::Global = vise::Global::new(); -pub(super) fn report_vm_memory_metrics( - tx_id: &str, - memory_metrics: &VmMemoryMetrics, - vm_execution_took: Duration, - storage_metrics: StorageViewMetrics, -) { - MEMORY_METRICS.event_sink_size[&SizeType::Inner].observe(memory_metrics.event_sink_inner); - MEMORY_METRICS.event_sink_size[&SizeType::History].observe(memory_metrics.event_sink_history); - MEMORY_METRICS.memory_size[&SizeType::Inner].observe(memory_metrics.memory_inner); - MEMORY_METRICS.memory_size[&SizeType::History].observe(memory_metrics.memory_history); - MEMORY_METRICS.decommitter_size[&SizeType::Inner] - .observe(memory_metrics.decommittment_processor_inner); - MEMORY_METRICS.decommitter_size[&SizeType::History] - .observe(memory_metrics.decommittment_processor_history); - MEMORY_METRICS.storage_size[&SizeType::Inner].observe(memory_metrics.storage_inner); - MEMORY_METRICS.storage_size[&SizeType::History].observe(memory_metrics.storage_history); - - MEMORY_METRICS - .storage_view_cache_size - .observe(storage_metrics.cache_size); - MEMORY_METRICS - .full - .observe(memory_metrics.full_size() + storage_metrics.cache_size); - - let total_storage_invocations = storage_metrics.get_value_storage_invocations - + storage_metrics.set_value_storage_invocations; - let total_time_spent_in_storage = - storage_metrics.time_spent_on_get_value + storage_metrics.time_spent_on_set_value; - - STORAGE_METRICS.amount[&InteractionType::Missed] - .observe(storage_metrics.storage_invocations_missed); - STORAGE_METRICS.amount[&InteractionType::GetValue] - .observe(storage_metrics.get_value_storage_invocations); - STORAGE_METRICS.amount[&InteractionType::SetValue] - .observe(storage_metrics.set_value_storage_invocations); - STORAGE_METRICS.amount[&InteractionType::Total].observe(total_storage_invocations); - - STORAGE_METRICS.duration[&InteractionType::Missed] - .observe(storage_metrics.time_spent_on_storage_missed); - STORAGE_METRICS.duration[&InteractionType::GetValue] - .observe(storage_metrics.time_spent_on_get_value); - STORAGE_METRICS.duration[&InteractionType::SetValue] - .observe(storage_metrics.time_spent_on_set_value); - STORAGE_METRICS.duration[&InteractionType::Total].observe(total_time_spent_in_storage); - - if total_storage_invocations > 0 { - STORAGE_METRICS.duration_per_unit[&InteractionType::Total] - .observe(total_time_spent_in_storage.div_f64(total_storage_invocations as f64)); - } - if storage_metrics.storage_invocations_missed > 0 { - let duration_per_unit = storage_metrics - .time_spent_on_storage_missed - .div_f64(storage_metrics.storage_invocations_missed as f64); - STORAGE_METRICS.duration_per_unit[&InteractionType::Missed].observe(duration_per_unit); - } - - STORAGE_METRICS - .ratio - .observe(total_time_spent_in_storage.as_secs_f64() / vm_execution_took.as_secs_f64()); - - const STORAGE_INVOCATIONS_DEBUG_THRESHOLD: usize = 1_000; - - if total_storage_invocations > STORAGE_INVOCATIONS_DEBUG_THRESHOLD { - tracing::info!( - "Tx {tx_id} resulted in {total_storage_invocations} storage_invocations, {} new_storage_invocations, \ - {} get_value_storage_invocations, {} set_value_storage_invocations, \ - vm execution took {vm_execution_took:?}, storage interaction took {total_time_spent_in_storage:?} \ - (missed: {:?} get: {:?} set: {:?})", - storage_metrics.storage_invocations_missed, - storage_metrics.get_value_storage_invocations, - storage_metrics.set_value_storage_invocations, - storage_metrics.time_spent_on_storage_missed, - storage_metrics.time_spent_on_get_value, - storage_metrics.time_spent_on_set_value, - ); - } -} - pub(super) fn collect_tx_execution_metrics( contracts_deployed: u16, result: &VmExecutionResultAndLogs, diff --git a/core/node/api_server/src/tx_sender/mod.rs b/core/node/api_server/src/tx_sender/mod.rs index 5f913e305cd..44eaae2e3ee 100644 --- a/core/node/api_server/src/tx_sender/mod.rs +++ b/core/node/api_server/src/tx_sender/mod.rs @@ -10,7 +10,10 @@ use zksync_dal::{ transactions_dal::L2TxSubmissionResult, Connection, ConnectionPool, Core, CoreDal, }; use zksync_multivm::{ - interface::{TransactionExecutionMetrics, TxExecutionMode, VmExecutionResultAndLogs}, + interface::{ + OneshotTracingParams, TransactionExecutionMetrics, TxExecutionArgs, TxExecutionMode, + VmExecutionResultAndLogs, + }, utils::{ adjust_pubdata_price_for_tx, derive_base_fee_and_gas_per_pubdata, derive_overhead, get_max_batch_gas_limit, @@ -41,8 +44,8 @@ pub(super) use self::result::SubmitTxError; use self::{master_pool_sink::MasterPoolSink, tx_sink::TxSink}; use crate::{ execution_sandbox::{ - BlockArgs, SubmitTxStage, TransactionExecutor, TxExecutionArgs, TxSetupArgs, - VmConcurrencyBarrier, VmConcurrencyLimiter, VmPermit, SANDBOX_METRICS, + BlockArgs, SubmitTxStage, TransactionExecutor, TxSetupArgs, VmConcurrencyBarrier, + VmConcurrencyLimiter, VmPermit, SANDBOX_METRICS, }, tx_sender::result::ApiCallResult, }; @@ -140,6 +143,38 @@ impl MultiVMBaseSystemContracts { } } } + + pub fn load_estimate_gas_blocking() -> Self { + Self { + pre_virtual_blocks: BaseSystemContracts::estimate_gas_pre_virtual_blocks(), + post_virtual_blocks: BaseSystemContracts::estimate_gas_post_virtual_blocks(), + post_virtual_blocks_finish_upgrade_fix: + BaseSystemContracts::estimate_gas_post_virtual_blocks_finish_upgrade_fix(), + post_boojum: BaseSystemContracts::estimate_gas_post_boojum(), + post_allowlist_removal: BaseSystemContracts::estimate_gas_post_allowlist_removal(), + post_1_4_1: BaseSystemContracts::estimate_gas_post_1_4_1(), + post_1_4_2: BaseSystemContracts::estimate_gas_post_1_4_2(), + vm_1_5_0_small_memory: BaseSystemContracts::estimate_gas_1_5_0_small_memory(), + vm_1_5_0_increased_memory: + BaseSystemContracts::estimate_gas_post_1_5_0_increased_memory(), + } + } + + pub fn load_eth_call_blocking() -> Self { + Self { + pre_virtual_blocks: BaseSystemContracts::playground_pre_virtual_blocks(), + post_virtual_blocks: BaseSystemContracts::playground_post_virtual_blocks(), + post_virtual_blocks_finish_upgrade_fix: + BaseSystemContracts::playground_post_virtual_blocks_finish_upgrade_fix(), + post_boojum: BaseSystemContracts::playground_post_boojum(), + post_allowlist_removal: BaseSystemContracts::playground_post_allowlist_removal(), + post_1_4_1: BaseSystemContracts::playground_post_1_4_1(), + post_1_4_2: BaseSystemContracts::playground_post_1_4_2(), + vm_1_5_0_small_memory: BaseSystemContracts::playground_1_5_0_small_memory(), + vm_1_5_0_increased_memory: BaseSystemContracts::playground_post_1_5_0_increased_memory( + ), + } + } } /// Smart contracts to be used in the API sandbox requests, e.g. for estimating gas and @@ -169,32 +204,8 @@ impl ApiContracts { /// Blocking version of [`Self::load_from_disk()`]. pub fn load_from_disk_blocking() -> Self { Self { - estimate_gas: MultiVMBaseSystemContracts { - pre_virtual_blocks: BaseSystemContracts::estimate_gas_pre_virtual_blocks(), - post_virtual_blocks: BaseSystemContracts::estimate_gas_post_virtual_blocks(), - post_virtual_blocks_finish_upgrade_fix: - BaseSystemContracts::estimate_gas_post_virtual_blocks_finish_upgrade_fix(), - post_boojum: BaseSystemContracts::estimate_gas_post_boojum(), - post_allowlist_removal: BaseSystemContracts::estimate_gas_post_allowlist_removal(), - post_1_4_1: BaseSystemContracts::estimate_gas_post_1_4_1(), - post_1_4_2: BaseSystemContracts::estimate_gas_post_1_4_2(), - vm_1_5_0_small_memory: BaseSystemContracts::estimate_gas_1_5_0_small_memory(), - vm_1_5_0_increased_memory: - BaseSystemContracts::estimate_gas_post_1_5_0_increased_memory(), - }, - eth_call: MultiVMBaseSystemContracts { - pre_virtual_blocks: BaseSystemContracts::playground_pre_virtual_blocks(), - post_virtual_blocks: BaseSystemContracts::playground_post_virtual_blocks(), - post_virtual_blocks_finish_upgrade_fix: - BaseSystemContracts::playground_post_virtual_blocks_finish_upgrade_fix(), - post_boojum: BaseSystemContracts::playground_post_boojum(), - post_allowlist_removal: BaseSystemContracts::playground_post_allowlist_removal(), - post_1_4_1: BaseSystemContracts::playground_post_1_4_1(), - post_1_4_2: BaseSystemContracts::playground_post_1_4_2(), - vm_1_5_0_small_memory: BaseSystemContracts::playground_1_5_0_small_memory(), - vm_1_5_0_increased_memory: - BaseSystemContracts::playground_post_1_5_0_increased_memory(), - }, + estimate_gas: MultiVMBaseSystemContracts::load_estimate_gas_blocking(), + eth_call: MultiVMBaseSystemContracts::load_eth_call_blocking(), } } } @@ -388,7 +399,7 @@ impl TxSender { connection, block_args, None, - vec![], + OneshotTracingParams::default(), ) .await?; tracing::info!( @@ -725,7 +736,7 @@ impl TxSender { connection, block_args, state_override, - vec![], + OneshotTracingParams::default(), ) .await?; Ok((execution_output.vm, execution_output.metrics)) @@ -1003,7 +1014,7 @@ impl TxSender { .await } - pub(super) async fn eth_call( + pub async fn eth_call( &self, block_args: BlockArgs, call_overrides: CallOverrides, @@ -1025,7 +1036,7 @@ impl TxSender { connection, block_args, state_override, - vec![], + OneshotTracingParams::default(), ) .await?; result.vm.into_api_call_result() diff --git a/core/node/api_server/src/tx_sender/tests.rs b/core/node/api_server/src/tx_sender/tests.rs index 5b2ab0495da..0ac3eb0b4f3 100644 --- a/core/node/api_server/src/tx_sender/tests.rs +++ b/core/node/api_server/src/tx_sender/tests.rs @@ -9,12 +9,10 @@ use zksync_node_genesis::{insert_genesis_batch, GenesisParams}; use zksync_node_test_utils::{create_l2_block, create_l2_transaction, prepare_recovery_snapshot}; use zksync_types::{api, get_nonce_key, L1BatchNumber, L2BlockNumber, StorageLog}; use zksync_utils::u256_to_h256; +use zksync_vm_executor::oneshot::MockOneshotExecutor; use super::*; -use crate::{ - execution_sandbox::{testonly::MockOneshotExecutor, BlockStartInfo}, - web3::testonly::create_test_tx_sender, -}; +use crate::{execution_sandbox::BlockStartInfo, web3::testonly::create_test_tx_sender}; #[tokio::test] async fn getting_nonce_for_account() { diff --git a/core/node/api_server/src/web3/backend_jsonrpsee/namespaces/en.rs b/core/node/api_server/src/web3/backend_jsonrpsee/namespaces/en.rs index c3e116d3992..de763526373 100644 --- a/core/node/api_server/src/web3/backend_jsonrpsee/namespaces/en.rs +++ b/core/node/api_server/src/web3/backend_jsonrpsee/namespaces/en.rs @@ -19,6 +19,12 @@ impl EnNamespaceServer for EnNamespace { .map_err(|err| self.current_method().map_err(err)) } + async fn consensus_global_config(&self) -> RpcResult> { + self.consensus_global_config_impl() + .await + .map_err(|err| self.current_method().map_err(err)) + } + async fn consensus_genesis(&self) -> RpcResult> { self.consensus_genesis_impl() .await diff --git a/core/node/api_server/src/web3/namespaces/debug.rs b/core/node/api_server/src/web3/namespaces/debug.rs index 473391476a3..ad00f6a878b 100644 --- a/core/node/api_server/src/web3/namespaces/debug.rs +++ b/core/node/api_server/src/web3/namespaces/debug.rs @@ -1,10 +1,9 @@ -use std::sync::Arc; - use anyhow::Context as _; -use once_cell::sync::OnceCell; use zksync_dal::{CoreDal, DalError}; use zksync_multivm::{ - interface::{Call, CallType, ExecutionResult, TxExecutionMode}, + interface::{ + Call, CallType, ExecutionResult, OneshotTracingParams, TxExecutionArgs, TxExecutionMode, + }, vm_latest::constants::BATCH_COMPUTATIONAL_GAS_LIMIT, }; use zksync_system_constants::MAX_ENCODED_TX_SIZE; @@ -19,7 +18,7 @@ use zksync_types::{ use zksync_web3_decl::error::Web3Error; use crate::{ - execution_sandbox::{ApiTracer, TxExecutionArgs, TxSetupArgs}, + execution_sandbox::TxSetupArgs, tx_sender::{ApiContracts, TxSenderConfig}, web3::{backend_jsonrpsee::MethodTracer, state::RpcState}, }; @@ -190,11 +189,8 @@ impl DebugNamespace { let vm_permit = vm_permit.context("cannot acquire VM permit")?; // We don't need properly trace if we only need top call - let call_tracer_result = Arc::new(OnceCell::default()); - let custom_tracers = if only_top_call { - vec![] - } else { - vec![ApiTracer::CallTracer(call_tracer_result.clone())] + let tracing_params = OneshotTracingParams { + trace_calls: !only_top_call, }; let connection = self.state.acquire_connection().await?; @@ -207,12 +203,11 @@ impl DebugNamespace { connection, block_args, None, - custom_tracers, + tracing_params, ) - .await? - .vm; + .await?; - let (output, revert_reason) = match result.result { + let (output, revert_reason) = match result.vm.result { ExecutionResult::Success { output, .. } => (output, None), ExecutionResult::Revert { output } => (vec![], Some(output.to_string())), ExecutionResult::Halt { reason } => { @@ -223,19 +218,14 @@ impl DebugNamespace { } }; - // We had only one copy of Arc this arc is already dropped it's safe to unwrap - let trace = Arc::try_unwrap(call_tracer_result) - .unwrap() - .take() - .unwrap_or_default(); let call = Call::new_high_level( tx.common_data.fee.gas_limit.as_u64(), - result.statistics.gas_used, + result.vm.statistics.gas_used, tx.execute.value, tx.execute.calldata, output, revert_reason, - trace, + result.call_traces, ); Ok(Self::map_call(call, false)) } diff --git a/core/node/api_server/src/web3/namespaces/en.rs b/core/node/api_server/src/web3/namespaces/en.rs index ca15352fd1a..26f4aa2b0b5 100644 --- a/core/node/api_server/src/web3/namespaces/en.rs +++ b/core/node/api_server/src/web3/namespaces/en.rs @@ -21,18 +21,35 @@ impl EnNamespace { Self { state } } + pub async fn consensus_global_config_impl( + &self, + ) -> Result, Web3Error> { + let mut conn = self.state.acquire_connection().await?; + let Some(cfg) = conn + .consensus_dal() + .global_config() + .await + .context("global_config()")? + else { + return Ok(None); + }; + Ok(Some(en::ConsensusGlobalConfig( + zksync_protobuf::serde::serialize(&cfg, serde_json::value::Serializer).unwrap(), + ))) + } + pub async fn consensus_genesis_impl(&self) -> Result, Web3Error> { let mut conn = self.state.acquire_connection().await?; - let Some(genesis) = conn + let Some(cfg) = conn .consensus_dal() - .genesis() + .global_config() .await - .map_err(DalError::generalize)? + .context("global_config()")? else { return Ok(None); }; Ok(Some(en::ConsensusGenesis( - zksync_protobuf::serde::serialize(&genesis, serde_json::value::Serializer).unwrap(), + zksync_protobuf::serde::serialize(&cfg.genesis, serde_json::value::Serializer).unwrap(), ))) } @@ -40,7 +57,7 @@ impl EnNamespace { pub async fn attestation_status_impl( &self, ) -> Result, Web3Error> { - let status = self + let Some(status) = self .state .acquire_connection() .await? @@ -54,13 +71,13 @@ impl EnNamespace { .context("TransactionBuilder::build()")? .consensus_dal() .attestation_status() - .await?; - - Ok(status.map(|s| { - en::AttestationStatus( - zksync_protobuf::serde::serialize(&s, serde_json::value::Serializer).unwrap(), - ) - })) + .await? + else { + return Ok(None); + }; + Ok(Some(en::AttestationStatus( + zksync_protobuf::serde::serialize(&status, serde_json::value::Serializer).unwrap(), + ))) } pub(crate) fn current_method(&self) -> &MethodTracer { diff --git a/core/node/api_server/src/web3/testonly.rs b/core/node/api_server/src/web3/testonly.rs index 9f6b30b6026..a77498d4341 100644 --- a/core/node/api_server/src/web3/testonly.rs +++ b/core/node/api_server/src/web3/testonly.rs @@ -14,12 +14,10 @@ use zksync_types::{ fee_model::{BatchFeeInput, FeeParams}, L2ChainId, }; +use zksync_vm_executor::oneshot::MockOneshotExecutor; use super::{metrics::ApiTransportLabel, *}; -use crate::{ - execution_sandbox::{testonly::MockOneshotExecutor, TransactionExecutor}, - tx_sender::TxSenderConfig, -}; +use crate::{execution_sandbox::TransactionExecutor, tx_sender::TxSenderConfig}; const TEST_TIMEOUT: Duration = Duration::from_secs(90); const POLL_INTERVAL: Duration = Duration::from_millis(50); diff --git a/core/node/api_server/src/web3/tests/mod.rs b/core/node/api_server/src/web3/tests/mod.rs index 5617b097c0c..635620e9c52 100644 --- a/core/node/api_server/src/web3/tests/mod.rs +++ b/core/node/api_server/src/web3/tests/mod.rs @@ -42,6 +42,7 @@ use zksync_types::{ U256, U64, }; use zksync_utils::u256_to_h256; +use zksync_vm_executor::oneshot::MockOneshotExecutor; use zksync_web3_decl::{ client::{Client, DynClient, L2}, jsonrpsee::{ @@ -57,10 +58,7 @@ use zksync_web3_decl::{ }; use super::*; -use crate::{ - execution_sandbox::testonly::MockOneshotExecutor, - web3::testonly::{spawn_http_server, spawn_ws_server}, -}; +use crate::web3::testonly::{spawn_http_server, spawn_ws_server}; mod debug; mod filters; diff --git a/core/node/api_server/src/web3/tests/vm.rs b/core/node/api_server/src/web3/tests/vm.rs index 5b04250eebf..d8d1a2c7768 100644 --- a/core/node/api_server/src/web3/tests/vm.rs +++ b/core/node/api_server/src/web3/tests/vm.rs @@ -11,6 +11,7 @@ use zksync_types::{ L2ChainId, PackedEthSignature, StorageLogKind, StorageLogWithPreviousValue, U256, }; use zksync_utils::u256_to_h256; +use zksync_vm_executor::oneshot::MockOneshotExecutor; use zksync_web3_decl::namespaces::DebugNamespaceClient; use super::*; @@ -327,7 +328,7 @@ impl HttpTest for SendTransactionWithDetailedOutputTest { total_log_queries_count: 0, }; - tx_executor.set_tx_responses_with_logs(move |tx, env| { + tx_executor.set_full_tx_responses(move |tx, env| { assert_eq!(tx.hash(), tx_bytes_and_hash.1); assert_eq!(env.l1_batch.first_l2_block.number, 1); diff --git a/core/node/consensus/Cargo.toml b/core/node/consensus/Cargo.toml index e82969dae6c..707bd957d81 100644 --- a/core/node/consensus/Cargo.toml +++ b/core/node/consensus/Cargo.toml @@ -20,6 +20,7 @@ zksync_consensus_storage.workspace = true zksync_consensus_executor.workspace = true zksync_consensus_bft.workspace = true zksync_consensus_utils.workspace = true +zksync_contracts.workspace = true zksync_protobuf.workspace = true zksync_dal.workspace = true zksync_l1_contract_interface.workspace = true @@ -31,22 +32,24 @@ zksync_system_constants.workspace = true zksync_types.workspace = true zksync_utils.workspace = true zksync_web3_decl.workspace = true - +zksync_node_api_server.workspace = true +zksync_state.workspace = true +zksync_vm_interface.workspace = true anyhow.workspace = true async-trait.workspace = true secrecy.workspace = true tempfile.workspace = true thiserror.workspace = true tracing.workspace = true +hex.workspace = true tokio.workspace = true +semver.workspace = true [dev-dependencies] zksync_node_genesis.workspace = true zksync_node_test_utils.workspace = true zksync_node_api_server.workspace = true zksync_test_account.workspace = true -zksync_contracts.workspace = true -tokio.workspace = true test-casing.workspace = true rand.workspace = true diff --git a/core/node/consensus/src/abi.rs b/core/node/consensus/src/abi.rs new file mode 100644 index 00000000000..0e2200e2803 --- /dev/null +++ b/core/node/consensus/src/abi.rs @@ -0,0 +1,133 @@ +//! Strongly-typed API for Consensus-related solidity contracts. +//! Placeholder until we can depend on alloy_sol_types. +use anyhow::Context as _; +use zksync_types::{ethabi, ethabi::Token}; + +/// Strongly typed representation of a contract function. +/// It also represents the inputs of the function. +pub trait Function { + /// Name of the solidity function. + const NAME: &'static str; + /// Type representing contract this function belongs to. + type Contract: AsRef; + /// Typ representing outputs of this function. + type Outputs; + /// Encodes this struct to inputs of this function. + fn encode(&self) -> Vec; + /// Decodes outputs of this function. + fn decode_outputs(outputs: Vec) -> anyhow::Result; +} + +/// Address of contract C. It is just a wrapper of ethabi::Address, +/// just additionally indicating what contract is deployed under this address. +#[derive(Debug)] +pub struct Address(ethabi::Address, std::marker::PhantomData); + +impl Clone for Address { + fn clone(&self) -> Self { + *self + } +} + +impl Copy for Address {} + +impl PartialEq for Address { + fn eq(&self, other: &Self) -> bool { + self.0.eq(&other.0) + } +} + +impl Eq for Address {} + +impl Address { + pub fn new(address: ethabi::Address) -> Self { + Self(address, std::marker::PhantomData) + } +} + +impl std::ops::Deref for Address { + type Target = ethabi::Address; + fn deref(&self) -> &Self::Target { + &self.0 + } +} + +/// Represents a call to the function F. +#[derive(Debug)] +pub struct Call { + /// Contract of the function. + pub contract: F::Contract, + /// Inputs to the function. + pub inputs: F, +} + +impl Call { + pub(super) fn function(&self) -> ðabi::Function { + self.contract.as_ref().function(F::NAME).unwrap() + } + /// Converts the call to raw calldata. + pub fn calldata(&self) -> ethabi::Result { + self.function().encode_input(&self.inputs.encode()) + } + /// Parses the outputs of the call. + pub fn decode_outputs(&self, outputs: &[u8]) -> anyhow::Result { + F::decode_outputs( + self.function() + .decode_output(outputs) + .context("decode_output()")?, + ) + } +} + +pub(crate) fn into_fixed_bytes(t: Token) -> anyhow::Result<[u8; N]> { + match t { + Token::FixedBytes(b) => b.try_into().ok().context("bad size"), + bad => anyhow::bail!("want fixed_bytes, got {bad:?}"), + } +} + +pub(crate) fn into_tuple(t: Token) -> anyhow::Result<[Token; N]> { + match t { + Token::Tuple(ts) => ts.try_into().ok().context("bad size"), + bad => anyhow::bail!("want tuple, got {bad:?}"), + } +} + +pub(crate) fn into_uint>(t: Token) -> anyhow::Result { + match t { + Token::Uint(i) => i.try_into().ok().context("overflow"), + bad => anyhow::bail!("want uint, got {bad:?}"), + } +} + +#[cfg(test)] +fn example(t: ðabi::ParamType) -> Token { + use ethabi::ParamType as T; + match t { + T::Address => Token::Address(ethabi::Address::default()), + T::Bytes => Token::Bytes(ethabi::Bytes::default()), + T::Int(_) => Token::Int(ethabi::Int::default()), + T::Uint(_) => Token::Uint(ethabi::Uint::default()), + T::Bool => Token::Bool(bool::default()), + T::String => Token::String(String::default()), + T::Array(t) => Token::Array(vec![example(t)]), + T::FixedBytes(n) => Token::FixedBytes(vec![0; *n]), + T::FixedArray(t, n) => Token::FixedArray(vec![example(t); *n]), + T::Tuple(ts) => Token::Tuple(ts.iter().map(example).collect()), + } +} + +#[cfg(test)] +impl Call { + pub(crate) fn test(&self) -> anyhow::Result<()> { + self.calldata().context("calldata()")?; + F::decode_outputs( + self.function() + .outputs + .iter() + .map(|p| example(&p.kind)) + .collect(), + )?; + Ok(()) + } +} diff --git a/core/node/consensus/src/config.rs b/core/node/consensus/src/config.rs index c2fa1347206..22f8fc01192 100644 --- a/core/node/consensus/src/config.rs +++ b/core/node/consensus/src/config.rs @@ -11,6 +11,8 @@ use zksync_config::{ use zksync_consensus_crypto::{Text, TextFmt}; use zksync_consensus_executor as executor; use zksync_consensus_roles::{attester, node, validator}; +use zksync_dal::consensus_dal; +use zksync_types::ethabi; fn read_secret_text(text: Option<&Secret>) -> anyhow::Result> { text.map(|text| Text::new(text.expose_secret()).decode()) @@ -41,16 +43,18 @@ pub(super) struct GenesisSpec { pub(super) validators: validator::Committee, pub(super) attesters: Option, pub(super) leader_selection: validator::LeaderSelectionMode, + pub(super) registry_address: Option, } impl GenesisSpec { - pub(super) fn from_genesis(g: &validator::Genesis) -> Self { + pub(super) fn from_global_config(cfg: &consensus_dal::GlobalConfig) -> Self { Self { - chain_id: g.chain_id, - protocol_version: g.protocol_version, - validators: g.validators.clone(), - attesters: g.attesters.clone(), - leader_selection: g.leader_selection.clone(), + chain_id: cfg.genesis.chain_id, + protocol_version: cfg.genesis.protocol_version, + validators: cfg.genesis.validators.clone(), + attesters: cfg.genesis.attesters.clone(), + leader_selection: cfg.genesis.leader_selection.clone(), + registry_address: cfg.registry_address, } } @@ -93,6 +97,7 @@ impl GenesisSpec { } else { Some(attester::Committee::new(attesters).context("attesters")?) }, + registry_address: x.registry_address, }) } } @@ -104,6 +109,7 @@ pub(super) fn node_key(secrets: &ConsensusSecrets) -> anyhow::Result, ) -> anyhow::Result { let mut gossip_static_outbound = HashMap::new(); { @@ -128,6 +134,7 @@ pub(super) fn executor( }; Ok(executor::Config { + build_version, server_addr: cfg.server_addr, public_addr: net::Host(cfg.public_addr.0.clone()), max_payload_size: cfg.max_payload_size, diff --git a/core/node/consensus/src/en.rs b/core/node/consensus/src/en.rs index 259cac5d074..a52393c0f48 100644 --- a/core/node/consensus/src/en.rs +++ b/core/node/consensus/src/en.rs @@ -6,15 +6,20 @@ use zksync_consensus_executor::{self as executor, attestation}; use zksync_consensus_roles::{attester, validator}; use zksync_consensus_storage::{BatchStore, BlockStore}; use zksync_dal::consensus_dal; -use zksync_node_sync::{ - fetcher::FetchedBlock, sync_action::ActionQueueSender, MainNodeClient, SyncState, -}; -use zksync_protobuf::ProtoFmt as _; +use zksync_node_sync::{fetcher::FetchedBlock, sync_action::ActionQueueSender, SyncState}; use zksync_types::L2BlockNumber; -use zksync_web3_decl::client::{DynClient, L2}; +use zksync_web3_decl::{ + client::{DynClient, L2}, + error::is_retriable, + jsonrpsee::{core::ClientError, types::error::ErrorCode}, + namespaces::{EnNamespaceClient as _, EthNamespaceClient as _}, +}; use super::{config, storage::Store, ConsensusConfig, ConsensusSecrets}; -use crate::storage::{self, ConnectionPool}; +use crate::{ + registry, + storage::{self, ConnectionPool}, +}; /// External node. pub(super) struct EN { @@ -27,7 +32,7 @@ impl EN { /// Task running a consensus node for the external node. /// It may be a validator, but it cannot be a leader (cannot propose blocks). /// - /// NOTE: Before starting the consensus node if fetches all the blocks + /// NOTE: Before starting the consensus node it fetches all the blocks /// older than consensus genesis from the main node using json RPC. pub async fn run( self, @@ -35,6 +40,7 @@ impl EN { actions: ActionQueueSender, cfg: ConsensusConfig, secrets: ConsensusSecrets, + build_version: Option, ) -> anyhow::Result<()> { let attester = config::attester_key(&secrets).context("attester_key")?; @@ -47,13 +53,16 @@ impl EN { // Update sync state in the background. s.spawn_bg(self.fetch_state_loop(ctx)); - // Initialize genesis. - let genesis = self.fetch_genesis(ctx).await.wrap("fetch_genesis()")?; + // Initialize global config. + let global_config = self + .fetch_global_config(ctx) + .await + .wrap("fetch_global_config()")?; let mut conn = self.pool.connection(ctx).await.wrap("connection()")?; - conn.try_update_genesis(ctx, &genesis) + conn.try_update_global_config(ctx, &global_config) .await - .wrap("set_genesis()")?; + .wrap("try_update_global_config()")?; let mut payload_queue = conn .new_payload_queue(ctx, actions, self.sync_state.clone()) @@ -63,21 +72,25 @@ impl EN { drop(conn); // Fetch blocks before the genesis. - self.fetch_blocks(ctx, &mut payload_queue, Some(genesis.first_block)) - .await - .wrap("fetch_blocks()")?; + self.fetch_blocks( + ctx, + &mut payload_queue, + Some(global_config.genesis.first_block), + ) + .await + .wrap("fetch_blocks()")?; // Monitor the genesis of the main node. // If it changes, it means that a hard fork occurred and we need to reset the consensus state. s.spawn_bg::<()>({ - let old = genesis.clone(); + let old = global_config.clone(); async { let old = old; loop { - if let Ok(new) = self.fetch_genesis(ctx).await { + if let Ok(new) = self.fetch_global_config(ctx).await { if new != old { return Err(anyhow::format_err!( - "genesis changed: old {old:?}, new {new:?}" + "global config changed: old {old:?}, new {new:?}" ) .into()); } @@ -105,10 +118,14 @@ impl EN { s.spawn_bg(async { Ok(runner.run(ctx).await?) }); let attestation = Arc::new(attestation::Controller::new(attester)); - s.spawn_bg(self.run_attestation_updater(ctx, genesis.clone(), attestation.clone())); + s.spawn_bg(self.run_attestation_controller( + ctx, + global_config.clone(), + attestation.clone(), + )); let executor = executor::Executor { - config: config::executor(&cfg, &secrets)?, + config: config::executor(&cfg, &secrets, build_version)?, block_store, batch_store, validator: config::validator_key(&secrets) @@ -164,24 +181,21 @@ impl EN { /// Monitors the `AttestationStatus` on the main node, /// and updates the attestation config accordingly. - async fn run_attestation_updater( + async fn run_attestation_controller( &self, ctx: &ctx::Ctx, - genesis: validator::Genesis, + cfg: consensus_dal::GlobalConfig, attestation: Arc, ) -> ctx::Result<()> { const POLL_INTERVAL: time::Duration = time::Duration::seconds(5); - let Some(committee) = &genesis.attesters else { - return Ok(()); - }; - let committee = Arc::new(committee.clone()); + let registry = registry::Registry::new(cfg.genesis.clone(), self.pool.clone()).await; let mut next = attester::BatchNumber(0); loop { let status = loop { match self.fetch_attestation_status(ctx).await { Err(err) => tracing::warn!("{err:#}"), Ok(status) => { - if status.genesis != genesis.hash() { + if status.genesis != cfg.genesis.hash() { return Err(anyhow::format_err!("genesis mismatch").into()); } if status.next_batch_to_attest >= next { @@ -191,6 +205,7 @@ impl EN { } ctx.sleep(POLL_INTERVAL).await?; }; + next = status.next_batch_to_attest.next(); tracing::info!( "waiting for hash of batch {:?}", status.next_batch_to_attest @@ -199,6 +214,27 @@ impl EN { .pool .wait_for_batch_hash(ctx, status.next_batch_to_attest) .await?; + let Some(committee) = registry + .attester_committee_for( + ctx, + cfg.registry_address.map(registry::Address::new), + status.next_batch_to_attest, + ) + .await + .wrap("attester_committee_for()")? + else { + tracing::info!("attestation not required"); + continue; + }; + let committee = Arc::new(committee); + // Persist the derived committee. + self.pool + .connection(ctx) + .await + .wrap("connection")? + .upsert_attester_committee(ctx, status.next_batch_to_attest, &committee) + .await + .wrap("upsert_attester_committee()")?; tracing::info!( "attesting batch {:?} with hash {hash:?}", status.next_batch_to_attest @@ -214,7 +250,6 @@ impl EN { })) .await .context("start_attestation()")?; - next = status.next_batch_to_attest.next(); } } @@ -224,37 +259,52 @@ impl EN { const DELAY_INTERVAL: time::Duration = time::Duration::milliseconds(500); const RETRY_INTERVAL: time::Duration = time::Duration::seconds(5); loop { - match ctx.wait(self.client.fetch_l2_block_number()).await? { + match ctx.wait(self.client.get_block_number()).await? { Ok(head) => { + let head = L2BlockNumber(head.try_into().ok().context("overflow")?); self.sync_state.set_main_node_block(head); ctx.sleep(DELAY_INTERVAL).await?; } Err(err) => { - tracing::warn!("main_node_client.fetch_l2_block_number(): {err}"); + tracing::warn!("get_block_number(): {err}"); ctx.sleep(RETRY_INTERVAL).await?; } } } } - /// Fetches genesis from the main node. + /// Fetches consensus global configuration from the main node. #[tracing::instrument(skip_all)] - async fn fetch_genesis(&self, ctx: &ctx::Ctx) -> ctx::Result { + async fn fetch_global_config( + &self, + ctx: &ctx::Ctx, + ) -> ctx::Result { + match ctx.wait(self.client.consensus_global_config()).await? { + Ok(cfg) => { + let cfg = cfg.context("main node is not running consensus component")?; + return Ok(zksync_protobuf::serde::deserialize(&cfg.0).context("deserialize()")?); + } + // For non-whitelisted methods, proxyd returns HTTP 403 with MethodNotFound in the body. + // For some stupid reason ClientError doesn't expose HTTP error codes. + Err(ClientError::Transport(_)) => {} + // For missing methods api server, returns HTTP 200 with MethodNotFound in the body. + Err(ClientError::Call(err)) if err.code() == ErrorCode::MethodNotFound.code() => {} + Err(err) => { + return Err(err) + .context("consensus_global_config()") + .map_err(|err| err.into()); + } + } + tracing::info!("consensus_global_config() not found, calling consensus_genesis() instead"); let genesis = ctx - .wait(self.client.fetch_consensus_genesis()) + .wait(self.client.consensus_genesis()) .await? - .context("fetch_consensus_genesis()")? + .context("consensus_genesis()")? .context("main node is not running consensus component")?; - // Deserialize the json, but don't allow for unknown fields. - // We need to compute the hash of the Genesis, so simply ignoring the unknown fields won't - // do. - Ok(validator::GenesisRaw::read( - &zksync_protobuf::serde::deserialize_proto_with_options( - &genesis.0, /*deny_unknown_fields=*/ true, - ) - .context("deserialize")?, - )? - .with_hash()) + Ok(consensus_dal::GlobalConfig { + genesis: zksync_protobuf::serde::deserialize(&genesis.0).context("deserialize()")?, + registry_address: None, + }) } #[tracing::instrument(skip_all)] @@ -262,15 +312,12 @@ impl EN { &self, ctx: &ctx::Ctx, ) -> ctx::Result { - match ctx.wait(self.client.fetch_attestation_status()).await? { - Ok(Some(status)) => Ok(zksync_protobuf::serde::deserialize(&status.0) - .context("deserialize(AttestationStatus")?), - Ok(None) => Err(anyhow::format_err!("empty response").into()), - Err(err) => Err(anyhow::format_err!( - "AttestationStatus call to main node HTTP RPC failed: {err:#}" - ) - .into()), - } + let status = ctx + .wait(self.client.attestation_status()) + .await? + .context("attestation_status()")? + .context("main node is not runnign consensus component")?; + Ok(zksync_protobuf::serde::deserialize(&status.0).context("deserialize()")?) } /// Fetches (with retries) the given block from the main node. @@ -278,14 +325,11 @@ impl EN { const RETRY_INTERVAL: time::Duration = time::Duration::seconds(5); loop { - let res = ctx.wait(self.client.fetch_l2_block(n, true)).await?; - match res { + match ctx.wait(self.client.sync_l2_block(n, true)).await? { Ok(Some(block)) => return Ok(block.try_into()?), Ok(None) => {} - Err(err) if err.is_retriable() => {} - Err(err) => { - return Err(anyhow::format_err!("client.fetch_l2_block({}): {err}", n).into()); - } + Err(err) if is_retriable(&err) => {} + Err(err) => Err(err).with_context(|| format!("client.sync_l2_block({n})"))?, } ctx.sleep(RETRY_INTERVAL).await?; } diff --git a/core/node/consensus/src/era.rs b/core/node/consensus/src/era.rs index 574e496f4d1..3150f839680 100644 --- a/core/node/consensus/src/era.rs +++ b/core/node/consensus/src/era.rs @@ -45,6 +45,7 @@ pub async fn run_external_node( sync_state: SyncState, main_node_client: Box>, actions: ActionQueueSender, + build_version: semver::Version, ) -> anyhow::Result<()> { let en = en::EN { pool: ConnectionPool(pool), @@ -58,7 +59,8 @@ pub async fn run_external_node( is_validator = secrets.validator_key.is_some(), "running external node" ); - en.run(ctx, actions, cfg, secrets).await + en.run(ctx, actions, cfg, secrets, Some(build_version)) + .await } None => { tracing::info!("running fetcher"); diff --git a/core/node/consensus/src/lib.rs b/core/node/consensus/src/lib.rs index 13d918b5b6e..ff9cdf86528 100644 --- a/core/node/consensus/src/lib.rs +++ b/core/node/consensus/src/lib.rs @@ -5,6 +5,7 @@ use zksync_config::configs::consensus::{ConsensusConfig, ConsensusSecrets}; +mod abi; // Currently `batch` module is only used in tests, // but will be used in production once batch syncing is implemented in consensus. #[allow(unused)] @@ -13,8 +14,10 @@ mod config; mod en; pub mod era; mod mn; +mod registry; mod storage; #[cfg(test)] pub(crate) mod testonly; #[cfg(test)] mod tests; +mod vm; diff --git a/core/node/consensus/src/mn.rs b/core/node/consensus/src/mn.rs index 7de86b4d8ba..4d428346ebe 100644 --- a/core/node/consensus/src/mn.rs +++ b/core/node/consensus/src/mn.rs @@ -6,9 +6,10 @@ use zksync_config::configs::consensus::{ConsensusConfig, ConsensusSecrets}; use zksync_consensus_executor::{self as executor, attestation}; use zksync_consensus_roles::{attester, validator}; use zksync_consensus_storage::{BatchStore, BlockStore}; +use zksync_dal::consensus_dal; use crate::{ - config, + config, registry, storage::{ConnectionPool, InsertCertificateError, Store}, }; @@ -36,9 +37,9 @@ pub async fn run_main_node( pool.connection(ctx) .await .wrap("connection()")? - .adjust_genesis(ctx, &spec) + .adjust_global_config(ctx, &spec) .await - .wrap("adjust_genesis()")?; + .wrap("adjust_global_config()")?; } // The main node doesn't have a payload queue as it produces all the L2 blocks itself. @@ -47,33 +48,40 @@ pub async fn run_main_node( .wrap("Store::new()")?; s.spawn_bg(runner.run(ctx)); - let (block_store, runner) = BlockStore::new(ctx, Box::new(store.clone())) + let global_config = pool + .connection(ctx) .await - .wrap("BlockStore::new()")?; - s.spawn_bg(runner.run(ctx)); - - let genesis = block_store.genesis().clone(); + .wrap("connection()")? + .global_config(ctx) + .await + .wrap("global_config()")? + .context("global_config() disappeared")?; anyhow::ensure!( - genesis.leader_selection + global_config.genesis.leader_selection == validator::LeaderSelectionMode::Sticky(validator_key.public()), "unsupported leader selection mode - main node has to be the leader" ); + let (block_store, runner) = BlockStore::new(ctx, Box::new(store.clone())) + .await + .wrap("BlockStore::new()")?; + s.spawn_bg(runner.run(ctx)); + let (batch_store, runner) = BatchStore::new(ctx, Box::new(store.clone())) .await .wrap("BatchStore::new()")?; s.spawn_bg(runner.run(ctx)); let attestation = Arc::new(attestation::Controller::new(attester)); - s.spawn_bg(run_attestation_updater( + s.spawn_bg(run_attestation_controller( ctx, &pool, - genesis, + global_config, attestation.clone(), )); let executor = executor::Executor { - config: config::executor(&cfg, &secrets)?, + config: config::executor(&cfg, &secrets, None)?, block_store, batch_store, validator: Some(executor::Validator { @@ -93,18 +101,17 @@ pub async fn run_main_node( /// Manages attestation state by configuring the /// next batch to attest and storing the collected /// certificates. -async fn run_attestation_updater( +async fn run_attestation_controller( ctx: &ctx::Ctx, pool: &ConnectionPool, - genesis: validator::Genesis, + cfg: consensus_dal::GlobalConfig, attestation: Arc, ) -> anyhow::Result<()> { const POLL_INTERVAL: time::Duration = time::Duration::seconds(5); + let registry = registry::Registry::new(cfg.genesis, pool.clone()).await; + let registry_addr = cfg.registry_address.map(registry::Address::new); + let mut next = attester::BatchNumber(0); let res = async { - let Some(committee) = &genesis.attesters else { - return Ok(()); - }; - let committee = Arc::new(committee.clone()); loop { // After regenesis it might happen that the batch number for the first block // is not immediately known (the first block was not produced yet), @@ -118,10 +125,12 @@ async fn run_attestation_updater( .await .wrap("attestation_status()")? { - Some(status) => break status, - None => ctx.sleep(POLL_INTERVAL).await?, + Some(status) if status.next_batch_to_attest >= next => break status, + _ => {} } + ctx.sleep(POLL_INTERVAL).await?; }; + next = status.next_batch_to_attest.next(); tracing::info!( "waiting for hash of batch {:?}", status.next_batch_to_attest @@ -129,6 +138,22 @@ async fn run_attestation_updater( let hash = pool .wait_for_batch_hash(ctx, status.next_batch_to_attest) .await?; + let Some(committee) = registry + .attester_committee_for(ctx, registry_addr, status.next_batch_to_attest) + .await + .wrap("attester_committee_for()")? + else { + tracing::info!("attestation not required"); + continue; + }; + let committee = Arc::new(committee); + // Persist the derived committee. + pool.connection(ctx) + .await + .wrap("connection")? + .upsert_attester_committee(ctx, status.next_batch_to_attest, &committee) + .await + .wrap("upsert_attester_committee()")?; tracing::info!( "attesting batch {:?} with hash {hash:?}", status.next_batch_to_attest @@ -140,7 +165,7 @@ async fn run_attestation_updater( number: status.next_batch_to_attest, genesis: status.genesis, }, - committee: committee.clone(), + committee, })) .await .context("start_attestation()")?; diff --git a/core/node/consensus/src/registry/abi.rs b/core/node/consensus/src/registry/abi.rs new file mode 100644 index 00000000000..55cc7f9264f --- /dev/null +++ b/core/node/consensus/src/registry/abi.rs @@ -0,0 +1,225 @@ +//! Strongly-typed API for ConsensusRegistry contract. +#![allow(dead_code)] + +use std::sync::Arc; + +use anyhow::Context as _; +use zksync_types::{ethabi, ethabi::Token}; + +use crate::abi; + +/// Reprents ConsensusRegistry contract. +#[derive(Debug, Clone)] +pub(crate) struct ConsensusRegistry(Arc); + +impl AsRef for ConsensusRegistry { + fn as_ref(&self) -> ðabi::Contract { + &self.0 + } +} + +impl ConsensusRegistry { + const FILE: &'static str = "contracts/l2-contracts/artifacts-zk/contracts/ConsensusRegistry.sol/ConsensusRegistry.json"; + + /// Loads bytecode of the contract. + #[cfg(test)] + pub(crate) fn bytecode() -> Vec { + zksync_contracts::read_bytecode(Self::FILE) + } + + /// Loads the `ethabi` representation of the contract. + pub(crate) fn load() -> Self { + Self(zksync_contracts::load_contract(ConsensusRegistry::FILE).into()) + } + + /// Constructs a call to function `F` of this contract. + pub(crate) fn call>(&self, inputs: F) -> abi::Call { + abi::Call { + contract: self.clone(), + inputs, + } + } +} + +/// ConsensusRegistry.getAttesterCommittee function. +#[derive(Debug, Default)] +pub(crate) struct GetAttesterCommittee; + +impl abi::Function for GetAttesterCommittee { + type Contract = ConsensusRegistry; + const NAME: &'static str = "getAttesterCommittee"; + + fn encode(&self) -> Vec { + vec![] + } + + type Outputs = Vec; + fn decode_outputs(tokens: Vec) -> anyhow::Result { + let [attesters] = tokens.try_into().ok().context("bad size")?; + let mut res = vec![]; + for token in attesters.into_array().context("not array")? { + res.push(Attester::from_token(token).context("attesters")?); + } + Ok(res) + } +} + +/// ConsensusRegistry.add function. +#[derive(Debug, Default)] +pub(crate) struct Add { + pub(crate) node_owner: ethabi::Address, + pub(crate) validator_weight: u32, + pub(crate) validator_pub_key: BLS12_381PublicKey, + pub(crate) validator_pop: BLS12_381Signature, + pub(crate) attester_weight: u32, + pub(crate) attester_pub_key: Secp256k1PublicKey, +} + +impl abi::Function for Add { + type Contract = ConsensusRegistry; + const NAME: &'static str = "add"; + fn encode(&self) -> Vec { + vec![ + Token::Address(self.node_owner), + Token::Uint(self.validator_weight.into()), + self.validator_pub_key.to_token(), + self.validator_pop.to_token(), + Token::Uint(self.attester_weight.into()), + self.attester_pub_key.to_token(), + ] + } + type Outputs = (); + fn decode_outputs(tokens: Vec) -> anyhow::Result<()> { + let [] = tokens.try_into().ok().context("bad size")?; + Ok(()) + } +} + +/// ConsensusRegistry.initialize function. +#[derive(Debug, Default)] +pub(crate) struct Initialize { + pub(crate) initial_owner: ethabi::Address, +} + +impl abi::Function for Initialize { + type Contract = ConsensusRegistry; + const NAME: &'static str = "initialize"; + fn encode(&self) -> Vec { + vec![Token::Address(self.initial_owner)] + } + type Outputs = (); + fn decode_outputs(tokens: Vec) -> anyhow::Result<()> { + let [] = tokens.try_into().ok().context("bad size")?; + Ok(()) + } +} + +/// ConsensusRegistry.commitAttesterCommittee function. +#[derive(Debug, Default)] +pub(crate) struct CommitAttesterCommittee; + +impl abi::Function for CommitAttesterCommittee { + type Contract = ConsensusRegistry; + const NAME: &'static str = "commitAttesterCommittee"; + fn encode(&self) -> Vec { + vec![] + } + type Outputs = (); + fn decode_outputs(tokens: Vec) -> anyhow::Result<()> { + let [] = tokens.try_into().ok().context("bad size")?; + Ok(()) + } +} + +/// ConsensusRegistry.owner function. +#[derive(Debug, Default)] +pub(crate) struct Owner; + +impl abi::Function for Owner { + type Contract = ConsensusRegistry; + const NAME: &'static str = "owner"; + fn encode(&self) -> Vec { + vec![] + } + type Outputs = ethabi::Address; + fn decode_outputs(tokens: Vec) -> anyhow::Result { + let [owner] = tokens.try_into().ok().context("bad size")?; + owner.into_address().context("not an address") + } +} + +// Auxiliary structs. + +/// Raw representation of a secp256k1 public key. +#[derive(Debug, Default)] +pub(crate) struct Secp256k1PublicKey { + pub(crate) tag: [u8; 1], + pub(crate) x: [u8; 32], +} + +impl Secp256k1PublicKey { + fn from_token(token: Token) -> anyhow::Result { + let [tag, x] = abi::into_tuple(token)?; + Ok(Self { + tag: abi::into_fixed_bytes(tag).context("tag")?, + x: abi::into_fixed_bytes(x).context("x")?, + }) + } + + fn to_token(&self) -> Token { + Token::Tuple(vec![ + Token::FixedBytes(self.tag.into()), + Token::FixedBytes(self.x.into()), + ]) + } +} + +/// Raw representation of an attester committee member. +#[derive(Debug)] +pub(crate) struct Attester { + pub(crate) weight: u32, + pub(crate) pub_key: Secp256k1PublicKey, +} + +impl Attester { + fn from_token(token: Token) -> anyhow::Result { + let [weight, pub_key] = abi::into_tuple(token)?; + Ok(Self { + weight: abi::into_uint(weight).context("weight")?, + pub_key: Secp256k1PublicKey::from_token(pub_key).context("pub_key")?, + }) + } +} + +/// Raw representation of a BLS12_381 public key. +#[derive(Debug, Default)] +pub(crate) struct BLS12_381PublicKey { + pub(crate) a: [u8; 32], + pub(crate) b: [u8; 32], + pub(crate) c: [u8; 32], +} + +impl BLS12_381PublicKey { + fn to_token(&self) -> Token { + Token::Tuple(vec![ + Token::FixedBytes(self.a.into()), + Token::FixedBytes(self.b.into()), + Token::FixedBytes(self.c.into()), + ]) + } +} + +#[derive(Debug, Default)] +pub(crate) struct BLS12_381Signature { + pub(crate) a: [u8; 32], + pub(crate) b: [u8; 16], +} + +impl BLS12_381Signature { + fn to_token(&self) -> Token { + Token::Tuple(vec![ + Token::FixedBytes(self.a.into()), + Token::FixedBytes(self.b.into()), + ]) + } +} diff --git a/core/node/consensus/src/registry/mod.rs b/core/node/consensus/src/registry/mod.rs new file mode 100644 index 00000000000..74da4130957 --- /dev/null +++ b/core/node/consensus/src/registry/mod.rs @@ -0,0 +1,80 @@ +use anyhow::Context as _; +use zksync_concurrency::{ctx, error::Wrap as _}; +use zksync_consensus_crypto::ByteFmt; +use zksync_consensus_roles::{attester, validator}; + +use crate::{storage::ConnectionPool, vm::VM}; + +mod abi; +#[cfg(test)] +pub(crate) mod testonly; +#[cfg(test)] +mod tests; + +fn decode_attester_key(k: &abi::Secp256k1PublicKey) -> anyhow::Result { + let mut x = vec![]; + x.extend(k.tag); + x.extend(k.x); + ByteFmt::decode(&x) +} + +fn decode_weighted_attester(a: &abi::Attester) -> anyhow::Result { + Ok(attester::WeightedAttester { + weight: a.weight.into(), + key: decode_attester_key(&a.pub_key).context("key")?, + }) +} + +pub type Address = crate::abi::Address; + +#[derive(Debug)] +pub(crate) struct Registry { + contract: abi::ConsensusRegistry, + genesis: validator::Genesis, + vm: VM, +} + +impl Registry { + pub async fn new(genesis: validator::Genesis, pool: ConnectionPool) -> Self { + Self { + contract: abi::ConsensusRegistry::load(), + genesis, + vm: VM::new(pool).await, + } + } + + /// Attester committee for the given batch. + /// It reads committee from the contract. + /// Falls back to committee specified in the genesis. + pub async fn attester_committee_for( + &self, + ctx: &ctx::Ctx, + address: Option
, + attested_batch: attester::BatchNumber, + ) -> ctx::Result> { + let Some(batch_defining_committee) = attested_batch.prev() else { + // Batch 0 doesn't need attestation. + return Ok(None); + }; + let Some(address) = address else { + return Ok(self.genesis.attesters.clone()); + }; + let raw = self + .vm + .call( + ctx, + batch_defining_committee, + address, + self.contract.call(abi::GetAttesterCommittee), + ) + .await + .wrap("vm.call()")?; + let mut attesters = vec![]; + for a in raw { + attesters.push(decode_weighted_attester(&a).context("decode_weighted_attester()")?); + } + Ok(Some( + attester::Committee::new(attesters.into_iter()).context("Committee::new()")?, + )) + } +} diff --git a/core/node/consensus/src/registry/testonly.rs b/core/node/consensus/src/registry/testonly.rs new file mode 100644 index 00000000000..a0c55a557fe --- /dev/null +++ b/core/node/consensus/src/registry/testonly.rs @@ -0,0 +1,118 @@ +use rand::Rng; +use zksync_consensus_crypto::ByteFmt; +use zksync_consensus_roles::{attester, validator}; +use zksync_test_account::Account; +use zksync_types::{ethabi, Execute, Transaction, U256}; + +use super::*; + +pub(crate) fn make_tx( + account: &mut Account, + address: crate::abi::Address, + call: crate::abi::Call, +) -> Transaction { + account.get_l2_tx_for_execute( + Execute { + contract_address: *address, + calldata: call.calldata().unwrap(), + value: U256::zero(), + factory_deps: vec![], + }, + None, + ) +} + +pub(crate) struct WeightedValidator { + weight: validator::Weight, + key: validator::PublicKey, + pop: validator::ProofOfPossession, +} + +fn encode_attester_key(k: &attester::PublicKey) -> abi::Secp256k1PublicKey { + let b: [u8; 33] = ByteFmt::encode(k).try_into().unwrap(); + abi::Secp256k1PublicKey { + tag: b[0..1].try_into().unwrap(), + x: b[1..33].try_into().unwrap(), + } +} + +fn encode_validator_key(k: &validator::PublicKey) -> abi::BLS12_381PublicKey { + let b: [u8; 96] = ByteFmt::encode(k).try_into().unwrap(); + abi::BLS12_381PublicKey { + a: b[0..32].try_into().unwrap(), + b: b[32..64].try_into().unwrap(), + c: b[64..96].try_into().unwrap(), + } +} + +fn encode_validator_pop(pop: &validator::ProofOfPossession) -> abi::BLS12_381Signature { + let b: [u8; 48] = ByteFmt::encode(pop).try_into().unwrap(); + abi::BLS12_381Signature { + a: b[0..32].try_into().unwrap(), + b: b[32..48].try_into().unwrap(), + } +} + +pub(crate) fn gen_validator(rng: &mut impl Rng) -> WeightedValidator { + let k: validator::SecretKey = rng.gen(); + WeightedValidator { + key: k.public(), + weight: rng.gen_range(1..100), + pop: k.sign_pop(), + } +} + +pub(crate) fn gen_attester(rng: &mut impl Rng) -> attester::WeightedAttester { + attester::WeightedAttester { + key: rng.gen(), + weight: rng.gen_range(1..100), + } +} + +impl Registry { + pub(crate) fn deploy(&self, account: &mut Account) -> (Address, Transaction) { + let tx = account.get_deploy_tx( + &abi::ConsensusRegistry::bytecode(), + None, + zksync_test_account::TxType::L2, + ); + (Address::new(tx.address), tx.tx) + } + + pub(crate) fn add( + &self, + node_owner: ethabi::Address, + validator: WeightedValidator, + attester: attester::WeightedAttester, + ) -> anyhow::Result> { + Ok(self.contract.call(abi::Add { + node_owner, + validator_pub_key: encode_validator_key(&validator.key), + validator_weight: validator + .weight + .try_into() + .context("overflow") + .context("validator_weight")?, + validator_pop: encode_validator_pop(&validator.pop), + attester_pub_key: encode_attester_key(&attester.key), + attester_weight: attester + .weight + .try_into() + .context("overflow") + .context("attester_weight")?, + })) + } + + pub(crate) fn initialize( + &self, + initial_owner: ethabi::Address, + ) -> crate::abi::Call { + self.contract.call(abi::Initialize { initial_owner }) + } + + pub(crate) fn commit_attester_committee( + &self, + ) -> crate::abi::Call { + self.contract.call(abi::CommitAttesterCommittee) + } +} diff --git a/core/node/consensus/src/registry/tests.rs b/core/node/consensus/src/registry/tests.rs new file mode 100644 index 00000000000..935cd673891 --- /dev/null +++ b/core/node/consensus/src/registry/tests.rs @@ -0,0 +1,91 @@ +use rand::Rng as _; +use zksync_concurrency::{ctx, scope}; +use zksync_consensus_roles::{attester, validator::testonly::Setup}; +use zksync_test_account::Account; +use zksync_types::ProtocolVersionId; + +use super::*; +use crate::storage::ConnectionPool; + +/// Test checking that parsing logic matches the abi specified in the json file. +#[test] +fn test_consensus_registry_abi() { + zksync_concurrency::testonly::abort_on_panic(); + let c = abi::ConsensusRegistry::load(); + c.call(abi::GetAttesterCommittee).test().unwrap(); + c.call(abi::Add::default()).test().unwrap(); + c.call(abi::Initialize::default()).test().unwrap(); + c.call(abi::CommitAttesterCommittee).test().unwrap(); + c.call(abi::Owner).test().unwrap(); +} + +#[tokio::test(flavor = "multi_thread")] +async fn test_attester_committee() { + zksync_concurrency::testonly::abort_on_panic(); + let ctx = &ctx::test_root(&ctx::RealClock); + let rng = &mut ctx.rng(); + let setup = Setup::new(rng, 10); + let account = &mut Account::random(); + let to_fund = &[account.address]; + + scope::run!(ctx, |ctx, s| async { + let pool = ConnectionPool::test(false, ProtocolVersionId::latest()).await; + let registry = Registry::new(setup.genesis.clone(), pool.clone()).await; + + // If the registry contract address is not specified, + // then the committee from genesis should be returned. + let got = registry + .attester_committee_for(ctx, None, attester::BatchNumber(10)) + .await + .unwrap(); + assert_eq!(setup.genesis.attesters, got); + + let (mut node, runner) = crate::testonly::StateKeeper::new(ctx, pool.clone()).await?; + s.spawn_bg(runner.run_real(ctx, to_fund)); + + // Deploy registry contract and initialize it. + let committee = + attester::Committee::new((0..5).map(|_| testonly::gen_attester(rng))).unwrap(); + let (registry_addr, tx) = registry.deploy(account); + let mut txs = vec![tx]; + let account_addr = account.address(); + txs.push(testonly::make_tx( + account, + registry_addr, + registry.initialize(account_addr), + )); + // Add attesters. + for a in committee.iter() { + txs.push(testonly::make_tx( + account, + registry_addr, + registry + .add(rng.gen(), testonly::gen_validator(rng), a.clone()) + .unwrap(), + )); + } + // Commit the update. + txs.push(testonly::make_tx( + account, + registry_addr, + registry.commit_attester_committee(), + )); + + node.push_block(&txs).await; + node.seal_batch().await; + pool.wait_for_batch(ctx, node.last_batch()).await?; + + // Read the attester committee using the vm. + let batch = attester::BatchNumber(node.last_batch().0.into()); + assert_eq!( + Some(committee), + registry + .attester_committee_for(ctx, Some(registry_addr), batch + 1) + .await + .unwrap() + ); + Ok(()) + }) + .await + .unwrap(); +} diff --git a/core/node/consensus/src/storage/connection.rs b/core/node/consensus/src/storage/connection.rs index 6ff2fb1ce0a..512b37e81a1 100644 --- a/core/node/consensus/src/storage/connection.rs +++ b/core/node/consensus/src/storage/connection.rs @@ -1,13 +1,14 @@ use anyhow::Context as _; use zksync_concurrency::{ctx, error::Wrap as _, time}; use zksync_consensus_crypto::keccak256::Keccak256; -use zksync_consensus_roles::{attester, validator}; +use zksync_consensus_roles::{attester, attester::BatchNumber, validator}; use zksync_consensus_storage::{self as storage, BatchStoreState}; use zksync_dal::{consensus_dal, consensus_dal::Payload, Core, CoreDal, DalError}; use zksync_l1_contract_interface::i_executor::structures::StoredBatchInfo; +use zksync_node_api_server::execution_sandbox::{BlockArgs, BlockStartInfo}; use zksync_node_sync::{fetcher::IoCursorExt as _, ActionQueueSender, SyncState}; use zksync_state_keeper::io::common::IoCursor; -use zksync_types::{commitment::L1BatchWithMetadata, L1BatchNumber}; +use zksync_types::{api, commitment::L1BatchWithMetadata, L1BatchNumber}; use super::{InsertCertificateError, PayloadQueue}; use crate::config; @@ -18,7 +19,7 @@ pub(crate) struct ConnectionPool(pub(crate) zksync_dal::ConnectionPool); impl ConnectionPool { /// Wrapper for `connection_tagged()`. - pub(crate) async fn connection<'a>(&'a self, ctx: &ctx::Ctx) -> ctx::Result> { + pub(crate) async fn connection(&self, ctx: &ctx::Ctx) -> ctx::Result> { Ok(Connection( ctx.wait(self.0.connection_tagged("consensus")) .await? @@ -164,6 +165,22 @@ impl<'a> Connection<'a> { .map_err(E::Other)?) } + /// Wrapper for `consensus_dal().upsert_attester_committee()`. + pub async fn upsert_attester_committee( + &mut self, + ctx: &ctx::Ctx, + number: BatchNumber, + committee: &attester::Committee, + ) -> ctx::Result<()> { + ctx.wait( + self.0 + .consensus_dal() + .upsert_attester_committee(number, committee), + ) + .await??; + Ok(()) + } + /// Wrapper for `consensus_dal().replica_state()`. pub async fn replica_state(&mut self, ctx: &ctx::Ctx) -> ctx::Result { Ok(ctx @@ -229,22 +246,22 @@ impl<'a> Connection<'a> { }) } - /// Wrapper for `consensus_dal().genesis()`. - pub async fn genesis(&mut self, ctx: &ctx::Ctx) -> ctx::Result> { - Ok(ctx - .wait(self.0.consensus_dal().genesis()) - .await? - .map_err(DalError::generalize)?) + /// Wrapper for `consensus_dal().global_config()`. + pub async fn global_config( + &mut self, + ctx: &ctx::Ctx, + ) -> ctx::Result> { + Ok(ctx.wait(self.0.consensus_dal().global_config()).await??) } - /// Wrapper for `consensus_dal().try_update_genesis()`. - pub async fn try_update_genesis( + /// Wrapper for `consensus_dal().try_update_global_config()`. + pub async fn try_update_global_config( &mut self, ctx: &ctx::Ctx, - genesis: &validator::Genesis, + cfg: &consensus_dal::GlobalConfig, ) -> ctx::Result<()> { Ok(ctx - .wait(self.0.consensus_dal().try_update_genesis(genesis)) + .wait(self.0.consensus_dal().try_update_global_config(cfg)) .await??) } @@ -267,7 +284,7 @@ impl<'a> Connection<'a> { /// (Re)initializes consensus genesis to start at the last L2 block in storage. /// Noop if `spec` matches the current genesis. - pub(crate) async fn adjust_genesis( + pub(crate) async fn adjust_global_config( &mut self, ctx: &ctx::Ctx, spec: &config::GenesisSpec, @@ -277,31 +294,34 @@ impl<'a> Connection<'a> { .await .wrap("start_transaction()")?; - let old = txn.genesis(ctx).await.wrap("genesis()")?; + let old = txn.global_config(ctx).await.wrap("genesis()")?; if let Some(old) = &old { - if &config::GenesisSpec::from_genesis(old) == spec { + if &config::GenesisSpec::from_global_config(old) == spec { // Hard fork is not needed. return Ok(()); } } tracing::info!("Performing a hard fork of consensus."); - let genesis = validator::GenesisRaw { - chain_id: spec.chain_id, - fork_number: old - .as_ref() - .map_or(validator::ForkNumber(0), |old| old.fork_number.next()), - first_block: txn.next_block(ctx).await.context("next_block()")?, - protocol_version: spec.protocol_version, - validators: spec.validators.clone(), - attesters: spec.attesters.clone(), - leader_selection: spec.leader_selection.clone(), - } - .with_hash(); + let new = consensus_dal::GlobalConfig { + genesis: validator::GenesisRaw { + chain_id: spec.chain_id, + fork_number: old.as_ref().map_or(validator::ForkNumber(0), |old| { + old.genesis.fork_number.next() + }), + first_block: txn.next_block(ctx).await.context("next_block()")?, + protocol_version: spec.protocol_version, + validators: spec.validators.clone(), + attesters: spec.attesters.clone(), + leader_selection: spec.leader_selection.clone(), + } + .with_hash(), + registry_address: spec.registry_address, + }; - txn.try_update_genesis(ctx, &genesis) + txn.try_update_global_config(ctx, &new) .await - .wrap("try_update_genesis()")?; + .wrap("try_update_global_config()")?; txn.commit(ctx).await.wrap("commit()")?; Ok(()) } @@ -447,4 +467,29 @@ impl<'a> Connection<'a> { .await? .context("attestation_status()")?) } + + /// Constructs `BlockArgs` for the last block of the batch. + pub async fn vm_block_args( + &mut self, + ctx: &ctx::Ctx, + batch: attester::BatchNumber, + ) -> ctx::Result { + let (_, block) = self + .get_l2_block_range_of_l1_batch(ctx, batch) + .await + .wrap("get_l2_block_range_of_l1_batch()")? + .context("batch not sealed")?; + let block = api::BlockId::Number(api::BlockNumber::Number(block.0.into())); + let start_info = ctx + .wait(BlockStartInfo::new( + &mut self.0, + /*max_cache_age=*/ std::time::Duration::from_secs(10), + )) + .await? + .context("BlockStartInfo::new()")?; + Ok(ctx + .wait(BlockArgs::new(&mut self.0, block, &start_info)) + .await? + .context("BlockArgs::new")?) + } } diff --git a/core/node/consensus/src/storage/store.rs b/core/node/consensus/src/storage/store.rs index 6a96812ae40..cb8e039d7d0 100644 --- a/core/node/consensus/src/storage/store.rs +++ b/core/node/consensus/src/storage/store.rs @@ -325,9 +325,10 @@ impl storage::PersistentBlockStore for Store { Ok(self .conn(ctx) .await? - .genesis(ctx) + .global_config(ctx) .await? - .context("not found")?) + .context("not found")? + .genesis) } fn persisted(&self) -> sync::watch::Receiver { diff --git a/core/node/consensus/src/storage/testonly.rs b/core/node/consensus/src/storage/testonly.rs index 5d1279afbbf..65c464d98b9 100644 --- a/core/node/consensus/src/storage/testonly.rs +++ b/core/node/consensus/src/storage/testonly.rs @@ -1,5 +1,4 @@ //! Storage test helpers. - use anyhow::Context as _; use zksync_concurrency::{ctx, error::Wrap as _, time}; use zksync_consensus_roles::{attester, validator}; @@ -13,6 +12,7 @@ use zksync_types::{ }; use super::{Connection, ConnectionPool}; +use crate::registry; impl Connection<'_> { /// Wrapper for `consensus_dal().batch_of_block()`. @@ -181,16 +181,16 @@ impl ConnectionPool { want_last: validator::BlockNumber, ) -> ctx::Result> { let blocks = self.wait_for_block_certificates(ctx, want_last).await?; - let genesis = self + let cfg = self .connection(ctx) .await .wrap("connection()")? - .genesis(ctx) + .global_config(ctx) .await .wrap("genesis()")? .context("genesis is missing")?; for block in &blocks { - block.verify(&genesis).context(block.number())?; + block.verify(&cfg.genesis).context(block.number())?; } Ok(blocks) } @@ -199,6 +199,7 @@ impl ConnectionPool { &self, ctx: &ctx::Ctx, want_last: attester::BatchNumber, + registry_addr: Option, ) -> ctx::Result<()> { // Wait for the last batch to be attested. const POLL_INTERVAL: time::Duration = time::Duration::milliseconds(100); @@ -214,17 +215,17 @@ impl ConnectionPool { ctx.sleep(POLL_INTERVAL).await?; } let mut conn = self.connection(ctx).await.wrap("connection()")?; - let genesis = conn - .genesis(ctx) + let cfg = conn + .global_config(ctx) .await - .wrap("genesis()")? - .context("genesis is missing")?; + .wrap("global_config()")? + .context("global config is missing")?; let first = conn - .batch_of_block(ctx, genesis.first_block) + .batch_of_block(ctx, cfg.genesis.first_block) .await .wrap("batch_of_block()")? .context("batch of first_block is missing")?; - let committee = genesis.attesters.as_ref().unwrap(); + let registry = registry::Registry::new(cfg.genesis.clone(), self.clone()).await; for i in first.0..want_last.0 { let i = attester::BatchNumber(i); let hash = conn @@ -240,8 +241,13 @@ impl ConnectionPool { if cert.message.hash != hash { return Err(anyhow::format_err!("cert[{i:?}]: hash mismatch").into()); } - cert.verify(genesis.hash(), committee) - .context("cert[{i:?}].verify()")?; + let committee = registry + .attester_committee_for(ctx, registry_addr, i) + .await + .context("attester_committee_for()")? + .context("committee not specified")?; + cert.verify(cfg.genesis.hash(), &committee) + .with_context(|| format!("cert[{i:?}].verify()"))?; } Ok(()) } diff --git a/core/node/consensus/src/testonly.rs b/core/node/consensus/src/testonly.rs index 90063772da9..241998f2692 100644 --- a/core/node/consensus/src/testonly.rs +++ b/core/node/consensus/src/testonly.rs @@ -42,8 +42,9 @@ use zksync_state_keeper::{ }; use zksync_test_account::Account; use zksync_types::{ + ethabi, fee_model::{BatchFeeInput, L1PeggedBatchFeeModelInput}, - Address, L1BatchNumber, L2BlockNumber, L2ChainId, PriorityOpId, ProtocolVersionId, + L1BatchNumber, L2BlockNumber, L2ChainId, PriorityOpId, ProtocolVersionId, Transaction, }; use zksync_web3_decl::client::{Client, DynClient, L2}; @@ -54,6 +55,7 @@ use crate::{ }; /// Fake StateKeeper for tests. +#[derive(Debug)] pub(super) struct StateKeeper { protocol_version: ProtocolVersionId, // Batch of the `last_block`. @@ -62,8 +64,6 @@ pub(super) struct StateKeeper { // timestamp of the last block. last_timestamp: u64, batch_sealed: bool, - // test L2 account - account: Account, next_priority_op: PriorityOpId, actions_sender: ActionQueueSender, @@ -116,6 +116,7 @@ pub(super) fn new_configs( }) .collect(), leader: config::ValidatorPublicKey(setup.validator_keys[0].public().encode()), + registry_address: None, }; network::testonly::new_configs(rng, setup, gossip_peers) .into_iter() @@ -183,7 +184,6 @@ pub(super) struct StateKeeperRunner { addr: sync::watch::Sender>, rocksdb_dir: tempfile::TempDir, metadata_calculator: MetadataCalculator, - account: Account, } impl StateKeeper { @@ -242,7 +242,6 @@ impl StateKeeper { .await .context("MetadataCalculator::new()")?; let tree_reader = metadata_calculator.tree_reader(); - let account = Account::random(); Ok(( Self { protocol_version, @@ -256,7 +255,6 @@ impl StateKeeper { addr: addr.subscribe(), pool: pool.clone(), tree_reader, - account: account.clone(), }, StateKeeperRunner { actions_queue, @@ -265,7 +263,6 @@ impl StateKeeper { addr, rocksdb_dir, metadata_calculator, - account, }, )) } @@ -306,22 +303,29 @@ impl StateKeeper { } } - /// Pushes a new L2 block with `transactions` transactions to the `StateKeeper`. - pub async fn push_random_block(&mut self, rng: &mut impl Rng) { + pub async fn push_block(&mut self, txs: &[Transaction]) { let mut actions = vec![self.open_block()]; - for _ in 0..rng.gen_range(3..8) { - let tx = match rng.gen() { - true => l2_transaction(&mut self.account, 1_000_000), + actions.extend( + txs.iter() + .map(|tx| FetchedTransaction::new(tx.clone()).into()), + ); + actions.push(SyncAction::SealL2Block); + self.actions_sender.push_actions(actions).await.unwrap(); + } + + /// Pushes a new L2 block with `transactions` transactions to the `StateKeeper`. + pub async fn push_random_block(&mut self, rng: &mut impl Rng, account: &mut Account) { + let txs: Vec<_> = (0..rng.gen_range(3..8)) + .map(|_| match rng.gen() { + true => l2_transaction(account, 1_000_000), false => { - let tx = l1_transaction(&mut self.account, self.next_priority_op); + let tx = l1_transaction(account, self.next_priority_op); self.next_priority_op += 1; tx } - }; - actions.push(FetchedTransaction::new(tx).into()); - } - actions.push(SyncAction::SealL2Block); - self.actions_sender.push_actions(actions).await.unwrap(); + }) + .collect(); + self.push_block(&txs).await; } /// Pushes `SealBatch` command to the `StateKeeper`. @@ -334,14 +338,19 @@ impl StateKeeper { } /// Pushes `count` random L2 blocks to the StateKeeper. - pub async fn push_random_blocks(&mut self, rng: &mut impl Rng, count: usize) { + pub async fn push_random_blocks( + &mut self, + rng: &mut impl Rng, + account: &mut Account, + count: usize, + ) { for _ in 0..count { // 20% chance to seal an L1 batch. // `seal_batch()` also produces a (fictive) block. if rng.gen_range(0..100) < 20 { self.seal_batch().await; } else { - self.push_random_block(rng).await; + self.push_random_block(rng, account).await; } } } @@ -451,7 +460,13 @@ impl StateKeeper { client, sync_state: self.sync_state.clone(), } - .run(ctx, self.actions_sender, cfgs.config, cfgs.secrets) + .run( + ctx, + self.actions_sender, + cfgs.config, + cfgs.secrets, + cfgs.net.build_version, + ) .await } } @@ -534,14 +549,21 @@ async fn mock_metadata_calculator_step(ctx: &ctx::Ctx, pool: &ConnectionPool) -> impl StateKeeperRunner { // Executes the state keeper task with real metadata calculator task // and fake commitment generator (because real one is too slow). - pub async fn run_real(self, ctx: &ctx::Ctx) -> anyhow::Result<()> { + pub async fn run_real( + self, + ctx: &ctx::Ctx, + addrs_to_fund: &[ethabi::Address], + ) -> anyhow::Result<()> { let res = scope::run!(ctx, |ctx, s| async { - // Fund the test account. Required for L2 transactions to succeed. - fund(&self.pool.0, &[self.account.address]).await; + // Fund the test accounts. Required for L2 transactions to succeed. + fund(&self.pool.0, addrs_to_fund).await; let (stop_send, stop_recv) = sync::watch::channel(false); - let (persistence, l2_block_sealer) = - StateKeeperPersistence::new(self.pool.0.clone(), Address::repeat_byte(11), 5); + let (persistence, l2_block_sealer) = StateKeeperPersistence::new( + self.pool.0.clone(), + ethabi::Address::repeat_byte(11), + 5, + ); let io = ExternalIO::new( self.pool.0.clone(), @@ -649,8 +671,11 @@ impl StateKeeperRunner { pub async fn run(self, ctx: &ctx::Ctx) -> anyhow::Result<()> { let res = scope::run!(ctx, |ctx, s| async { let (stop_send, stop_recv) = sync::watch::channel(false); - let (persistence, l2_block_sealer) = - StateKeeperPersistence::new(self.pool.0.clone(), Address::repeat_byte(11), 5); + let (persistence, l2_block_sealer) = StateKeeperPersistence::new( + self.pool.0.clone(), + ethabi::Address::repeat_byte(11), + 5, + ); let tree_writes_persistence = TreeWritesPersistence::new(self.pool.0.clone()); let io = ExternalIO::new( diff --git a/core/node/consensus/src/tests/attestation.rs b/core/node/consensus/src/tests/attestation.rs index b245d0524aa..abd35508c7f 100644 --- a/core/node/consensus/src/tests/attestation.rs +++ b/core/node/consensus/src/tests/attestation.rs @@ -1,17 +1,24 @@ use anyhow::Context as _; -use test_casing::{test_casing, Product}; +use rand::Rng as _; +use test_casing::test_casing; use tracing::Instrument as _; use zksync_concurrency::{ctx, error::Wrap, scope}; use zksync_consensus_roles::{ attester, validator::testonly::{Setup, SetupSpec}, }; -use zksync_dal::consensus_dal::AttestationStatus; -use zksync_node_sync::MainNodeClient; +use zksync_dal::consensus_dal; +use zksync_test_account::Account; use zksync_types::{L1BatchNumber, ProtocolVersionId}; +use zksync_web3_decl::namespaces::EnNamespaceClient as _; -use super::{FROM_SNAPSHOT, VERSIONS}; -use crate::{mn::run_main_node, storage::ConnectionPool, testonly}; +use super::VERSIONS; +use crate::{ + mn::run_main_node, + registry::{testonly, Registry}, + storage::ConnectionPool, + testonly::{new_configs, StateKeeper}, +}; #[test_casing(2, VERSIONS)] #[tokio::test] @@ -19,24 +26,31 @@ async fn test_attestation_status_api(version: ProtocolVersionId) { zksync_concurrency::testonly::abort_on_panic(); let ctx = &ctx::test_root(&ctx::RealClock); let rng = &mut ctx.rng(); + let account = &mut Account::random(); scope::run!(ctx, |ctx, s| async { let pool = ConnectionPool::test(false, version).await; - let (mut sk, runner) = testonly::StateKeeper::new(ctx, pool.clone()).await?; + let (mut sk, runner) = StateKeeper::new(ctx, pool.clone()).await?; s.spawn_bg(runner.run(ctx).instrument(tracing::info_span!("validator"))); // Setup nontrivial genesis. while sk.last_sealed_batch() < L1BatchNumber(3) { - sk.push_random_blocks(rng, 10).await; + sk.push_random_blocks(rng, account, 10).await; } let mut setup = SetupSpec::new(rng, 3); setup.first_block = sk.last_block(); let first_batch = sk.last_batch(); let setup = Setup::from(setup); let mut conn = pool.connection(ctx).await.wrap("connection()")?; - conn.try_update_genesis(ctx, &setup.genesis) - .await - .wrap("try_update_genesis()")?; + conn.try_update_global_config( + ctx, + &consensus_dal::GlobalConfig { + genesis: setup.genesis.clone(), + registry_address: None, + }, + ) + .await + .wrap("try_update_global_config()")?; // Make sure that the first_batch is actually sealed. sk.seal_batch().await; pool.wait_for_batch(ctx, first_batch).await?; @@ -44,11 +58,11 @@ async fn test_attestation_status_api(version: ProtocolVersionId) { // Connect to API endpoint. let api = sk.connect(ctx).await?; let fetch_status = || async { - let s = api - .fetch_attestation_status() - .await? + let s = ctx + .wait(api.attestation_status()) + .await?? .context("no attestation_status")?; - let s: AttestationStatus = + let s: consensus_dal::AttestationStatus = zksync_protobuf::serde::deserialize(&s.0).context("deserialize()")?; anyhow::ensure!(s.genesis == setup.genesis.hash(), "genesis hash mismatch"); Ok(s) @@ -62,24 +76,37 @@ async fn test_attestation_status_api(version: ProtocolVersionId) { attester::BatchNumber(first_batch.0.into()) ); - // Insert a (fake) cert, then check again. + tracing::info!("Insert a cert"); { let mut conn = pool.connection(ctx).await?; let number = status.next_batch_to_attest; let hash = conn.batch_hash(ctx, number).await?.unwrap(); - let genesis = conn.genesis(ctx).await?.unwrap().hash(); + let gcfg = conn.global_config(ctx).await?.unwrap(); + let m = attester::Batch { + number, + hash, + genesis: gcfg.genesis.hash(), + }; + let mut sigs = attester::MultiSig::default(); + for k in &setup.attester_keys { + sigs.add(k.public(), k.sign_msg(m.clone()).sig); + } let cert = attester::BatchQC { - signatures: attester::MultiSig::default(), - message: attester::Batch { - number, - hash, - genesis, - }, + signatures: sigs, + message: m, }; + conn.upsert_attester_committee( + ctx, + cert.message.number, + setup.genesis.attesters.as_ref().unwrap(), + ) + .await + .context("upsert_attester_committee")?; conn.insert_batch_certificate(ctx, &cert) .await .context("insert_batch_certificate()")?; } + tracing::info!("Check again."); let want = status.next_batch_to_attest.next(); let got = fetch_status().await?; assert_eq!(want, got.next_batch_to_attest); @@ -93,34 +120,65 @@ async fn test_attestation_status_api(version: ProtocolVersionId) { // Test running a couple of attesters (which are also validators). // Main node is expected to collect all certificates. // External nodes are expected to just vote for the batch. -// -// TODO: it would be nice to use `StateKeeperRunner::run_real()` in this test, -// however as of now it doesn't work with ENs and it doesn't work with -// `ConnectionPool::from_snapshot`. -#[test_casing(4, Product((FROM_SNAPSHOT,VERSIONS)))] +#[test_casing(2, VERSIONS)] #[tokio::test] -async fn test_multiple_attesters(from_snapshot: bool, version: ProtocolVersionId) { +async fn test_multiple_attesters(version: ProtocolVersionId) { const NODES: usize = 4; zksync_concurrency::testonly::abort_on_panic(); let ctx = &ctx::test_root(&ctx::AffineClock::new(10.)); let rng = &mut ctx.rng(); + let account = &mut Account::random(); + let to_fund = &[account.address]; let setup = Setup::new(rng, 4); - let cfgs = testonly::new_configs(rng, &setup, NODES); - + let mut cfgs = new_configs(rng, &setup, NODES); scope::run!(ctx, |ctx, s| async { - let validator_pool = ConnectionPool::test(from_snapshot, version).await; - let (mut validator, runner) = - testonly::StateKeeper::new(ctx, validator_pool.clone()).await?; + let validator_pool = ConnectionPool::test(false, version).await; + let (mut validator, runner) = StateKeeper::new(ctx, validator_pool.clone()).await?; s.spawn_bg(async { runner - .run(ctx) + .run_real(ctx, to_fund) .instrument(tracing::info_span!("validator")) .await .context("validator") }); - // API server needs at least 1 L1 batch to start. + + tracing::info!("deploy registry with 1 attester"); + let attesters: Vec<_> = setup.genesis.attesters.as_ref().unwrap().iter().collect(); + let registry = Registry::new(setup.genesis.clone(), validator_pool.clone()).await; + let (registry_addr, tx) = registry.deploy(account); + cfgs[0] + .config + .genesis_spec + .as_mut() + .unwrap() + .registry_address = Some(*registry_addr); + let mut txs = vec![tx]; + txs.push(testonly::make_tx( + account, + registry_addr, + registry.initialize(account.address), + )); + txs.push(testonly::make_tx( + account, + registry_addr, + registry + .add( + rng.gen(), + testonly::gen_validator(rng), + attesters[0].clone(), + ) + .unwrap(), + )); + txs.push(testonly::make_tx( + account, + registry_addr, + registry.commit_attester_committee(), + )); + validator.push_block(&txs).await; validator.seal_batch().await; + + tracing::info!("wait for the batch to be processed before starting consensus"); validator_pool .wait_for_payload(ctx, validator.last_block()) .await?; @@ -137,13 +195,13 @@ async fn test_multiple_attesters(from_snapshot: bool, version: ProtocolVersionId let mut node_pools = vec![]; for (i, cfg) in cfgs[1..].iter().enumerate() { let i = ctx::NoCopy(i); - let pool = ConnectionPool::test(from_snapshot, version).await; - let (node, runner) = testonly::StateKeeper::new(ctx, pool.clone()).await?; + let pool = ConnectionPool::test(false, version).await; + let (node, runner) = StateKeeper::new(ctx, pool.clone()).await?; node_pools.push(pool.clone()); s.spawn_bg(async { let i = i; runner - .run(ctx) + .run_real(ctx, to_fund) .instrument(tracing::info_span!("node", i = *i)) .await .with_context(|| format!("node{}", *i)) @@ -151,13 +209,31 @@ async fn test_multiple_attesters(from_snapshot: bool, version: ProtocolVersionId s.spawn_bg(node.run_consensus(ctx, validator.connect(ctx).await?, cfg.clone())); } - tracing::info!("Create some batches"); - validator.push_random_blocks(rng, 20).await; - validator.seal_batch().await; + tracing::info!("add attesters one by one"); + #[allow(clippy::needless_range_loop)] + for i in 1..attesters.len() { + let txs = vec![ + testonly::make_tx( + account, + registry_addr, + registry + .add( + rng.gen(), + testonly::gen_validator(rng), + attesters[i].clone(), + ) + .unwrap(), + ), + testonly::make_tx(account, registry_addr, registry.commit_attester_committee()), + ]; + validator.push_block(&txs).await; + validator.seal_batch().await; + } + tracing::info!("Wait for the batches to be attested"); let want_last = attester::BatchNumber(validator.last_sealed_batch().0.into()); validator_pool - .wait_for_batch_certificates_and_verify(ctx, want_last) + .wait_for_batch_certificates_and_verify(ctx, want_last, Some(registry_addr)) .await?; Ok(()) }) diff --git a/core/node/consensus/src/tests/batch.rs b/core/node/consensus/src/tests/batch.rs index 41d73fdb87c..f0cae7f2c02 100644 --- a/core/node/consensus/src/tests/batch.rs +++ b/core/node/consensus/src/tests/batch.rs @@ -1,6 +1,7 @@ use test_casing::{test_casing, Product}; use zksync_concurrency::{ctx, scope}; use zksync_consensus_roles::validator; +use zksync_test_account::Account; use zksync_types::{L1BatchNumber, ProtocolVersionId}; use super::{FROM_SNAPSHOT, VERSIONS}; @@ -13,6 +14,7 @@ async fn test_connection_get_batch(from_snapshot: bool, version: ProtocolVersion let ctx = &ctx::test_root(&ctx::RealClock); let rng = &mut ctx.rng(); let pool = ConnectionPool::test(from_snapshot, version).await; + let account = &mut Account::random(); // Fill storage with unsigned L2 blocks and L1 batches in a way that the // last L1 batch is guaranteed to have some L2 blocks executed in it. @@ -23,11 +25,11 @@ async fn test_connection_get_batch(from_snapshot: bool, version: ProtocolVersion for _ in 0..3 { for _ in 0..2 { - sk.push_random_block(rng).await; + sk.push_random_block(rng, account).await; } sk.seal_batch().await; } - sk.push_random_block(rng).await; + sk.push_random_block(rng, account).await; pool.wait_for_payload(ctx, sk.last_block()).await?; @@ -84,11 +86,13 @@ async fn test_batch_witness(version: ProtocolVersionId) { zksync_concurrency::testonly::abort_on_panic(); let ctx = &ctx::test_root(&ctx::RealClock); let rng = &mut ctx.rng(); + let account = &mut Account::random(); + let to_fund = &[account.address]; scope::run!(ctx, |ctx, s| async { let pool = ConnectionPool::from_genesis(version).await; let (mut node, runner) = testonly::StateKeeper::new(ctx, pool.clone()).await?; - s.spawn_bg(runner.run_real(ctx)); + s.spawn_bg(runner.run_real(ctx, to_fund)); tracing::info!("analyzing storage"); { @@ -101,7 +105,7 @@ async fn test_batch_witness(version: ProtocolVersionId) { } // Seal a bunch of batches. - node.push_random_blocks(rng, 10).await; + node.push_random_blocks(rng, account, 10).await; node.seal_batch().await; pool.wait_for_batch(ctx, node.last_sealed_batch()).await?; // We can verify only 2nd batch onward, because diff --git a/core/node/consensus/src/tests/mod.rs b/core/node/consensus/src/tests/mod.rs index 0b611d55f06..91f01f865a2 100644 --- a/core/node/consensus/src/tests/mod.rs +++ b/core/node/consensus/src/tests/mod.rs @@ -7,6 +7,8 @@ use zksync_consensus_roles::{ validator::testonly::{Setup, SetupSpec}, }; use zksync_consensus_storage::BlockStore; +use zksync_dal::consensus_dal; +use zksync_test_account::Account; use zksync_types::ProtocolVersionId; use crate::{ @@ -28,6 +30,7 @@ async fn test_validator_block_store(version: ProtocolVersionId) { let ctx = &ctx::test_root(&ctx::RealClock); let rng = &mut ctx.rng(); let pool = ConnectionPool::test(false, version).await; + let account = &mut Account::random(); // Fill storage with unsigned L2 blocks. // Fetch a suffix of blocks that we will generate (fake) certs for. @@ -35,15 +38,21 @@ async fn test_validator_block_store(version: ProtocolVersionId) { // Start state keeper. let (mut sk, runner) = testonly::StateKeeper::new(ctx, pool.clone()).await?; s.spawn_bg(runner.run(ctx)); - sk.push_random_blocks(rng, 10).await; + sk.push_random_blocks(rng, account, 10).await; pool.wait_for_payload(ctx, sk.last_block()).await?; let mut setup = SetupSpec::new(rng, 3); setup.first_block = validator::BlockNumber(4); let mut setup = Setup::from(setup); let mut conn = pool.connection(ctx).await.wrap("connection()")?; - conn.try_update_genesis(ctx, &setup.genesis) - .await - .wrap("try_update_genesis()")?; + conn.try_update_global_config( + ctx, + &consensus_dal::GlobalConfig { + genesis: setup.genesis.clone(), + registry_address: None, + }, + ) + .await + .wrap("try_update_global_config()")?; for i in setup.genesis.first_block.0..sk.last_block().next().0 { let i = validator::BlockNumber(i); let payload = conn @@ -95,6 +104,7 @@ async fn test_validator(from_snapshot: bool, version: ProtocolVersionId) { let rng = &mut ctx.rng(); let setup = Setup::new(rng, 1); let cfg = testonly::new_configs(rng, &setup, 0)[0].clone(); + let account = &mut Account::random(); scope::run!(ctx, |ctx, s| async { tracing::info!("Start state keeper."); @@ -103,7 +113,7 @@ async fn test_validator(from_snapshot: bool, version: ProtocolVersionId) { s.spawn_bg(runner.run(ctx)); tracing::info!("Populate storage with a bunch of blocks."); - sk.push_random_blocks(rng, 5).await; + sk.push_random_blocks(rng, account, 5).await; pool .wait_for_payload(ctx, sk.last_block()) .await @@ -118,7 +128,7 @@ async fn test_validator(from_snapshot: bool, version: ProtocolVersionId) { s.spawn_bg(run_main_node(ctx, cfg.config.clone(), cfg.secrets.clone(), pool.clone())); tracing::info!("Generate couple more blocks and wait for consensus to catch up."); - sk.push_random_blocks(rng, 3).await; + sk.push_random_blocks(rng, account, 3).await; pool .wait_for_block_certificate(ctx, sk.last_block()) .await @@ -126,7 +136,7 @@ async fn test_validator(from_snapshot: bool, version: ProtocolVersionId) { tracing::info!("Synchronously produce blocks one by one, and wait for consensus."); for _ in 0..2 { - sk.push_random_blocks(rng, 1).await; + sk.push_random_blocks(rng, account, 1).await; pool .wait_for_block_certificate(ctx, sk.last_block()) .await @@ -158,6 +168,7 @@ async fn test_nodes_from_various_snapshots(version: ProtocolVersionId) { let rng = &mut ctx.rng(); let setup = Setup::new(rng, 1); let validator_cfg = testonly::new_configs(rng, &setup, 0)[0].clone(); + let account = &mut Account::random(); scope::run!(ctx, |ctx, s| async { tracing::info!("spawn validator"); @@ -173,7 +184,7 @@ async fn test_nodes_from_various_snapshots(version: ProtocolVersionId) { )); tracing::info!("produce some batches"); - validator.push_random_blocks(rng, 5).await; + validator.push_random_blocks(rng, account, 5).await; validator.seal_batch().await; validator_pool .wait_for_block_certificate(ctx, validator.last_block()) @@ -191,7 +202,7 @@ async fn test_nodes_from_various_snapshots(version: ProtocolVersionId) { }); tracing::info!("produce more batches"); - validator.push_random_blocks(rng, 5).await; + validator.push_random_blocks(rng, account, 5).await; validator.seal_batch().await; node_pool .wait_for_block_certificate(ctx, validator.last_block()) @@ -209,7 +220,7 @@ async fn test_nodes_from_various_snapshots(version: ProtocolVersionId) { }); tracing::info!("produce more blocks and compare storages"); - validator.push_random_blocks(rng, 5).await; + validator.push_random_blocks(rng, account, 5).await; let want = validator_pool .wait_for_block_certificates_and_verify(ctx, validator.last_block()) .await?; @@ -243,6 +254,7 @@ async fn test_full_nodes(from_snapshot: bool, version: ProtocolVersionId) { let rng = &mut ctx.rng(); let setup = Setup::new(rng, 1); let validator_cfg = testonly::new_configs(rng, &setup, 0)[0].clone(); + let account = &mut Account::random(); // topology: // validator <-> node <-> node <-> ... @@ -264,7 +276,7 @@ async fn test_full_nodes(from_snapshot: bool, version: ProtocolVersionId) { .context("validator") }); tracing::info!("Generate a couple of blocks, before initializing consensus genesis."); - validator.push_random_blocks(rng, 5).await; + validator.push_random_blocks(rng, account, 5).await; // API server needs at least 1 L1 batch to start. validator.seal_batch().await; validator_pool @@ -299,7 +311,7 @@ async fn test_full_nodes(from_snapshot: bool, version: ProtocolVersionId) { tracing::info!("Make validator produce blocks and wait for fetchers to get them."); // Note that block from before and after genesis have to be fetched. - validator.push_random_blocks(rng, 5).await; + validator.push_random_blocks(rng, account, 5).await; let want_last = validator.last_block(); let want = validator_pool .wait_for_block_certificates_and_verify(ctx, want_last) @@ -328,6 +340,7 @@ async fn test_en_validators(from_snapshot: bool, version: ProtocolVersionId) { let rng = &mut ctx.rng(); let setup = Setup::new(rng, NODES); let cfgs = testonly::new_configs(rng, &setup, 1); + let account = &mut Account::random(); // Run all nodes in parallel. scope::run!(ctx, |ctx, s| async { @@ -342,7 +355,7 @@ async fn test_en_validators(from_snapshot: bool, version: ProtocolVersionId) { .context("main_node") }); tracing::info!("Generate a couple of blocks, before initializing consensus genesis."); - main_node.push_random_blocks(rng, 5).await; + main_node.push_random_blocks(rng, account, 5).await; // API server needs at least 1 L1 batch to start. main_node.seal_batch().await; main_node_pool @@ -381,7 +394,7 @@ async fn test_en_validators(from_snapshot: bool, version: ProtocolVersionId) { } tracing::info!("Make the main node produce blocks and wait for consensus to finalize them"); - main_node.push_random_blocks(rng, 5).await; + main_node.push_random_blocks(rng, account, 5).await; let want_last = main_node.last_block(); let want = main_node_pool .wait_for_block_certificates_and_verify(ctx, want_last) @@ -409,6 +422,7 @@ async fn test_p2p_fetcher_backfill_certs(from_snapshot: bool, version: ProtocolV let setup = Setup::new(rng, 1); let validator_cfg = testonly::new_configs(rng, &setup, 0)[0].clone(); let node_cfg = validator_cfg.new_fullnode(rng); + let account = &mut Account::random(); scope::run!(ctx, |ctx, s| async { tracing::info!("Spawn validator."); @@ -433,7 +447,7 @@ async fn test_p2p_fetcher_backfill_certs(from_snapshot: bool, version: ProtocolV let (node, runner) = testonly::StateKeeper::new(ctx, node_pool.clone()).await?; s.spawn_bg(runner.run(ctx)); s.spawn_bg(node.run_consensus(ctx, client.clone(), node_cfg.clone())); - validator.push_random_blocks(rng, 3).await; + validator.push_random_blocks(rng, account, 3).await; node_pool .wait_for_block_certificate(ctx, validator.last_block()) .await?; @@ -447,7 +461,7 @@ async fn test_p2p_fetcher_backfill_certs(from_snapshot: bool, version: ProtocolV let (node, runner) = testonly::StateKeeper::new(ctx, node_pool.clone()).await?; s.spawn_bg(runner.run(ctx)); s.spawn_bg(node.run_fetcher(ctx, client.clone())); - validator.push_random_blocks(rng, 3).await; + validator.push_random_blocks(rng, account, 3).await; node_pool .wait_for_payload(ctx, validator.last_block()) .await?; @@ -461,7 +475,7 @@ async fn test_p2p_fetcher_backfill_certs(from_snapshot: bool, version: ProtocolV let (node, runner) = testonly::StateKeeper::new(ctx, node_pool.clone()).await?; s.spawn_bg(runner.run(ctx)); s.spawn_bg(node.run_consensus(ctx, client.clone(), node_cfg)); - validator.push_random_blocks(rng, 3).await; + validator.push_random_blocks(rng, account, 3).await; let want = validator_pool .wait_for_block_certificates_and_verify(ctx, validator.last_block()) .await?; @@ -488,6 +502,7 @@ async fn test_with_pruning(version: ProtocolVersionId) { let setup = Setup::new(rng, 1); let validator_cfg = testonly::new_configs(rng, &setup, 0)[0].clone(); let node_cfg = validator_cfg.new_fullnode(rng); + let account = &mut Account::random(); scope::run!(ctx, |ctx, s| async { let validator_pool = ConnectionPool::test(false, version).await; @@ -535,7 +550,7 @@ async fn test_with_pruning(version: ProtocolVersionId) { }); tracing::info!("Sync some blocks"); - validator.push_random_blocks(rng, 5).await; + validator.push_random_blocks(rng, account, 5).await; validator.seal_batch().await; let to_prune = validator.last_sealed_batch(); tracing::info!( @@ -546,7 +561,7 @@ async fn test_with_pruning(version: ProtocolVersionId) { tracing::info!( "Seal another batch to make sure that there is at least 1 sealed batch after pruning." ); - validator.push_random_blocks(rng, 5).await; + validator.push_random_blocks(rng, account, 5).await; validator.seal_batch().await; validator_pool .wait_for_batch(ctx, validator.last_sealed_batch()) @@ -565,7 +580,7 @@ async fn test_with_pruning(version: ProtocolVersionId) { .prune_batches(ctx, to_prune) .await .context("prune_batches")?; - validator.push_random_blocks(rng, 5).await; + validator.push_random_blocks(rng, account, 5).await; node_pool .wait_for_block_certificates(ctx, validator.last_block()) .await @@ -582,6 +597,7 @@ async fn test_centralized_fetcher(from_snapshot: bool, version: ProtocolVersionI zksync_concurrency::testonly::abort_on_panic(); let ctx = &ctx::test_root(&ctx::RealClock); let rng = &mut ctx.rng(); + let account = &mut Account::random(); scope::run!(ctx, |ctx, s| async { tracing::info!("Spawn a validator."); @@ -601,7 +617,7 @@ async fn test_centralized_fetcher(from_snapshot: bool, version: ProtocolVersionI s.spawn_bg(node.run_fetcher(ctx, validator.connect(ctx).await?)); tracing::info!("Produce some blocks and wait for node to fetch them"); - validator.push_random_blocks(rng, 10).await; + validator.push_random_blocks(rng, account, 10).await; let want = validator_pool .wait_for_payload(ctx, validator.last_block()) .await?; diff --git a/core/node/consensus/src/vm.rs b/core/node/consensus/src/vm.rs new file mode 100644 index 00000000000..11b6b5c67e3 --- /dev/null +++ b/core/node/consensus/src/vm.rs @@ -0,0 +1,98 @@ +use anyhow::Context as _; +use zksync_concurrency::{ctx, error::Wrap as _, scope}; +use zksync_consensus_roles::attester; +use zksync_node_api_server::{ + execution_sandbox::{TransactionExecutor, TxSetupArgs, VmConcurrencyLimiter}, + tx_sender::MultiVMBaseSystemContracts, +}; +use zksync_state::PostgresStorageCaches; +use zksync_system_constants::DEFAULT_L2_TX_GAS_PER_PUBDATA_BYTE; +use zksync_types::{ + ethabi, fee::Fee, fee_model::BatchFeeInput, l2::L2Tx, AccountTreeId, L2ChainId, Nonce, U256, +}; +use zksync_vm_interface::{ + ExecutionResult, OneshotTracingParams, TxExecutionArgs, TxExecutionMode, +}; + +use crate::{abi, storage::ConnectionPool}; + +/// VM executes eth_calls on the db. +#[derive(Debug)] +pub(crate) struct VM { + pool: ConnectionPool, + setup_args: TxSetupArgs, + limiter: VmConcurrencyLimiter, +} + +impl VM { + /// Constructs a new `VM` instance. + pub async fn new(pool: ConnectionPool) -> Self { + Self { + pool, + setup_args: TxSetupArgs { + execution_mode: TxExecutionMode::EthCall, + operator_account: AccountTreeId::default(), + fee_input: BatchFeeInput::sensible_l1_pegged_default(), + base_system_contracts: scope::wait_blocking( + MultiVMBaseSystemContracts::load_eth_call_blocking, + ) + .await, + caches: PostgresStorageCaches::new(1, 1), + validation_computational_gas_limit: u32::MAX, + chain_id: L2ChainId::default(), + whitelisted_tokens_for_aa: vec![], + enforced_base_fee: None, + }, + limiter: VmConcurrencyLimiter::new(1).0, + } + } + + // FIXME (PLA-1018): switch to oneshot executor + pub async fn call( + &self, + ctx: &ctx::Ctx, + batch: attester::BatchNumber, + address: abi::Address, + call: abi::Call, + ) -> ctx::Result { + let tx = L2Tx::new( + *address, + call.calldata().context("call.calldata()")?, + Nonce(0), + Fee { + gas_limit: U256::from(2000000000u32), + max_fee_per_gas: U256::zero(), + max_priority_fee_per_gas: U256::zero(), + gas_per_pubdata_limit: U256::from(DEFAULT_L2_TX_GAS_PER_PUBDATA_BYTE), + }, + ethabi::Address::zero(), + U256::zero(), + vec![], + Default::default(), + ); + let permit = ctx.wait(self.limiter.acquire()).await?.unwrap(); + let mut conn = self.pool.connection(ctx).await.wrap("connection()")?; + let args = conn + .vm_block_args(ctx, batch) + .await + .wrap("vm_block_args()")?; + let output = ctx + .wait(TransactionExecutor::real(usize::MAX).execute_tx_in_sandbox( + permit, + self.setup_args.clone(), + TxExecutionArgs::for_eth_call(tx.clone()), + conn.0, + args, + None, + OneshotTracingParams::default(), + )) + .await? + .context("execute_tx_in_sandbox()")?; + match output.vm.result { + ExecutionResult::Success { output } => { + Ok(call.decode_outputs(&output).context("decode_output()")?) + } + other => Err(anyhow::format_err!("unsuccessful execution: {other:?}").into()), + } + } +} diff --git a/core/node/consistency_checker/Cargo.toml b/core/node/consistency_checker/Cargo.toml index 769690b493a..ed2cbd5bbd7 100644 --- a/core/node/consistency_checker/Cargo.toml +++ b/core/node/consistency_checker/Cargo.toml @@ -14,7 +14,6 @@ categories.workspace = true zksync_contracts.workspace = true zksync_dal.workspace = true zksync_eth_client.workspace = true -zksync_eth_sender.workspace = true zksync_health_check.workspace = true zksync_l1_contract_interface.workspace = true zksync_shared_metrics.workspace = true diff --git a/core/node/da_clients/Cargo.toml b/core/node/da_clients/Cargo.toml new file mode 100644 index 00000000000..b91962b4b57 --- /dev/null +++ b/core/node/da_clients/Cargo.toml @@ -0,0 +1,43 @@ +[package] +name = "zksync_da_clients" +description = "ZKsync data availability clients" +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] +serde = { workspace = true, features = ["derive"] } +tracing.workspace = true +async-trait.workspace = true +anyhow.workspace = true +flate2.workspace = true +tokio.workspace = true + +zksync_config.workspace = true +zksync_types.workspace = true +zksync_object_store.workspace = true +zksync_da_client.workspace = true +zksync_env_config.workspace = true +futures.workspace = true + +# Avail dependencies +scale-encode.workspace = true +subxt-metadata.workspace = true +blake2.workspace = true +base58.workspace = true +serde_json.workspace = true +hex.workspace = true +blake2b_simd.workspace = true + +jsonrpsee = { workspace = true, features = ["ws-client"] } +parity-scale-codec = { workspace = true, features = ["derive"] } +subxt-signer = { workspace = true, features = ["sr25519", "native"] } + +# EigenDA dependencies +reqwest = { version= "0.12" } +http = "1" diff --git a/core/node/da_clients/README.md b/core/node/da_clients/README.md new file mode 100644 index 00000000000..df06cef2419 --- /dev/null +++ b/core/node/da_clients/README.md @@ -0,0 +1,10 @@ +# Data Availability Clients + +This crate contains the implementations of the Data Availability clients. + +Currently, the following DataAvailability clients are implemented: + +- `NoDA client` that does not send or store any pubdata, it is needed to run the zkSync network in the "no-DA" mode + utilizing the DA framework. +- `Object Store client` that stores the pubdata in the Object Store(GCS). +- `Avail` that sends the pubdata to the Avail DA layer. diff --git a/core/node/da_clients/src/avail/client.rs b/core/node/da_clients/src/avail/client.rs new file mode 100644 index 00000000000..021906d73a0 --- /dev/null +++ b/core/node/da_clients/src/avail/client.rs @@ -0,0 +1,85 @@ +use std::{fmt::Debug, sync::Arc}; + +use async_trait::async_trait; +use jsonrpsee::ws_client::WsClientBuilder; +use zksync_config::AvailConfig; +use zksync_da_client::{ + types::{DAError, DispatchResponse, InclusionData}, + DataAvailabilityClient, +}; + +use crate::avail::sdk::RawAvailClient; + +/// An implementation of the `DataAvailabilityClient` trait that interacts with the Avail network. +#[derive(Debug, Clone)] +pub struct AvailClient { + config: AvailConfig, + sdk_client: Arc, +} + +impl AvailClient { + pub async fn new(config: AvailConfig) -> anyhow::Result { + let sdk_client = RawAvailClient::new(config.app_id, config.seed.clone()).await?; + + Ok(Self { + config, + sdk_client: Arc::new(sdk_client), + }) + } +} + +#[async_trait] +impl DataAvailabilityClient for AvailClient { + async fn dispatch_blob( + &self, + _: u32, // batch_number + data: Vec, + ) -> anyhow::Result { + let client = WsClientBuilder::default() + .build(self.config.api_node_url.as_str()) + .await + .map_err(to_non_retriable_da_error)?; + + let extrinsic = self + .sdk_client + .build_extrinsic(&client, data) + .await + .map_err(to_non_retriable_da_error)?; + + let block_hash = self + .sdk_client + .submit_extrinsic(&client, extrinsic.as_str()) + .await + .map_err(to_non_retriable_da_error)?; + let tx_id = self + .sdk_client + .get_tx_id(&client, block_hash.as_str(), extrinsic.as_str()) + .await + .map_err(to_non_retriable_da_error)?; + + Ok(DispatchResponse::from(format!("{}:{}", block_hash, tx_id))) + } + + async fn get_inclusion_data( + &self, + _blob_id: &str, + ) -> anyhow::Result, DAError> { + // TODO: implement inclusion data retrieval + Ok(Some(InclusionData { data: vec![] })) + } + + fn clone_boxed(&self) -> Box { + Box::new(self.clone()) + } + + fn blob_size_limit(&self) -> Option { + Some(RawAvailClient::MAX_BLOB_SIZE) + } +} + +pub fn to_non_retriable_da_error(error: impl Into) -> DAError { + DAError { + error: error.into(), + is_retriable: false, + } +} diff --git a/core/node/da_clients/src/avail/mod.rs b/core/node/da_clients/src/avail/mod.rs new file mode 100644 index 00000000000..82073448ba1 --- /dev/null +++ b/core/node/da_clients/src/avail/mod.rs @@ -0,0 +1,4 @@ +mod client; +mod sdk; + +pub use self::client::AvailClient; diff --git a/core/node/da_clients/src/avail/sdk.rs b/core/node/da_clients/src/avail/sdk.rs new file mode 100644 index 00000000000..5e67540fcc6 --- /dev/null +++ b/core/node/da_clients/src/avail/sdk.rs @@ -0,0 +1,371 @@ +//! Minimal reimplementation of the Avail SDK client required for the DA client implementation. +//! This is considered to be a temporary solution until a mature SDK is available on crates.io + +use std::fmt::Debug; + +use jsonrpsee::{ + core::client::{Client, ClientT, Subscription, SubscriptionClientT}, + rpc_params, +}; +use parity_scale_codec::{Compact, Decode, Encode}; +use scale_encode::EncodeAsFields; +use subxt_signer::{ + bip39::Mnemonic, + sr25519::{Keypair, Signature}, +}; + +use crate::avail::client::to_non_retriable_da_error; + +const PROTOCOL_VERSION: u8 = 4; + +/// An implementation of the `DataAvailabilityClient` trait that interacts with the Avail network. +#[derive(Debug, Clone)] +pub(crate) struct RawAvailClient { + app_id: u32, + keypair: Keypair, +} + +/// Utility type needed for encoding the call data +#[derive(parity_scale_codec::Encode, scale_encode::EncodeAsType)] +#[encode_as_type(crate_path = "scale_encode")] +struct SubmitData { + pub data: BoundedVec, +} + +/// Utility type needed for encoding the call data +#[derive(parity_scale_codec::Encode, scale_encode::EncodeAsType)] +#[encode_as_type(crate_path = "scale_encode")] +struct BoundedVec<_0>(pub Vec<_0>); + +impl RawAvailClient { + pub(crate) const MAX_BLOB_SIZE: usize = 512 * 1024; // 512kb + + pub(crate) async fn new(app_id: u32, seed: String) -> anyhow::Result { + let mnemonic = Mnemonic::parse(seed)?; + let keypair = Keypair::from_phrase(&mnemonic, None)?; + + Ok(Self { app_id, keypair }) + } + + /// Returns a hex-encoded extrinsic + pub(crate) async fn build_extrinsic( + &self, + client: &Client, + data: Vec, + ) -> anyhow::Result { + let call_data = self + .get_encoded_call(client, data) + .await + .map_err(to_non_retriable_da_error)?; + let extra_params = self + .get_extended_params(client) + .await + .map_err(to_non_retriable_da_error)?; + let additional_params = self + .get_additional_params(client) + .await + .map_err(to_non_retriable_da_error)?; + + let signature = self.get_signature( + call_data.as_slice(), + extra_params.as_slice(), + additional_params.as_slice(), + ); + + let ext = self.get_submittable_extrinsic( + signature, + extra_params.as_slice(), + call_data.as_slice(), + ); + + Ok(hex::encode(&ext)) + } + + /// Returns an encoded call data + async fn get_encoded_call( + &self, + client: &Client, + data: Vec, + ) -> anyhow::Result, anyhow::Error> { + let resp: serde_json::Value = client.request("state_getMetadata", rpc_params![]).await?; + + let resp = resp + .as_str() + .ok_or_else(|| anyhow::anyhow!("Invalid metadata"))? + .to_string(); + + let metadata_bytes = hex::decode( + resp.strip_prefix("0x") + .ok_or_else(|| anyhow::anyhow!("Metadata doesn't have 0x prefix"))?, + )?; + let meta = subxt_metadata::Metadata::decode(&mut &metadata_bytes[..])?; + + let pallet = meta + .pallet_by_name("DataAvailability") + .ok_or_else(|| anyhow::anyhow!("DataAvailability pallet not found"))?; + + let call = pallet + .call_variant_by_name("submit_data") + .ok_or_else(|| anyhow::anyhow!("submit_data call not found"))?; + + let mut fields = call + .fields + .iter() + .map(|f| scale_encode::Field::new(f.ty.id, f.name.as_deref())); + + let mut bytes = Vec::new(); + pallet.index().encode_to(&mut bytes); + call.index.encode_to(&mut bytes); + + SubmitData { + data: BoundedVec(data), + } + .encode_as_fields_to(&mut fields, meta.types(), &mut bytes)?; + + Ok(bytes) + } + + /// Queries a node for a nonce + async fn fetch_account_nonce(&self, client: &Client) -> anyhow::Result { + let address = to_addr(self.keypair.clone()); + let resp: serde_json::Value = client + .request("system_accountNextIndex", rpc_params![address]) + .await?; + + let nonce = resp + .as_u64() + .ok_or_else(|| anyhow::anyhow!("Invalid nonce"))?; + + Ok(nonce) + } + + /// Returns a Compact-encoded extended extrinsic parameters + /// Extrinsic params used here: + /// - CheckMortality + /// - CheckNonce + /// - ChargeTransactionPayment + /// - CheckAppId + async fn get_extended_params(&self, client: &Client) -> anyhow::Result> { + let era = 0u8; // immortal era + let tip = 0u128; // no tip + let nonce = self.fetch_account_nonce(client).await?; + + // Encode the params + let mut bytes = vec![era]; + Compact(nonce).encode_to(&mut bytes); + Compact(tip).encode_to(&mut bytes); + Compact(self.app_id).encode_to(&mut bytes); + + Ok(bytes) + } + + /// Returns a Compact-encoded additional extrinsic parameters + /// Extrinsic params used here + /// - CheckSpecVersion + /// - CheckTxVersion + /// - CheckGenesis + async fn get_additional_params(&self, client: &Client) -> anyhow::Result> { + let (spec_version, tx_version) = self.get_runtime_version(client).await?; + let genesis_hash = self.fetch_genesis_hash(client).await?; + + let mut bytes = Vec::new(); + spec_version.encode_to(&mut bytes); + tx_version.encode_to(&mut bytes); + // adding genesis hash twice (that's what API requires ¯\_(ツ)_/¯) + bytes.extend(hex::decode(&genesis_hash)?); + bytes.extend(hex::decode(&genesis_hash)?); + + Ok(bytes) + } + + /// Returns the specification and transaction versions of a runtime + async fn get_runtime_version(&self, client: &Client) -> anyhow::Result<(u32, u32)> { + let resp: serde_json::Value = client + .request("chain_getRuntimeVersion", rpc_params![]) + .await?; + + let sv = resp + .get("specVersion") + .ok_or_else(|| anyhow::anyhow!("Invalid runtime version"))?; + let tv = resp + .get("transactionVersion") + .ok_or_else(|| anyhow::anyhow!("Invalid runtime version"))?; + + let spec_version = sv + .as_u64() + .ok_or_else(|| anyhow::anyhow!("Invalid spec version"))?; + let transaction_version = tv + .as_u64() + .ok_or_else(|| anyhow::anyhow!("Invalid transaction version"))?; + + Ok((spec_version as u32, transaction_version as u32)) + } + + async fn fetch_genesis_hash(&self, client: &Client) -> anyhow::Result { + let resp: serde_json::Value = client.request("chain_getBlockHash", rpc_params![0]).await?; + + let genesis_hash = resp + .as_str() + .ok_or_else(|| anyhow::anyhow!("Invalid genesis hash"))?; + + Ok(genesis_hash + .strip_prefix("0x") + .ok_or_else(|| anyhow::anyhow!("Genesis hash doesn't have a 0x prefix"))? + .to_string()) + } + + /// Returns a signature for partially-encoded extrinsic + fn get_signature( + &self, + call_data: &[u8], + extra_params: &[u8], + additional_params: &[u8], + ) -> Signature { + let mut bytes = vec![]; + bytes.extend_from_slice(call_data); + bytes.extend_from_slice(extra_params); + bytes.extend_from_slice(additional_params); + + if bytes.len() > 256 { + bytes = blake2::<32>(bytes).to_vec(); + } + + self.keypair.sign(&bytes) + } + + /// Encodes all the components of an extrinsic into a single vector + fn get_submittable_extrinsic( + &self, + signature: Signature, + extra_params: &[u8], + call_data: &[u8], + ) -> Vec { + let mut encoded_inner = Vec::new(); + (0b10000000 + PROTOCOL_VERSION).encode_to(&mut encoded_inner); // "is signed" + transaction protocol version + + // sender + encoded_inner.push(0); // 0 as an id param in MultiAddress enum + self.keypair.public_key().0.encode_to(&mut encoded_inner); // from address for signature + + // signature + encoded_inner.push(1); // 1 as an Sr25519 in MultiSignature enum + signature.0.encode_to(&mut encoded_inner); + + // extra params + encoded_inner.extend_from_slice(extra_params); + + // call data + encoded_inner.extend_from_slice(call_data); + + // now, prefix with byte length: + let len = Compact( + u32::try_from(encoded_inner.len()).expect("extrinsic size expected to be <4GB"), + ); + let mut encoded = Vec::new(); + len.encode_to(&mut encoded); + encoded.extend(encoded_inner); + + encoded + } + + /// Submits an extrinsic. Subscribes to a stream and waits for a tx to be included in a block + /// to return the block hash + pub(crate) async fn submit_extrinsic( + &self, + client: &Client, + extrinsic: &str, + ) -> anyhow::Result { + let mut sub: Subscription = client + .subscribe( + "author_submitAndWatchExtrinsic", + rpc_params![extrinsic], + "author_unwatchExtrinsic", + ) + .await?; + + let block_hash = loop { + let status = sub.next().await.transpose()?; + + if status.is_some() && status.as_ref().unwrap().is_object() { + if let Some(block_hash) = status.unwrap().get("inBlock") { + break block_hash + .as_str() + .ok_or_else(|| anyhow::anyhow!("Invalid block hash"))? + .strip_prefix("0x") + .ok_or_else(|| anyhow::anyhow!("Block hash doesn't have 0x prefix"))? + .to_string(); + } + } + }; + sub.unsubscribe().await?; + + Ok(block_hash) + } + + /// Iterates over all transaction in the block and finds an ID of the one provided as an argument + pub(crate) async fn get_tx_id( + &self, + client: &Client, + block_hash: &str, + hex_ext: &str, + ) -> anyhow::Result { + let resp: serde_json::Value = client + .request("chain_getBlock", rpc_params![block_hash]) + .await?; + + let block = resp + .get("block") + .ok_or_else(|| anyhow::anyhow!("Invalid block"))?; + let extrinsics = block + .get("extrinsics") + .ok_or_else(|| anyhow::anyhow!("No field named extrinsics in block"))? + .as_array() + .ok_or_else(|| anyhow::anyhow!("Extrinsics field is not an array"))?; + + let hex_ext = format!("0x{}", hex_ext); + + let tx_id = extrinsics + .iter() + .position(|extrinsic| extrinsic.as_str() == Some(hex_ext.as_str())) + .ok_or_else(|| anyhow::anyhow!("Extrinsic not found in block"))?; + + Ok(tx_id) + } +} + +fn blake2(data: Vec) -> [u8; N] { + blake2b_simd::Params::new() + .hash_length(N) + .hash(data.as_slice()) + .as_bytes() + .try_into() + .expect("slice is always the necessary length") +} + +// Taken from subxt accountId implementation +fn to_addr(keypair: Keypair) -> String { + // For serializing to a string to obtain the account nonce, we use the default substrate + // prefix (since we have no way to otherwise pick one). It doesn't really matter, since when + // it's deserialized back in system_accountNextIndex, we ignore this (so long as it's valid). + const SUBSTRATE_SS58_PREFIX: u8 = 42; + // prefix <= 63 just take up one byte at the start: + let mut v = vec![SUBSTRATE_SS58_PREFIX]; + // then push the account ID bytes. + v.extend(keypair.public_key().0); + // then push a 2 byte checksum of what we have so far. + let r = ss58hash(&v); + v.extend(&r[0..2]); + // then encode to base58. + use base58::ToBase58; + v.to_base58() +} + +// Taken from subxt accountId implementation +fn ss58hash(data: &[u8]) -> Vec { + use blake2::{Blake2b512, Digest}; + const PREFIX: &[u8] = b"SS58PRE"; + let mut ctx = Blake2b512::new(); + ctx.update(PREFIX); + ctx.update(data); + ctx.finalize().to_vec() +} diff --git a/core/node/da_clients/src/eigen_da.rs b/core/node/da_clients/src/eigen_da.rs new file mode 100644 index 00000000000..54f17cce87e --- /dev/null +++ b/core/node/da_clients/src/eigen_da.rs @@ -0,0 +1,116 @@ +use std::fmt::Debug; + +use async_trait::async_trait; +use zksync_config::configs::da_client::eigen_da::EigenDAConfig; +use zksync_da_client::{ + types::{self, InclusionData}, + DataAvailabilityClient, +}; + +#[derive(Clone, Debug)] +pub struct EigenDAClient { + client: reqwest::Client, + config: EigenDAConfig, +} + +impl EigenDAClient { + pub const BLOB_SIZE_LIMIT_IN_BYTES: usize = 10 * 1024 * 1024; // 10MB + + pub async fn new(config: EigenDAConfig) -> anyhow::Result { + Ok(Self { + client: reqwest::Client::new(), + config, + }) + } +} + +#[async_trait] +impl DataAvailabilityClient for EigenDAClient { + async fn dispatch_blob( + &self, + _batch_number: u32, + blob_data: Vec, + ) -> Result { + tracing::info!("Dispatching blob to Eigen DA"); + let response = self + .client + .post(format!("{}/put/", self.config.api_node_url)) + .header(http::header::CONTENT_TYPE, "application/octet-stream") + .body(blob_data) + .send() + .await + .unwrap(); + + let request_id = response.bytes().await.unwrap().to_vec(); + Ok(types::DispatchResponse { + blob_id: hex::encode(request_id), + }) + } + async fn get_inclusion_data( + &self, + _blob_id: &str, + ) -> anyhow::Result, types::DAError> { + // let request_id = hex::decode(blob_id).unwrap(); + // let blob_status_reply = self + // .disperser + // .lock() + // .await + // .get_blob_status(BlobStatusRequest { request_id }) + // .await + // .unwrap() + // .into_inner(); + // let blob_status = blob_status_reply.status(); + // match blob_status { + // BlobStatus::Unknown => Err(to_retriable_error(anyhow::anyhow!( + // "Blob status is unknown" + // ))), + // BlobStatus::Processing => Err(to_retriable_error(anyhow::anyhow!( + // "Blob is being processed" + // ))), + // BlobStatus::Confirmed => Err(to_retriable_error(anyhow::anyhow!( + // "Blob is confirmed but not finalized" + // ))), + // BlobStatus::Failed => Err(to_non_retriable_error(anyhow::anyhow!("Blob has failed"))), + // BlobStatus::InsufficientSignatures => Err(to_non_retriable_error(anyhow::anyhow!( + // "Insufficient signatures for blob" + // ))), + // BlobStatus::Dispersing => Err(to_retriable_error(anyhow::anyhow!( + // "Blob is being dispersed" + // ))), + // BlobStatus::Finalized => Ok(Some(types::InclusionData { + // data: blob_status_reply + // .info + // .unwrap() + // .blob_verification_proof + // .unwrap() + // .inclusion_proof, + // })), + // } + Ok(Some(InclusionData { data: vec![] })) + } + + fn clone_boxed(&self) -> Box { + Box::new(self.clone()) + } + + fn blob_size_limit(&self) -> Option { + Some(Self::BLOB_SIZE_LIMIT_IN_BYTES) + } +} + +// Note: This methods should be uncommented if the `get_inclusion_data` method +// implementation gets uncommented. +// +// fn to_retriable_error(error: anyhow::Error) -> types::DAError { +// types::DAError { +// error, +// is_retriable: true, +// } +// } + +// fn to_non_retriable_error(error: anyhow::Error) -> types::DAError { +// types::DAError { +// error, +// is_retriable: false, +// } +// } diff --git a/core/lib/default_da_clients/src/lib.rs b/core/node/da_clients/src/lib.rs similarity index 52% rename from core/lib/default_da_clients/src/lib.rs rename to core/node/da_clients/src/lib.rs index 3aa2a18cdce..6b2622c64e2 100644 --- a/core/lib/default_da_clients/src/lib.rs +++ b/core/node/da_clients/src/lib.rs @@ -1,2 +1,4 @@ +pub mod avail; +pub mod eigen_da; pub mod no_da; pub mod object_store; diff --git a/core/lib/default_da_clients/src/no_da/client.rs b/core/node/da_clients/src/no_da.rs similarity index 100% rename from core/lib/default_da_clients/src/no_da/client.rs rename to core/node/da_clients/src/no_da.rs diff --git a/core/lib/default_da_clients/src/object_store/client.rs b/core/node/da_clients/src/object_store.rs similarity index 51% rename from core/lib/default_da_clients/src/object_store/client.rs rename to core/node/da_clients/src/object_store.rs index f05029a8eb1..55764e8260e 100644 --- a/core/lib/default_da_clients/src/object_store/client.rs +++ b/core/node/da_clients/src/object_store.rs @@ -1,16 +1,20 @@ -use std::sync::Arc; +use std::{ + io::{Read, Write}, + sync::Arc, +}; use async_trait::async_trait; +use flate2::{read::GzDecoder, write::GzEncoder, Compression}; use zksync_config::ObjectStoreConfig; use zksync_da_client::{ types::{DAError, DispatchResponse, InclusionData}, DataAvailabilityClient, }; -use zksync_object_store::{ObjectStore, ObjectStoreFactory}; +use zksync_object_store::{ + Bucket, ObjectStore, ObjectStoreFactory, StoredObject, _reexports::BoxedError, +}; use zksync_types::L1BatchNumber; -use crate::object_store::types::StorablePubdata; - /// An implementation of the `DataAvailabilityClient` trait that stores the pubdata in the GCS. #[derive(Clone, Debug)] pub struct ObjectStoreDAClient { @@ -84,3 +88,79 @@ impl DataAvailabilityClient for ObjectStoreDAClient { None } } + +/// Used as a wrapper for the pubdata to be stored in the GCS. +#[derive(Debug)] +struct StorablePubdata { + pub data: Vec, +} + +impl StoredObject for StorablePubdata { + const BUCKET: Bucket = Bucket::DataAvailability; + type Key<'a> = L1BatchNumber; + + fn encode_key(key: Self::Key<'_>) -> String { + format!("l1_batch_{key}_pubdata.gzip") + } + + fn serialize(&self) -> Result, BoxedError> { + let mut encoder = GzEncoder::new(Vec::new(), Compression::default()); + encoder.write_all(&self.data[..])?; + encoder.finish().map_err(From::from) + } + + fn deserialize(bytes: Vec) -> Result { + let mut decoder = GzDecoder::new(&bytes[..]); + let mut decompressed_bytes = Vec::new(); + decoder + .read_to_end(&mut decompressed_bytes) + .map_err(BoxedError::from)?; + + Ok(Self { + data: decompressed_bytes, + }) + } +} + +#[cfg(test)] +mod tests { + use tokio::fs; + use zksync_object_store::{MockObjectStore, StoredObject}; + use zksync_types::L1BatchNumber; + + use super::StorablePubdata; + + #[tokio::test] + async fn test_storable_pubdata_deserialization() { + let serialized = fs::read("./src/test_data/l1_batch_123_pubdata.gzip") + .await + .unwrap(); + + let data = StorablePubdata::deserialize(serialized).unwrap().data; + assert_eq!(data[12], 0); + assert_eq!(data[123], 129); + assert_eq!(data[1234], 153); + } + + #[tokio::test] + async fn stored_object_serialization() { + let batch_number = 123; + let data = vec![1, 2, 3, 4, 5, 6, 123, 255, 0, 0]; + + let store = MockObjectStore::arc(); + store + .put( + L1BatchNumber(batch_number), + &StorablePubdata { data: data.clone() }, + ) + .await + .unwrap(); + + let resp = store + .get::(L1BatchNumber(batch_number)) + .await + .unwrap(); + + assert_eq!(data, resp.data); + } +} diff --git a/core/node/da_clients/src/test_data/l1_batch_123_pubdata.gzip b/core/node/da_clients/src/test_data/l1_batch_123_pubdata.gzip new file mode 100644 index 00000000000..78bc67e94ef Binary files /dev/null and b/core/node/da_clients/src/test_data/l1_batch_123_pubdata.gzip differ diff --git a/core/node/db_pruner/Cargo.toml b/core/node/db_pruner/Cargo.toml index eb21e3e476d..98eba1b6c0e 100644 --- a/core/node/db_pruner/Cargo.toml +++ b/core/node/db_pruner/Cargo.toml @@ -26,7 +26,6 @@ serde_json.workspace = true [dev-dependencies] assert_matches.workspace = true -test-casing.workspace = true test-log.workspace = true zksync_node_genesis.workspace = true diff --git a/core/node/fee_model/Cargo.toml b/core/node/fee_model/Cargo.toml index 09048515e7a..8760b97d9db 100644 --- a/core/node/fee_model/Cargo.toml +++ b/core/node/fee_model/Cargo.toml @@ -27,4 +27,3 @@ tracing.workspace = true [dev-dependencies] test-casing.workspace = true -zksync_node_test_utils.workspace = true diff --git a/core/node/node_framework/Cargo.toml b/core/node/node_framework/Cargo.toml index fe488922567..1df47e77553 100644 --- a/core/node/node_framework/Cargo.toml +++ b/core/node/node_framework/Cargo.toml @@ -18,7 +18,6 @@ zksync_health_check.workspace = true zksync_dal.workspace = true zksync_db_connection.workspace = true zksync_config.workspace = true -zksync_protobuf_config.workspace = true zksync_state.workspace = true zksync_object_store.workspace = true zksync_storage.workspace = true @@ -35,6 +34,7 @@ zksync_house_keeper.workspace = true zksync_node_fee_model.workspace = true zksync_eth_sender.workspace = true zksync_da_client.workspace = true +zksync_da_clients.workspace = true zksync_da_dispatcher.workspace = true zksync_block_reverter.workspace = true zksync_vm_executor.workspace = true @@ -64,9 +64,9 @@ futures.workspace = true anyhow.workspace = true tokio = { workspace = true, features = ["rt"] } ctrlc.workspace = true +semver.workspace = true [dev-dependencies] -zksync_env_config.workspace = true assert_matches.workspace = true # For running UI tests for proc macro trybuild.workspace = true diff --git a/core/node/node_framework/src/implementations/layers/consensus/external_node.rs b/core/node/node_framework/src/implementations/layers/consensus/external_node.rs index 14365384c1a..5acdab568e7 100644 --- a/core/node/node_framework/src/implementations/layers/consensus/external_node.rs +++ b/core/node/node_framework/src/implementations/layers/consensus/external_node.rs @@ -23,6 +23,7 @@ use crate::{ /// Wiring layer for external node consensus component. #[derive(Debug)] pub struct ExternalNodeConsensusLayer { + pub build_version: semver::Version, pub config: Option, pub secrets: Option, } @@ -78,6 +79,7 @@ impl WiringLayer for ExternalNodeConsensusLayer { }; let consensus_task = ExternalNodeTask { + build_version: self.build_version, config, pool, main_node_client, @@ -90,6 +92,7 @@ impl WiringLayer for ExternalNodeConsensusLayer { #[derive(Debug)] pub struct ExternalNodeTask { + build_version: semver::Version, config: Option<(ConsensusConfig, ConsensusSecrets)>, pool: ConnectionPool, main_node_client: Box>, @@ -118,6 +121,7 @@ impl Task for ExternalNodeTask { self.sync_state, self.main_node_client, self.action_queue_sender, + self.build_version, )); // `run_external_node` might return an error or panic, // in which case we need to return immediately, diff --git a/core/node/node_framework/src/implementations/layers/da_clients/avail.rs b/core/node/node_framework/src/implementations/layers/da_clients/avail.rs new file mode 100644 index 00000000000..7c3d82b6d25 --- /dev/null +++ b/core/node/node_framework/src/implementations/layers/da_clients/avail.rs @@ -0,0 +1,45 @@ +use zksync_config::AvailConfig; +use zksync_da_client::DataAvailabilityClient; +use zksync_da_clients::avail::AvailClient; + +use crate::{ + implementations::resources::da_client::DAClientResource, + wiring_layer::{WiringError, WiringLayer}, + IntoContext, +}; + +#[derive(Debug)] +pub struct AvailWiringLayer { + config: AvailConfig, +} + +impl AvailWiringLayer { + pub fn new(config: AvailConfig) -> Self { + Self { config } + } +} + +#[derive(Debug, IntoContext)] +#[context(crate = crate)] +pub struct Output { + pub client: DAClientResource, +} + +#[async_trait::async_trait] +impl WiringLayer for AvailWiringLayer { + type Input = (); + type Output = Output; + + fn layer_name(&self) -> &'static str { + "avail_client_layer" + } + + async fn wire(self, _input: Self::Input) -> Result { + let client: Box = + Box::new(AvailClient::new(self.config).await?); + + Ok(Self::Output { + client: DAClientResource(client), + }) + } +} diff --git a/core/node/node_framework/src/implementations/layers/da_clients/eigen_da.rs b/core/node/node_framework/src/implementations/layers/da_clients/eigen_da.rs new file mode 100644 index 00000000000..b7c1025309c --- /dev/null +++ b/core/node/node_framework/src/implementations/layers/da_clients/eigen_da.rs @@ -0,0 +1,45 @@ +use zksync_config::configs::da_client::eigen_da::EigenDAConfig; +use zksync_da_client::DataAvailabilityClient; +use zksync_da_clients::eigen_da::EigenDAClient; + +use crate::{ + implementations::resources::da_client::DAClientResource, + wiring_layer::{WiringError, WiringLayer}, + IntoContext, +}; + +#[derive(Debug, Default)] +pub struct EigenDAWiringLayer { + config: EigenDAConfig, +} + +impl EigenDAWiringLayer { + pub fn new(config: EigenDAConfig) -> Self { + Self { config } + } +} + +#[derive(Debug, IntoContext)] +#[context(crate = crate)] +pub struct Output { + pub client: DAClientResource, +} + +#[async_trait::async_trait] +impl WiringLayer for EigenDAWiringLayer { + type Input = (); + type Output = Output; + + fn layer_name(&self) -> &'static str { + "eigen_da_client_layer" + } + + async fn wire(self, _: Self::Input) -> Result { + let client: Box = + Box::new(EigenDAClient::new(self.config).await?); + + Ok(Self::Output { + client: DAClientResource(client), + }) + } +} diff --git a/core/node/node_framework/src/implementations/layers/da_clients/mod.rs b/core/node/node_framework/src/implementations/layers/da_clients/mod.rs new file mode 100644 index 00000000000..6b2622c64e2 --- /dev/null +++ b/core/node/node_framework/src/implementations/layers/da_clients/mod.rs @@ -0,0 +1,4 @@ +pub mod avail; +pub mod eigen_da; +pub mod no_da; +pub mod object_store; diff --git a/core/lib/default_da_clients/src/no_da/wiring_layer.rs b/core/node/node_framework/src/implementations/layers/da_clients/no_da.rs similarity index 90% rename from core/lib/default_da_clients/src/no_da/wiring_layer.rs rename to core/node/node_framework/src/implementations/layers/da_clients/no_da.rs index 71a2ee7ce58..5a81ce9b340 100644 --- a/core/lib/default_da_clients/src/no_da/wiring_layer.rs +++ b/core/node/node_framework/src/implementations/layers/da_clients/no_da.rs @@ -1,18 +1,19 @@ use std::fmt::Debug; use zksync_da_client::DataAvailabilityClient; -use zksync_node_framework::{ +use zksync_da_clients::no_da::NoDAClient; + +use crate::{ implementations::resources::da_client::DAClientResource, wiring_layer::{WiringError, WiringLayer}, IntoContext, }; -use crate::no_da::client::NoDAClient; - #[derive(Debug, Default)] pub struct NoDAClientWiringLayer; #[derive(Debug, IntoContext)] +#[context(crate = crate)] pub struct Output { pub client: DAClientResource, } diff --git a/core/lib/default_da_clients/src/object_store/wiring_layer.rs b/core/node/node_framework/src/implementations/layers/da_clients/object_store.rs similarity index 91% rename from core/lib/default_da_clients/src/object_store/wiring_layer.rs rename to core/node/node_framework/src/implementations/layers/da_clients/object_store.rs index 6fc84fb707b..3fb720696da 100644 --- a/core/lib/default_da_clients/src/object_store/wiring_layer.rs +++ b/core/node/node_framework/src/implementations/layers/da_clients/object_store.rs @@ -1,13 +1,13 @@ use zksync_config::ObjectStoreConfig; use zksync_da_client::DataAvailabilityClient; -use zksync_node_framework::{ +use zksync_da_clients::object_store::ObjectStoreDAClient; + +use crate::{ implementations::resources::da_client::DAClientResource, wiring_layer::{WiringError, WiringLayer}, IntoContext, }; -use crate::object_store::client::ObjectStoreDAClient; - #[derive(Debug)] pub struct ObjectStorageClientWiringLayer { config: ObjectStoreConfig, @@ -20,6 +20,7 @@ impl ObjectStorageClientWiringLayer { } #[derive(Debug, IntoContext)] +#[context(crate = crate)] pub struct Output { pub client: DAClientResource, } diff --git a/core/node/node_framework/src/implementations/layers/mod.rs b/core/node/node_framework/src/implementations/layers/mod.rs index 6f3500a82cb..75828da1902 100644 --- a/core/node/node_framework/src/implementations/layers/mod.rs +++ b/core/node/node_framework/src/implementations/layers/mod.rs @@ -6,6 +6,7 @@ pub mod commitment_generator; pub mod consensus; pub mod consistency_checker; pub mod contract_verification_api; +pub mod da_clients; pub mod da_dispatcher; pub mod eth_sender; pub mod eth_watch; diff --git a/core/node/node_framework/src/implementations/layers/node_storage_init/external_node_strategy.rs b/core/node/node_framework/src/implementations/layers/node_storage_init/external_node_strategy.rs index 317f0b197d8..bdd69214de9 100644 --- a/core/node/node_framework/src/implementations/layers/node_storage_init/external_node_strategy.rs +++ b/core/node/node_framework/src/implementations/layers/node_storage_init/external_node_strategy.rs @@ -76,16 +76,18 @@ impl WiringLayer for ExternalNodeInitStrategyLayer { }); let snapshot_recovery = match self.snapshot_recovery_config { Some(recovery_config) => { + // Add a connection for checking whether the storage is initialized. let recovery_pool = input .master_pool - .get_custom(self.max_postgres_concurrency.get() as u32) + .get_custom(self.max_postgres_concurrency.get() as u32 + 1) .await?; - let recovery = Arc::new(ExternalNodeSnapshotRecovery { + let recovery: Arc = Arc::new(ExternalNodeSnapshotRecovery { client: client.clone(), pool: recovery_pool, + max_concurrency: self.max_postgres_concurrency, recovery_config, app_health, - }) as Arc; + }); Some(recovery) } None => None, diff --git a/core/node/node_framework/src/service/mod.rs b/core/node/node_framework/src/service/mod.rs index 9e3555f22c2..b6d42009354 100644 --- a/core/node/node_framework/src/service/mod.rs +++ b/core/node/node_framework/src/service/mod.rs @@ -200,7 +200,7 @@ impl ZkStackService { // Report all the errors we've met during the init. if !errors.is_empty() { for (layer, error) in &errors { - tracing::error!("Wiring layer {layer} can't be initialized: {error}"); + tracing::error!("Wiring layer {layer} can't be initialized: {error:?}"); } return Err(ZkStackServiceError::Wiring(errors)); } @@ -302,7 +302,7 @@ impl ZkStackService { tracing::info!("Shutdown hook {name} completed"); } Ok(Err(err)) => { - tracing::error!("Shutdown hook {name} failed: {err}"); + tracing::error!("Shutdown hook {name} failed: {err:?}"); self.errors.push(TaskError::ShutdownHookFailed(name, err)); } Err(_) => { @@ -324,7 +324,7 @@ impl ZkStackService { tracing::info!("Task {task_name} finished"); } Ok(Err(err)) => { - tracing::error!("Task {task_name} failed: {err}"); + tracing::error!("Task {task_name} failed: {err:?}"); self.errors.push(TaskError::TaskFailed(task_name, err)); } Err(panic_err) => { diff --git a/core/node/node_storage_init/src/external_node/snapshot_recovery.rs b/core/node/node_storage_init/src/external_node/snapshot_recovery.rs index d9ba60a1bcb..9bc065b939c 100644 --- a/core/node/node_storage_init/src/external_node/snapshot_recovery.rs +++ b/core/node/node_storage_init/src/external_node/snapshot_recovery.rs @@ -1,4 +1,4 @@ -use std::{sync::Arc, time::Instant}; +use std::{num::NonZeroUsize, sync::Arc, time::Instant}; use anyhow::Context as _; use tokio::sync::watch; @@ -17,6 +17,7 @@ use crate::{InitializeStorage, SnapshotRecoveryConfig}; pub struct ExternalNodeSnapshotRecovery { pub client: Box>, pub pool: ConnectionPool, + pub max_concurrency: NonZeroUsize, pub recovery_config: SnapshotRecoveryConfig, pub app_health: Arc, } @@ -24,8 +25,17 @@ pub struct ExternalNodeSnapshotRecovery { #[async_trait::async_trait] impl InitializeStorage for ExternalNodeSnapshotRecovery { async fn initialize_storage(&self, stop_receiver: watch::Receiver) -> anyhow::Result<()> { - let pool = self.pool.clone(); tracing::warn!("Proceeding with snapshot recovery. This is an experimental feature; use at your own risk"); + + let pool_size = self.pool.max_size() as usize; + if pool_size < self.max_concurrency.get() + 1 { + tracing::error!( + "Connection pool has insufficient number of connections ({pool_size} vs concurrency {} + 1 connection for checks). \ + This will likely lead to pool starvation during recovery.", + self.max_concurrency + ); + } + let object_store_config = self.recovery_config.object_store_config.clone().context( "Snapshot object store must be presented if snapshot recovery is activated", @@ -34,10 +44,13 @@ impl InitializeStorage for ExternalNodeSnapshotRecovery { .create_store() .await?; - let config = SnapshotsApplierConfig::default(); + let config = SnapshotsApplierConfig { + max_concurrency: self.max_concurrency, + ..SnapshotsApplierConfig::default() + }; let mut snapshots_applier_task = SnapshotsApplierTask::new( config, - pool, + self.pool.clone(), Box::new(self.client.clone().for_component("snapshot_recovery")), object_store, ); @@ -80,3 +93,60 @@ impl InitializeStorage for ExternalNodeSnapshotRecovery { Ok(completed) } } + +#[cfg(test)] +mod tests { + use std::future; + + use zksync_types::{ + tokens::{TokenInfo, TokenMetadata}, + Address, L2BlockNumber, + }; + use zksync_web3_decl::client::MockClient; + + use super::*; + + #[tokio::test] + async fn recovery_does_not_starve_pool_connections() { + let pool = ConnectionPool::constrained_test_pool(5).await; + let app_health = Arc::new(AppHealthCheck::new(None, None)); + let client = MockClient::builder(L2::default()) + .method("en_syncTokens", |_number: Option| { + Ok(vec![TokenInfo { + l1_address: Address::repeat_byte(1), + l2_address: Address::repeat_byte(2), + metadata: TokenMetadata { + name: "test".to_string(), + symbol: "TEST".to_string(), + decimals: 18, + }, + }]) + }) + .build(); + let recovery = ExternalNodeSnapshotRecovery { + client: Box::new(client), + pool, + max_concurrency: NonZeroUsize::new(4).unwrap(), + recovery_config: SnapshotRecoveryConfig { + snapshot_l1_batch_override: None, + drop_storage_key_preimages: false, + object_store_config: None, + }, + app_health, + }; + + // Emulate recovery by indefinitely holding onto `max_concurrency` connections. In practice, + // the snapshot applier will release connections eventually, but it may require more time than the connection + // acquisition timeout configured for the DB pool. + for _ in 0..recovery.max_concurrency.get() { + let connection = recovery.pool.connection().await.unwrap(); + tokio::spawn(async move { + future::pending::<()>().await; + drop(connection); + }); + } + + // The only token reported by the mock client isn't recovered + assert!(!recovery.is_initialized().await.unwrap()); + } +} diff --git a/core/node/node_sync/src/client.rs b/core/node/node_sync/src/client.rs index d064803eab5..ee89db10ddd 100644 --- a/core/node/node_sync/src/client.rs +++ b/core/node/node_sync/src/client.rs @@ -42,12 +42,7 @@ pub trait MainNodeClient: 'static + Send + Sync + fmt::Debug { with_transactions: bool, ) -> EnrichedClientResult>; - async fn fetch_consensus_genesis(&self) -> EnrichedClientResult>; - async fn fetch_genesis_config(&self) -> EnrichedClientResult; - - async fn fetch_attestation_status(&self) - -> EnrichedClientResult>; } #[async_trait] @@ -133,20 +128,6 @@ impl MainNodeClient for Box> { .with_arg("with_transactions", &with_transactions) .await } - - async fn fetch_consensus_genesis(&self) -> EnrichedClientResult> { - self.consensus_genesis() - .rpc_context("consensus_genesis") - .await - } - - async fn fetch_attestation_status( - &self, - ) -> EnrichedClientResult> { - self.attestation_status() - .rpc_context("attestation_status") - .await - } } /// Main node health check. diff --git a/core/node/node_sync/src/testonly.rs b/core/node/node_sync/src/testonly.rs index b9e1adc995a..16027a71a25 100644 --- a/core/node/node_sync/src/testonly.rs +++ b/core/node/node_sync/src/testonly.rs @@ -71,18 +71,6 @@ impl MainNodeClient for MockMainNodeClient { Ok(Some(block)) } - async fn fetch_consensus_genesis( - &self, - ) -> EnrichedClientResult> { - unimplemented!() - } - - async fn fetch_attestation_status( - &self, - ) -> EnrichedClientResult> { - unimplemented!() - } - async fn fetch_genesis_config(&self) -> EnrichedClientResult { Ok(mock_genesis_config()) } diff --git a/core/node/proof_data_handler/Cargo.toml b/core/node/proof_data_handler/Cargo.toml index 31a0e8437ba..82063b23fdb 100644 --- a/core/node/proof_data_handler/Cargo.toml +++ b/core/node/proof_data_handler/Cargo.toml @@ -16,7 +16,6 @@ zksync_config.workspace = true zksync_dal.workspace = true zksync_object_store.workspace = true zksync_prover_interface.workspace = true -zksync_tee_verifier.workspace = true zksync_types.workspace = true anyhow.workspace = true axum.workspace = true diff --git a/core/node/state_keeper/src/testonly/mod.rs b/core/node/state_keeper/src/testonly/mod.rs index 0ce8c06be0e..23aec8af49f 100644 --- a/core/node/state_keeper/src/testonly/mod.rs +++ b/core/node/state_keeper/src/testonly/mod.rs @@ -117,7 +117,7 @@ pub async fn fund(pool: &ConnectionPool, addresses: &[Address]) { pub(crate) const DEFAULT_GAS_PER_PUBDATA: u32 = 10000; -pub(crate) fn fee(gas_limit: u32) -> Fee { +pub fn fee(gas_limit: u32) -> Fee { Fee { gas_limit: U256::from(gas_limit), max_fee_per_gas: SYSTEM_CONTEXT_MINIMAL_BASE_FEE.into(), diff --git a/core/tests/loadnext/src/config.rs b/core/tests/loadnext/src/config.rs index a9648edb00a..ab578ecfdc6 100644 --- a/core/tests/loadnext/src/config.rs +++ b/core/tests/loadnext/src/config.rs @@ -4,7 +4,7 @@ use serde::Deserialize; use tokio::sync::Semaphore; use zksync_contracts::test_contracts::LoadnextContractExecutionParams; use zksync_types::{network::Network, Address, L2ChainId, H160}; -use zksync_utils::workspace_dir_or_current_dir; +use zksync_utils::env::Workspace; use crate::fs_utils::read_tokens; @@ -190,7 +190,7 @@ fn default_main_token() -> H160 { } fn default_test_contracts_path() -> PathBuf { - let test_contracts_path = workspace_dir_or_current_dir().join("etc/contracts-test-data"); + let test_contracts_path = Workspace::locate().core().join("etc/contracts-test-data"); tracing::info!("Test contracts path: {}", test_contracts_path.display()); test_contracts_path } diff --git a/core/tests/loadnext/src/fs_utils.rs b/core/tests/loadnext/src/fs_utils.rs index 8af9df8afee..c4472a00531 100644 --- a/core/tests/loadnext/src/fs_utils.rs +++ b/core/tests/loadnext/src/fs_utils.rs @@ -5,7 +5,7 @@ use std::{fs::File, io::BufReader, path::Path}; use serde::Deserialize; use zksync_types::{ethabi::Contract, network::Network, Address}; -use zksync_utils::workspace_dir_or_current_dir; +use zksync_utils::env::Workspace; /// A token stored in `etc/tokens/{network}.json` files. #[derive(Debug, Deserialize)] @@ -27,7 +27,7 @@ pub struct TestContract { } pub fn read_tokens(network: Network) -> anyhow::Result> { - let home = workspace_dir_or_current_dir(); + let home = Workspace::locate().core(); let path = home.join(format!("etc/tokens/{network}.json")); let file = File::open(path)?; let reader = BufReader::new(file); diff --git a/core/tests/revert-test/tests/revert-and-restart-en.test.ts b/core/tests/revert-test/tests/revert-and-restart-en.test.ts index e1694418db1..42fa01a02c9 100644 --- a/core/tests/revert-test/tests/revert-and-restart-en.test.ts +++ b/core/tests/revert-test/tests/revert-and-restart-en.test.ts @@ -4,79 +4,34 @@ // main_contract.getTotalBatchesCommitted actually checks the number of batches committed. // main_contract.getTotalBatchesExecuted actually checks the number of batches executed. import * as utils from 'utils'; -import { Tester } from './tester'; -import { exec, runServerInBackground, runExternalNodeInBackground } from './utils'; +import { + checkRandomTransfer, + executeDepositAfterRevert, + executeRevert, + Node, + NodeSpawner, + NodeType, + waitToCommitBatchesWithoutExecution, + waitToExecuteBatch +} from './utils'; import * as zksync from 'zksync-ethers'; import * as ethers from 'ethers'; -import { expect, assert } from 'chai'; -import fs from 'fs'; +import { assert, expect } from 'chai'; +import fs from 'node:fs/promises'; import * as child_process from 'child_process'; import * as dotenv from 'dotenv'; -import { - getAllConfigsPath, - loadConfig, - shouldLoadConfigFromFile, - replaceAggregatedBlockExecuteDeadline -} from 'utils/build/file-configs'; +import { loadConfig, replaceAggregatedBlockExecuteDeadline, shouldLoadConfigFromFile } from 'utils/build/file-configs'; import path from 'path'; -import { ChildProcessWithoutNullStreams } from 'child_process'; import { logsTestPath } from 'utils/build/logs'; -import { killPidWithAllChilds } from 'utils/build/kill'; +import { IZkSyncHyperchain } from 'zksync-ethers/build/typechain'; const pathToHome = path.join(__dirname, '../../../..'); const fileConfig = shouldLoadConfigFromFile(); -let mainEnv: string; -let extEnv: string; - -let deploymentMode: string; - -if (fileConfig.loadFromFile) { - const genesisConfig = loadConfig({ pathToHome, chain: fileConfig.chain, config: 'genesis.yaml' }); - deploymentMode = genesisConfig.deploymentMode; -} else { - if (!process.env.DEPLOYMENT_MODE) { - throw new Error('DEPLOYMENT_MODE is not set'); - } - if (!['Validium', 'Rollup'].includes(process.env.DEPLOYMENT_MODE)) { - throw new Error(`Unknown deployment mode: ${process.env.DEPLOYMENT_MODE}`); - } - deploymentMode = process.env.DEPLOYMENT_MODE; -} - -if (deploymentMode == 'Validium') { - mainEnv = process.env.IN_DOCKER ? 'dev_validium_docker' : 'dev_validium'; - extEnv = process.env.IN_DOCKER ? 'ext-node-validium-docker' : 'ext-node-validium'; -} else { - // Rollup deployment mode - mainEnv = process.env.IN_DOCKER ? 'docker' : 'dev'; - extEnv = process.env.IN_DOCKER ? 'ext-node-docker' : 'ext-node'; -} - async function logsPath(name: string): Promise { return await logsTestPath(fileConfig.chain, 'logs/revert/en', name); } -interface SuggestedValues { - lastExecutedL1BatchNumber: bigint; - nonce: number; - priorityFee: number; -} - -// Parses output of "print-suggested-values" command of the revert block tool. -function parseSuggestedValues(jsonString: string): SuggestedValues { - const json = JSON.parse(jsonString); - assert(json && typeof json === 'object'); - assert(Number.isInteger(json.last_executed_l1_batch_number)); - assert(Number.isInteger(json.nonce)); - assert(Number.isInteger(json.priority_fee)); - return { - lastExecutedL1BatchNumber: BigInt(json.last_executed_l1_batch_number), - nonce: json.nonce, - priorityFee: json.priority_fee - }; -} - function run(cmd: string, args: string[], options: child_process.SpawnOptions): child_process.SpawnSyncReturns { let res = child_process.spawnSync(cmd, args, options); expect(res.error).to.be.undefined; @@ -94,7 +49,7 @@ function compileBinaries() { // Fetches env vars for the given environment (like 'dev', 'ext-node'). // TODO: it would be better to import zk tool code directly. -function fetchEnv(zksyncEnv: string): any { +function fetchEnv(zksyncEnv: string): Record { let res = run('./bin/zk', ['f', 'env'], { cwd: process.env.ZKSYNC_HOME, env: { @@ -106,218 +61,62 @@ function fetchEnv(zksyncEnv: string): any { return { ...process.env, ...dotenv.parse(res.stdout) }; } -async function runBlockReverter(args: string[]): Promise { - let env = fetchEnv(mainEnv); - - let fileConfigFlags = ''; +/** Loads env profiles for the main and external nodes */ +function loadEnvs() { + let deploymentMode: string; if (fileConfig.loadFromFile) { - const configPaths = getAllConfigsPath({ pathToHome, chain: fileConfig.chain }); - fileConfigFlags = ` - --config-path=${configPaths['general.yaml']} - --contracts-config-path=${configPaths['contracts.yaml']} - --secrets-path=${configPaths['secrets.yaml']} - --wallets-path=${configPaths['wallets.yaml']} - --genesis-path=${configPaths['genesis.yaml']} - `; - } - - const cmd = `cd ${pathToHome} && RUST_LOG=off cargo run --bin block_reverter --release -- ${args.join( - ' ' - )} ${fileConfigFlags}`; - const executedProcess = await exec(cmd, { - cwd: env.ZKSYNC_HOME, - env: { - ...env, - PATH: process.env.PATH - } - }); - - return executedProcess.stdout; -} - -async function killServerAndWaitForShutdown(proc: MainNode | ExtNode) { - await proc.terminate(); - // Wait until it's really stopped. - let iter = 0; - while (iter < 30) { - try { - await proc.tester.syncWallet.provider.getBlockNumber(); - await utils.sleep(2); - iter += 1; - } catch (_) { - // When exception happens, we assume that server died. - return; + const genesisConfig = loadConfig({ pathToHome, chain: fileConfig.chain, config: 'genesis.yaml' }); + deploymentMode = genesisConfig.deploymentMode; + } else { + deploymentMode = process.env.DEPLOYMENT_MODE ?? 'Rollup'; + if (!['Validium', 'Rollup'].includes(deploymentMode)) { + throw new Error(`Unknown deployment mode: ${deploymentMode}`); } } - // It's going to panic anyway, since the server is a singleton entity, so better to exit early. - throw new Error("Server didn't stop after a kill request"); -} - -class MainNode { - constructor(public tester: Tester, public proc: ChildProcessWithoutNullStreams, public zkInception: boolean) {} - - public async terminate() { - try { - await killPidWithAllChilds(this.proc.pid!, 9); - } catch (err) { - console.log(`ignored error: ${err}`); - } - } - - // Terminates all main node processes running. - // - // WARNING: This is not safe to use when running nodes on multiple chains. - public static async terminateAll() { - try { - await utils.exec('killall -INT zksync_server'); - } catch (err) { - console.log(`ignored error: ${err}`); - } + console.log(`Using deployment mode: ${deploymentMode}`); + + let mainEnvName: string; + let extEnvName: string; + if (deploymentMode === 'Validium') { + mainEnvName = process.env.IN_DOCKER ? 'dev_validium_docker' : 'dev_validium'; + extEnvName = process.env.IN_DOCKER ? 'ext-node-validium-docker' : 'ext-node-validium'; + } else { + // Rollup deployment mode + mainEnvName = process.env.IN_DOCKER ? 'docker' : 'dev'; + extEnvName = process.env.IN_DOCKER ? 'ext-node-docker' : 'ext-node'; } - // Spawns a main node. - // if enableConsensus is set, consensus component will be started in the main node. - // if enableExecute is NOT set, main node will NOT send L1 transactions to execute L1 batches. - public static async spawn( - logs: fs.WriteStream, - enableConsensus: boolean, - enableExecute: boolean, - ethClientWeb3Url: string, - apiWeb3JsonRpcHttpUrl: string, - baseTokenAddress: string - ): Promise { - let env = fetchEnv(mainEnv); - env.ETH_SENDER_SENDER_AGGREGATED_BLOCK_EXECUTE_DEADLINE = enableExecute ? '1' : '10000'; - // Set full mode for the Merkle tree as it is required to get blocks committed. - env.DATABASE_MERKLE_TREE_MODE = 'full'; - - if (fileConfig.loadFromFile) { - replaceAggregatedBlockExecuteDeadline(pathToHome, fileConfig, enableExecute ? 1 : 10000); - } - - let components = 'api,tree,eth,state_keeper,commitment_generator,da_dispatcher,vm_runner_protective_reads'; - if (enableConsensus) { - components += ',consensus'; - } - if (baseTokenAddress != zksync.utils.LEGACY_ETH_ADDRESS) { - components += ',base_token_ratio_persister'; - } - let proc = runServerInBackground({ - components: [components], - stdio: ['ignore', logs, logs], - cwd: pathToHome, - env: env, - useZkInception: fileConfig.loadFromFile, - chain: fileConfig.chain - }); - - // Wait until the main node starts responding. - let tester: Tester = await Tester.init(ethClientWeb3Url, apiWeb3JsonRpcHttpUrl, baseTokenAddress); - while (true) { - try { - console.log(`Web3 ${apiWeb3JsonRpcHttpUrl}`); - await tester.syncWallet.provider.getBridgehubContractAddress(); - break; - } catch (err) { - if (proc.exitCode != null) { - assert.fail(`server failed to start, exitCode = ${proc.exitCode}`); - } - console.log('MainNode waiting for api endpoint'); - await utils.sleep(1); - } - } - return new MainNode(tester, proc, fileConfig.loadFromFile); - } -} - -class ExtNode { - constructor(public tester: Tester, private proc: child_process.ChildProcess, public zkInception: boolean) {} - - public async terminate() { - try { - await killPidWithAllChilds(this.proc.pid!, 9); - } catch (err) { - console.log(`ignored error: ${err}`); - } - } - - // Terminates all main node processes running. - // - // WARNING: This is not safe to use when running nodes on multiple chains. - public static async terminateAll() { - try { - await utils.exec('killall -INT zksync_external_node'); - } catch (err) { - console.log(`ignored error: ${err}`); - } - } - - // Spawns an external node. - // If enableConsensus is set, the node will use consensus P2P network to fetch blocks. - public static async spawn( - logs: fs.WriteStream, - enableConsensus: boolean, - ethClientWeb3Url: string, - enEthClientUrl: string, - baseTokenAddress: string - ): Promise { - let env = fetchEnv(extEnv); - let args = []; - if (enableConsensus) { - args.push('--enable-consensus'); - } - - // Run server in background. - let proc = runExternalNodeInBackground({ - stdio: ['ignore', logs, logs], - cwd: pathToHome, - env: env, - useZkInception: fileConfig.loadFromFile, - chain: fileConfig.chain - }); - - // Wait until the node starts responding. - let tester: Tester = await Tester.init(ethClientWeb3Url, enEthClientUrl, baseTokenAddress); - while (true) { - try { - await tester.syncWallet.provider.getBlockNumber(); - break; - } catch (err) { - if (proc.exitCode != null) { - assert.fail(`node failed to start, exitCode = ${proc.exitCode}`); - } - console.log('ExtNode waiting for api endpoint'); - await utils.sleep(1); - } - } - return new ExtNode(tester, proc, fileConfig.loadFromFile); - } - - // Waits for the node process to exit. - public async waitForExit(): Promise { - while (this.proc.exitCode === null) { - await utils.sleep(1); - } - return this.proc.exitCode; - } + console.log(`Fetching main node env: ${mainEnvName}`); + const mainEnv = fetchEnv(mainEnvName); + console.log(`Fetching EN env: ${extEnvName}`); + const extEnv = fetchEnv(extEnvName); + return [mainEnv, extEnv]; } describe('Block reverting test', function () { - let ethClientWeb3Url: string; - let apiWeb3JsonRpcHttpUrl: string; - let baseTokenAddress: string; - let enEthClientUrl: string; let operatorAddress: string; - let mainLogs: fs.WriteStream; - let extLogs: fs.WriteStream; let depositAmount: bigint; - let enableConsensus: boolean; - let mainNode: MainNode; - let extNode: ExtNode; + let mainNodeSpawner: NodeSpawner; + let mainEnv: Record; + let mainNode: Node; + let extNodeSpawner: NodeSpawner; + let extNode: Node; + let mainContract: IZkSyncHyperchain; + let alice: zksync.Wallet; + let depositL1BatchNumber: number; + let batchesCommittedBeforeRevert: bigint; const autoKill: boolean = !fileConfig.loadFromFile || !process.env.NO_KILL; before('initialize test', async () => { + let ethClientWeb3Url: string; + let apiWeb3JsonRpcHttpUrl: string; + let baseTokenAddress: string; + let enEthClientUrl: string; + + let extEnv; + [mainEnv, extEnv] = loadEnvs(); + if (fileConfig.loadFromFile) { const secretsConfig = loadConfig({ pathToHome, chain: fileConfig.chain, config: 'secrets.yaml' }); const generalConfig = loadConfig({ pathToHome, chain: fileConfig.chain, config: 'general.yaml' }); @@ -336,223 +135,143 @@ describe('Block reverting test', function () { enEthClientUrl = externalNodeGeneralConfig.api.web3_json_rpc.http_url; operatorAddress = walletsConfig.operator.address; } else { - let env = fetchEnv(mainEnv); - ethClientWeb3Url = env.ETH_CLIENT_WEB3_URL; - apiWeb3JsonRpcHttpUrl = env.API_WEB3_JSON_RPC_HTTP_URL; - baseTokenAddress = env.CONTRACTS_BASE_TOKEN_ADDR; - enEthClientUrl = `http://127.0.0.1:${env.EN_HTTP_PORT}`; + ethClientWeb3Url = mainEnv.ETH_CLIENT_WEB3_URL!; + apiWeb3JsonRpcHttpUrl = mainEnv.API_WEB3_JSON_RPC_HTTP_URL!; + baseTokenAddress = mainEnv.CONTRACTS_BASE_TOKEN_ADDR!; + enEthClientUrl = `http://127.0.0.1:${extEnv.EN_HTTP_PORT!}`; // TODO use env variable for this? operatorAddress = '0xde03a0B5963f75f1C8485B355fF6D30f3093BDE7'; } - mainLogs = fs.createWriteStream(await logsPath('server.log'), { flags: 'a' }); - extLogs = fs.createWriteStream(await logsPath('external_node.log'), { flags: 'a' }); + + const pathToMainLogs = await logsPath('server.log'); + const mainLogs = await fs.open(pathToMainLogs, 'a'); + console.log(`Writing main node logs to ${pathToMainLogs}`); + + const pathToEnLogs = await logsPath('external_node.log'); + const extLogs = await fs.open(pathToEnLogs, 'a'); + console.log(`Writing EN logs to ${pathToEnLogs}`); + if (process.env.SKIP_COMPILATION !== 'true' && !fileConfig.loadFromFile) { compileBinaries(); } - enableConsensus = process.env.ENABLE_CONSENSUS === 'true'; + const enableConsensus = process.env.ENABLE_CONSENSUS === 'true'; console.log(`enableConsensus = ${enableConsensus}`); depositAmount = ethers.parseEther('0.001'); - }); - - step('run', async () => { - if (autoKill) { - console.log('Make sure that nodes are not running'); - await ExtNode.terminateAll(); - await MainNode.terminateAll(); - } - console.log('Start main node'); - mainNode = await MainNode.spawn( - mainLogs, + const mainNodeSpawnOptions = { enableConsensus, - true, ethClientWeb3Url, apiWeb3JsonRpcHttpUrl, baseTokenAddress - ); - console.log('Start ext node'); - extNode = await ExtNode.spawn(extLogs, enableConsensus, ethClientWeb3Url, enEthClientUrl, baseTokenAddress); + }; + mainNodeSpawner = new NodeSpawner(pathToHome, mainLogs, fileConfig, mainNodeSpawnOptions, mainEnv); + const extNodeSpawnOptions = { + enableConsensus, + ethClientWeb3Url, + apiWeb3JsonRpcHttpUrl: enEthClientUrl, + baseTokenAddress + }; + extNodeSpawner = new NodeSpawner(pathToHome, extLogs, fileConfig, extNodeSpawnOptions, extEnv); + }); + step('Make sure that nodes are not running', async () => { + if (autoKill) { + await Node.killAll(NodeType.MAIN); + await Node.killAll(NodeType.EXT); + } + }); + + step('Start main node', async () => { + mainNode = await mainNodeSpawner.spawnMainNode(true); + }); + + step('Start external node', async () => { + extNode = await extNodeSpawner.spawnExtNode(); + }); + + step('Fund wallets', async () => { await mainNode.tester.fundSyncWallet(); + mainContract = await mainNode.tester.syncWallet.getMainContract(); await extNode.tester.fundSyncWallet(); + alice = extNode.tester.emptyWallet(); + }); - const main_contract = await mainNode.tester.syncWallet.getMainContract(); - const baseToken = await mainNode.tester.syncWallet.getBaseToken(); - const isETHBasedChain = baseToken === zksync.utils.ETH_ADDRESS_IN_CONTRACTS; - const alice: zksync.Wallet = extNode.tester.emptyWallet(); + step('Seal L1 batch', async () => { + depositL1BatchNumber = await extNode.createBatchWithDeposit(alice.address, depositAmount); + }); - console.log( - 'Finalize an L1 transaction to ensure at least 1 executed L1 batch and that all transactions are processed' - ); + step('wait for L1 batch to get executed', async () => { + await waitToExecuteBatch(mainContract, depositL1BatchNumber); + }); - for (let iter = 0; iter < 30; iter++) { - try { - const h: zksync.types.PriorityOpResponse = await extNode.tester.syncWallet.deposit({ - token: isETHBasedChain ? zksync.utils.LEGACY_ETH_ADDRESS : baseToken, - amount: depositAmount, - to: alice.address, - approveBaseERC20: true, - approveERC20: true - }); - await h.waitFinalize(); - break; - } catch (error: any) { - if (error.message == 'server shutting down') { - await utils.sleep(2); - continue; - } - } - } + step('Restart main node with batch execution turned off', async () => { + await mainNode.killAndWaitForShutdown(); + mainNode = await mainNodeSpawner.spawnMainNode(false); + }); - console.log('Restart the main node with L1 batch execution disabled.'); - await killServerAndWaitForShutdown(mainNode); - mainNode = await MainNode.spawn( - mainLogs, - enableConsensus, - false, - ethClientWeb3Url, - apiWeb3JsonRpcHttpUrl, - baseTokenAddress - ); + // FIXME: need 2 batches? + step('seal another L1 batch', async () => { + await extNode.createBatchWithDeposit(alice.address, depositAmount); + }); - console.log('Commit at least 2 L1 batches which are not executed'); - const lastExecuted = await main_contract.getTotalBatchesExecuted(); - // One is not enough to test the reversion of sk cache because - // it gets updated with some batch logs only at the start of the next batch. - const initialL1BatchNumber = await main_contract.getTotalBatchesCommitted(); - const firstDepositHandle = await extNode.tester.syncWallet.deposit({ - token: isETHBasedChain ? zksync.utils.LEGACY_ETH_ADDRESS : baseToken, - amount: depositAmount, - to: alice.address, - approveBaseERC20: true, - approveERC20: true - }); - - await firstDepositHandle.wait(); - while ((await extNode.tester.web3Provider.getL1BatchNumber()) <= initialL1BatchNumber) { - await utils.sleep(0.1); - } + step('check wallet balance', async () => { + const balance = await alice.getBalance(); + console.log(`Balance before revert: ${balance}`); + assert(balance === depositAmount * 2n, 'Incorrect balance after deposits'); + }); - const secondDepositHandle = await extNode.tester.syncWallet.deposit({ - token: isETHBasedChain ? zksync.utils.LEGACY_ETH_ADDRESS : baseToken, - amount: depositAmount, - to: alice.address, - approveBaseERC20: true, - approveERC20: true - }); - await secondDepositHandle.wait(); - while ((await extNode.tester.web3Provider.getL1BatchNumber()) <= initialL1BatchNumber + 1n) { - await utils.sleep(0.3); - } + step('wait for the new batch to be committed', async () => { + batchesCommittedBeforeRevert = await waitToCommitBatchesWithoutExecution(mainContract); + }); - const alice2 = await alice.getBalance(); - while (true) { - const lastCommitted = await main_contract.getTotalBatchesCommitted(); - console.log(`lastExecuted = ${lastExecuted}, lastCommitted = ${lastCommitted}`); - if (lastCommitted - lastExecuted >= 2n) { - console.log('Terminate the main node'); - await killServerAndWaitForShutdown(mainNode); - break; - } - await utils.sleep(0.3); - } + step('stop server', async () => { + await mainNode.killAndWaitForShutdown(); + }); - console.log('Ask block_reverter to suggest to which L1 batch we should revert'); - const values_json = await runBlockReverter([ - 'print-suggested-values', - '--json', - '--operator-address', - operatorAddress - ]); - console.log(`values = ${values_json}`); - const values = parseSuggestedValues(values_json); - assert(lastExecuted === values.lastExecutedL1BatchNumber); - - console.log('Send reverting transaction to L1'); - await runBlockReverter([ - 'send-eth-transaction', - '--l1-batch-number', - values.lastExecutedL1BatchNumber.toString(), - '--nonce', - values.nonce.toString(), - '--priority-fee-per-gas', - values.priorityFee.toString() - ]); - - console.log('Check that batches are reverted on L1'); - const lastCommitted2 = await main_contract.getTotalBatchesCommitted(); - console.log(`lastCommitted = ${lastCommitted2}, want ${lastExecuted}`); - assert(lastCommitted2 === lastExecuted); - - console.log('Rollback db'); - await runBlockReverter([ - 'rollback-db', - '--l1-batch-number', - values.lastExecutedL1BatchNumber.toString(), - '--rollback-postgres', - '--rollback-tree', - '--rollback-sk-cache', - '--rollback-vm-runners-cache' - ]); - - console.log('Start main node.'); - mainNode = await MainNode.spawn( - mainLogs, - enableConsensus, - true, - ethClientWeb3Url, - apiWeb3JsonRpcHttpUrl, - baseTokenAddress + step('revert batches', async () => { + await executeRevert( + pathToHome, + fileConfig.chain, + operatorAddress, + batchesCommittedBeforeRevert, + mainContract, + mainEnv ); + }); - console.log('Wait for the external node to detect reorg and terminate'); + step('restart server', async () => { + mainNode = await mainNodeSpawner.spawnMainNode(true); + }); + + step('Wait for EN to detect reorg and terminate', async () => { await extNode.waitForExit(); + }); - console.log('Restart external node and wait for it to revert.'); - extNode = await ExtNode.spawn(extLogs, enableConsensus, ethClientWeb3Url, enEthClientUrl, baseTokenAddress); - - console.log('Execute an L1 transaction'); - const depositHandle = await extNode.tester.syncWallet.deposit({ - token: isETHBasedChain ? zksync.utils.LEGACY_ETH_ADDRESS : baseToken, - amount: depositAmount, - to: alice.address, - approveBaseERC20: true, - approveERC20: true - }); - - let l1TxResponse = await alice._providerL1().getTransaction(depositHandle.hash); - while (!l1TxResponse) { - console.log(`Deposit ${depositHandle.hash} is not visible to the L1 network; sleeping`); - await utils.sleep(1); - l1TxResponse = await alice._providerL1().getTransaction(depositHandle.hash); - } + step('Restart EN', async () => { + extNode = await extNodeSpawner.spawnExtNode(); + }); - // TODO: it would be nice to know WHY it "doesn't work well with block reversions" and what it actually means. - console.log( - "ethers doesn't work well with block reversions, so wait for the receipt before calling `.waitFinalize()`." - ); - const l2Tx = await alice._providerL2().getL2TransactionFromPriorityOp(l1TxResponse); - let receipt = null; - while (true) { - receipt = await extNode.tester.syncWallet.provider.getTransactionReceipt(l2Tx.hash); - if (receipt != null) { - break; - } + step('wait until last deposit is re-executed', async () => { + let balanceBefore; + let tryCount = 0; + while ((balanceBefore = await alice.getBalance()) !== 2n * depositAmount && tryCount < 30) { + console.log(`Balance after revert: ${balanceBefore}`); + tryCount++; await utils.sleep(1); } - await depositHandle.waitFinalize(); - expect(receipt.status).to.be.eql(1); - - // The reverted transactions are expected to be reexecuted before the next transaction is applied. - // Hence we compare the state against the alice2, rather than against alice3. - const alice4want = alice2 + depositAmount; - const alice4 = await alice.getBalance(); - console.log(`Alice's balance is ${alice4}, want ${alice4want}`); - assert(alice4 === alice4want); - - console.log('Execute an L2 transaction'); - await checkedRandomTransfer(alice, 1n); + assert(balanceBefore === 2n * depositAmount, 'Incorrect balance after revert'); + }); + + step('execute transaction after revert', async () => { + await executeDepositAfterRevert(extNode.tester, alice, depositAmount); + const balanceAfter = await alice.getBalance(); + console.log(`Balance after another deposit: ${balanceAfter}`); + assert(balanceAfter === depositAmount * 3n, 'Incorrect balance after another deposit'); + }); + + step('check random transfer', async () => { + await checkRandomTransfer(alice, 1n); }); after('terminate nodes', async () => { @@ -564,25 +283,3 @@ describe('Block reverting test', function () { } }); }); - -// Transfers amount from sender to a random wallet in an L2 transaction. -async function checkedRandomTransfer(sender: zksync.Wallet, amount: bigint) { - const senderBalanceBefore = await sender.getBalance(); - const receiver = zksync.Wallet.createRandom().connect(sender.provider); - const transferHandle = await sender.sendTransaction({ to: receiver.address, value: amount, type: 0 }); - - // ethers doesn't work well with block reversions, so we poll for the receipt manually. - let txReceipt = null; - do { - txReceipt = await sender.provider.getTransactionReceipt(transferHandle.hash); - await utils.sleep(1); - } while (txReceipt === null); - - const senderBalance = await sender.getBalance(); - const receiverBalance = await receiver.provider!.getBalance(receiver.address); - - expect(receiverBalance === amount, 'Failed updated the balance of the receiver').to.be.true; - - const spentAmount = txReceipt.gasUsed * transferHandle.gasPrice! + amount; - expect(senderBalance + spentAmount >= senderBalanceBefore, 'Failed to update the balance of the sender').to.be.true; -} diff --git a/core/tests/revert-test/tests/revert-and-restart.test.ts b/core/tests/revert-test/tests/revert-and-restart.test.ts index a01788284d2..163a7294b5f 100644 --- a/core/tests/revert-test/tests/revert-and-restart.test.ts +++ b/core/tests/revert-test/tests/revert-and-restart.test.ts @@ -1,104 +1,52 @@ import * as utils from 'utils'; -import { loadConfig, shouldLoadConfigFromFile, getAllConfigsPath } from 'utils/build/file-configs'; -import { runServerInBackground } from './utils'; -import { Tester } from './tester'; +import { loadConfig, shouldLoadConfigFromFile } from 'utils/build/file-configs'; +import { + checkRandomTransfer, + executeDepositAfterRevert, + executeRevert, + Node, + NodeSpawner, + NodeType, + waitToCommitBatchesWithoutExecution, + waitToExecuteBatch +} from './utils'; import * as zksync from 'zksync-ethers'; import * as ethers from 'ethers'; -import { expect } from 'chai'; +import { assert } from 'chai'; import { IZkSyncHyperchain } from 'zksync-ethers/build/typechain'; import path from 'path'; -import { ChildProcessWithoutNullStreams } from 'child_process'; import fs from 'node:fs/promises'; import { logsTestPath } from 'utils/build/logs'; -import { killPidWithAllChilds } from 'utils/build/kill'; - -// Parses output of "print-suggested-values" command of the revert block tool. -function parseSuggestedValues(suggestedValuesString: string): { - lastL1BatchNumber: bigint; - nonce: bigint; - priorityFee: bigint; -} { - const json = JSON.parse(suggestedValuesString); - if (!json || typeof json !== 'object') { - throw new TypeError('suggested values are not an object'); - } - - const lastL1BatchNumber = json.last_executed_l1_batch_number; - if (!Number.isInteger(lastL1BatchNumber)) { - throw new TypeError('suggested `lastL1BatchNumber` is not an integer'); - } - const nonce = json.nonce; - if (!Number.isInteger(nonce)) { - throw new TypeError('suggested `nonce` is not an integer'); - } - const priorityFee = json.priority_fee; - if (!Number.isInteger(priorityFee)) { - throw new TypeError('suggested `priorityFee` is not an integer'); - } - - return { - lastL1BatchNumber: BigInt(lastL1BatchNumber), - nonce: BigInt(nonce), - priorityFee: BigInt(priorityFee) - }; -} - -async function killServerAndWaitForShutdown(tester: Tester, serverProcess?: ChildProcessWithoutNullStreams) { - if (!serverProcess) { - await utils.exec('killall -9 zksync_server').catch(ignoreError); - return; - } - await killPidWithAllChilds(serverProcess.pid!, 9).catch(ignoreError); - // Wait until it's really stopped. - let iter = 0; - while (iter < 30) { - try { - await tester.syncWallet.provider.getBlockNumber(); - await utils.sleep(2); - iter += 1; - } catch (_) { - // When exception happens, we assume that server died. - return; - } - } - // It's going to panic anyway, since the server is a singleton entity, so better to exit early. - throw new Error("Server didn't stop after a kill request"); -} function ignoreError(_err: any, context?: string) { const message = context ? `Error ignored (context: ${context}).` : 'Error ignored.'; console.info(message); } -const fileConfig = shouldLoadConfigFromFile(); -const depositAmount = ethers.parseEther('0.001'); - -async function logsPath(name: string): Promise { - return await logsTestPath(fileConfig.chain, 'logs/revert/', name); -} - describe('Block reverting test', function () { - let tester: Tester; let alice: zksync.Wallet; let mainContract: IZkSyncHyperchain; - let blocksCommittedBeforeRevert: bigint; - let logs: fs.FileHandle; + let depositL1BatchNumber: number; + let batchesCommittedBeforeRevert: bigint; + let mainLogs: fs.FileHandle; let operatorAddress: string; + let baseTokenAddress: string; let ethClientWeb3Url: string; let apiWeb3JsonRpcHttpUrl: string; - let serverProcess: ChildProcessWithoutNullStreams | undefined; + let mainNodeSpawner: NodeSpawner; + let mainNode: Node; + + const fileConfig = shouldLoadConfigFromFile(); const pathToHome = path.join(__dirname, '../../../..'); const autoKill: boolean = !fileConfig.loadFromFile || !process.env.NO_KILL; const enableConsensus = process.env.ENABLE_CONSENSUS == 'true'; - let components = 'api,tree,eth,state_keeper,commitment_generator,da_dispatcher,vm_runner_protective_reads'; - if (enableConsensus) { - components += ',consensus'; + const depositAmount = ethers.parseEther('0.001'); + + async function logsPath(name: string): Promise { + return await logsTestPath(fileConfig.chain, 'logs/revert/', name); } before('initialize test', async () => { - // Clone file configs if necessary - let baseTokenAddress: string; - if (!fileConfig.loadFromFile) { operatorAddress = process.env.ETH_SENDER_SENDER_OPERATOR_COMMIT_ETH_ADDR!; ethClientWeb3Url = process.env.ETH_CLIENT_WEB3_URL!; @@ -132,198 +80,107 @@ describe('Block reverting test', function () { baseTokenAddress = contractsConfig.l1.base_token_addr; } - // Create test wallets - tester = await Tester.init(ethClientWeb3Url, apiWeb3JsonRpcHttpUrl, baseTokenAddress); - alice = tester.emptyWallet(); + const pathToMainLogs = await logsPath('server.log'); + mainLogs = await fs.open(pathToMainLogs, 'a'); + console.log(`Writing server logs to ${pathToMainLogs}`); + + mainNodeSpawner = new NodeSpawner(pathToHome, mainLogs, fileConfig, { + enableConsensus, + ethClientWeb3Url, + apiWeb3JsonRpcHttpUrl, + baseTokenAddress + }); }); - step('run server and execute some transactions', async () => { + step('Make sure that the server is not running', async () => { if (autoKill) { // Make sure server isn't running. - await killServerAndWaitForShutdown(tester); - } - - // Run server in background. - logs = await fs.open(await logsPath('server.log'), 'a'); - serverProcess = runServerInBackground({ - components: [components], - stdio: ['ignore', logs, logs], - cwd: pathToHome, - useZkInception: fileConfig.loadFromFile, - chain: fileConfig.chain - }); - - // Server may need some time to recompile if it's a cold run, so wait for it. - let iter = 0; - while (iter < 30 && !mainContract) { - try { - mainContract = await tester.syncWallet.getMainContract(); - } catch (err) { - ignoreError(err, 'waiting for server HTTP JSON-RPC to start'); - await utils.sleep(2); - iter += 1; - } - } - if (!mainContract) { - throw new Error('Server did not start'); - } - - await tester.fundSyncWallet(); - - // Seal 2 L1 batches. - // One is not enough to test the reversion of sk cache because - // it gets updated with some batch logs only at the start of the next batch. - const initialL1BatchNumber = await tester.web3Provider.getL1BatchNumber(); - const firstDepositHandle = await tester.syncWallet.deposit({ - token: tester.isETHBasedChain ? zksync.utils.LEGACY_ETH_ADDRESS : tester.baseTokenAddress, - amount: depositAmount, - to: alice.address, - approveBaseERC20: true, - approveERC20: true - }); - await firstDepositHandle.wait(); - while ((await tester.web3Provider.getL1BatchNumber()) <= initialL1BatchNumber) { - await utils.sleep(1); + await Node.killAll(NodeType.MAIN); } - const secondDepositHandle = await tester.syncWallet.deposit({ - token: tester.isETHBasedChain ? zksync.utils.LEGACY_ETH_ADDRESS : tester.baseTokenAddress, - amount: depositAmount, - to: alice.address, - approveBaseERC20: true, - approveERC20: true - }); - await secondDepositHandle.wait(); - while ((await tester.web3Provider.getL1BatchNumber()) <= initialL1BatchNumber + 1) { - await utils.sleep(1); - } - - const balance = await alice.getBalance(); - expect(balance === depositAmount * 2n, 'Incorrect balance after deposits').to.be.true; + }); - // Check L1 committed and executed blocks. - let blocksCommitted = await mainContract.getTotalBatchesCommitted(); - let blocksExecuted = await mainContract.getTotalBatchesExecuted(); - let tryCount = 0; - while (blocksCommitted === blocksExecuted && tryCount < 100) { - blocksCommitted = await mainContract.getTotalBatchesCommitted(); - blocksExecuted = await mainContract.getTotalBatchesExecuted(); - tryCount += 1; - await utils.sleep(1); - } - expect(blocksCommitted > blocksExecuted, 'There is no committed but not executed block').to.be.true; - blocksCommittedBeforeRevert = blocksCommitted; + step('start server', async () => { + mainNode = await mainNodeSpawner.spawnMainNode(true); + }); - // Stop server. - await killServerAndWaitForShutdown(tester, serverProcess!); + step('fund wallet', async () => { + await mainNode.tester.fundSyncWallet(); + mainContract = await mainNode.tester.syncWallet.getMainContract(); + alice = mainNode.tester.emptyWallet(); }); - step('revert blocks', async () => { - let fileConfigFlags = ''; - if (fileConfig.loadFromFile) { - const configPaths = getAllConfigsPath({ - pathToHome, - chain: fileConfig.chain - }); - fileConfigFlags = ` - --config-path=${configPaths['general.yaml']} - --contracts-config-path=${configPaths['contracts.yaml']} - --secrets-path=${configPaths['secrets.yaml']} - --wallets-path=${configPaths['wallets.yaml']} - --genesis-path=${configPaths['genesis.yaml']} - `; - } + // Seal 2 L1 batches. + // One is not enough to test the reversion of sk cache because + // it gets updated with some batch logs only at the start of the next batch. + step('seal L1 batch', async () => { + depositL1BatchNumber = await mainNode.createBatchWithDeposit(alice.address, depositAmount); + }); - const executedProcess = await utils.exec( - `cd ${pathToHome} && RUST_LOG=off cargo run --bin block_reverter --release -- print-suggested-values --json --operator-address ${operatorAddress} ${fileConfigFlags}` - // ^ Switch off logs to not pollute the output JSON - ); - const suggestedValuesOutput = executedProcess.stdout; - const { lastL1BatchNumber, nonce, priorityFee } = parseSuggestedValues(suggestedValuesOutput); - expect(lastL1BatchNumber < blocksCommittedBeforeRevert, 'There should be at least one block for revert').to.be - .true; + step('wait for an L1 batch to get executed', async () => { + await waitToExecuteBatch(mainContract, depositL1BatchNumber); + }); - console.log( - `Reverting with parameters: last unreverted L1 batch number: ${lastL1BatchNumber}, nonce: ${nonce}, priorityFee: ${priorityFee}` - ); + step('restart server with batch execution turned off', async () => { + await mainNode.killAndWaitForShutdown(); + mainNode = await mainNodeSpawner.spawnMainNode(false); + }); - console.log('Sending ETH transaction..'); - await utils.spawn( - `cd ${pathToHome} && cargo run --bin block_reverter --release -- send-eth-transaction --l1-batch-number ${lastL1BatchNumber} --nonce ${nonce} --priority-fee-per-gas ${priorityFee} ${fileConfigFlags}` - ); + step('seal another L1 batch', async () => { + await mainNode.createBatchWithDeposit(alice.address, depositAmount); + }); - console.log('Rolling back DB..'); - await utils.spawn( - `cd ${pathToHome} && cargo run --bin block_reverter --release -- rollback-db --l1-batch-number ${lastL1BatchNumber} --rollback-postgres --rollback-tree --rollback-sk-cache --rollback-vm-runners-cache ${fileConfigFlags}` - ); + step('check wallet balance', async () => { + const balance = await alice.getBalance(); + console.log(`Balance before revert: ${balance}`); + assert(balance === depositAmount * 2n, 'Incorrect balance after deposits'); + }); - let blocksCommitted = await mainContract.getTotalBatchesCommitted(); - expect(blocksCommitted === lastL1BatchNumber, 'Revert on contract was unsuccessful').to.be.true; + step('wait for the new batch to be committed', async () => { + batchesCommittedBeforeRevert = await waitToCommitBatchesWithoutExecution(mainContract); }); - step('execute transaction after revert', async () => { - // Run server. - serverProcess = runServerInBackground({ - components: [components], - stdio: ['ignore', logs, logs], - cwd: pathToHome, - useZkInception: fileConfig.loadFromFile, - chain: fileConfig.chain - }); - await utils.sleep(30); + step('stop server', async () => { + await mainNode.killAndWaitForShutdown(); + }); - const balanceBefore = await alice.getBalance(); - expect(balanceBefore === depositAmount * 2n, 'Incorrect balance after revert').to.be.true; + step('revert batches', async () => { + await executeRevert(pathToHome, fileConfig.chain, operatorAddress, batchesCommittedBeforeRevert, mainContract); + }); - // Execute a transaction - const depositHandle = await tester.syncWallet.deposit({ - token: tester.isETHBasedChain ? zksync.utils.LEGACY_ETH_ADDRESS : tester.baseTokenAddress, - amount: depositAmount, - to: alice.address, - approveBaseERC20: true, - approveERC20: true - }); + step('restart server', async () => { + mainNode = await mainNodeSpawner.spawnMainNode(true); + }); - let l1TxResponse = await alice._providerL1().getTransaction(depositHandle.hash); - while (!l1TxResponse) { - console.log(`Deposit ${depositHandle.hash} is not visible to the L1 network; sleeping`); + step('wait until last deposit is re-executed', async () => { + let balanceBefore; + let tryCount = 0; + while ((balanceBefore = await alice.getBalance()) !== 2n * depositAmount && tryCount < 30) { + console.log(`Balance after revert: ${balanceBefore}`); + tryCount++; await utils.sleep(1); - l1TxResponse = await alice._providerL1().getTransaction(depositHandle.hash); } + assert(balanceBefore === 2n * depositAmount, 'Incorrect balance after revert'); + }); - // ethers doesn't work well with block reversions, so wait for the receipt before calling `.waitFinalize()`. - const l2Tx = await alice._providerL2().getL2TransactionFromPriorityOp(l1TxResponse); - let receipt = null; - do { - receipt = await tester.syncWallet.provider.getTransactionReceipt(l2Tx.hash); - await utils.sleep(1); - } while (receipt == null); - - await depositHandle.waitFinalize(); - expect(receipt.status).to.be.eql(1); - + step('execute transaction after revert', async () => { + await executeDepositAfterRevert(mainNode.tester, alice, depositAmount); const balanceAfter = await alice.getBalance(); - expect(balanceAfter === depositAmount * 3n, 'Incorrect balance after another deposit').to.be.true; + console.log(`Balance after another deposit: ${balanceAfter}`); + assert(balanceAfter === depositAmount * 3n, 'Incorrect balance after another deposit'); }); step('execute transactions after simple restart', async () => { // Execute an L2 transaction - await checkedRandomTransfer(alice, 1n); + await checkRandomTransfer(alice, 1n); // Stop server. - await killServerAndWaitForShutdown(tester, serverProcess!); + await mainNode.killAndWaitForShutdown(); // Run again. - serverProcess = runServerInBackground({ - components: [components], - stdio: ['ignore', logs, logs], - cwd: pathToHome, - useZkInception: fileConfig.loadFromFile, - chain: fileConfig.chain - }); - await utils.sleep(30); + mainNode = await mainNodeSpawner.spawnMainNode(true); // Trying to send a transaction from the same address again - await checkedRandomTransfer(alice, 1n); + await checkRandomTransfer(alice, 1n); }); after('Try killing server', async () => { @@ -332,29 +189,3 @@ describe('Block reverting test', function () { } }); }); - -async function checkedRandomTransfer(sender: zksync.Wallet, amount: bigint) { - const senderBalanceBefore = await sender.getBalance(); - const receiverHD = zksync.Wallet.createRandom(); - const receiver = new zksync.Wallet(receiverHD.privateKey, sender.provider); - const transferHandle = await sender.sendTransaction({ - to: receiver.address, - value: amount, - type: 0 - }); - - // ethers doesn't work well with block reversions, so we poll for the receipt manually. - let txReceipt = null; - do { - txReceipt = await sender.provider.getTransactionReceipt(transferHandle.hash); - await utils.sleep(1); - } while (txReceipt == null); - - const senderBalance = await sender.getBalance(); - const receiverBalance = await receiver.getBalance(); - - expect(receiverBalance === amount, 'Failed updated the balance of the receiver').to.be.true; - - const spentAmount = txReceipt.gasUsed * transferHandle.gasPrice! + amount; - expect(senderBalance + spentAmount >= senderBalanceBefore, 'Failed to update the balance of the sender').to.be.true; -} diff --git a/core/tests/revert-test/tests/utils.ts b/core/tests/revert-test/tests/utils.ts index 4e3e292da65..ea8a45b97c3 100644 --- a/core/tests/revert-test/tests/utils.ts +++ b/core/tests/revert-test/tests/utils.ts @@ -1,5 +1,13 @@ import { exec as _exec, spawn as _spawn, ChildProcessWithoutNullStreams, type ProcessEnvOptions } from 'child_process'; import { promisify } from 'util'; +import { assert, expect } from 'chai'; +import { FileConfig, getAllConfigsPath, replaceAggregatedBlockExecuteDeadline } from 'utils/build/file-configs'; +import { IZkSyncHyperchain } from 'zksync-ethers/build/typechain'; +import { Tester } from './tester'; +import { killPidWithAllChilds } from 'utils/build/kill'; +import * as utils from 'utils'; +import fs from 'node:fs/promises'; +import * as zksync from 'zksync-ethers'; // executes a command in background and returns a child process handle // by default pipes data to parent's stdio but this can be overridden @@ -100,3 +108,389 @@ export function exec(command: string, options: ProcessEnvOptions) { command = command.replace(/\n/g, ' '); return promisified(command, options); } + +export interface SuggestedValues { + lastExecutedL1BatchNumber: bigint; + nonce: number; + priorityFee: number; +} + +/** Parses output of "print-suggested-values" command of the revert block tool. */ +export function parseSuggestedValues(jsonString: string): SuggestedValues { + const json = JSON.parse(jsonString); + assert(json && typeof json === 'object'); + assert(Number.isInteger(json.last_executed_l1_batch_number)); + assert(Number.isInteger(json.nonce)); + assert(Number.isInteger(json.priority_fee)); + return { + lastExecutedL1BatchNumber: BigInt(json.last_executed_l1_batch_number), + nonce: json.nonce, + priorityFee: json.priority_fee + }; +} + +async function runBlockReverter( + pathToHome: string, + chain: string | undefined, + env: ProcessEnvOptions['env'] | undefined, + args: string[] +): Promise { + let fileConfigFlags = ''; + if (chain) { + const configPaths = getAllConfigsPath({ pathToHome, chain }); + fileConfigFlags = ` + --config-path=${configPaths['general.yaml']} + --contracts-config-path=${configPaths['contracts.yaml']} + --secrets-path=${configPaths['secrets.yaml']} + --wallets-path=${configPaths['wallets.yaml']} + --genesis-path=${configPaths['genesis.yaml']} + `; + } + + const cmd = `cd ${pathToHome} && RUST_LOG=off cargo run --bin block_reverter --release -- ${args.join( + ' ' + )} ${fileConfigFlags}`; + + const options = env + ? { + cwd: env.ZKSYNC_HOME, + env: { + ...env, + PATH: process.env.PATH + } + } + : {}; + const executedProcess = await exec(cmd, options); + return executedProcess.stdout; +} + +export async function executeRevert( + pathToHome: string, + chain: string | undefined, + operatorAddress: string, + batchesCommittedBeforeRevert: bigint, + mainContract: IZkSyncHyperchain, + env?: ProcessEnvOptions['env'] +) { + const suggestedValuesOutput = await runBlockReverter(pathToHome, chain, env, [ + 'print-suggested-values', + '--json', + '--operator-address', + operatorAddress + ]); + const values = parseSuggestedValues(suggestedValuesOutput); + assert( + values.lastExecutedL1BatchNumber < batchesCommittedBeforeRevert, + 'There should be at least one block for revert' + ); + + console.log('Reverting with parameters', values); + + console.log('Sending ETH transaction..'); + await runBlockReverter(pathToHome, chain, env, [ + 'send-eth-transaction', + '--l1-batch-number', + values.lastExecutedL1BatchNumber.toString(), + '--nonce', + values.nonce.toString(), + '--priority-fee-per-gas', + values.priorityFee.toString() + ]); + + console.log('Rolling back DB..'); + await runBlockReverter(pathToHome, chain, env, [ + 'rollback-db', + '--l1-batch-number', + values.lastExecutedL1BatchNumber.toString(), + '--rollback-postgres', + '--rollback-tree', + '--rollback-sk-cache', + '--rollback-vm-runners-cache' + ]); + + const blocksCommitted = await mainContract.getTotalBatchesCommitted(); + assert(blocksCommitted === values.lastExecutedL1BatchNumber, 'Revert on contract was unsuccessful'); +} + +export interface MainNodeSpawnOptions { + enableConsensus: boolean; + ethClientWeb3Url: string; + apiWeb3JsonRpcHttpUrl: string; + baseTokenAddress: string; +} + +export enum NodeType { + MAIN = 'zksync_server', + EXT = 'zksync_external_node' +} + +export class Node { + constructor( + public readonly tester: Tester, + private readonly proc: ChildProcessWithoutNullStreams, + private readonly type: TYPE + ) {} + + public async terminate() { + try { + await killPidWithAllChilds(this.proc.pid!, 9); + } catch (err) { + console.log(`ignored error: ${err}`); + } + } + + /** + * Terminates all main node processes running. + * + * WARNING: This is not safe to use when running nodes on multiple chains. + */ + public static async killAll(type: NodeType) { + try { + await utils.exec(`killall -KILL ${type}`); + } catch (err) { + console.log(`ignored error: ${err}`); + } + } + + /** Waits for the node process to exit. */ + public async waitForExit(): Promise { + while (this.proc.exitCode === null) { + await utils.sleep(1); + } + return this.proc.exitCode; + } + + public async killAndWaitForShutdown() { + await this.terminate(); + // Wait until it's really stopped. + let iter = 0; + while (iter < 30) { + try { + await this.tester.syncWallet.provider.getBlockNumber(); + await utils.sleep(2); + iter += 1; + } catch (_) { + // When exception happens, we assume that server died. + return; + } + } + // It's going to panic anyway, since the server is a singleton entity, so better to exit early. + throw new Error(`${this.type} didn't stop after a kill request`); + } + + public async createBatchWithDeposit(to: string, amount: bigint) { + const initialL1BatchNumber = await this.tester.web3Provider.getL1BatchNumber(); + console.log(`Initial L1 batch: ${initialL1BatchNumber}`); + + const depositHandle = await this.tester.syncWallet.deposit({ + token: this.tester.isETHBasedChain ? zksync.utils.LEGACY_ETH_ADDRESS : this.tester.baseTokenAddress, + amount, + to, + approveBaseERC20: true, + approveERC20: true + }); + + let depositBatchNumber; + while (!(depositBatchNumber = (await depositHandle.wait()).l1BatchNumber)) { + console.log('Deposit is not included in L1 batch; sleeping'); + await utils.sleep(1); + } + console.log(`Deposit was included into L1 batch ${depositBatchNumber}`); + expect(depositBatchNumber).to.be.greaterThan(initialL1BatchNumber); + return depositBatchNumber; + } +} + +export class NodeSpawner { + public constructor( + private readonly pathToHome: string, + private readonly logs: fs.FileHandle, + private readonly fileConfig: FileConfig, + private readonly options: MainNodeSpawnOptions, + private readonly env?: ProcessEnvOptions['env'] + ) {} + + public async spawnMainNode(enableExecute: boolean): Promise> { + const env = this.env ?? process.env; + env.ETH_SENDER_SENDER_AGGREGATED_BLOCK_EXECUTE_DEADLINE = enableExecute ? '1' : '10000'; + // Set full mode for the Merkle tree as it is required to get blocks committed. + env.DATABASE_MERKLE_TREE_MODE = 'full'; + + const { fileConfig, pathToHome, options, logs } = this; + + if (fileConfig.loadFromFile) { + replaceAggregatedBlockExecuteDeadline(pathToHome, fileConfig, enableExecute ? 1 : 10000); + } + + let components = 'api,tree,eth,state_keeper,commitment_generator,da_dispatcher,vm_runner_protective_reads'; + if (options.enableConsensus) { + components += ',consensus'; + } + if (options.baseTokenAddress != zksync.utils.LEGACY_ETH_ADDRESS) { + components += ',base_token_ratio_persister'; + } + let proc = runServerInBackground({ + components: [components], + stdio: ['ignore', logs, logs], + cwd: pathToHome, + env: env, + useZkInception: fileConfig.loadFromFile, + chain: fileConfig.chain + }); + + // Wait until the main node starts responding. + const tester = await Tester.init( + options.ethClientWeb3Url, + options.apiWeb3JsonRpcHttpUrl, + options.baseTokenAddress + ); + await waitForNodeToStart(tester, proc, options.apiWeb3JsonRpcHttpUrl); + return new Node(tester, proc, NodeType.MAIN); + } + + public async spawnExtNode(): Promise> { + const env = this.env ?? process.env; + const { pathToHome, fileConfig, logs, options } = this; + + let args = []; // FIXME: unused + if (options.enableConsensus) { + args.push('--enable-consensus'); + } + + // Run server in background. + let proc = runExternalNodeInBackground({ + stdio: ['ignore', logs, logs], + cwd: pathToHome, + env, + useZkInception: fileConfig.loadFromFile, + chain: fileConfig.chain + }); + + const tester = await Tester.init( + options.ethClientWeb3Url, + options.apiWeb3JsonRpcHttpUrl, + options.baseTokenAddress + ); + await waitForNodeToStart(tester, proc, options.apiWeb3JsonRpcHttpUrl); + return new Node(tester, proc, NodeType.EXT); + } +} + +async function waitForNodeToStart(tester: Tester, proc: ChildProcessWithoutNullStreams, l2Url: string) { + while (true) { + try { + const blockNumber = await tester.syncWallet.provider.getBlockNumber(); + console.log(`Initialized node API on ${l2Url}; latest block: ${blockNumber}`); + break; + } catch (err) { + if (proc.exitCode != null) { + assert.fail(`server failed to start, exitCode = ${proc.exitCode}`); + } + console.log(`Node waiting for API on ${l2Url}`); + await utils.sleep(1); + } + } +} + +export async function waitToExecuteBatch(mainContract: IZkSyncHyperchain, latestBatch: number) { + let tryCount = 0; + const initialExecutedBatch = await mainContract.getTotalBatchesExecuted(); + console.log(`Initial executed L1 batch: ${initialExecutedBatch}`); + + if (initialExecutedBatch >= latestBatch) { + console.log('Latest batch is executed; no need to wait'); + return; + } + + let lastExecutedBatch; + while ( + (lastExecutedBatch = await mainContract.getTotalBatchesExecuted()) === initialExecutedBatch && + tryCount < 100 + ) { + console.log(`Last executed batch: ${lastExecutedBatch}`); + tryCount++; + await utils.sleep(1); + } + assert(lastExecutedBatch > initialExecutedBatch); +} + +export async function waitToCommitBatchesWithoutExecution(mainContract: IZkSyncHyperchain): Promise { + let batchesCommitted = await mainContract.getTotalBatchesCommitted(); + let batchesExecuted = await mainContract.getTotalBatchesExecuted(); + console.log(`Batches committed: ${batchesCommitted}, executed: ${batchesExecuted}`); + + let tryCount = 0; + while ((batchesExecuted === 0n || batchesCommitted === batchesExecuted) && tryCount < 100) { + await utils.sleep(1); + batchesCommitted = await mainContract.getTotalBatchesCommitted(); + batchesExecuted = await mainContract.getTotalBatchesExecuted(); + console.log(`Batches committed: ${batchesCommitted}, executed: ${batchesExecuted}`); + tryCount += 1; + } + expect(batchesCommitted > batchesExecuted, 'There is no committed but not executed batch').to.be.true; + return batchesCommitted; +} + +export async function executeDepositAfterRevert(tester: Tester, wallet: zksync.Wallet, amount: bigint) { + const depositHandle = await tester.syncWallet.deposit({ + token: tester.isETHBasedChain ? zksync.utils.LEGACY_ETH_ADDRESS : tester.baseTokenAddress, + amount, + to: wallet.address, + approveBaseERC20: true, + approveERC20: true + }); + + let l1TxResponse = await wallet._providerL1().getTransaction(depositHandle.hash); + while (!l1TxResponse) { + console.log(`Deposit ${depositHandle.hash} is not visible to the L1 network; sleeping`); + await utils.sleep(1); + l1TxResponse = await wallet._providerL1().getTransaction(depositHandle.hash); + } + console.log(`Got L1 deposit tx`, l1TxResponse); + + // ethers doesn't work well with block reversions, so wait for the receipt before calling `.waitFinalize()`. + const l2Tx = await wallet._providerL2().getL2TransactionFromPriorityOp(l1TxResponse); + let receipt = null; + while (receipt === null) { + console.log(`L2 deposit transaction ${l2Tx.hash} is not confirmed; sleeping`); + await utils.sleep(1); + receipt = await tester.syncWallet.provider.getTransactionReceipt(l2Tx.hash); + } + expect(receipt.status).to.be.eql(1); + console.log(`L2 deposit transaction ${l2Tx.hash} is confirmed`); + + await depositHandle.waitFinalize(); + console.log('New deposit is finalized'); +} + +export async function checkRandomTransfer(sender: zksync.Wallet, amount: bigint) { + const senderBalanceBefore = await sender.getBalance(); + console.log(`Sender's balance before transfer: ${senderBalanceBefore}`); + + const receiverHD = zksync.Wallet.createRandom(); + const receiver = new zksync.Wallet(receiverHD.privateKey, sender.provider); + const transferHandle = await sender.sendTransaction({ + to: receiver.address, + value: amount, + type: 0 + }); + + // ethers doesn't work well with block reversions, so we poll for the receipt manually. + let txReceipt = null; + while (txReceipt === null) { + console.log(`Transfer ${transferHandle.hash} is not confirmed, sleeping`); + await utils.sleep(1); + txReceipt = await sender.provider.getTransactionReceipt(transferHandle.hash); + } + + const senderBalance = await sender.getBalance(); + console.log(`Sender's balance after transfer: ${senderBalance}`); + const receiverBalance = await receiver.getBalance(); + console.log(`Receiver's balance after transfer: ${receiverBalance}`); + + assert(receiverBalance === amount, 'Failed updated the balance of the receiver'); + + const spentAmount = txReceipt.gasUsed * transferHandle.gasPrice! + amount; + console.log(`Expected spent amount: ${spentAmount}`); + assert(senderBalance + spentAmount >= senderBalanceBefore, 'Failed to update the balance of the sender'); +} diff --git a/core/tests/ts-integration/tests/api/web3.test.ts b/core/tests/ts-integration/tests/api/web3.test.ts index b20e9d1e37d..79789e74447 100644 --- a/core/tests/ts-integration/tests/api/web3.test.ts +++ b/core/tests/ts-integration/tests/api/web3.test.ts @@ -202,7 +202,7 @@ describe('web3 API compatibility tests', () => { test('Should test web3 response extensions', async () => { if (testMaster.isFastMode()) { - // This test requires a new L1 batch to be created, which may be very time consuming on stage. + // This test requires a new L1 batch to be created, which may be very time-consuming on stage. return; } @@ -333,7 +333,7 @@ describe('web3 API compatibility tests', () => { // Pubsub notifier is not reactive + tests are being run in parallel, so we can't expect that the next block // would be expected one. Instead, we just want to receive an event with the particular block number. - wsProvider.on('block', (block) => { + await wsProvider.on('block', (block) => { if (block >= currentBlock) { newBlock = block; } @@ -355,7 +355,6 @@ describe('web3 API compatibility tests', () => { // ...though the gap should not be *too* big. expect(newBlock).toBeLessThan(currentBlock + 100); await tx.wait(); // To not leave a hanging promise. - wsProvider.removeAllListeners(); await wsProvider.destroy(); }); @@ -368,7 +367,7 @@ describe('web3 API compatibility tests', () => { let newTxHash: string | null = null; // We can't use `once` as there may be other pending txs sent together with our one. - wsProvider.on('pending', async (txHash) => { + await wsProvider.on('pending', async (txHash) => { const tx = await alice.provider.getTransaction(txHash); // We're waiting for the exact transaction to appear. if (!tx || tx.to != uniqueRecipient) { @@ -392,7 +391,6 @@ describe('web3 API compatibility tests', () => { expect(newTxHash as string).toEqual(tx.hash); await tx.wait(); // To not leave a hanging promise. - wsProvider.removeAllListeners(); await wsProvider.destroy(); }); @@ -404,7 +402,7 @@ describe('web3 API compatibility tests', () => { // We're sending a few transfers from the wallet, so we'll use a new account to make event unique. let uniqueRecipient = testMaster.newEmptyAccount().address; - // Setup a filter for an ERC20 transfer. + // Set up a filter for an ERC20 transfer. const erc20TransferTopic = ethers.id('Transfer(address,address,uint256)'); let filter = { address: l2Token, @@ -414,15 +412,15 @@ describe('web3 API compatibility tests', () => { ethers.zeroPadValue(uniqueRecipient, 32) // Recipient ] }; - wsProvider.once(filter, (event) => { + await wsProvider.once(filter, (event) => { newEvent = event; }); - // Setup a filter that should not match anything. + // Set up a filter that should not match anything. let incorrectFilter = { address: alice.address }; - wsProvider.once(incorrectFilter, (_) => { + await wsProvider.once(incorrectFilter, (_) => { expect(null).fail('Found log for incorrect filter'); }); @@ -439,7 +437,6 @@ describe('web3 API compatibility tests', () => { expect((newEvent as any).transactionHash).toEqual(tx.hash); await tx.wait(); // To not leave a hanging promise. - wsProvider.removeAllListeners(); await wsProvider.destroy(); }); @@ -608,7 +605,7 @@ describe('web3 API compatibility tests', () => { // Pubsub notify is not reactive and may be laggy, so we want to increase the chances // for test to pass. So we try to sleep a few iterations until we receive expected amount - // of events. If we won't receive them, we continue and the test will fail anyway. + // of events. If we don't receive them, we continue and the test will fail anyway. const expectedTrivialEventsCount = 2; const expectedSimpleEventsCount = 2; const expectedIndexedEventsCount = 1; @@ -681,42 +678,9 @@ describe('web3 API compatibility tests', () => { ).resolves.toHaveProperty('result', expect.stringMatching(HEX_VALUE_REGEX)); }); - test('Should check API returns error when there are too many logs in eth_getLogs', async () => { - const contract = await deployContract(alice, contracts.events, []); - const maxLogsLimit = testMaster.environment().maxLogsLimit; - - // Send 3 transactions that emit `maxLogsLimit / 2` events. - const tx1 = await contract.emitManyEvents(maxLogsLimit / 2); - const tx1Receipt = await tx1.wait(); - - const tx2 = await contract.emitManyEvents(maxLogsLimit / 2); - await tx2.wait(); - - const tx3 = await contract.emitManyEvents(maxLogsLimit / 2); - const tx3Receipt = await tx3.wait(); - - // There are around `0.5 * maxLogsLimit` logs in [tx1Receipt.blockNumber, tx1Receipt.blockNumber] range, - // so query with such filter should succeed. - await expect( - alice.provider.getLogs({ - fromBlock: tx1Receipt.blockNumber, - toBlock: tx1Receipt.blockNumber - }) - ).resolves; - - // There are at least `1.5 * maxLogsLimit` logs in [tx1Receipt.blockNumber, tx3Receipt.blockNumber] range, - // so query with such filter should fail. - await expect( - alice.provider.getLogs({ - fromBlock: tx1Receipt.blockNumber, - toBlock: tx3Receipt.blockNumber - }) - ).rejects.toThrow(`Query returned more than ${maxLogsLimit} results.`); - }); - test('Should throw error for estimate gas for account with balance < tx.value', async () => { let poorBob = testMaster.newEmptyAccount(); - expect( + await expect( poorBob.estimateGas({ value: 1, to: alice.address }) ).toBeRejected(/*'insufficient balance for transfer'*/); }); @@ -860,7 +824,7 @@ describe('web3 API compatibility tests', () => { const getLogsByHash = (await alice.provider.getLogs({ blockHash: latestBlock.hash || undefined })).map((x) => { return new zksync.types.Log({ ...x, l1BatchNumber: 0 }, alice.provider); // Set bogus value. }); - await expect(getLogsByNumber).toEqual(getLogsByHash); + expect(getLogsByNumber).toEqual(getLogsByHash); // Check that incorrect queries are rejected. await expect( @@ -1030,7 +994,7 @@ describe('web3 API compatibility tests', () => { const incrementFunctionData = contract2.interface.encodeFunctionData('increment', [1]); // Assert that the estimation fails because the increment function is not present in contract1 - expect( + await expect( alice.provider.estimateGas({ to: contract1Address.toString(), data: incrementFunctionData diff --git a/core/tests/upgrade-test/tests/upgrade.test.ts b/core/tests/upgrade-test/tests/upgrade.test.ts index ffa28e4f109..2e223b9d744 100644 --- a/core/tests/upgrade-test/tests/upgrade.test.ts +++ b/core/tests/upgrade-test/tests/upgrade.test.ts @@ -89,25 +89,29 @@ describe('Upgrade test', function () { alice = tester.emptyWallet(); if (fileConfig.loadFromFile) { - let walletConfig = loadConfig({ pathToHome, chain: fileConfig.chain, config: 'wallets.yaml' }); + const chainWalletConfig = loadConfig({ pathToHome, chain: fileConfig.chain, config: 'wallets.yaml' }); - adminGovWallet = new ethers.Wallet(walletConfig.governor.private_key, alice._providerL1()); + adminGovWallet = new ethers.Wallet(chainWalletConfig.governor.private_key, alice._providerL1()); - walletConfig = loadConfig({ + const ecosystemWalletConfig = loadConfig({ pathToHome, chain: fileConfig.chain, configsFolder: '../../configs/', config: 'wallets.yaml' }); - ecosystemGovWallet = new ethers.Wallet(walletConfig.governor.private_key, alice._providerL1()); + if (ecosystemWalletConfig.governor.private_key == chainWalletConfig.governor.private_key) { + ecosystemGovWallet = adminGovWallet; + } else { + ecosystemGovWallet = new ethers.Wallet(ecosystemWalletConfig.governor.private_key, alice._providerL1()); + } } else { let govMnemonic = ethers.Mnemonic.fromPhrase( require('../../../../etc/test_config/constant/eth.json').mnemonic ); let govWalletHD = ethers.HDNodeWallet.fromMnemonic(govMnemonic, "m/44'/60'/0'/0/1"); adminGovWallet = new ethers.Wallet(govWalletHD.privateKey, alice._providerL1()); - ecosystemGovWallet = new ethers.Wallet(govWalletHD.privateKey, alice._providerL1()); + ecosystemGovWallet = adminGovWallet; } logs = fs.createWriteStream('upgrade.log', { flags: 'a' }); @@ -280,9 +284,11 @@ describe('Upgrade test', function () { ); executeOperation = chainUpgradeCalldata; + console.log('Sending scheduleTransparentOperation'); await sendGovernanceOperation(stmUpgradeData.scheduleTransparentOperation); + console.log('Sending executeOperation'); await sendGovernanceOperation(stmUpgradeData.executeOperation); - + console.log('Sending chain admin operation'); await sendChainAdminOperation(setTimestampCalldata); // Wait for server to process L1 event. @@ -371,23 +377,25 @@ describe('Upgrade test', function () { }); async function sendGovernanceOperation(data: string) { - await ( - await ecosystemGovWallet.sendTransaction({ - to: await governanceContract.getAddress(), - data: data, - type: 0 - }) - ).wait(); + const transaction = await ecosystemGovWallet.sendTransaction({ + to: await governanceContract.getAddress(), + data: data, + type: 0 + }); + console.log(`Sent governance operation, tx_hash=${transaction.hash}, nonce=${transaction.nonce}`); + await transaction.wait(); + console.log(`Governance operation succeeded, tx_hash=${transaction.hash}`); } async function sendChainAdminOperation(data: string) { - await ( - await adminGovWallet.sendTransaction({ - to: await chainAdminContract.getAddress(), - data: data, - type: 0 - }) - ).wait(); + const transaction = await adminGovWallet.sendTransaction({ + to: await chainAdminContract.getAddress(), + data: data, + type: 0 + }); + console.log(`Sent chain admin operation, tx_hash=${transaction.hash}, nonce=${transaction.nonce}`); + await transaction.wait(); + console.log(`Chain admin operation succeeded, tx_hash=${transaction.hash}`); } }); diff --git a/deny.toml b/deny.toml index b840ec5176e..c2775fc057c 100644 --- a/deny.toml +++ b/deny.toml @@ -8,8 +8,6 @@ feature-depth = 1 [advisories] ignore = [ - "RUSTSEC-2023-0045", # memoffset vulnerability, dependency coming from bellman_ce - "RUSTSEC-2022-0041", # crossbeam-utils vulnerability, dependency coming from bellman_ce "RUSTSEC-2024-0320", # yaml_rust dependency being unmaintained, dependency in core, we should consider moving to yaml_rust2 fork "RUSTSEC-2020-0168", # mach dependency being unmaintained, dependency in consensus, we should consider moving to mach2 fork "RUSTSEC-2024-0370", # `cs_derive` needs to be updated to not rely on `proc-macro-error` @@ -31,6 +29,8 @@ allow = [ "BSD-3-Clause", "Zlib", "OpenSSL", + "Apache-2.0 WITH LLVM-exception", + "0BSD", ] confidence-threshold = 0.8 diff --git a/docker-compose-cpu-runner.yml b/docker-compose-cpu-runner.yml index 08d01390d77..e0f751130eb 100644 --- a/docker-compose-cpu-runner.yml +++ b/docker-compose-cpu-runner.yml @@ -2,7 +2,7 @@ version: '3.2' services: reth: restart: always - image: "ghcr.io/paradigmxyz/reth:v0.2.0-beta.2" + image: "ghcr.io/paradigmxyz/reth:v1.0.6" volumes: - type: bind source: ./volumes/reth/data @@ -11,7 +11,7 @@ services: source: ./etc/reth/chaindata target: /chaindata - command: node --dev --datadir /rethdata --http --http.addr 0.0.0.0 --http.port 8545 --http.corsdomain "*" --dev.block-time 300ms --chain /chaindata/reth_config + command: node --dev --datadir /rethdata --http --http.addr 0.0.0.0 --http.port 8545 --http.corsdomain "*" --dev.block-time 600ms --chain /chaindata/reth_config ports: - 127.0.0.1:8545:8545 diff --git a/docker-compose-gpu-runner-cuda-12-0.yml b/docker-compose-gpu-runner-cuda-12-0.yml index 92a7b0b0088..f2089446a41 100644 --- a/docker-compose-gpu-runner-cuda-12-0.yml +++ b/docker-compose-gpu-runner-cuda-12-0.yml @@ -2,7 +2,7 @@ version: '3.2' services: reth: restart: always - image: "ghcr.io/paradigmxyz/reth:v0.2.0-beta.2" + image: "ghcr.io/paradigmxyz/reth:v1.0.6" volumes: - type: bind source: ./volumes/reth/data @@ -11,7 +11,7 @@ services: source: ./etc/reth/chaindata target: /chaindata - command: node --dev --datadir /rethdata --http --http.addr 0.0.0.0 --http.port 8545 --http.corsdomain "*" --dev.block-time 300ms --chain /chaindata/reth_config + command: node --dev --datadir /rethdata --http --http.addr 0.0.0.0 --http.port 8545 --http.corsdomain "*" --dev.block-time 600ms --chain /chaindata/reth_config ports: - 127.0.0.1:8545:8545 diff --git a/docker-compose-gpu-runner.yml b/docker-compose-gpu-runner.yml index bbd61715842..35c6c3778f2 100644 --- a/docker-compose-gpu-runner.yml +++ b/docker-compose-gpu-runner.yml @@ -2,7 +2,7 @@ version: '3.2' services: reth: restart: always - image: "ghcr.io/paradigmxyz/reth:v0.2.0-beta.2" + image: "ghcr.io/paradigmxyz/reth:v1.0.6" volumes: - type: bind source: ./volumes/reth/data @@ -11,7 +11,7 @@ services: source: ./etc/reth/chaindata target: /chaindata - command: node --dev --datadir /rethdata --http --http.addr 0.0.0.0 --http.port 8545 --http.corsdomain "*" --dev.block-time 300ms --chain /chaindata/reth_config + command: node --dev --datadir /rethdata --http --http.addr 0.0.0.0 --http.port 8545 --http.corsdomain "*" --dev.block-time 600ms --chain /chaindata/reth_config ports: - 127.0.0.1:8545:8545 diff --git a/docker-compose.yml b/docker-compose.yml index 7751c99d68a..7e1b52f8334 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -2,7 +2,7 @@ version: '3.2' services: reth: restart: always - image: "ghcr.io/paradigmxyz/reth:v0.2.0-beta.2" + image: "ghcr.io/paradigmxyz/reth:v1.0.6" ports: - 127.0.0.1:8545:8545 volumes: @@ -13,7 +13,7 @@ services: source: ./etc/reth/chaindata target: /chaindata - command: node --dev --datadir /rethdata --http --http.addr 0.0.0.0 --http.port 8545 --http.corsdomain "*" --dev.block-time 300ms --chain /chaindata/reth_config + command: node --dev --datadir /rethdata --http --http.addr 0.0.0.0 --http.port 8545 --http.corsdomain "*" --dev.block-time 600ms --chain /chaindata/reth_config postgres: diff --git a/docker/proof-fri-gpu-compressor/Dockerfile b/docker/proof-fri-gpu-compressor/Dockerfile index a3d92d113cd..45f2ffa51b0 100644 --- a/docker/proof-fri-gpu-compressor/Dockerfile +++ b/docker/proof-fri-gpu-compressor/Dockerfile @@ -4,8 +4,7 @@ FROM nvidia/cuda:12.2.0-devel-ubuntu22.04 as builder ARG DEBIAN_FRONTEND=noninteractive ARG CUDA_ARCH=89 -ARG A100_CUDA_ARCH=80 -ENV CUDAARCHS=${CUDA_ARCH};${A100_CUDA_ARCH} +ENV CUDAARCHS=${CUDA_ARCH} RUN apt-get update && apt-get install -y curl clang openssl libssl-dev gcc g++ git \ pkg-config build-essential libclang-dev && \ diff --git a/docker/zk-environment/Dockerfile b/docker/zk-environment/Dockerfile index 375384bf7fc..53e53265311 100644 --- a/docker/zk-environment/Dockerfile +++ b/docker/zk-environment/Dockerfile @@ -25,10 +25,34 @@ RUN git submodule update --init --recursive # Build Solidity WORKDIR /solidity/build -RUN cmake .. -RUN make +# The default compilation is Release with Debug symbols, which is quite large. +RUN cmake .. -DCMAKE_BUILD_TYPE="Release" +RUN make -j -FROM debian:bookworm as rust-lightweight +# Rust binaries - with a separate builder. +FROM rust:slim-bookworm as rust-builder + +ARG ARCH=amd64 +RUN apt-get update && apt-get install -y \ + libssl-dev \ + pkg-config \ + libclang-15-dev \ + g++ \ + cmake \ + git + +RUN cargo install --version=0.8.0 sqlx-cli +RUN cargo install cargo-nextest +RUN cargo install cargo-spellcheck +RUN cargo install sccache + +RUN git clone https://github.com/matter-labs/foundry-zksync +RUN cd foundry-zksync && cargo build --release --bins +RUN mv ./foundry-zksync/target/release/forge /usr/local/cargo/bin/ +RUN mv ./foundry-zksync/target/release/cast /usr/local/cargo/bin/ + +# Main builder. +FROM debian:bookworm as rust-lightweight-base ARG ARCH=amd64 @@ -69,7 +93,7 @@ RUN apt-get update && \ lldb-15 \ lld-15 \ liburing-dev \ - libclang-dev + libclang-15-dev # Install Docker RUN apt-get update && \ @@ -97,27 +121,28 @@ ENV RUSTUP_HOME=/usr/local/rustup \ PATH=/usr/local/cargo/bin:$PATH # Install gloud for GCR/GAR login +# Google was super lazy, and their package is around 1 GB. +# So we trim it a little bit based on info from `https://github.com/GoogleCloudPlatform/gsutil/issues/1732` ENV GCLOUD_VERSION=451.0.1 RUN echo "deb [arch=${ARCH}] http://packages.cloud.google.com/apt cloud-sdk main" > /etc/apt/sources.list.d/google-cloud-sdk.list && \ wget -c -O - https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add - && \ apt-get update -y && apt-get install google-cloud-cli=${GCLOUD_VERSION}-0 --no-install-recommends -y && \ gcloud config set core/disable_usage_reporting true && \ gcloud config set component_manager/disable_update_check true && \ - gcloud config set metrics/environment github_docker_image - -RUN wget -c -O - https://sh.rustup.rs | bash -s -- -y && \ - rustup default stable - -RUN cargo install --version=0.8.0 sqlx-cli -RUN cargo install cargo-nextest - -# Installing foundry-zksync from git is failing, we will build it from sources -# Install foundry -RUN git clone https://github.com/matter-labs/foundry-zksync -RUN cd foundry-zksync && cargo build --release --bins -RUN mv ./foundry-zksync/target/release/forge /usr/local/bin/ -RUN mv ./foundry-zksync/target/release/cast /usr/local/bin/ - + gcloud config set metrics/environment github_docker_image && \ + rm -rf $(find /usr/lib/google-cloud-sdk/ -regex ".*/__pycache__") && \ + rm -rf /usr/lib/google-cloud-sdk/bin/anthoscli && \ + rm -rf /usr/lib/google-cloud-sdk/platform/bundledpythonunix && \ + rm -rf /usr/lib/google-cloud-sdk/data/gcloud.json + +COPY --from=rust-builder /usr/local/cargo/bin/sqlx \ + /usr/local/cargo/bin/cargo-sqlx \ + /usr/local/cargo/bin/cargo-nextest \ + /usr/local/cargo/bin/cargo-spellcheck \ + /usr/local/cargo/bin/sccache \ + /usr/local/cargo/bin/forge \ + /usr/local/cargo/bin/cast /usr/local/cargo/bin/ + # Copy compiler (both solc and zksolc) binaries # Obtain `solc` 0.8.20. COPY --from=solidity-builder /solidity/build/solc/solc /usr/bin/ @@ -133,7 +158,7 @@ RUN apt-get remove valgrind -y # We need valgrind 3.20, which is unavailable in repos or ppa, so we will build it from source RUN wget -c https://sourceware.org/pub/valgrind/valgrind-3.20.0.tar.bz2 && \ tar -xf valgrind-3.20.0.tar.bz2 && \ - cd valgrind-3.20.0 && ./configure && make && make install && \ + cd valgrind-3.20.0 && ./configure && make -j && make install && \ cd ../ && rm -rf valgrind-3.20.0.tar.bz2 && rm -rf valgrind-3.20.0 @@ -141,10 +166,13 @@ RUN wget -c https://sourceware.org/pub/valgrind/valgrind-3.20.0.tar.bz2 && \ ENV ZKSYNC_HOME=/usr/src/zksync ENV PATH="${ZKSYNC_HOME}/bin:${PATH}" ENV CI=1 -RUN cargo install sccache ENV RUSTC_WRAPPER=/usr/local/cargo/bin/sccache -FROM rust-lightweight as rust-lightweight-nightly +# If target is 'main' - then install default rust. +FROM rust-lightweight-base as rust-lightweight +RUN wget -c -O - https://sh.rustup.rs | bash -s -- -y + -RUN rustup install nightly-2024-08-01 && \ - rustup default nightly-2024-08-01 +# If target is nightly - then install only nightly rust. +FROM rust-lightweight-base as rust-lightweight-nightly +RUN wget -c -O - https://sh.rustup.rs | bash -s -- -y --default-toolchain nightly-2024-08-01 \ No newline at end of file diff --git a/etc/env/base/eigen_da_client.toml b/etc/env/base/eigen_da_client.toml new file mode 100644 index 00000000000..6af1caf943d --- /dev/null +++ b/etc/env/base/eigen_da_client.toml @@ -0,0 +1,2 @@ +[eigen_da_client] +api_node_url="http://localhost:3100" diff --git a/etc/nix/container-tee_prover.nix b/etc/nix/container-tee_prover.nix index 7c0d8d164e3..cb8ebfb5154 100644 --- a/etc/nix/container-tee_prover.nix +++ b/etc/nix/container-tee_prover.nix @@ -33,9 +33,9 @@ nixsgxLib.mkSGXContainer { env = { TEE_PROVER_API_URL.passthrough = true; TEE_PROVER_MAX_RETRIES.passthrough = true; - TEE_PROVER_INITIAL_RETRY_BACKOFF_SECONDS.passthrough = true; + TEE_PROVER_INITIAL_RETRY_BACKOFF_SEC.passthrough = true; TEE_PROVER_RETRY_BACKOFF_MULTIPLIER.passthrough = true; - TEE_PROVER_MAX_BACKOFF_SECONDS.passthrough = true; + TEE_PROVER_MAX_BACKOFF_SEC.passthrough = true; API_PROMETHEUS_LISTENER_PORT.passthrough = true; API_PROMETHEUS_PUSHGATEWAY_URL.passthrough = true; API_PROMETHEUS_PUSH_INTERVAL_MS.passthrough = true; diff --git a/etc/selector-generator-data/README.md b/etc/selector-generator-data/README.md new file mode 100644 index 00000000000..ddba2769e4f --- /dev/null +++ b/etc/selector-generator-data/README.md @@ -0,0 +1,3 @@ +# List of selectors from our contracts + +To regenerate the list, please use the selector_generator tool from core/bin directory. diff --git a/etc/selector-generator-data/selectors.json b/etc/selector-generator-data/selectors.json new file mode 100644 index 00000000000..6ea986e4263 --- /dev/null +++ b/etc/selector-generator-data/selectors.json @@ -0,0 +1,518 @@ +{ + "d0f2c663": "getBatchNumberAndTimestamp", + "2a79c611": "getCommitment", + "8129fc1c": "initialize", + "e2a9d554": "setUpgradeTimestamp", + "84c2ff75": "stmAssetId", + "7ac3a553": "withdrawLegacyBridge", + "e91659ae": "addNewChainIfNeeded", + "06d49e5b": "getPubdataPricingMode", + "1ff5a783": "execute", + "8310f2c6": "transferFundsFromSharedBridge", + "80b41246": "getBlockHashEVM", + "7da01cd6": "executeUpgrade", + "74044673": "addStateTransitionManager", + "82b57749": "forwardedBridgeMint", + "6478d8ed": "chainAdmin", + "4af63f02": "deploy", + "d0707b67": "aggregate", + "e0ab6368": "assetIdIsRegistered", + "27e86d6e": "getLastBlockHash", + "13bc9f20": "isOperationReady", + "4a2e35ba": "withdraw", + "1e4fba05": "getChainRoot", + "762008c2": "executeBatchesSharedBridge", + "155fd27a": "setValueUnderNonce", + "a6ae0aac": "coinbase", + "86d516e8": "getCurrentBlockGasLimit", + "3659cfe6": "upgradeTo", + "fa8f7ea6": "getAllHyperchains", + "7b510fe8": "getAccountInfo", + "40c10f19": "mint", + "e02e1bfd": "chainCount", + "015f58d7": "genesisUpgrade", + "28e439f3": "tryBlockAndAggregate", + "e76db865": "setPubdataPricingMode", + "62f84b24": "sendToL1", + "1c9f0149": "updateChainBalancesFromSharedBridge", + "38720778": "sharedBridge", + "64e130cf": "nativeTokenVault", + "adfca15e": "facetFunctionSelectors", + "af500fb7": "readBytes32", + "7b315630": "upgradeChainFromVersion", + "b6ea1757": "pushNewLeaf", + "e66c8c44": "validatorTimelock", + "4f1ef286": "upgradeToAndCall", + "fe26699e": "getTotalBlocksCommitted", + "805b9869": "executeTransactionFromOutside", + "aa4593dc": "revertReceive", + "64b554ad": "forwardedBridgeBurn", + "ba238947": "getProtocolVersion", + "07f8c636": "multicall", + "39607382": "getTotalBlocksExecuted", + "796b89b9": "getBlockTimestamp", + "9cd939e4": "l2LogsRootHash", + "b298e36b": "push", + "7890e5da": "side", + "5e1ac65f": "hashOperation", + "1806aa18": "getCodeSize", + "d4a4ca0d": "getBlockNumberAndTimestamp", + "06bed036": "setL2Block", + "aa970773": "validateAndPayForPaymasterTransaction", + "6223258e": "setDAValidatorPair", + "728cb93b": "bridgeClaimFailedBurn", + "d6abe642": "getAssetId", + "d2ef1b0e": "storedBatchZero", + "51b3c157": "hyperbridgingEnabled", + "53e61bdc": "processL2RollupDAValidatorOutputHash", + "95d89b41": "symbol", + "a37dc1d4": "forwardedBridgeClaimFailedBurn", + "db1f0bf9": "getTotalBatchesCommitted", + "beda594a": "setHyperchain", + "3977d71c": "getAggregatedRoot", + "c4d252f5": "cancel", + "2878fe74": "genesisUpgrade", + "2ab0f529": "isOperationDone", + "5d4edca7": "BRIDGE_HUB", + "d4b9f4fa": "messageRoot", + "fb1a9a57": "getDeploymentNonce", + "bb0fd610": "extendedAccountVersion", + "3cda3351": "create2", + "3a9d7f8d": "stmDeployer", + "db541184": "setShouldRevertOnExecuteBatches", + "74f4f547": "bridgeBurn", + "b852ad36": "l1SharedBridge", + "6ef25c3a": "baseFee", + "eb39e6d5": "stateTransitionManager", + "381c3f13": "checkDA", + "f92ad219": "initialize", + "9fa8826b": "depositHappened", + "01d23d4b": "diamondCut", + "55d35d18": "getValueUnderNonce", + "ee7fb38b": "calculateRoot", + "64d62353": "updateDelay", + "fd3c6b55": "processCalldataDA", + "39b34c6e": "requestBytecodeL1Publication", + "71623274": "l2TransactionBaseCost", + "53b9e632": "assetHandlerAddress", + "c987336c": "upgrade", + "5c975abb": "paused", + "4623c91d": "setValidator", + "4f1e1be0": "storeAccountConstructingCodeHash", + "b0f40a17": "processBatch", + "2c4f2a58": "bridgehubDepositBaseToken", + "ced531eb": "setHashes", + "18160ddd": "totalSupply", + "7cb9357e": "gasPerPubdataByte", + "7877a797": "blockGasLimit", + "cdc4878b": "nodeCount", + "c2eeeebd": "l1Address", + "0f23da43": "revertBatchesSharedBridge", + "e1239cd8": "incrementMinNonceIfEquals", + "8456cb59": "pause", + "9a42c2c2": "zeroPointerTest", + "f9f3ee2d": "setResult", + "7ba8be34": "decodeUint8", + "a635f01d": "delegateCall", + "2f90b184": "L1_CHAIN_ID", + "6c0960f9": "finalizeEthWithdrawal", + "31d50750": "isOperation", + "59ec65a2": "baseToken", + "a9b0d128": "setPriorityTreeStartIndex", + "c4879440": "bridgehubDepositBaseToken", + "823f1d96": "l2TokenProxyBytecodeHash", + "18876a04": "chunkPubdataToBlobs", + "699b0fb9": "bridgeBurn", + "17338945": "unfreezeDiamond", + "8a75bb09": "saveL2LogsRootHash", + "91b19874": "validators", + "63dc94b1": "forceDeploy", + "5a590335": "getDAValidatorPair", + "60144197": "setTokenMultiplierSetter", + "938b5f32": "origin", + "36ba0355": "bridgeMint", + "6dde7209": "l2TokenBeacon", + "bf54096e": "MAX_NUMBER_OF_HYPERCHAINS", + "7e44bc5e": "setImmutables", + "8e8acf87": "getL2BlockNumberAndTimestamp", + "e30c3978": "pendingOwner", + "f5e69a47": "publishCompressedBytecode", + "84da1fb4": "getNewAddressCreate2", + "47fcedb8": "setFeeParams", + "b22dd78e": "storedBatchHash", + "57e6246b": "initialCutHash", + "2b805192": "setNewVersionUpgrade", + "dbfe3e96": "updateSecurityCouncil", + "e03fe177": "getCodeHash", + "02fa5779": "setNewBatch", + "a225efcb": "setPubdataInfo", + "9cc395d0": "bridgeCheckCounterpartAddress", + "868085b1": "getBatchProofPublicInput", + "6a0cd1f5": "removeValidator", + "2ae9c600": "protocolVersion", + "61f91b2e": "initialForceDeploymentHash", + "72425d9d": "getCurrentBlockDifficulty", + "8c2a993e": "bridgeMint", + "b473318e": "l2TransactionBaseCost", + "f851a440": "admin", + "681fe70c": "isEmpty", + "ef3f0bae": "getTotalBatchesVerified", + "ba75bbd8": "front", + "cdffacc6": "facetAddress", + "89f9a072": "validatePubdata", + "66869d49": "changeFeeParams", + "e8b99b1b": "deposit", + "4d4a1eca": "setTokenMultiplier", + "a0803ef7": "currentBlockInfo", + "fb4baf17": "changeFeeParams", + "3591c1a0": "getBridgehub", + "fd791f3c": "getL2DefaultAccountBytecodeHash", + "ec8067c7": "updateNonceOrdering", + "a3912ec8": "receiveEther", + "79823c9a": "getFirstUnprocessedPriorityTx", + "235d9eb5": "setTokenMultiplier", + "dd354a06": "calculateCreate2TokenAddress", + "7efda2ae": "proveL2LeafInclusion", + "f120e6c4": "encodeTxDataHash", + "f5f15168": "l2TokenAddress", + "4d2301cc": "getEthBalance", + "ab07b2e9": "getL2GasPrice", + "363bf964": "setAddresses", + "607457f2": "setShouldRevertOnCommitBatches", + "d1ba7e97": "hyperchainAddress", + "841a9d42": "aggregate3Value", + "ea6c029c": "baseTokenGasPriceMultiplierNominator", + "de8fa431": "getSize", + "24a55db9": "markBytecodeAsPublished", + "c438a9f2": "L2_LEGACY_SHARED_BRIDGE", + "ddeaa8e6": "getBatchHash", + "8f31f052": "isWithdrawalFinalized", + "41cf49bb": "prepareChainCommitment", + "5d382700": "create2Account", + "6d9860e1": "l1AssetRouter", + "e1ad1162": "transfer", + "bf1fe420": "setGasPrice", + "a1954fc5": "getTotalPriorityTxs", + "c0a16dda": "setAssetDeploymentTracker", + "4145ca27": "removePriorityQueueFront", + "09e14277": "setStateTransitionManager", + "1f067457": "revertTransfer", + "b8c2f66f": "getTotalBatchesExecuted", + "07ee9355": "l2BridgeAddress", + "095ea7b3": "approve", + "84b0196e": "eip712Domain", + "18b1771f": "getAssetId", + "f85894c5": "forwardedBridgeBurn", + "bd7c5412": "isEthWithdrawalFinalized", + "70a08231": "balanceOf", + "3425eb89": "tokenMultiplierSetter", + "5aa9b6b5": "getRawNonce", + "7ab08472": "finalizeWithdrawalLegacyErc20Bridge", + "205c2878": "withdrawTo", + "ec3d5f88": "setPriorityTxMaxGasLimit", + "8eb7db57": "bridgehubConfirmL2Transaction", + "2a72b707": "bridgehubRequestL2Transaction", + "0f3fa211": "setNativeTokenVault", + "4bed8212": "isWithdrawalFinalized", + "0c56efe9": "initializeV2", + "501e60d5": "setUpgradeDiamondCut", + "c29f093f": "setSTM", + "f2fde38b": "transferOwnership", + "8c5a3445": "general", + "ca8f93f1": "setLegacyBaseTokenAssetId", + "71abd109": "upgrade", + "eced0bf0": "__DEPRECATED_tokenIsRegistered", + "dc8e4b26": "registerSettlementLayer", + "310ab089": "getImmutable", + "19cae462": "difficulty", + "77421056": "setFunctionToCall", + "3997d064": "tryAggregate", + "f1d357e5": "L1_SHARED_BRIDGE", + "952a3ee7": "getERC20Getters", + "29b98c67": "isDiamondStorageFrozen", + "17d7de7c": "getName", + "e81e0ba1": "isFunctionFreezable", + "7ebba672": "setTokenMultiplier", + "6ee1dc20": "validateNonceUsage", + "6a27e8b5": "getSettlementLayer", + "7a28adb2": "proveL2LogInclusion", + "671a7131": "settlementLayer", + "accdd16c": "freezeChain", + "c3bbd2d7": "isFacetFreezable", + "99a88ec4": "upgrade", + "95f11a40": "bridgeInitialize", + "c9f5c932": "requestL2TransactionTwoBridges", + "f1a78aa6": "postTransaction", + "ca65fe79": "finalizeDeposit", + "5518c73b": "getStateTransitionManager", + "b5b18fe5": "processL2Logs", + "969b53da": "l1Bridge", + "e8a71ca9": "forwardedBridgeMint", + "505e6d47": "updateAllLeaves", + "ecf95b8a": "createAccount", + "84d9fedd": "popFront", + "3f4ba83a": "unpause", + "1f98fa08": "createNewChain", + "313ce567": "decimals", + "3ce695e7": "registerSTMAssetOnL1", + "73c58a2d": "publishBlobs", + "f0e9da23": "readAddress", + "e23d2563": "getEraChainId", + "0ec6b0b7": "getPriorityTxMaxGasLimit", + "fdbb0301": "__DEPRECATED_l2BridgeAddress", + "52d1902d": "proxiableUUID", + "97bb3ce9": "tokenAddress", + "5d83b6da": "__DEPRECATED_baseToken", + "966c523e": "blockAndAggregate", + "f4943a20": "protocolVersionDeadline", + "46746c7d": "commitBatchesSharedBridge", + "87d9d023": "verify", + "57f3921f": "stmAssetIdToAddress", + "e516761e": "markFactoryDeps", + "daa51a8c": "pushBack", + "2e1a7d4d": "withdraw", + "af6ed122": "executeUpgrade", + "a6f2c076": "setDataToBeReturnedInFinalizeWithdrawal", + "01eae183": "depositAmount", + "9e8945d2": "verificationKeyHash", + "a3bd0112": "genesisUpgrade", + "927c4bf7": "upgradeExternal", + "56079ac8": "sendL2ToL1Log", + "d92f86a2": "setLegacyChainAddress", + "be6f11cf": "setPriorityTxMaxGasLimit", + "7321c485": "dummySetValidator", + "c0991525": "claimFailedDeposit", + "72d74cd7": "reinitializeToken", + "ab93d6f3": "requestL2TransactionToGatewayMailbox", + "3601e63e": "bridgeRecoverFailedTransfer", + "eb672419": "requestL2Transaction", + "af6a2dcd": "getTotalBlocksVerified", + "27eb6c0f": "securityCouncil", + "4c6314f0": "getMarker", + "49a7cc72": "payForTransaction", + "f20265d2": "setRevertTransfer", + "84bc3eb0": "withdrawWithMessage", + "79c4f929": "markBytecodeAsPublished", + "580d6bff": "updateAllNodesAtHeight", + "e5355c75": "getL2SystemContractsUpgradeBatchNumber", + "ca408c23": "bridgehubDeposit", + "6ab8f82e": "proveL2LogInclusion", + "7528c2c6": "applyL1ToL2Alias", + "59890bcb": "setExecutedBatches", + "b19f0ade": "executeUpgradeNoOverlap", + "15f9a2fe": "prepareForPaymaster", + "6e9d7899": "legacyBridge", + "ef0e2ff4": "setChainId", + "e52db4ca": "baseTokenAssetId", + "0f28c97d": "getCurrentBlockTimestamp", + "d0e30db0": "deposit", + "9623609d": "upgradeAndCall", + "5ca1e165": "getRoot", + "fe173b97": "gasPrice", + "a851ae78": "setTxOrigin", + "18717dc1": "setPorterAvailability", + "cbcf2e3c": "isTransactionAllowed", + "c4d66de8": "initialize", + "7c9bd1f3": "publishTimestampDataToL1", + "69c76df2": "readUint32", + "a75b496d": "getAllHyperchainChainIDs", + "f5ba4232": "removeStateTransitionManager", + "42cbb15c": "getBlockNumber", + "607e2cb2": "setRevertReceive", + "328ef4fe": "setBaseTokenGasMultiplierPrice", + "1c50cfea": "addTokenAssetId", + "6d1d8363": "scheduleShadow", + "9cc7f708": "balanceOf", + "933999fb": "deposit", + "c2e047ff": "aggregate3", + "bb7044b6": "stateTransitionManagerIsRegistered", + "d4ce08c2": "addNewChain", + "f34d1868": "setExecutionDelay", + "9caf9bac": "setX", + "f113c88b": "createNewChain", + "1cc5d103": "setPorterAvailability", + "cdf25430": "L1_ASSET_ROUTER", + "def9d6af": "protocolVersionIsActive", + "c21a38e2": "proveL2MessageInclusion", + "e543e5bf": "setChainCreationParams", + "4be99e1d": "getCurrentPubdataCost", + "74f4d30d": "storedBlockHash", + "f8f7cd76": "validateTransaction", + "7a0ed627": "facets", + "38a78092": "increaseMinNonce", + "8cb7f3d0": "forceDeployOnAddresses", + "a2d5a0cc": "proveBatchesSharedBridge", + "301e7765": "getChainAdmin", + "fb644fc5": "addChainBatchRoot", + "6006d8b5": "verifyCompressedStateDiffs", + "39509351": "increaseAllowance", + "51cff8d9": "withdraw", + "8ffe1b81": "setBridgeHubAddress", + "95ce3e93": "decodeString", + "09824a80": "registerToken", + "d86970d8": "getL2BootloaderBytecodeHash", + "a31ee5b0": "initialize", + "0d4651aa": "storeAccountConstructedCodeHash", + "9a188371": "requestL2TransactionDirect", + "ed1d7d97": "chainIndexToId", + "c63c4e9b": "minDelay", + "546b6d2a": "SHARED_BRIDGE", + "187598a5": "getNewAddressCreate", + "bf529569": "setFreezability", + "cfe7af7c": "finalizeDeposit", + "bcf284e5": "executeTransaction", + "3437949a": "l1GenesisUpgrade", + "f54266a2": "l1TokenAddress", + "c9d1c097": "stmAssetIdFromChainId", + "39d7d4aa": "getPriorityTreeRoot", + "41c841c3": "L1_WETH_TOKEN", + "19fa7f62": "claimFailedDeposit", + "5c60da1b": "implementation", + "dd62ed3e": "allowance", + "9cd45184": "chainBalance", + "7958004c": "getOperationState", + "8cf2b2f0": "uncheckedInc", + "715018a6": "renounceOwnership", + "30bda03e": "setL1Erc20Bridge", + "c0d5b949": "getCurrentPubdataSpent", + "4de2e468": "getRawCodeHash", + "7ecebe00": "nonces", + "0e18b681": "acceptAdmin", + "d0468156": "getPendingAdmin", + "d83e4e03": "genesisUpgrade", + "49eb3b50": "getTransactionHashes", + "ebf0c717": "root", + "8da5cb5b": "owner", + "11a2ccc1": "finalizeWithdrawal", + "1dd93b33": "keccakValidationTest", + "f088ccdc": "callCodeOracle", + "aad74262": "setProtocolVersionDeadline", + "72c84445": "callKeccak", + "21f603d7": "setTransactionFilterer", + "52ef6b2c": "facetAddresses", + "9e6ea417": "depositLegacyErc20Bridge", + "960dcf24": "getBaseTokenAssetId", + "a888cc3a": "bridgehubRequestL2TransactionOnGateway", + "c7ca373c": "initFromCommitment", + "548a5a33": "setAssetHandlerAddressThisChain", + "402efc91": "stateTransitionManager", + "7b30c8da": "getL2SystemContractsUpgradeTxHash", + "0ef26743": "height", + "79ba5097": "acceptOwnership", + "584b153e": "isOperationPending", + "06fdde03": "name", + "e717bab7": "proveL1ToL2TransactionStatusViaGateway", + "a8b0574e": "getCurrentBlockCoinbase", + "30e5ccbd": "incrementTxNumberInBatch", + "ef011dff": "ERA_CHAIN_ID", + "f8c1f0d2": "upgradeChainFromVersion", + "f3b7dead": "getProxyAdmin", + "f26f3c8f": "proveL2MessageInclusion", + "3558c188": "executeBatches", + "bcd1b23d": "updateFullTree", + "3a3f36f9": "codeOracleTest", + "1de72e34": "baseTokenGasPriceMultiplierDenominator", + "81d100a3": "scheduleTransparent", + "85e4e16a": "assetDeploymentTracker", + "204e1c7a": "getProxyImplementation", + "d566afd3": "createBatchCommitment", + "70f5c679": "setMessageRoot", + "07168226": "deployBeaconProxy", + "7b574586": "publishedBlobCommitments", + "fcc73360": "updateLeaf", + "631f4bac": "getPriorityQueueSize", + "3e64a696": "getBasefee", + "facd743b": "isValidator", + "7fb67816": "setValidatorTimelock", + "ee82ac5e": "getBlockHash", + "6e9960c3": "getAdmin", + "98acd7a6": "getBaseToken", + "06e7517b": "appendTransactionToCurrentL2Block", + "b993549e": "getCommittedBatchTimestamp", + "23dc4a09": "keccakPerformUpgrade", + "cf347e17": "setValidator", + "3408e470": "getChainId", + "ae1f6aaf": "l2Bridge", + "c2e90293": "bridgeRecoverFailedTransfer", + "86b7f856": "publishPubdataAndClearState", + "b292f5f1": "proveL1ToL2TransactionStatus", + "7a592065": "calculateRoot", + "a5277a02": "initialize", + "ef939455": "keccakUpgradeTest", + "3644e515": "DOMAIN_SEPARATOR", + "306395c6": "incrementDeploymentNonce", + "b277f199": "uncheckedAdd", + "6fadcf72": "forward", + "ae65def1": "node", + "e0bf0850": "setShouldRevertOnProveBatches", + "a457c2d7": "decreaseAllowance", + "9f3f89dc": "getZero", + "4dd18bf5": "setPendingAdmin", + "33ce93fe": "getProtocolVersion", + "c87325f1": "finalizeWithdrawal", + "40a434d5": "transferTokenToNTV", + "e9420f8c": "whitelistedSettlementLayers", + "3f704d2a": "setAssetHandlerAddress", + "ede25608": "protocolVersionToUpgradeTimestamp", + "042901c7": "proveL1ToL2TransactionStatus", + "cab7e8eb": "isNonceUsed", + "5aa6fa1f": "NATIVE_TOKEN_VAULT", + "b8776d4d": "chainRegistered", + "8fbb3711": "claimFailedDepositLegacyErc20Bridge", + "8dd14802": "setBridge", + "b3160bad": "executeBatchesSharedBridge", + "f5c1182c": "getSemverProtocolVersion", + "8b257989": "executionDelay", + "588570a5": "initialize", + "4cd40a02": "setLegacyTokenAssetId", + "d124dc4f": "send", + "23b872dd": "transferFrom", + "086a56f8": "getBaseTokenBridge", + "689992b3": "undoL1ToL2Alias", + "03c5d8af": "forwardTransactionOnGateway", + "48ceb85e": "chainIndex", + "ba334825": "hyperchain", + "b1fde1a8": "sharedTree", + "7069d0c0": "executeInstant", + "c2aaf9c4": "receiveEth", + "2986c0e5": "index", + "b5872958": "timestamps", + "c2e4ff97": "markAccountCodeHashAsConstructed", + "9c4d535b": "create", + "923b3b56": "forceDeployOnAddress", + "3635f3e6": "resetTxNumberInBatch", + "19698bc9": "infiniteFunction", + "315fff4e": "THIS_ADDRESS", + "52c9eacb": "upgradeCutHash", + "18e3a941": "getVerifierParams", + "29f172ad": "unsafeOverrideBatch", + "4b561753": "addValidator", + "a9059cbb": "transfer", + "949431dc": "approvalBased", + "8f283970": "changeAdmin", + "85df51fd": "blockHash", + "dead6f7f": "getHyperchain", + "896909dc": "getMinNonce", + "7eff275e": "changeProxyAdmin", + "27ae4c16": "freezeDiamond", + "566338a9": "getL1TokenAddress", + "8ac84c0e": "txNumberInBlock", + "53ce2061": "revertBatches", + "9a8a0592": "chainId", + "f5407abe": "setValues", + "46657fe9": "getVerifier", + "484f0505": "getHyperchainLegacy", + "b760faf9": "depositTo", + "5de097b1": "nullifyChainBalanceByNTV", + "e8295588": "zeros", + "f90eb963": "getPorterAvailability", + "57180981": "updateAccountVersion", + "579952fc": "transferFromTo", + "d505accf": "permit", + "e02da327": "readUint256", + "51d218f7": "unfreezeChain", + "8466d8d1": "getBridgeHubAddress", + "b381724e": "setFeeParams", + "d9caed12": "withdraw", + "9d1b5a81": "getL2SystemContractsUpgradeBlockNumber" +} \ No newline at end of file diff --git a/etc/utils/src/file-configs.ts b/etc/utils/src/file-configs.ts index fad72901d15..374bf53f6be 100644 --- a/etc/utils/src/file-configs.ts +++ b/etc/utils/src/file-configs.ts @@ -2,18 +2,11 @@ import * as path from 'path'; import * as fs from 'fs'; import * as yaml from 'yaml'; -export function shouldLoadConfigFromFile() { +export type FileConfig = { loadFromFile: false; chain?: undefined } | { loadFromFile: true; chain: string }; + +export function shouldLoadConfigFromFile(): FileConfig { const chain = process.env.CHAIN_NAME; - if (chain) { - return { - loadFromFile: true, - chain - } as const; - } else { - return { - loadFromFile: false - } as const; - } + return chain ? { loadFromFile: true, chain } : { loadFromFile: false }; } export const configNames = [ diff --git a/etc/utils/src/logs.ts b/etc/utils/src/logs.ts index cdb26f5ad1b..7db54ef8600 100644 --- a/etc/utils/src/logs.ts +++ b/etc/utils/src/logs.ts @@ -1,7 +1,7 @@ import path from 'path'; import fs from 'node:fs/promises'; -const pathToHome = path.join(__dirname, '../../../..'); +const pathToHome = path.join(__dirname, '../../..'); export async function logsTestPath(chain: string | undefined, relativePath: string, name: string): Promise { chain = chain ? chain! : 'default'; diff --git a/prover/Cargo.lock b/prover/Cargo.lock index 24e8638876b..17f27737aa2 100644 --- a/prover/Cargo.lock +++ b/prover/Cargo.lock @@ -45,7 +45,7 @@ version = "0.8.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "once_cell", "version_check", "zerocopy", @@ -355,7 +355,7 @@ checksum = "17c6a35df3749d2e8bb1b7b21a976d82b15548788d2735b9d82f329268f71a11" dependencies = [ "addr2line", "cc", - "cfg-if 1.0.0", + "cfg-if", "libc", "miniz_oxide", "object", @@ -407,54 +407,6 @@ dependencies = [ "serde", ] -[[package]] -name = "bellman_ce" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ea340d5c1394ee4daf4415dd80e06f74e0ad9b08e21f73f6bb1fa3a9dfae80d" -dependencies = [ - "arrayvec 0.7.4", - "bit-vec", - "blake2s_const 0.7.0", - "blake2s_simd", - "byteorder", - "cfg-if 1.0.0", - "crossbeam 0.7.3", - "futures 0.3.30", - "hex", - "lazy_static", - "num_cpus", - "pairing_ce", - "rand 0.4.6", - "serde", - "smallvec", - "tiny-keccak 1.5.0", -] - -[[package]] -name = "bellman_ce" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7aab6627603565b664e6c643a1dc7ea8bbff25b776f5fecd80ac88308fc7007b" -dependencies = [ - "arrayvec 0.7.4", - "bit-vec", - "blake2s_const 0.8.0", - "blake2s_simd", - "byteorder", - "cfg-if 1.0.0", - "crossbeam 0.7.3", - "futures 0.3.30", - "hex", - "lazy_static", - "num_cpus", - "pairing_ce", - "rand 0.4.6", - "serde", - "smallvec", - "tiny-keccak 1.5.0", -] - [[package]] name = "bigdecimal" version = "0.4.5" @@ -500,27 +452,6 @@ dependencies = [ "which", ] -[[package]] -name = "bindgen" -version = "0.65.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cfdf7b466f9a4903edc73f95d6d2bcd5baf8ae620638762244d3f60143643cc5" -dependencies = [ - "bitflags 1.3.2", - "cexpr", - "clang-sys", - "lazy_static", - "lazycell", - "peeking_take_while", - "prettyplease", - "proc-macro2 1.0.85", - "quote 1.0.36", - "regex", - "rustc-hash", - "shlex", - "syn 2.0.66", -] - [[package]] name = "bindgen" version = "0.69.4" @@ -629,28 +560,6 @@ dependencies = [ "digest 0.10.7", ] -[[package]] -name = "blake2s_const" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f39d933cb38939f885001867874c65699c36f30f0c78aae9f4c9f01b3e4b306a" -dependencies = [ - "arrayref", - "arrayvec 0.5.2", - "constant_time_eq", -] - -[[package]] -name = "blake2s_const" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1db04f0f5f88d8c95977159949b23d2ed24d33309901cf7f7e48ed40f36de667" -dependencies = [ - "arrayref", - "arrayvec 0.5.2", - "constant_time_eq", -] - [[package]] name = "blake2s_simd" version = "0.5.11" @@ -701,18 +610,17 @@ dependencies = [ [[package]] name = "boojum" -version = "0.2.2" +version = "0.30.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df88daa33db46d683967ca09a4f04817c38950483f2501a771d497669a8a4bb1" +checksum = "68ec2f007ff8f90cc459f03e9f30ca1065440170f013c868823646e2e48d0234" dependencies = [ "arrayvec 0.7.4", "bincode", "blake2 0.10.6", "const_format", "convert_case", - "crossbeam 0.8.4", + "crossbeam", "crypto-bigint 0.5.5", - "cs_derive", "derivative", "ethereum-types", "firestorm", @@ -720,7 +628,6 @@ dependencies = [ "lazy_static", "num-modular", "num_cpus", - "pairing_ce", "rand 0.8.5", "rayon", "serde", @@ -729,13 +636,15 @@ dependencies = [ "smallvec", "tracing", "unroll", + "zksync_cs_derive", + "zksync_pairing", ] [[package]] name = "boojum-cuda" -version = "0.150.6" +version = "0.150.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "252c28bc729eb32a053de0cbd1c8c55b2f51d00ca0c656f30bc70d255c2d8753" +checksum = "ac7735446f2263e8d12435fc4d5a02c7727838eaffc7c518a961b3e839fb59e7" dependencies = [ "boojum", "cmake", @@ -826,17 +735,6 @@ version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "514de17de45fdb8dc022b1a7975556c53c86f9f0aa5f534b98977b171857c2c9" -[[package]] -name = "bzip2-sys" -version = "0.1.11+1.0.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "736a955f3fa7875102d57c82b8cac37ec45224a07fd32d58f9f7a186b6cd4cdc" -dependencies = [ - "cc", - "libc", - "pkg-config", -] - [[package]] name = "cc" version = "1.1.14" @@ -863,12 +761,6 @@ dependencies = [ "nom", ] -[[package]] -name = "cfg-if" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" - [[package]] name = "cfg-if" version = "1.0.0" @@ -898,12 +790,12 @@ dependencies = [ [[package]] name = "circuit_definitions" -version = "0.150.4" +version = "0.150.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fffaa17c1585fbf010b9340bb1fd7f4c4eedec2c15cb74a72162fd2d16435d55" +checksum = "9b532214f063e5e0ee5c0fc1d3afd56dec541efa68b8985f14cc55cc324f4c48" dependencies = [ - "circuit_encodings 0.150.4", - "crossbeam 0.8.4", + "circuit_encodings 0.150.5", + "crossbeam", "derivative", "seq-macro", "serde", @@ -948,82 +840,82 @@ dependencies = [ [[package]] name = "circuit_encodings" -version = "0.150.4" +version = "0.150.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2593c02ad6b4b31ba63506c3f807f666133dd36bf47422f99b1d2947cf3c8dc1" +checksum = "e67617688c66640c84f9b98ff26d48f7898dca4faeb45241a4f21ec333788e7b" dependencies = [ "derivative", "serde", - "zk_evm 0.150.4", - "zkevm_circuits 0.150.4", + "zk_evm 0.150.5", + "zkevm_circuits 0.150.5", ] [[package]] name = "circuit_sequencer_api" -version = "0.133.0" +version = "0.133.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a87dc7bee6630d4954ac7982eb77e2007476662250cf18e5c460bbc5ee435f1" +checksum = "eb959b1f8c6bbd8be711994d182e85452a26a5d2213a709290b71c8262af1331" dependencies = [ - "bellman_ce 0.7.0", "derivative", "rayon", "serde", "zk_evm 0.133.0", + "zksync_bellman", ] [[package]] name = "circuit_sequencer_api" -version = "0.140.0" +version = "0.140.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b5138e6524c73e6d49fc1d0822b26e62a8d78b2c07e4e1c56061a447c10bec0" +checksum = "fa5f22311ce609d852d7d9f4943535ea4610aeb785129ae6ff83d5201c4fb387" dependencies = [ - "bellman_ce 0.7.0", "circuit_encodings 0.140.1", "derivative", "rayon", "serde", "zk_evm 0.140.0", + "zksync_bellman", ] [[package]] name = "circuit_sequencer_api" -version = "0.141.1" +version = "0.141.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55a257b31a8ea1c1723cab4fb5661c6b4c0ebe022d4b73bea9eb7c9150bd3bc1" +checksum = "4c47c71d6ba83a8beb0af13af70beffd627f5497caf3d44c6f96363e788b07ea" dependencies = [ - "bellman_ce 0.8.0", "circuit_encodings 0.141.1", "derivative", "rayon", "serde", "zk_evm 0.141.0", + "zksync_bellman", ] [[package]] name = "circuit_sequencer_api" -version = "0.142.0" +version = "0.142.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1d861a7a9b8df9389c63092985fc993c46954771da86462d7cab8cbf55a6497" +checksum = "e264723359e6a1aad98110bdccf1ae3ad596e93e7d31da9e40f6adc07e4add54" dependencies = [ - "bellman_ce 0.7.0", "circuit_encodings 0.142.1", "derivative", "rayon", "serde", "zk_evm 0.141.0", + "zksync_bellman", ] [[package]] name = "circuit_sequencer_api" -version = "0.150.4" +version = "0.150.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42d1a86b9c2207f3bb2dff5f00d1af1cb95004b6d07e9bacb6519fe08f12c04b" +checksum = "21017310971d4a051e4a52ad70eed11d1ae69defeca8314f73a3a4bad16705a9" dependencies = [ - "bellman_ce 0.7.0", - "circuit_encodings 0.150.4", + "circuit_encodings 0.150.5", "derivative", "rayon", "serde", + "zksync_bellman", ] [[package]] @@ -1148,7 +1040,7 @@ version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4ca0197aee26d1ae37445ee532fefce43251d24cc7c166799f4d46817f1d3973" dependencies = [ - "crossbeam-utils 0.8.20", + "crossbeam-utils", ] [[package]] @@ -1257,21 +1149,7 @@ version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a97769d94ddab943e4510d138150169a2758b5ef3eb191a9ee688de3e23ef7b3" dependencies = [ - "cfg-if 1.0.0", -] - -[[package]] -name = "crossbeam" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69323bff1fb41c635347b8ead484a5ca6c3f11914d784170b158d8449ab07f8e" -dependencies = [ - "cfg-if 0.1.10", - "crossbeam-channel 0.4.4", - "crossbeam-deque 0.7.4", - "crossbeam-epoch 0.8.2", - "crossbeam-queue 0.2.3", - "crossbeam-utils 0.7.2", + "cfg-if", ] [[package]] @@ -1280,21 +1158,11 @@ version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1137cd7e7fc0fb5d3c5a8678be38ec56e819125d8d7907411fe24ccb943faca8" dependencies = [ - "crossbeam-channel 0.5.13", - "crossbeam-deque 0.8.5", - "crossbeam-epoch 0.9.18", - "crossbeam-queue 0.3.11", - "crossbeam-utils 0.8.20", -] - -[[package]] -name = "crossbeam-channel" -version = "0.4.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b153fe7cbef478c567df0f972e02e6d736db11affe43dfc9c56a9374d1adfb87" -dependencies = [ - "crossbeam-utils 0.7.2", - "maybe-uninit", + "crossbeam-channel", + "crossbeam-deque", + "crossbeam-epoch", + "crossbeam-queue", + "crossbeam-utils", ] [[package]] @@ -1303,18 +1171,7 @@ version = "0.5.13" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "33480d6946193aa8033910124896ca395333cae7e2d1113d1fef6c3272217df2" dependencies = [ - "crossbeam-utils 0.8.20", -] - -[[package]] -name = "crossbeam-deque" -version = "0.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c20ff29ded3204c5106278a81a38f4b482636ed4fa1e6cfbeef193291beb29ed" -dependencies = [ - "crossbeam-epoch 0.8.2", - "crossbeam-utils 0.7.2", - "maybe-uninit", + "crossbeam-utils", ] [[package]] @@ -1323,23 +1180,8 @@ version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "613f8cc01fe9cf1a3eb3d7f488fd2fa8388403e97039e2f73692932e291a770d" dependencies = [ - "crossbeam-epoch 0.9.18", - "crossbeam-utils 0.8.20", -] - -[[package]] -name = "crossbeam-epoch" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "058ed274caafc1f60c4997b5fc07bf7dc7cca454af7c6e81edffe5f33f70dace" -dependencies = [ - "autocfg", - "cfg-if 0.1.10", - "crossbeam-utils 0.7.2", - "lazy_static", - "maybe-uninit", - "memoffset", - "scopeguard", + "crossbeam-epoch", + "crossbeam-utils", ] [[package]] @@ -1348,18 +1190,7 @@ version = "0.9.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" dependencies = [ - "crossbeam-utils 0.8.20", -] - -[[package]] -name = "crossbeam-queue" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "774ba60a54c213d409d5353bda12d49cd68d14e45036a285234c8d6f91f92570" -dependencies = [ - "cfg-if 0.1.10", - "crossbeam-utils 0.7.2", - "maybe-uninit", + "crossbeam-utils", ] [[package]] @@ -1368,18 +1199,7 @@ version = "0.3.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "df0346b5d5e76ac2fe4e327c5fd1118d6be7c51dfb18f9b7922923f287471e35" dependencies = [ - "crossbeam-utils 0.8.20", -] - -[[package]] -name = "crossbeam-utils" -version = "0.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3c7c73a2d1e9fc0886a08b93e98eb643461230d5f1925e4036204d5f2e261a8" -dependencies = [ - "autocfg", - "cfg-if 0.1.10", - "lazy_static", + "crossbeam-utils", ] [[package]] @@ -1476,7 +1296,7 @@ version = "4.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "97fb8b7c4503de7d6ae7b42ab72a5a59857b4c937ec27a3d4539dba95b5ab2be" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "cpufeatures", "curve25519-dalek-derive", "digest 0.10.7", @@ -1796,7 +1616,7 @@ version = "0.8.34" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b45de904aa0b010bce2ab45264d0631681847fa7b6f2eaa7dab7619943bc4f59" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", ] [[package]] @@ -1862,9 +1682,9 @@ checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" [[package]] name = "era_cudart" -version = "0.150.6" +version = "0.150.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "803be147b389086e33254a6c9fe26a0d1d21a11f9f73181cad06cf5b1beb7d16" +checksum = "f76aa50bd291b43ad56fb7da3e63c4c3cecb3c7e19db76c8097856371bc0d84a" dependencies = [ "bitflags 2.6.0", "era_cudart_sys", @@ -1873,9 +1693,9 @@ dependencies = [ [[package]] name = "era_cudart_sys" -version = "0.150.6" +version = "0.150.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49f9a3d87f3d45d11bc835e5fc78fe6e3fe243355d435f6b3e794b98df7d3323" +checksum = "e7d2db304df6b72141d45b140ec6df68ecd2300a7ab27de18b3e0e3af38c9776" dependencies = [ "serde_json", ] @@ -1904,7 +1724,7 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "136d1b5283a1ab77bd9257427ffd09d8667ced0570b6f938942bc7568ed5b943" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "home", "windows-sys 0.48.0", ] @@ -1997,27 +1817,11 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5b538e4231443a5b9c507caee3356f016d832cf7393d2d90f03ea3180d4e3fbc" dependencies = [ "byteorder", - "ff_derive_ce", "hex", "rand 0.4.6", "serde", ] -[[package]] -name = "ff_derive_ce" -version = "0.11.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b96fbccd88dbb1fac4ee4a07c2fcc4ca719a74ffbd9d2b9d41d8c8eb073d8b20" -dependencies = [ - "num-bigint 0.4.5", - "num-integer", - "num-traits", - "proc-macro2 1.0.85", - "quote 1.0.36", - "serde", - "syn 1.0.109", -] - [[package]] name = "fiat-crypto" version = "0.2.9" @@ -2113,12 +1917,11 @@ dependencies = [ [[package]] name = "franklin-crypto" -version = "0.2.2" +version = "0.30.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05eab544ba915269919b5f158a061b540a4e3a04150c1346481f4f7b80eb6311" +checksum = "971289216ea5c91872e5e0bb6989214b537bbce375d09fabea5c3ccfe031b204" dependencies = [ "arr_macro", - "bellman_ce 0.8.0", "bit-vec", "blake2 0.9.2", "blake2-rfc_bellman_edition", @@ -2142,6 +1945,7 @@ dependencies = [ "smallvec", "splitmut", "tiny-keccak 1.5.0", + "zksync_bellman", ] [[package]] @@ -2308,7 +2112,7 @@ version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "js-sys", "libc", "wasi", @@ -3194,7 +2998,7 @@ version = "0.11.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "72c1e0b51e7ec0a97369623508396067a486bd0cbed95a2659a4b863d28cfc8b" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "ecdsa 0.14.8", "elliptic-curve 0.12.3", "sha2 0.10.8", @@ -3206,7 +3010,7 @@ version = "0.13.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "956ff9b67e26e1a6a866cb758f12c6f8746208489e3e4a4b5580802f2f0a587b" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "ecdsa 0.16.9", "elliptic-curve 0.13.8", "once_cell", @@ -3238,12 +3042,6 @@ version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" -[[package]] -name = "leb128" -version = "0.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "884e2677b40cc8c339eaefcb701c32ef1fd2493d71118dc0ca4b6a736c93bd67" - [[package]] name = "libc" version = "0.2.155" @@ -3256,7 +3054,7 @@ version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0c2a198fb6b0eada2a8df47933734e6d35d350665a33a3593d7164fa52c75c19" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "windows-targets 0.52.5", ] @@ -3266,22 +3064,6 @@ version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4ec2a862134d2a7d32d7983ddcdd1c4923530833c9f2ea1a44fc5fa473989058" -[[package]] -name = "librocksdb-sys" -version = "0.11.0+8.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3386f101bcb4bd252d8e9d2fb41ec3b0862a15a62b478c355b2982efa469e3e" -dependencies = [ - "bindgen 0.65.1", - "bzip2-sys", - "cc", - "glob", - "libc", - "libz-sys", - "lz4-sys", - "zstd-sys", -] - [[package]] name = "libsqlite3-sys" version = "0.30.1" @@ -3293,17 +3075,6 @@ dependencies = [ "vcpkg", ] -[[package]] -name = "libz-sys" -version = "1.1.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c15da26e5af7e25c90b37a2d75cdbf940cf4a55316de9d84c679c9b8bfabf82e" -dependencies = [ - "cc", - "pkg-config", - "vcpkg", -] - [[package]] name = "linux-raw-sys" version = "0.4.14" @@ -3370,16 +3141,6 @@ dependencies = [ "logos-codegen", ] -[[package]] -name = "lz4-sys" -version = "1.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57d27b317e207b10f69f5e75494119e391a96f48861ae870d1da6edac98ca900" -dependencies = [ - "cc", - "libc", -] - [[package]] name = "match_cfg" version = "0.1.0" @@ -3401,19 +3162,13 @@ version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0e7465ac9959cc2b1404e8e2367b43684a6d13790fe23056cc8c6c5a6b7bcb94" -[[package]] -name = "maybe-uninit" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60302e4db3a61da70c0cb7991976248362f30319e88850c487b9b95bbf059e00" - [[package]] name = "md-5" version = "0.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d89e7ee0cfbedfc4da3340218492196241d89eefb6dab27de5df917a6d2e78cf" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "digest 0.10.7", ] @@ -3429,15 +3184,6 @@ version = "2.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6c8640c5d730cb13ebd907d8d04b52f55ac9a2eec55b440c8892f40d56c76c1d" -[[package]] -name = "memoffset" -version = "0.5.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "043175f069eda7b85febe4a74abbaeff828d9f8b448515d3151a14a3542811aa" -dependencies = [ - "autocfg", -] - [[package]] name = "miette" version = "5.10.0" @@ -3564,7 +3310,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ab2156c4fce2f8df6c499cc1c763e4394b7482525bf2a9701c9d79d215f519e4" dependencies = [ "bitflags 2.6.0", - "cfg-if 1.0.0", + "cfg-if", "cfg_aliases", "libc", ] @@ -3813,7 +3559,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9529f4786b70a3e8c61e11179af17ab6188ad8d0ded78c5529441ed39d4bd9c1" dependencies = [ "bitflags 2.6.0", - "cfg-if 1.0.0", + "cfg-if", "foreign-types", "libc", "once_cell", @@ -3986,19 +3732,6 @@ dependencies = [ "sha2 0.10.8", ] -[[package]] -name = "pairing_ce" -version = "0.28.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "843b5b6fb63f00460f611dbc87a50bbbb745f0dfe5cbf67ca89299c79098640e" -dependencies = [ - "byteorder", - "cfg-if 1.0.0", - "ff_ce", - "rand 0.4.6", - "serde", -] - [[package]] name = "parity-scale-codec" version = "3.6.11" @@ -4047,7 +3780,7 @@ version = "0.9.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "libc", "redox_syscall 0.5.1", "smallvec", @@ -4671,8 +4404,8 @@ version = "1.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1465873a3dfdaa8ae7cb14b4383657caab0b3e8a0aa9ae8e04b044854c8dfce2" dependencies = [ - "crossbeam-deque 0.8.5", - "crossbeam-utils 0.8.20", + "crossbeam-deque", + "crossbeam-utils", ] [[package]] @@ -4859,9 +4592,9 @@ dependencies = [ [[package]] name = "rescue_poseidon" -version = "0.5.2" +version = "0.30.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f27fbc6ba44baf99a0ca8387b1fa1cf90d3d7062860c1afedbbb64454829acc5" +checksum = "82900c877a0ba5362ac5756efbd82c5b795dc509011c1253e2389d8708f1389d" dependencies = [ "addchain", "arrayvec 0.7.4", @@ -4910,7 +4643,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c17fa4cb658e3583423e915b9f3acc01cceaee1860e33d59ebae66adc3a2dc0d" dependencies = [ "cc", - "cfg-if 1.0.0", + "cfg-if", "getrandom", "libc", "spin", @@ -4957,16 +4690,6 @@ dependencies = [ "rustc-hex", ] -[[package]] -name = "rocksdb" -version = "0.21.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb6f170a4041d50a0ce04b0d2e14916d6ca863ea2e422689a5b694395d299ffe" -dependencies = [ - "libc", - "librocksdb-sys", -] - [[package]] name = "rsa" version = "0.9.6" @@ -5491,7 +5214,7 @@ version = "0.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e3bf829a2d51ab4a5ddf1352d8470c140cadc8301b2ae1789db023f01cedd6ba" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "cpufeatures", "digest 0.10.7", ] @@ -5503,7 +5226,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4d58a1e1bf39749807d89cf2d98ac2dfa0ff1cb3faa38fbb64dd88ac8013d800" dependencies = [ "block-buffer 0.9.0", - "cfg-if 1.0.0", + "cfg-if", "cpufeatures", "digest 0.9.0", "opaque-debug", @@ -5515,7 +5238,7 @@ version = "0.10.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "cpufeatures", "digest 0.10.7", ] @@ -5526,7 +5249,7 @@ version = "0.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eca2daa77078f4ddff27e75c4bf59e4c2697525f56dbb3c842d34a5d1f2b04a2" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "cpufeatures", "digest 0.10.7", ] @@ -5580,9 +5303,9 @@ checksum = "24188a676b6ae68c3b2cb3a01be17fbf7240ce009799bb56d5b1409051e78fde" [[package]] name = "shivini" -version = "0.150.6" +version = "0.150.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "331868b8d92ffec8887c17e786632cf0c9bd4750986fc1400a6d1fbf3739cba4" +checksum = "3f11e6942c89861aecb72261f8220800a1b69b8a5463c07c24df75b81fd809b0" dependencies = [ "bincode", "blake2 0.10.6", @@ -5672,9 +5395,9 @@ dependencies = [ [[package]] name = "snark_wrapper" -version = "0.1.2" +version = "0.30.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "71aa5bffe5e7daca634bf2fedf0bf566273cb7eae01711d1aa6e5223d36d987d" +checksum = "0b5dfdc3eed51d79541adff827593743750fe6626a65006814f8cfa4273371de" dependencies = [ "derivative", "rand 0.4.6", @@ -5777,7 +5500,7 @@ dependencies = [ "bytes", "chrono", "crc", - "crossbeam-queue 0.3.11", + "crossbeam-queue", "either", "event-listener", "futures-channel", @@ -6143,7 +5866,7 @@ version = "3.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "85b77fafb263dd9d05cbeac119526425676db3784113aa9295c88498cbf8bff1" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "fastrand", "rustix", "windows-sys 0.52.0", @@ -6221,7 +5944,7 @@ version = "1.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b9ef9bad013ada3808854ceac7b46812a6465ba368859a37e2100283d2d719c" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "once_cell", ] @@ -6829,8 +6552,8 @@ dependencies = [ "enum_dispatch", "eravm-stable-interface", "primitive-types", - "zk_evm_abstractions 0.150.4", - "zkevm_opcode_defs 0.150.4", + "zk_evm_abstractions 0.150.5", + "zkevm_opcode_defs 0.150.5", ] [[package]] @@ -6879,7 +6602,7 @@ version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4be2531df63900aeb2bca0daaaddec08491ee64ceecbee5076636a3b026795a8" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "wasm-bindgen-macro", ] @@ -6904,7 +6627,7 @@ version = "0.4.42" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "76bc14366121efc8dbb487ab05bcc9d346b3b5ec0eaa76e46594cabbe51762c0" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "js-sys", "wasm-bindgen", "web-sys", @@ -7197,7 +6920,7 @@ version = "0.50.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "524e57b2c537c0f9b1e69f1965311ec12182b4122e45035b1508cd24d2adadb1" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "windows-sys 0.48.0", ] @@ -7207,7 +6930,7 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a277a57398d4bfa075df44f501a17cfdf8542d224f0d36095a2adc7aee4ef0a5" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "windows-sys 0.48.0", ] @@ -7334,9 +7057,9 @@ dependencies = [ [[package]] name = "zk_evm" -version = "0.150.4" +version = "0.150.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2dbb0ed38d61fbd04bd7575755924d1303e129c04c909abba7f5bfcc6260bcf" +checksum = "5a6e69931f24db5cf333b714721e8d80ff88bfdb7da8c3dc7882612ffddb8d27" dependencies = [ "anyhow", "lazy_static", @@ -7344,7 +7067,7 @@ dependencies = [ "serde", "serde_json", "static_assertions", - "zk_evm_abstractions 0.150.4", + "zk_evm_abstractions 0.150.5", ] [[package]] @@ -7375,22 +7098,22 @@ dependencies = [ [[package]] name = "zk_evm_abstractions" -version = "0.150.4" +version = "0.150.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31460aacfe65b39ac484a2a2e0bbb02baf141f65264bf48e1e4f59ab375fe933" +checksum = "93d6b0720261ab55490fe3a96e96de30d5d7b277940b52ea7f52dbf564eb1748" dependencies = [ "anyhow", "num_enum 0.6.1", "serde", "static_assertions", - "zkevm_opcode_defs 0.150.4", + "zkevm_opcode_defs 0.150.5", ] [[package]] name = "zkevm-assembly" -version = "0.150.4" +version = "0.150.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b69d09d125b94767847c4cdc4ae399654b9e2a2f9304bd8935a7033bef4b07c" +checksum = "e99106038062537c05b4e6e7754d1bbba28ba16185a3e5ee5ad22e2f8be883bb" dependencies = [ "env_logger 0.9.3", "hex", @@ -7403,7 +7126,7 @@ dependencies = [ "smallvec", "structopt", "thiserror", - "zkevm_opcode_defs 0.150.4", + "zkevm_opcode_defs 0.150.5", ] [[package]] @@ -7452,13 +7175,12 @@ dependencies = [ [[package]] name = "zkevm_circuits" -version = "0.150.4" +version = "0.150.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "abdfaa95dfe0878fda219dd17a6cc8c28711e2067785910c0e06d3ffdca78629" +checksum = "784fa7cfb51e17c5ced112bca43da30b3468b2347b7af0427ad9638759fb140e" dependencies = [ "arrayvec 0.7.4", "boojum", - "cs_derive", "derivative", "hex", "itertools 0.10.5", @@ -7467,7 +7189,8 @@ dependencies = [ "seq-macro", "serde", "smallvec", - "zkevm_opcode_defs 0.150.4", + "zkevm_opcode_defs 0.150.5", + "zksync_cs_derive", ] [[package]] @@ -7514,9 +7237,9 @@ dependencies = [ [[package]] name = "zkevm_opcode_defs" -version = "0.150.4" +version = "0.150.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb7c5c7b4481a646f8696b08cee64a8dec097509a6378d18242f81022f327f1e" +checksum = "79055eae1b6c1ab80793ed9d77d2964c9c896afa4b5dfed278cf58cd10acfe8f" dependencies = [ "bitflags 2.6.0", "blake2 0.10.6", @@ -7531,15 +7254,15 @@ dependencies = [ [[package]] name = "zkevm_test_harness" -version = "0.150.4" +version = "0.150.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9416dc5fcf7bc403d4c24d37f0e9a492a81926ff0e89a7792dc8a29de69aec1b" +checksum = "550f82d3b7448c35168dc13bfadbccd5fd306097b6e1ea01793151c1c9137a36" dependencies = [ "bincode", "circuit_definitions", - "circuit_sequencer_api 0.150.4", + "circuit_sequencer_api 0.150.5", "codegen", - "crossbeam 0.8.4", + "crossbeam", "derivative", "env_logger 0.9.3", "hex", @@ -7558,13 +7281,13 @@ dependencies = [ [[package]] name = "zksync-gpu-ffi" -version = "0.150.6" +version = "0.150.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae694dc0ad818e4d45af70b2cf579ff46f1ac938b42ee55543529beb45ba1464" +checksum = "aecd7f624185b785e9d8457986ac34685d478e2baa78417d51b102b7d0fa27fd" dependencies = [ "bindgen 0.59.2", "cmake", - "crossbeam 0.8.4", + "crossbeam", "derivative", "era_cudart_sys", "futures 0.3.30", @@ -7574,13 +7297,13 @@ dependencies = [ [[package]] name = "zksync-gpu-prover" -version = "0.150.6" +version = "0.150.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8156dbaf36764409cc93424d43dc86c993601d73f5aa9a5938e6552a14dc2df" +checksum = "a089b11fcdbd37065acaf427545cb50b87e6712951a10f3761b3d370e4b8f9bc" dependencies = [ "bit-vec", - "cfg-if 1.0.0", - "crossbeam 0.8.4", + "cfg-if", + "crossbeam", "franklin-crypto", "itertools 0.10.5", "num_cpus", @@ -7591,9 +7314,9 @@ dependencies = [ [[package]] name = "zksync-wrapper-prover" -version = "0.150.6" +version = "0.150.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83975189451bfacfa97dbcce899fde9db15a0c072196a9b92ddfabbe756bab9d" +checksum = "dc764c21d4ae15c5bc2c07c14c814c5e3ba8d194ddcca543b8cec95456031832" dependencies = [ "circuit_definitions", "zkevm_test_harness", @@ -7618,11 +7341,34 @@ dependencies = [ "url", ] +[[package]] +name = "zksync_bellman" +version = "0.30.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ffa03efe9bdb137a4b36b97d1a74237e18c9ae42b755163d903a9d48c1a5d80" +dependencies = [ + "arrayvec 0.7.4", + "bit-vec", + "blake2s_simd", + "byteorder", + "cfg-if", + "crossbeam", + "futures 0.3.30", + "hex", + "lazy_static", + "num_cpus", + "rand 0.4.6", + "serde", + "smallvec", + "tiny-keccak 1.5.0", + "zksync_pairing", +] + [[package]] name = "zksync_concurrency" -version = "0.1.0-rc.11" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0e31a9fc9a390b440cd12bbe040330dc64f64697a8a8ecbc3beb98cd0747909" +checksum = "c1c8cf6c689ab5922b52d81b775cd2d9cffbfc8fb8da65985e11b06546dfb3bf" dependencies = [ "anyhow", "once_cell", @@ -7656,9 +7402,9 @@ dependencies = [ [[package]] name = "zksync_consensus_crypto" -version = "0.1.0-rc.11" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "efb7ff3ec44b7b92fd4e28d9d92b83d61dc74125ccfc90bcfb27a5750d8a8580" +checksum = "cc7baced4e811015038322dad10239f2d631d9e339e8d6b7b6e6b146bee30f41" dependencies = [ "anyhow", "blst", @@ -7669,7 +7415,6 @@ dependencies = [ "k256 0.13.3", "num-bigint 0.4.5", "num-traits", - "pairing_ce", "rand 0.4.6", "rand 0.8.5", "sha3 0.10.8", @@ -7680,9 +7425,9 @@ dependencies = [ [[package]] name = "zksync_consensus_roles" -version = "0.1.0-rc.11" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72223c0b20621775db51bcc4b043addafeaf784d444af2ad4bc8bcdee477367c" +checksum = "0aab4ddf62f6001903c5fe9f65afb1bdc42464928c9d1c6ce52e4d7e9944f5dc" dependencies = [ "anyhow", "bit-vec", @@ -7702,9 +7447,9 @@ dependencies = [ [[package]] name = "zksync_consensus_storage" -version = "0.1.0-rc.11" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41d1750ad93f7e3a0c2f5880f9bcc1244a3b46d3e6c124c4f65f545032b87464" +checksum = "7b9dbcb923fa201af03f49f70c11a923b416915d2ddf8b2de3a2e861f22898a4" dependencies = [ "anyhow", "async-trait", @@ -7722,9 +7467,9 @@ dependencies = [ [[package]] name = "zksync_consensus_utils" -version = "0.1.0-rc.11" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2ff679f8b5f671d887a750b8107f3b5c01fd6085f68eef37ab01de8d2bd0736b" +checksum = "29e69dffc0fbc7c096548c997f5ca157a490b34b3d49fd524fa3d51840f7fb22" dependencies = [ "anyhow", "rand 0.8.5", @@ -7754,9 +7499,7 @@ dependencies = [ "serde_yaml", "tokio", "zksync_config", - "zksync_dal", "zksync_env_config", - "zksync_node_genesis", "zksync_protobuf", "zksync_protobuf_config", ] @@ -7778,6 +7521,18 @@ dependencies = [ "zksync_utils", ] +[[package]] +name = "zksync_cs_derive" +version = "0.30.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5939e2df4288c263c706ff18ac718e984149223ad4289d6d957d767dcfc04c81" +dependencies = [ + "proc-macro-error", + "proc-macro2 1.0.85", + "quote 1.0.36", + "syn 1.0.109", +] + [[package]] name = "zksync_dal" version = "0.1.0" @@ -7824,7 +7579,6 @@ dependencies = [ "tracing", "vise", "zksync_basic_types", - "zksync_health_check", ] [[package]] @@ -7866,24 +7620,38 @@ dependencies = [ ] [[package]] -name = "zksync_health_check" -version = "0.1.0" +name = "zksync_ff" +version = "0.30.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9524b06780b5e164e84b38840c7c428c739f051f35af6efc4d1285f629ceb88e" dependencies = [ - "async-trait", - "futures 0.3.30", + "byteorder", + "hex", + "rand 0.4.6", "serde", - "serde_json", - "thiserror", - "tokio", - "tracing", - "vise", + "zksync_ff_derive", +] + +[[package]] +name = "zksync_ff_derive" +version = "0.30.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f91e58e75d65877f09f83bc3dca8f054847ae7ec4f3e64bfa610a557edd8e8e" +dependencies = [ + "num-bigint 0.4.5", + "num-integer", + "num-traits", + "proc-macro2 1.0.85", + "quote 1.0.36", + "serde", + "syn 1.0.109", ] [[package]] name = "zksync_kzg" -version = "0.150.4" +version = "0.150.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9949f48ea1a9f9a0e73242d4d1e87e681095181827486b3fcc2cf93e5aa03280" +checksum = "edb8a9c76c172a6d639855ee342b9a670e3ba472f5ae302f771b1c3ee777dc88" dependencies = [ "boojum", "derivative", @@ -7893,26 +7661,7 @@ dependencies = [ "serde", "serde_json", "serde_with", - "zkevm_circuits 0.150.4", -] - -[[package]] -name = "zksync_merkle_tree" -version = "0.1.0" -dependencies = [ - "anyhow", - "leb128", - "once_cell", - "rayon", - "thiserror", - "thread_local", - "tracing", - "vise", - "zksync_crypto_primitives", - "zksync_prover_interface", - "zksync_storage", - "zksync_types", - "zksync_utils", + "zkevm_circuits 0.150.5", ] [[package]] @@ -7929,11 +7678,11 @@ name = "zksync_multivm" version = "0.1.0" dependencies = [ "anyhow", - "circuit_sequencer_api 0.133.0", - "circuit_sequencer_api 0.140.0", - "circuit_sequencer_api 0.141.1", - "circuit_sequencer_api 0.142.0", - "circuit_sequencer_api 0.150.4", + "circuit_sequencer_api 0.133.1", + "circuit_sequencer_api 0.140.3", + "circuit_sequencer_api 0.141.2", + "circuit_sequencer_api 0.142.2", + "circuit_sequencer_api 0.150.5", "hex", "itertools 0.10.5", "once_cell", @@ -7946,7 +7695,7 @@ dependencies = [ "zk_evm 0.133.0", "zk_evm 0.140.0", "zk_evm 0.141.0", - "zk_evm 0.150.4", + "zk_evm 0.150.5", "zksync_contracts", "zksync_system_constants", "zksync_types", @@ -7954,27 +7703,6 @@ dependencies = [ "zksync_vm_interface", ] -[[package]] -name = "zksync_node_genesis" -version = "0.1.0" -dependencies = [ - "anyhow", - "itertools 0.10.5", - "thiserror", - "tokio", - "tracing", - "vise", - "zksync_config", - "zksync_contracts", - "zksync_dal", - "zksync_eth_client", - "zksync_merkle_tree", - "zksync_multivm", - "zksync_system_constants", - "zksync_types", - "zksync_utils", -] - [[package]] name = "zksync_object_store" version = "0.1.0" @@ -7998,6 +7726,19 @@ dependencies = [ "zksync_types", ] +[[package]] +name = "zksync_pairing" +version = "0.30.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8412ae5574472fa567a097e183f9a01974b99dd0b5da3bfa1bbe6c57c579aa2" +dependencies = [ + "byteorder", + "cfg-if", + "rand 0.4.6", + "serde", + "zksync_ff", +] + [[package]] name = "zksync_proof_fri_compressor" version = "0.1.0" @@ -8005,7 +7746,7 @@ dependencies = [ "anyhow", "async-trait", "bincode", - "circuit_sequencer_api 0.150.4", + "circuit_sequencer_api 0.150.5", "clap 4.5.4", "ctrlc", "futures 0.3.30", @@ -8034,9 +7775,9 @@ dependencies = [ [[package]] name = "zksync_protobuf" -version = "0.1.0-rc.11" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4f6ba3bf0aac20de18b4ae18a22d8c81b83f8f72e8fdec1c879525ecdacd2f5" +checksum = "df5467dfe2f845ca1fd6ceec623bbd32187589793d3c4023dcd2f5172369d198" dependencies = [ "anyhow", "bit-vec", @@ -8055,9 +7796,9 @@ dependencies = [ [[package]] name = "zksync_protobuf_build" -version = "0.1.0-rc.11" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7798c248b9a64505f0586bd5fadad6b26c999be4a8dec6b1a86b10b3888169c5" +checksum = "33d35280660b11be2a4ebdf531184eb729acebfdc3368d27176ec104f8bf9c5f" dependencies = [ "anyhow", "heck 0.5.0", @@ -8116,6 +7857,7 @@ dependencies = [ "shivini", "tokio", "tracing", + "tracing-subscriber", "vise", "zkevm_test_harness", "zksync_config", @@ -8191,7 +7933,7 @@ name = "zksync_prover_interface" version = "0.1.0" dependencies = [ "chrono", - "circuit_sequencer_api 0.150.4", + "circuit_sequencer_api 0.150.5", "serde", "serde_with", "strum", @@ -8252,18 +7994,6 @@ dependencies = [ "zksync_utils", ] -[[package]] -name = "zksync_storage" -version = "0.1.0" -dependencies = [ - "num_cpus", - "once_cell", - "rocksdb", - "thread_local", - "tracing", - "vise", -] - [[package]] name = "zksync_system_constants" version = "0.1.0" @@ -8314,7 +8044,6 @@ dependencies = [ "bigdecimal", "futures 0.3.30", "hex", - "itertools 0.10.5", "num", "once_cell", "reqwest 0.12.5", @@ -8344,6 +8073,7 @@ dependencies = [ "zksync_prover_fri_types", "zksync_prover_keystore", "zksync_types", + "zksync_utils", "zksync_vlog", ] @@ -8471,13 +8201,3 @@ dependencies = [ "zksync_utils", "zksync_vlog", ] - -[[package]] -name = "zstd-sys" -version = "2.0.10+zstd.1.5.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c253a4914af5bafc8fa8c86ee400827e83cf6ec01195ec1f1ed8441bf00d65aa" -dependencies = [ - "cc", - "pkg-config", -] diff --git a/prover/Cargo.toml b/prover/Cargo.toml index 403314cc13c..624661adc8d 100644 --- a/prover/Cargo.toml +++ b/prover/Cargo.toml @@ -52,17 +52,17 @@ tempfile = "3" tokio = "1" toml_edit = "0.14.4" tracing = "0.1" -tracing-subscriber = { version = "0.3" } +tracing-subscriber = "0.3" vise = "0.2.0" # Proving dependencies -circuit_definitions = "=0.150.4" -circuit_sequencer_api = "=0.150.4" -zkevm_test_harness = "=0.150.4" +circuit_definitions = "=0.150.5" +circuit_sequencer_api = "=0.150.5" +zkevm_test_harness = "=0.150.5" # GPU proving dependencies -wrapper_prover = { package = "zksync-wrapper-prover", version = "=0.150.6" } -shivini = "=0.150.6" +wrapper_prover = { package = "zksync-wrapper-prover", version = "=0.150.7" } +shivini = "=0.150.7" # Core workspace dependencies zksync_multivm = { path = "../core/lib/multivm", version = "0.1.0" } diff --git a/prover/crates/bin/proof_fri_compressor/src/compressor.rs b/prover/crates/bin/proof_fri_compressor/src/compressor.rs index 077347bce9b..e462097e38d 100644 --- a/prover/crates/bin/proof_fri_compressor/src/compressor.rs +++ b/prover/crates/bin/proof_fri_compressor/src/compressor.rs @@ -59,7 +59,6 @@ impl ProofCompressor { #[tracing::instrument(skip(proof, _compression_mode))] pub fn compress_proof( - l1_batch: L1BatchNumber, proof: ZkSyncRecursionLayerProof, _compression_mode: u8, keystore: Keystore, @@ -171,16 +170,13 @@ impl JobProcessor for ProofCompressor { async fn process_job( &self, - job_id: &L1BatchNumber, + _job_id: &L1BatchNumber, job: ZkSyncRecursionLayerProof, _started_at: Instant, ) -> JoinHandle> { let compression_mode = self.compression_mode; - let block_number = *job_id; let keystore = self.keystore.clone(); - tokio::task::spawn_blocking(move || { - Self::compress_proof(block_number, job, compression_mode, keystore) - }) + tokio::task::spawn_blocking(move || Self::compress_proof(job, compression_mode, keystore)) } async fn save_result( diff --git a/prover/crates/bin/prover_cli/README.md b/prover/crates/bin/prover_cli/README.md index 2d57e0b5649..e0dd1697bf6 100644 --- a/prover/crates/bin/prover_cli/README.md +++ b/prover/crates/bin/prover_cli/README.md @@ -9,6 +9,12 @@ git clone git@github.com:matter-labs/zksync-era.git cargo install prover_cli ``` +Or + +``` +cargo +nightly-2024-08-01 install --git https://github.com/matter-labs/zksync-era/ --locked prover_cli --force +``` + ## Usage ``` diff --git a/prover/crates/bin/prover_cli/src/config/mod.rs b/prover/crates/bin/prover_cli/src/config/mod.rs index 3d99f2be3b2..b3df2e7d2c5 100644 --- a/prover/crates/bin/prover_cli/src/config/mod.rs +++ b/prover/crates/bin/prover_cli/src/config/mod.rs @@ -1,12 +1,12 @@ use std::{io::Write, path::PathBuf}; -use crate::helper::core_workspace_dir_or_current_dir; +use zksync_utils::env::Workspace; pub fn get_envfile() -> anyhow::Result { if let Ok(envfile) = std::env::var("PLI__CONFIG") { return Ok(envfile.into()); } - Ok(core_workspace_dir_or_current_dir().join("etc/pliconfig")) + Ok(Workspace::locate().core().join("etc/pliconfig")) } pub fn load_envfile(path: impl AsRef) -> anyhow::Result<()> { diff --git a/prover/crates/bin/prover_cli/src/helper.rs b/prover/crates/bin/prover_cli/src/helper.rs index 352a789baed..7fe0c990e4e 100644 --- a/prover/crates/bin/prover_cli/src/helper.rs +++ b/prover/crates/bin/prover_cli/src/helper.rs @@ -1,10 +1,7 @@ -use std::{ - fs::File, - path::{Path, PathBuf}, -}; +use std::{fs::File, path::PathBuf}; use zksync_types::ethabi::Contract; -use zksync_utils::locate_workspace; +use zksync_utils::env::Workspace; const ZKSYNC_HYPERCHAIN_CONTRACT_FILE: &str = "contracts/l1-contracts/artifacts/contracts/state-transition/chain-interfaces/IZkSyncHyperchain.sol/IZkSyncHyperchain.json"; @@ -27,8 +24,7 @@ fn read_file_to_json_value(path: &PathBuf) -> serde_json::Value { } fn load_contract_if_present(path: &str) -> Contract { - let home = core_workspace_dir_or_current_dir(); - let path = Path::new(&home).join(path); + let path = Workspace::locate().core().join(path); path.exists() .then(|| { serde_json::from_value(read_file_to_json_value(&path)["abi"].take()).unwrap_or_else( @@ -39,9 +35,3 @@ fn load_contract_if_present(path: &str) -> Contract { panic!("Failed to load contract from {:?}", path); }) } - -pub fn core_workspace_dir_or_current_dir() -> PathBuf { - locate_workspace() - .map(|a| a.join("..")) - .unwrap_or_else(|| PathBuf::from(".")) -} diff --git a/prover/crates/bin/prover_fri/Cargo.toml b/prover/crates/bin/prover_fri/Cargo.toml index ae7853427e9..e41244cecbf 100644 --- a/prover/crates/bin/prover_fri/Cargo.toml +++ b/prover/crates/bin/prover_fri/Cargo.toml @@ -43,6 +43,9 @@ reqwest = { workspace = true, features = ["blocking"] } regex.workspace = true clap = { workspace = true, features = ["derive"] } +[dev-dependencies] +tracing-subscriber.workspace = true + [features] default = [] 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 240251df15b..cfd588c2666 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 @@ -8,8 +8,9 @@ pub mod gpu_prover { ProverContextConfig, }; use tokio::task::JoinHandle; - use zksync_config::configs::{fri_prover_group::FriProverGroupConfig, FriProverConfig}; - use zksync_env_config::FromEnv; + use zksync_config::configs::{ + fri_prover::SetupLoadMode as SetupLoadModeConfig, FriProverConfig, + }; use zksync_object_store::ObjectStore; use zksync_prover_dal::{ConnectionPool, ProverDal}; use zksync_prover_fri_types::{ @@ -341,38 +342,84 @@ pub mod gpu_prover { } } - pub fn load_setup_data_cache( + #[tracing::instrument(skip_all, fields(setup_load_mode = ?setup_load_mode, specialized_group_id = %specialized_group_id))] + pub async fn load_setup_data_cache( keystore: &Keystore, - config: &FriProverConfig, + setup_load_mode: SetupLoadModeConfig, + specialized_group_id: u8, + circuit_ids: &[CircuitIdRoundTuple], ) -> anyhow::Result { - Ok(match config.setup_load_mode { - zksync_config::configs::fri_prover::SetupLoadMode::FromDisk => SetupLoadMode::FromDisk, - zksync_config::configs::fri_prover::SetupLoadMode::FromMemory => { + Ok(match setup_load_mode { + SetupLoadModeConfig::FromDisk => SetupLoadMode::FromDisk, + SetupLoadModeConfig::FromMemory => { + anyhow::ensure!( + !circuit_ids.is_empty(), + "Circuit IDs must be provided when using FromMemory mode" + ); let mut cache = HashMap::new(); tracing::info!( "Loading setup data cache for group {}", - &config.specialized_group_id + &specialized_group_id ); - let prover_setup_metadata_list = FriProverGroupConfig::from_env() - .context("FriProverGroupConfig::from_env()")? - .get_circuit_ids_for_group_id(config.specialized_group_id) - .context( - "At least one circuit should be configured for group when running in FromMemory mode", - )?; tracing::info!( "for group {} configured setup metadata are {:?}", - &config.specialized_group_id, - prover_setup_metadata_list + &specialized_group_id, + circuit_ids ); - for prover_setup_metadata in prover_setup_metadata_list { - let key = setup_metadata_to_setup_data_key(&prover_setup_metadata); - let setup_data = keystore - .load_gpu_setup_data_for_circuit_type(key.clone()) - .context("load_gpu_setup_data_for_circuit_type()")?; - cache.insert(key, Arc::new(setup_data)); + // Load each file in parallel. Note that FS access is not necessarily parallel, but + // deserialization is (and it's not insignificant, as setup keys are large). + // Note: `collect` is important, because iterators are lazy and otherwise we won't actually + // spawn threads. + let handles: Vec<_> = circuit_ids + .into_iter() + .map(|prover_setup_metadata| { + let keystore = keystore.clone(); + let prover_setup_metadata = prover_setup_metadata.clone(); + tokio::task::spawn_blocking(move || { + let key = setup_metadata_to_setup_data_key(&prover_setup_metadata); + let setup_data = keystore + .load_gpu_setup_data_for_circuit_type(key.clone()) + .context("load_gpu_setup_data_for_circuit_type()")?; + anyhow::Ok((key, Arc::new(setup_data))) + }) + }) + .collect(); + for handle in futures::future::join_all(handles).await { + let (key, setup_data) = handle.context("Key loading future panicked")??; + cache.insert(key, setup_data); } SetupLoadMode::FromMemory(cache) } }) } + + #[cfg(test)] + mod tests { + use zksync_types::basic_fri_types::AggregationRound; + + use super::*; + + #[tokio::test] + async fn test_load_setup_data_cache() { + tracing_subscriber::fmt::try_init().ok(); + + let keystore = Keystore::locate(); + let mode = SetupLoadModeConfig::FromMemory; + let specialized_group_id = 0; + let ids: Vec<_> = AggregationRound::ALL_ROUNDS + .into_iter() + .flat_map(|r| r.circuit_ids()) + .collect(); + if !keystore.is_setup_data_present(&setup_metadata_to_setup_data_key(&ids[0])) { + // We don't want this test to fail on envs where setup keys are not present. + return; + } + + let start = Instant::now(); + let _cache = load_setup_data_cache(&keystore, mode, specialized_group_id, &ids) + .await + .expect("Unable to load keys"); + tracing::info!("Cache load time: {:?}", start.elapsed()); + } + } } diff --git a/prover/crates/bin/prover_fri/src/main.rs b/prover/crates/bin/prover_fri/src/main.rs index 8191653efec..cbba8d0ddb4 100644 --- a/prover/crates/bin/prover_fri/src/main.rs +++ b/prover/crates/bin/prover_fri/src/main.rs @@ -231,8 +231,14 @@ async fn get_prover_tasks( let keystore = Keystore::locate().with_setup_path(Some(prover_config.setup_data_path.clone().into())); - let setup_load_mode = gpu_prover::load_setup_data_cache(&keystore, &prover_config) - .context("load_setup_data_cache()")?; + let setup_load_mode = gpu_prover::load_setup_data_cache( + &keystore, + prover_config.setup_load_mode, + prover_config.specialized_group_id, + &circuit_ids_for_round_to_be_proven, + ) + .await + .context("load_setup_data_cache()")?; let witness_vector_queue = FixedSizeQueue::new(prover_config.queue_capacity); let shared_witness_vector_queue = Arc::new(Mutex::new(witness_vector_queue)); let consumer = shared_witness_vector_queue.clone(); 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 7c17e845450..4830f2277a7 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 @@ -20,6 +20,7 @@ zksync_vlog.workspace = true zksync_types.workspace = true zksync_prover_fri_types.workspace = true zksync_prover_keystore.workspace = true +zksync_utils.workspace = true zkevm_test_harness.workspace = true circuit_definitions = { workspace = true, features = ["log_tracing"] } 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 02cbe6e0c4d..2753799dc72 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,7 +2,7 @@ use std::{fs, path::PathBuf}; use anyhow::Context as _; use toml_edit::{Document, Item, Value}; -use zksync_prover_keystore::utils::core_workspace_dir_or_current_dir; +use zksync_utils::env::Workspace; pub fn get_toml_formatted_value(string_value: String) -> Item { let mut value = Value::from(string_value); @@ -23,5 +23,7 @@ pub fn read_contract_toml() -> anyhow::Result { } pub fn get_contract_toml_path() -> PathBuf { - core_workspace_dir_or_current_dir().join("etc/env/base/contracts.toml") + Workspace::locate() + .core() + .join("etc/env/base/contracts.toml") } diff --git a/prover/crates/bin/witness_generator/src/artifacts.rs b/prover/crates/bin/witness_generator/src/artifacts.rs new file mode 100644 index 00000000000..f509d3b2f64 --- /dev/null +++ b/prover/crates/bin/witness_generator/src/artifacts.rs @@ -0,0 +1,50 @@ +use std::time::Instant; + +use async_trait::async_trait; +use zksync_object_store::ObjectStore; +use zksync_prover_dal::{ConnectionPool, Prover}; + +#[derive(Debug)] +pub(crate) struct AggregationBlobUrls { + pub aggregations_urls: String, + pub circuit_ids_and_urls: Vec<(u8, String)>, +} + +#[derive(Debug)] +pub(crate) struct SchedulerBlobUrls { + pub circuit_ids_and_urls: Vec<(u8, String)>, + pub closed_form_inputs_and_urls: Vec<(u8, String, usize)>, + pub scheduler_witness_url: String, +} + +pub(crate) enum BlobUrls { + Url(String), + Aggregation(AggregationBlobUrls), + Scheduler(SchedulerBlobUrls), +} + +#[async_trait] +pub(crate) trait ArtifactsManager { + type InputMetadata; + type InputArtifacts; + type OutputArtifacts; + + async fn get_artifacts( + metadata: &Self::InputMetadata, + object_store: &dyn ObjectStore, + ) -> anyhow::Result; + + async fn save_artifacts( + job_id: u32, + artifacts: Self::OutputArtifacts, + object_store: &dyn ObjectStore, + ) -> BlobUrls; + + async fn update_database( + connection_pool: &ConnectionPool, + job_id: u32, + started_at: Instant, + blob_urls: BlobUrls, + artifacts: Self::OutputArtifacts, + ) -> anyhow::Result<()>; +} diff --git a/prover/crates/bin/witness_generator/src/basic_circuits/artifacts.rs b/prover/crates/bin/witness_generator/src/basic_circuits/artifacts.rs new file mode 100644 index 00000000000..3447659f829 --- /dev/null +++ b/prover/crates/bin/witness_generator/src/basic_circuits/artifacts.rs @@ -0,0 +1,108 @@ +use std::time::Instant; + +use async_trait::async_trait; +use zksync_object_store::ObjectStore; +use zksync_prover_dal::{ConnectionPool, Prover, ProverDal}; +use zksync_prover_fri_types::AuxOutputWitnessWrapper; +use zksync_prover_fri_utils::get_recursive_layer_circuit_id_for_base_layer; +use zksync_types::{basic_fri_types::AggregationRound, L1BatchNumber}; + +use crate::{ + artifacts::{ArtifactsManager, BlobUrls}, + basic_circuits::{BasicCircuitArtifacts, BasicWitnessGenerator, BasicWitnessGeneratorJob}, + utils::SchedulerPartialInputWrapper, +}; + +#[async_trait] +impl ArtifactsManager for BasicWitnessGenerator { + type InputMetadata = L1BatchNumber; + type InputArtifacts = BasicWitnessGeneratorJob; + type OutputArtifacts = BasicCircuitArtifacts; + + async fn get_artifacts( + metadata: &Self::InputMetadata, + object_store: &dyn ObjectStore, + ) -> anyhow::Result { + let l1_batch_number = *metadata; + let data = object_store.get(l1_batch_number).await.unwrap(); + Ok(BasicWitnessGeneratorJob { + block_number: l1_batch_number, + data, + }) + } + + async fn save_artifacts( + job_id: u32, + artifacts: Self::OutputArtifacts, + object_store: &dyn ObjectStore, + ) -> BlobUrls { + let aux_output_witness_wrapper = AuxOutputWitnessWrapper(artifacts.aux_output_witness); + object_store + .put(L1BatchNumber(job_id), &aux_output_witness_wrapper) + .await + .unwrap(); + let wrapper = SchedulerPartialInputWrapper(artifacts.scheduler_witness); + let url = object_store + .put(L1BatchNumber(job_id), &wrapper) + .await + .unwrap(); + + BlobUrls::Url(url) + } + + #[tracing::instrument(skip_all, fields(l1_batch = %job_id))] + async fn update_database( + connection_pool: &ConnectionPool, + job_id: u32, + started_at: Instant, + blob_urls: BlobUrls, + _artifacts: Self::OutputArtifacts, + ) -> anyhow::Result<()> { + let blob_urls = match blob_urls { + BlobUrls::Scheduler(blobs) => blobs, + _ => unreachable!(), + }; + + let mut connection = connection_pool + .connection() + .await + .expect("failed to get database connection"); + let mut transaction = connection + .start_transaction() + .await + .expect("failed to get database transaction"); + let protocol_version_id = transaction + .fri_witness_generator_dal() + .protocol_version_for_l1_batch(L1BatchNumber(job_id)) + .await; + transaction + .fri_prover_jobs_dal() + .insert_prover_jobs( + L1BatchNumber(job_id), + blob_urls.circuit_ids_and_urls, + AggregationRound::BasicCircuits, + 0, + protocol_version_id, + ) + .await; + transaction + .fri_witness_generator_dal() + .create_aggregation_jobs( + L1BatchNumber(job_id), + &blob_urls.closed_form_inputs_and_urls, + &blob_urls.scheduler_witness_url, + get_recursive_layer_circuit_id_for_base_layer, + protocol_version_id, + ) + .await; + transaction + .fri_witness_generator_dal() + .mark_witness_job_as_successful(L1BatchNumber(job_id), started_at.elapsed()) + .await; + transaction + .commit() + .await + .expect("failed to commit database transaction"); + Ok(()) + } +} diff --git a/prover/crates/bin/witness_generator/src/basic_circuits/job_processor.rs b/prover/crates/bin/witness_generator/src/basic_circuits/job_processor.rs new file mode 100644 index 00000000000..08732689e3a --- /dev/null +++ b/prover/crates/bin/witness_generator/src/basic_circuits/job_processor.rs @@ -0,0 +1,153 @@ +use std::{sync::Arc, time::Instant}; + +use anyhow::Context as _; +use tracing::Instrument; +use zksync_prover_dal::ProverDal; +use zksync_prover_fri_types::{get_current_pod_name, AuxOutputWitnessWrapper}; +use zksync_queued_job_processor::{async_trait, JobProcessor}; +use zksync_types::{basic_fri_types::AggregationRound, L1BatchNumber}; + +use crate::{ + artifacts::{ArtifactsManager, BlobUrls, SchedulerBlobUrls}, + basic_circuits::{BasicCircuitArtifacts, BasicWitnessGenerator, BasicWitnessGeneratorJob}, + metrics::WITNESS_GENERATOR_METRICS, +}; + +#[async_trait] +impl JobProcessor for BasicWitnessGenerator { + type Job = BasicWitnessGeneratorJob; + type JobId = L1BatchNumber; + // The artifact is optional to support skipping blocks when sampling is enabled. + type JobArtifacts = Option; + + const SERVICE_NAME: &'static str = "fri_basic_circuit_witness_generator"; + + async fn get_next_job(&self) -> anyhow::Result> { + let mut prover_connection = self.prover_connection_pool.connection().await?; + let last_l1_batch_to_process = self.config.last_l1_batch_to_process(); + let pod_name = get_current_pod_name(); + match prover_connection + .fri_witness_generator_dal() + .get_next_basic_circuit_witness_job( + last_l1_batch_to_process, + self.protocol_version, + &pod_name, + ) + .await + { + Some(block_number) => { + tracing::info!( + "Processing FRI basic witness-gen for block {}", + block_number + ); + let started_at = Instant::now(); + let job = Self::get_artifacts(&block_number, &*self.object_store).await?; + + WITNESS_GENERATOR_METRICS.blob_fetch_time[&AggregationRound::BasicCircuits.into()] + .observe(started_at.elapsed()); + + Ok(Some((block_number, job))) + } + None => Ok(None), + } + } + + async fn save_failure(&self, job_id: L1BatchNumber, _started_at: Instant, error: String) -> () { + self.prover_connection_pool + .connection() + .await + .unwrap() + .fri_witness_generator_dal() + .mark_witness_job_failed(&error, job_id) + .await; + } + + #[allow(clippy::async_yields_async)] + async fn process_job( + &self, + _job_id: &Self::JobId, + job: BasicWitnessGeneratorJob, + started_at: Instant, + ) -> tokio::task::JoinHandle>> { + let object_store = Arc::clone(&self.object_store); + let max_circuits_in_flight = self.config.max_circuits_in_flight; + tokio::spawn(async move { + let block_number = job.block_number; + Ok( + Self::process_job_impl(object_store, job, started_at, max_circuits_in_flight) + .instrument(tracing::info_span!("basic_circuit", %block_number)) + .await, + ) + }) + } + + #[tracing::instrument(skip_all, fields(l1_batch = %job_id))] + async fn save_result( + &self, + job_id: L1BatchNumber, + started_at: Instant, + optional_artifacts: Option, + ) -> anyhow::Result<()> { + match optional_artifacts { + None => Ok(()), + Some(artifacts) => { + let blob_started_at = Instant::now(); + let circuit_urls = artifacts.circuit_urls.clone(); + let queue_urls = artifacts.queue_urls.clone(); + + let aux_output_witness_wrapper = + AuxOutputWitnessWrapper(artifacts.aux_output_witness.clone()); + if self.config.shall_save_to_public_bucket { + self.public_blob_store.as_deref() + .expect("public_object_store shall not be empty while running with shall_save_to_public_bucket config") + .put(job_id, &aux_output_witness_wrapper) + .await + .unwrap(); + } + + let scheduler_witness_url = + match Self::save_artifacts(job_id.0, artifacts.clone(), &*self.object_store) + .await + { + BlobUrls::Url(url) => url, + _ => unreachable!(), + }; + + WITNESS_GENERATOR_METRICS.blob_save_time[&AggregationRound::BasicCircuits.into()] + .observe(blob_started_at.elapsed()); + + Self::update_database( + &self.prover_connection_pool, + job_id.0, + started_at, + BlobUrls::Scheduler(SchedulerBlobUrls { + circuit_ids_and_urls: circuit_urls, + closed_form_inputs_and_urls: queue_urls, + scheduler_witness_url, + }), + artifacts, + ) + .await?; + Ok(()) + } + } + } + + fn max_attempts(&self) -> u32 { + self.config.max_attempts + } + + async fn get_job_attempts(&self, job_id: &L1BatchNumber) -> anyhow::Result { + let mut prover_storage = self + .prover_connection_pool + .connection() + .await + .context("failed to acquire DB connection for BasicWitnessGenerator")?; + prover_storage + .fri_witness_generator_dal() + .get_basic_circuit_witness_job_attempts(*job_id) + .await + .map(|attempts| attempts.unwrap_or(0)) + .context("failed to get job attempts for BasicWitnessGenerator") + } +} diff --git a/prover/crates/bin/witness_generator/src/basic_circuits.rs b/prover/crates/bin/witness_generator/src/basic_circuits/mod.rs similarity index 63% rename from prover/crates/bin/witness_generator/src/basic_circuits.rs rename to prover/crates/bin/witness_generator/src/basic_circuits/mod.rs index 00a4d99ba9a..c9755c333da 100644 --- a/prover/crates/bin/witness_generator/src/basic_circuits.rs +++ b/prover/crates/bin/witness_generator/src/basic_circuits/mod.rs @@ -1,49 +1,43 @@ use std::{ - collections::{hash_map::DefaultHasher, HashSet}, - hash::{Hash, Hasher}, + collections::HashSet, + hash::{DefaultHasher, Hash, Hasher}, sync::Arc, time::Instant, }; -use anyhow::Context as _; -use async_trait::async_trait; use circuit_definitions::{ circuit_definitions::base_layer::{ZkSyncBaseLayerCircuit, ZkSyncBaseLayerStorage}, encodings::recursion_request::RecursionQueueSimulator, - zkevm_circuits::fsm_input_output::ClosedFormInputCompactFormWitness, + zkevm_circuits::{ + fsm_input_output::ClosedFormInputCompactFormWitness, + scheduler::{ + block_header::BlockAuxilaryOutputWitness, input::SchedulerCircuitInstanceWitness, + }, + }, }; use tokio::sync::Semaphore; use tracing::Instrument; -use zkevm_test_harness::{ - geometry_config::get_geometry_config, witness::oracle::WitnessGenerationArtifact, -}; +use zkevm_test_harness::witness::oracle::WitnessGenerationArtifact; use zksync_config::configs::FriWitnessGeneratorConfig; use zksync_multivm::{ - interface::storage::StorageView, - vm_latest::{constants::MAX_CYCLES_FOR_TX, HistoryDisabled, StorageOracle as VmStorageOracle}, -}; -use zksync_object_store::ObjectStore; -use zksync_prover_dal::{ConnectionPool, Prover, ProverDal}; -use zksync_prover_fri_types::{ - circuit_definitions::{ + circuit_sequencer_api_latest::{ boojum::{ field::goldilocks::{GoldilocksExt2, GoldilocksField}, gadgets::recursion::recursive_tree_hasher::CircuitGoldilocksPoseidon2Sponge, }, - zkevm_circuits::scheduler::{ - block_header::BlockAuxilaryOutputWitness, input::SchedulerCircuitInstanceWitness, - }, + geometry_config::get_geometry_config, }, - get_current_pod_name, - keys::ClosedFormInputKey, - AuxOutputWitnessWrapper, CircuitAuxData, + interface::storage::StorageView, + vm_latest::{constants::MAX_CYCLES_FOR_TX, HistoryDisabled, StorageOracle as VmStorageOracle}, + zk_evm_latest::ethereum_types::Address, }; -use zksync_prover_fri_utils::get_recursive_layer_circuit_id_for_base_layer; +use zksync_object_store::ObjectStore; +use zksync_prover_dal::{ConnectionPool, Prover}; +use zksync_prover_fri_types::{keys::ClosedFormInputKey, CircuitAuxData}; use zksync_prover_interface::inputs::WitnessInputData; -use zksync_queued_job_processor::JobProcessor; +use zksync_system_constants::BOOTLOADER_ADDRESS; use zksync_types::{ - basic_fri_types::AggregationRound, protocol_version::ProtocolSemanticVersion, Address, - L1BatchNumber, BOOTLOADER_ADDRESS, + basic_fri_types::AggregationRound, protocol_version::ProtocolSemanticVersion, L1BatchNumber, }; use crate::{ @@ -52,33 +46,30 @@ use crate::{ storage_oracle::StorageOracle, utils::{ expand_bootloader_contents, save_circuit, save_ram_premutation_queue_witness, - ClosedFormInputWrapper, SchedulerPartialInputWrapper, KZG_TRUSTED_SETUP_FILE, + ClosedFormInputWrapper, KZG_TRUSTED_SETUP_FILE, }, witness::WitnessStorage, }; +mod artifacts; +pub mod job_processor; + +#[derive(Clone)] pub struct BasicCircuitArtifacts { - circuit_urls: Vec<(u8, String)>, - queue_urls: Vec<(u8, String, usize)>, - scheduler_witness: SchedulerCircuitInstanceWitness< + pub(super) circuit_urls: Vec<(u8, String)>, + pub(super) queue_urls: Vec<(u8, String, usize)>, + pub(super) scheduler_witness: SchedulerCircuitInstanceWitness< GoldilocksField, CircuitGoldilocksPoseidon2Sponge, GoldilocksExt2, >, - aux_output_witness: BlockAuxilaryOutputWitness, -} - -#[derive(Debug)] -struct BlobUrls { - circuit_ids_and_urls: Vec<(u8, String)>, - closed_form_inputs_and_urls: Vec<(u8, String, usize)>, - scheduler_witness_url: String, + pub(super) aux_output_witness: BlockAuxilaryOutputWitness, } #[derive(Clone)] pub struct BasicWitnessGeneratorJob { - block_number: L1BatchNumber, - job: WitnessInputData, + pub(super) block_number: L1BatchNumber, + pub(super) data: WitnessInputData, } #[derive(Debug)] @@ -90,6 +81,17 @@ pub struct BasicWitnessGenerator { protocol_version: ProtocolSemanticVersion, } +type Witness = ( + Vec<(u8, String)>, + Vec<(u8, String, usize)>, + SchedulerCircuitInstanceWitness< + GoldilocksField, + CircuitGoldilocksPoseidon2Sponge, + GoldilocksExt2, + >, + BlockAuxilaryOutputWitness, +); + impl BasicWitnessGenerator { pub fn new( config: FriWitnessGeneratorConfig, @@ -113,7 +115,10 @@ impl BasicWitnessGenerator { started_at: Instant, max_circuits_in_flight: usize, ) -> Option { - let BasicWitnessGeneratorJob { block_number, job } = basic_job; + let BasicWitnessGeneratorJob { + block_number, + data: job, + } = basic_job; tracing::info!( "Starting witness generation of type {:?} for block {}", @@ -134,135 +139,8 @@ impl BasicWitnessGenerator { } } -#[async_trait] -impl JobProcessor for BasicWitnessGenerator { - type Job = BasicWitnessGeneratorJob; - type JobId = L1BatchNumber; - // The artifact is optional to support skipping blocks when sampling is enabled. - type JobArtifacts = Option; - - const SERVICE_NAME: &'static str = "fri_basic_circuit_witness_generator"; - - async fn get_next_job(&self) -> anyhow::Result> { - let mut prover_connection = self.prover_connection_pool.connection().await?; - let last_l1_batch_to_process = self.config.last_l1_batch_to_process(); - let pod_name = get_current_pod_name(); - match prover_connection - .fri_witness_generator_dal() - .get_next_basic_circuit_witness_job( - last_l1_batch_to_process, - self.protocol_version, - &pod_name, - ) - .await - { - Some(block_number) => { - tracing::info!( - "Processing FRI basic witness-gen for block {}", - block_number - ); - let started_at = Instant::now(); - let job = get_artifacts(block_number, &*self.object_store).await; - - WITNESS_GENERATOR_METRICS.blob_fetch_time[&AggregationRound::BasicCircuits.into()] - .observe(started_at.elapsed()); - - Ok(Some((block_number, job))) - } - None => Ok(None), - } - } - - async fn save_failure(&self, job_id: L1BatchNumber, _started_at: Instant, error: String) -> () { - self.prover_connection_pool - .connection() - .await - .unwrap() - .fri_witness_generator_dal() - .mark_witness_job_failed(&error, job_id) - .await; - } - - #[allow(clippy::async_yields_async)] - async fn process_job( - &self, - _job_id: &Self::JobId, - job: BasicWitnessGeneratorJob, - started_at: Instant, - ) -> tokio::task::JoinHandle>> { - let object_store = Arc::clone(&self.object_store); - let max_circuits_in_flight = self.config.max_circuits_in_flight; - tokio::spawn(async move { - let block_number = job.block_number; - Ok( - Self::process_job_impl(object_store, job, started_at, max_circuits_in_flight) - .instrument(tracing::info_span!("basic_circuit", %block_number)) - .await, - ) - }) - } - - #[tracing::instrument(skip_all, fields(l1_batch = %job_id))] - async fn save_result( - &self, - job_id: L1BatchNumber, - started_at: Instant, - optional_artifacts: Option, - ) -> anyhow::Result<()> { - match optional_artifacts { - None => Ok(()), - Some(artifacts) => { - let blob_started_at = Instant::now(); - let scheduler_witness_url = save_scheduler_artifacts( - job_id, - artifacts.scheduler_witness, - artifacts.aux_output_witness, - &*self.object_store, - self.public_blob_store.as_deref(), - self.config.shall_save_to_public_bucket, - ) - .await; - - WITNESS_GENERATOR_METRICS.blob_save_time[&AggregationRound::BasicCircuits.into()] - .observe(blob_started_at.elapsed()); - - update_database( - &self.prover_connection_pool, - started_at, - job_id, - BlobUrls { - circuit_ids_and_urls: artifacts.circuit_urls, - closed_form_inputs_and_urls: artifacts.queue_urls, - scheduler_witness_url, - }, - ) - .await; - Ok(()) - } - } - } - - fn max_attempts(&self) -> u32 { - self.config.max_attempts - } - - async fn get_job_attempts(&self, job_id: &L1BatchNumber) -> anyhow::Result { - let mut prover_storage = self - .prover_connection_pool - .connection() - .await - .context("failed to acquire DB connection for BasicWitnessGenerator")?; - prover_storage - .fri_witness_generator_dal() - .get_basic_circuit_witness_job_attempts(*job_id) - .await - .map(|attempts| attempts.unwrap_or(0)) - .context("failed to get job attempts for BasicWitnessGenerator") - } -} - #[tracing::instrument(skip_all, fields(l1_batch = %block_number))] -async fn process_basic_circuits_job( +pub(super) async fn process_basic_circuits_job( object_store: Arc, started_at: Instant, block_number: L1BatchNumber, @@ -287,93 +165,6 @@ async fn process_basic_circuits_job( } } -#[tracing::instrument(skip_all, fields(l1_batch = %block_number))] -async fn update_database( - prover_connection_pool: &ConnectionPool, - started_at: Instant, - block_number: L1BatchNumber, - blob_urls: BlobUrls, -) { - let mut connection = prover_connection_pool - .connection() - .await - .expect("failed to get database connection"); - let mut transaction = connection - .start_transaction() - .await - .expect("failed to get database transaction"); - let protocol_version_id = transaction - .fri_witness_generator_dal() - .protocol_version_for_l1_batch(block_number) - .await; - transaction - .fri_prover_jobs_dal() - .insert_prover_jobs( - block_number, - blob_urls.circuit_ids_and_urls, - AggregationRound::BasicCircuits, - 0, - protocol_version_id, - ) - .await; - transaction - .fri_witness_generator_dal() - .create_aggregation_jobs( - block_number, - &blob_urls.closed_form_inputs_and_urls, - &blob_urls.scheduler_witness_url, - get_recursive_layer_circuit_id_for_base_layer, - protocol_version_id, - ) - .await; - transaction - .fri_witness_generator_dal() - .mark_witness_job_as_successful(block_number, started_at.elapsed()) - .await; - transaction - .commit() - .await - .expect("failed to commit database transaction"); -} - -#[tracing::instrument(skip_all, fields(l1_batch = %block_number))] -async fn get_artifacts( - block_number: L1BatchNumber, - object_store: &dyn ObjectStore, -) -> BasicWitnessGeneratorJob { - let job = object_store.get(block_number).await.unwrap(); - BasicWitnessGeneratorJob { block_number, job } -} - -#[tracing::instrument(skip_all, fields(l1_batch = %block_number))] -async fn save_scheduler_artifacts( - block_number: L1BatchNumber, - scheduler_partial_input: SchedulerCircuitInstanceWitness< - GoldilocksField, - CircuitGoldilocksPoseidon2Sponge, - GoldilocksExt2, - >, - aux_output_witness: BlockAuxilaryOutputWitness, - object_store: &dyn ObjectStore, - public_object_store: Option<&dyn ObjectStore>, - shall_save_to_public_bucket: bool, -) -> String { - let aux_output_witness_wrapper = AuxOutputWitnessWrapper(aux_output_witness); - if shall_save_to_public_bucket { - public_object_store - .expect("public_object_store shall not be empty while running with shall_save_to_public_bucket config") - .put(block_number, &aux_output_witness_wrapper) - .await - .unwrap(); - } - object_store - .put(block_number, &aux_output_witness_wrapper) - .await - .unwrap(); - let wrapper = SchedulerPartialInputWrapper(scheduler_partial_input); - object_store.put(block_number, &wrapper).await.unwrap() -} - #[tracing::instrument(skip_all, fields(l1_batch = %block_number, circuit_id = %circuit_id))] async fn save_recursion_queue( block_number: L1BatchNumber, @@ -396,17 +187,6 @@ async fn save_recursion_queue( (circuit_id, blob_url, basic_circuit_count) } -type Witness = ( - Vec<(u8, String)>, - Vec<(u8, String, usize)>, - SchedulerCircuitInstanceWitness< - GoldilocksField, - CircuitGoldilocksPoseidon2Sponge, - GoldilocksExt2, - >, - BlockAuxilaryOutputWitness, -); - #[tracing::instrument(skip_all, fields(l1_batch = %block_number))] async fn generate_witness( block_number: L1BatchNumber, diff --git a/prover/crates/bin/witness_generator/src/leaf_aggregation/artifacts.rs b/prover/crates/bin/witness_generator/src/leaf_aggregation/artifacts.rs new file mode 100644 index 00000000000..a94587d00ec --- /dev/null +++ b/prover/crates/bin/witness_generator/src/leaf_aggregation/artifacts.rs @@ -0,0 +1,150 @@ +use std::time::Instant; + +use async_trait::async_trait; +use zksync_object_store::ObjectStore; +use zksync_prover_dal::{ConnectionPool, Prover, ProverDal}; +use zksync_prover_fri_types::keys::ClosedFormInputKey; +use zksync_prover_fri_utils::get_recursive_layer_circuit_id_for_base_layer; +use zksync_types::{basic_fri_types::AggregationRound, prover_dal::LeafAggregationJobMetadata}; + +use crate::{ + artifacts::{AggregationBlobUrls, ArtifactsManager, BlobUrls}, + leaf_aggregation::{LeafAggregationArtifacts, LeafAggregationWitnessGenerator}, + metrics::WITNESS_GENERATOR_METRICS, + utils::{save_node_aggregations_artifacts, ClosedFormInputWrapper}, +}; + +#[async_trait] +impl ArtifactsManager for LeafAggregationWitnessGenerator { + type InputMetadata = LeafAggregationJobMetadata; + type InputArtifacts = ClosedFormInputWrapper; + type OutputArtifacts = LeafAggregationArtifacts; + + async fn get_artifacts( + metadata: &Self::InputMetadata, + object_store: &dyn ObjectStore, + ) -> anyhow::Result { + let key = ClosedFormInputKey { + block_number: metadata.block_number, + circuit_id: metadata.circuit_id, + }; + + let artifacts = object_store + .get(key) + .await + .unwrap_or_else(|_| panic!("leaf aggregation job artifacts missing: {:?}", key)); + + Ok(artifacts) + } + + #[tracing::instrument( + skip_all, + fields(l1_batch = %artifacts.block_number, circuit_id = %artifacts.circuit_id) + )] + async fn save_artifacts( + _job_id: u32, + artifacts: Self::OutputArtifacts, + object_store: &dyn ObjectStore, + ) -> BlobUrls { + let started_at = Instant::now(); + let aggregations_urls = save_node_aggregations_artifacts( + artifacts.block_number, + get_recursive_layer_circuit_id_for_base_layer(artifacts.circuit_id), + 0, + artifacts.aggregations, + object_store, + ) + .await; + WITNESS_GENERATOR_METRICS.blob_save_time[&AggregationRound::LeafAggregation.into()] + .observe(started_at.elapsed()); + + BlobUrls::Aggregation(AggregationBlobUrls { + aggregations_urls, + circuit_ids_and_urls: artifacts.circuit_ids_and_urls, + }) + } + + #[tracing::instrument( + skip_all, + fields(l1_batch = %job_id) + )] + async fn update_database( + connection_pool: &ConnectionPool, + job_id: u32, + started_at: Instant, + blob_urls: BlobUrls, + artifacts: Self::OutputArtifacts, + ) -> anyhow::Result<()> { + tracing::info!( + "Updating database for job_id {}, block {} with circuit id {}", + job_id, + artifacts.block_number.0, + artifacts.circuit_id, + ); + + let blob_urls = match blob_urls { + BlobUrls::Aggregation(blob_urls) => blob_urls, + _ => panic!("Unexpected blob urls type"), + }; + + let mut prover_connection = connection_pool.connection().await.unwrap(); + let mut transaction = prover_connection.start_transaction().await.unwrap(); + let number_of_dependent_jobs = blob_urls.circuit_ids_and_urls.len(); + let protocol_version_id = transaction + .fri_witness_generator_dal() + .protocol_version_for_l1_batch(artifacts.block_number) + .await; + tracing::info!( + "Inserting {} prover jobs for job_id {}, block {} with circuit id {}", + blob_urls.circuit_ids_and_urls.len(), + job_id, + artifacts.block_number.0, + artifacts.circuit_id, + ); + transaction + .fri_prover_jobs_dal() + .insert_prover_jobs( + artifacts.block_number, + blob_urls.circuit_ids_and_urls, + AggregationRound::LeafAggregation, + 0, + protocol_version_id, + ) + .await; + tracing::info!( + "Updating node aggregation jobs url for job_id {}, block {} with circuit id {}", + job_id, + artifacts.block_number.0, + artifacts.circuit_id, + ); + transaction + .fri_witness_generator_dal() + .update_node_aggregation_jobs_url( + artifacts.block_number, + get_recursive_layer_circuit_id_for_base_layer(artifacts.circuit_id), + number_of_dependent_jobs, + 0, + blob_urls.aggregations_urls, + ) + .await; + tracing::info!( + "Marking leaf aggregation job as successful for job id {}, block {} with circuit id {}", + job_id, + artifacts.block_number.0, + artifacts.circuit_id, + ); + transaction + .fri_witness_generator_dal() + .mark_leaf_aggregation_as_successful(job_id, started_at.elapsed()) + .await; + + tracing::info!( + "Committing transaction for job_id {}, block {} with circuit id {}", + job_id, + artifacts.block_number.0, + artifacts.circuit_id, + ); + transaction.commit().await?; + Ok(()) + } +} diff --git a/prover/crates/bin/witness_generator/src/leaf_aggregation/job_processor.rs b/prover/crates/bin/witness_generator/src/leaf_aggregation/job_processor.rs new file mode 100644 index 00000000000..e032084151e --- /dev/null +++ b/prover/crates/bin/witness_generator/src/leaf_aggregation/job_processor.rs @@ -0,0 +1,124 @@ +use std::time::Instant; + +use anyhow::Context as _; +use async_trait::async_trait; +use zksync_prover_dal::ProverDal; +use zksync_prover_fri_types::get_current_pod_name; +use zksync_queued_job_processor::JobProcessor; +use zksync_types::basic_fri_types::AggregationRound; + +use crate::{ + artifacts::ArtifactsManager, + leaf_aggregation::{ + prepare_leaf_aggregation_job, LeafAggregationArtifacts, LeafAggregationWitnessGenerator, + LeafAggregationWitnessGeneratorJob, + }, + metrics::WITNESS_GENERATOR_METRICS, +}; + +#[async_trait] +impl JobProcessor for LeafAggregationWitnessGenerator { + type Job = LeafAggregationWitnessGeneratorJob; + type JobId = u32; + type JobArtifacts = LeafAggregationArtifacts; + + const SERVICE_NAME: &'static str = "fri_leaf_aggregation_witness_generator"; + + async fn get_next_job(&self) -> anyhow::Result> { + let mut prover_connection = self.prover_connection_pool.connection().await?; + let pod_name = get_current_pod_name(); + let Some(metadata) = prover_connection + .fri_witness_generator_dal() + .get_next_leaf_aggregation_job(self.protocol_version, &pod_name) + .await + else { + return Ok(None); + }; + tracing::info!("Processing leaf aggregation job {:?}", metadata.id); + Ok(Some(( + metadata.id, + prepare_leaf_aggregation_job(metadata, &*self.object_store, self.keystore.clone()) + .await + .context("prepare_leaf_aggregation_job()")?, + ))) + } + + async fn save_failure(&self, job_id: u32, _started_at: Instant, error: String) -> () { + self.prover_connection_pool + .connection() + .await + .unwrap() + .fri_witness_generator_dal() + .mark_leaf_aggregation_job_failed(&error, job_id) + .await; + } + + #[allow(clippy::async_yields_async)] + async fn process_job( + &self, + _job_id: &Self::JobId, + job: LeafAggregationWitnessGeneratorJob, + started_at: Instant, + ) -> tokio::task::JoinHandle> { + let object_store = self.object_store.clone(); + let max_circuits_in_flight = self.config.max_circuits_in_flight; + tokio::spawn(async move { + Ok(Self::process_job_impl(job, started_at, object_store, max_circuits_in_flight).await) + }) + } + + async fn save_result( + &self, + job_id: u32, + started_at: Instant, + artifacts: LeafAggregationArtifacts, + ) -> anyhow::Result<()> { + let block_number = artifacts.block_number; + let circuit_id = artifacts.circuit_id; + tracing::info!( + "Saving leaf aggregation artifacts for block {} with circuit {}", + block_number.0, + circuit_id, + ); + + let blob_save_started_at = Instant::now(); + + let blob_urls = Self::save_artifacts(job_id, artifacts.clone(), &*self.object_store).await; + + WITNESS_GENERATOR_METRICS.blob_save_time[&AggregationRound::LeafAggregation.into()] + .observe(blob_save_started_at.elapsed()); + + tracing::info!( + "Saved leaf aggregation artifacts for block {} with circuit {}", + block_number.0, + circuit_id, + ); + Self::update_database( + &self.prover_connection_pool, + job_id, + started_at, + blob_urls, + artifacts, + ) + .await?; + Ok(()) + } + + fn max_attempts(&self) -> u32 { + self.config.max_attempts + } + + async fn get_job_attempts(&self, job_id: &u32) -> anyhow::Result { + let mut prover_storage = self + .prover_connection_pool + .connection() + .await + .context("failed to acquire DB connection for LeafAggregationWitnessGenerator")?; + prover_storage + .fri_witness_generator_dal() + .get_leaf_aggregation_job_attempts(*job_id) + .await + .map(|attempts| attempts.unwrap_or(0)) + .context("failed to get job attempts for LeafAggregationWitnessGenerator") + } +} diff --git a/prover/crates/bin/witness_generator/src/leaf_aggregation.rs b/prover/crates/bin/witness_generator/src/leaf_aggregation/mod.rs similarity index 52% rename from prover/crates/bin/witness_generator/src/leaf_aggregation.rs rename to prover/crates/bin/witness_generator/src/leaf_aggregation/mod.rs index 503c46e41bb..d669a4cc97e 100644 --- a/prover/crates/bin/witness_generator/src/leaf_aggregation.rs +++ b/prover/crates/bin/witness_generator/src/leaf_aggregation/mod.rs @@ -1,7 +1,6 @@ use std::{sync::Arc, time::Instant}; use anyhow::Context as _; -use async_trait::async_trait; use circuit_definitions::circuit_definitions::recursion_layer::base_circuit_type_into_recursive_leaf_circuit_type; use tokio::sync::Semaphore; use zkevm_test_harness::{ @@ -12,7 +11,7 @@ use zkevm_test_harness::{ }; use zksync_config::configs::FriWitnessGeneratorConfig; use zksync_object_store::ObjectStore; -use zksync_prover_dal::{ConnectionPool, Prover, ProverDal}; +use zksync_prover_dal::{ConnectionPool, Prover}; use zksync_prover_fri_types::{ circuit_definitions::{ boojum::field::goldilocks::GoldilocksField, @@ -22,40 +21,25 @@ use zksync_prover_fri_types::{ encodings::recursion_request::RecursionQueueSimulator, zkevm_circuits::recursion::leaf_layer::input::RecursionLeafParametersWitness, }, - get_current_pod_name, - keys::ClosedFormInputKey, 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 crate::{ + artifacts::ArtifactsManager, metrics::WITNESS_GENERATOR_METRICS, utils::{ - load_proofs_for_job_ids, save_node_aggregations_artifacts, - save_recursive_layer_prover_input_artifacts, ClosedFormInputWrapper, + load_proofs_for_job_ids, save_recursive_layer_prover_input_artifacts, + ClosedFormInputWrapper, }, }; -pub struct LeafAggregationArtifacts { - circuit_id: u8, - block_number: L1BatchNumber, - pub aggregations: Vec<(u64, RecursionQueueSimulator)>, - pub circuit_ids_and_urls: Vec<(u8, String)>, - #[allow(dead_code)] - closed_form_inputs: Vec>, -} - -#[derive(Debug)] -struct BlobUrls { - circuit_ids_and_urls: Vec<(u8, String)>, - aggregations_urls: String, -} +mod artifacts; +mod job_processor; pub struct LeafAggregationWitnessGeneratorJob { pub(crate) circuit_id: u8, @@ -75,6 +59,16 @@ pub struct LeafAggregationWitnessGenerator { keystore: Keystore, } +#[derive(Clone)] +pub struct LeafAggregationArtifacts { + circuit_id: u8, + block_number: L1BatchNumber, + pub aggregations: Vec<(u64, RecursionQueueSimulator)>, + pub circuit_ids_and_urls: Vec<(u8, String)>, + #[allow(dead_code)] + closed_form_inputs: Vec>, +} + impl LeafAggregationWitnessGenerator { pub fn new( config: FriWitnessGeneratorConfig, @@ -113,108 +107,6 @@ impl LeafAggregationWitnessGenerator { } } -#[async_trait] -impl JobProcessor for LeafAggregationWitnessGenerator { - type Job = LeafAggregationWitnessGeneratorJob; - type JobId = u32; - type JobArtifacts = LeafAggregationArtifacts; - - const SERVICE_NAME: &'static str = "fri_leaf_aggregation_witness_generator"; - - async fn get_next_job(&self) -> anyhow::Result> { - let mut prover_connection = self.prover_connection_pool.connection().await?; - let pod_name = get_current_pod_name(); - let Some(metadata) = prover_connection - .fri_witness_generator_dal() - .get_next_leaf_aggregation_job(self.protocol_version, &pod_name) - .await - else { - return Ok(None); - }; - tracing::info!("Processing leaf aggregation job {:?}", metadata.id); - Ok(Some(( - metadata.id, - prepare_leaf_aggregation_job(metadata, &*self.object_store, self.keystore.clone()) - .await - .context("prepare_leaf_aggregation_job()")?, - ))) - } - - async fn save_failure(&self, job_id: u32, _started_at: Instant, error: String) -> () { - self.prover_connection_pool - .connection() - .await - .unwrap() - .fri_witness_generator_dal() - .mark_leaf_aggregation_job_failed(&error, job_id) - .await; - } - - #[allow(clippy::async_yields_async)] - async fn process_job( - &self, - _job_id: &Self::JobId, - job: LeafAggregationWitnessGeneratorJob, - started_at: Instant, - ) -> tokio::task::JoinHandle> { - let object_store = self.object_store.clone(); - let max_circuits_in_flight = self.config.max_circuits_in_flight; - tokio::spawn(async move { - Ok(Self::process_job_impl(job, started_at, object_store, max_circuits_in_flight).await) - }) - } - - async fn save_result( - &self, - job_id: u32, - started_at: Instant, - artifacts: LeafAggregationArtifacts, - ) -> anyhow::Result<()> { - let block_number = artifacts.block_number; - let circuit_id = artifacts.circuit_id; - tracing::info!( - "Saving leaf aggregation artifacts for block {} with circuit {}", - block_number.0, - circuit_id, - ); - let blob_urls = save_artifacts(artifacts, &*self.object_store).await; - tracing::info!( - "Saved leaf aggregation artifacts for block {} with circuit {} (count: {})", - block_number.0, - circuit_id, - blob_urls.circuit_ids_and_urls.len(), - ); - update_database( - &self.prover_connection_pool, - started_at, - block_number, - job_id, - blob_urls, - circuit_id, - ) - .await; - Ok(()) - } - - fn max_attempts(&self) -> u32 { - self.config.max_attempts - } - - async fn get_job_attempts(&self, job_id: &u32) -> anyhow::Result { - let mut prover_storage = self - .prover_connection_pool - .connection() - .await - .context("failed to acquire DB connection for LeafAggregationWitnessGenerator")?; - prover_storage - .fri_witness_generator_dal() - .get_leaf_aggregation_job_attempts(*job_id) - .await - .map(|attempts| attempts.unwrap_or(0)) - .context("failed to get job attempts for LeafAggregationWitnessGenerator") - } -} - #[tracing::instrument( skip_all, fields(l1_batch = %metadata.block_number, circuit_id = %metadata.circuit_id) @@ -225,7 +117,8 @@ pub async fn prepare_leaf_aggregation_job( keystore: Keystore, ) -> anyhow::Result { let started_at = Instant::now(); - let closed_form_input = get_artifacts(&metadata, object_store).await; + let closed_form_input = + LeafAggregationWitnessGenerator::get_artifacts(&metadata, object_store).await?; WITNESS_GENERATOR_METRICS.blob_fetch_time[&AggregationRound::LeafAggregation.into()] .observe(started_at.elapsed()); @@ -368,125 +261,3 @@ pub async fn process_leaf_aggregation_job( closed_form_inputs: job.closed_form_inputs.0, } } - -#[tracing::instrument( - skip_all, - fields(l1_batch = %block_number, circuit_id = %circuit_id) -)] -async fn update_database( - prover_connection_pool: &ConnectionPool, - started_at: Instant, - block_number: L1BatchNumber, - job_id: u32, - blob_urls: BlobUrls, - circuit_id: u8, -) { - tracing::info!( - "Updating database for job_id {}, block {} with circuit id {}", - job_id, - block_number.0, - circuit_id, - ); - let mut prover_connection = prover_connection_pool.connection().await.unwrap(); - let mut transaction = prover_connection.start_transaction().await.unwrap(); - let number_of_dependent_jobs = blob_urls.circuit_ids_and_urls.len(); - let protocol_version_id = transaction - .fri_witness_generator_dal() - .protocol_version_for_l1_batch(block_number) - .await; - tracing::info!( - "Inserting {} prover jobs for job_id {}, block {} with circuit id {}", - blob_urls.circuit_ids_and_urls.len(), - job_id, - block_number.0, - circuit_id, - ); - transaction - .fri_prover_jobs_dal() - .insert_prover_jobs( - block_number, - blob_urls.circuit_ids_and_urls, - AggregationRound::LeafAggregation, - 0, - protocol_version_id, - ) - .await; - tracing::info!( - "Updating node aggregation jobs url for job_id {}, block {} with circuit id {}", - job_id, - block_number.0, - circuit_id, - ); - transaction - .fri_witness_generator_dal() - .update_node_aggregation_jobs_url( - block_number, - get_recursive_layer_circuit_id_for_base_layer(circuit_id), - number_of_dependent_jobs, - 0, - blob_urls.aggregations_urls, - ) - .await; - tracing::info!( - "Marking leaf aggregation job as successful for job id {}, block {} with circuit id {}", - job_id, - block_number.0, - circuit_id, - ); - transaction - .fri_witness_generator_dal() - .mark_leaf_aggregation_as_successful(job_id, started_at.elapsed()) - .await; - - tracing::info!( - "Committing transaction for job_id {}, block {} with circuit id {}", - job_id, - block_number.0, - circuit_id, - ); - transaction.commit().await.unwrap(); -} - -#[tracing::instrument( - skip_all, - fields(l1_batch = %metadata.block_number, circuit_id = %metadata.circuit_id) -)] -async fn get_artifacts( - metadata: &LeafAggregationJobMetadata, - object_store: &dyn ObjectStore, -) -> ClosedFormInputWrapper { - let key = ClosedFormInputKey { - block_number: metadata.block_number, - circuit_id: metadata.circuit_id, - }; - object_store - .get(key) - .await - .unwrap_or_else(|_| panic!("leaf aggregation job artifacts missing: {:?}", key)) -} - -#[tracing::instrument( - skip_all, - fields(l1_batch = %artifacts.block_number, circuit_id = %artifacts.circuit_id) -)] -async fn save_artifacts( - artifacts: LeafAggregationArtifacts, - object_store: &dyn ObjectStore, -) -> BlobUrls { - let started_at = Instant::now(); - let aggregations_urls = save_node_aggregations_artifacts( - artifacts.block_number, - get_recursive_layer_circuit_id_for_base_layer(artifacts.circuit_id), - 0, - artifacts.aggregations, - object_store, - ) - .await; - WITNESS_GENERATOR_METRICS.blob_save_time[&AggregationRound::LeafAggregation.into()] - .observe(started_at.elapsed()); - - BlobUrls { - circuit_ids_and_urls: artifacts.circuit_ids_and_urls, - aggregations_urls, - } -} diff --git a/prover/crates/bin/witness_generator/src/lib.rs b/prover/crates/bin/witness_generator/src/lib.rs index 00d2ebf2bb3..c0ac9718c6e 100644 --- a/prover/crates/bin/witness_generator/src/lib.rs +++ b/prover/crates/bin/witness_generator/src/lib.rs @@ -1,6 +1,7 @@ #![allow(incomplete_features)] // We have to use generic const exprs. #![feature(generic_const_exprs)] +pub mod artifacts; pub mod basic_circuits; pub mod leaf_aggregation; pub mod metrics; diff --git a/prover/crates/bin/witness_generator/src/node_aggregation/artifacts.rs b/prover/crates/bin/witness_generator/src/node_aggregation/artifacts.rs new file mode 100644 index 00000000000..245027f0d67 --- /dev/null +++ b/prover/crates/bin/witness_generator/src/node_aggregation/artifacts.rs @@ -0,0 +1,146 @@ +use std::time::Instant; + +use async_trait::async_trait; +use zksync_object_store::ObjectStore; +use zksync_prover_dal::{ConnectionPool, Prover, ProverDal}; +use zksync_prover_fri_types::keys::AggregationsKey; +use zksync_types::{basic_fri_types::AggregationRound, prover_dal::NodeAggregationJobMetadata}; + +use crate::{ + artifacts::{AggregationBlobUrls, ArtifactsManager, BlobUrls}, + metrics::WITNESS_GENERATOR_METRICS, + node_aggregation::{NodeAggregationArtifacts, NodeAggregationWitnessGenerator}, + utils::{save_node_aggregations_artifacts, AggregationWrapper}, +}; + +#[async_trait] +impl ArtifactsManager for NodeAggregationWitnessGenerator { + type InputMetadata = NodeAggregationJobMetadata; + type InputArtifacts = AggregationWrapper; + type OutputArtifacts = NodeAggregationArtifacts; + + #[tracing::instrument( + skip_all, + fields(l1_batch = % metadata.block_number, circuit_id = % metadata.circuit_id) + )] + async fn get_artifacts( + metadata: &Self::InputMetadata, + object_store: &dyn ObjectStore, + ) -> anyhow::Result { + let key = AggregationsKey { + block_number: metadata.block_number, + circuit_id: metadata.circuit_id, + depth: metadata.depth, + }; + let artifacts = object_store.get(key).await.unwrap_or_else(|error| { + panic!( + "node aggregation job artifacts getting error. Key: {:?}, error: {:?}", + key, error + ) + }); + + Ok(artifacts) + } + + #[tracing::instrument( + skip_all, + fields(l1_batch = %artifacts.block_number, circuit_id = %artifacts.circuit_id) + )] + async fn save_artifacts( + _job_id: u32, + artifacts: Self::OutputArtifacts, + object_store: &dyn ObjectStore, + ) -> BlobUrls { + let started_at = Instant::now(); + let aggregations_urls = save_node_aggregations_artifacts( + artifacts.block_number, + artifacts.circuit_id, + artifacts.depth, + artifacts.next_aggregations, + object_store, + ) + .await; + + WITNESS_GENERATOR_METRICS.blob_save_time[&AggregationRound::NodeAggregation.into()] + .observe(started_at.elapsed()); + + BlobUrls::Aggregation(AggregationBlobUrls { + aggregations_urls, + circuit_ids_and_urls: artifacts.recursive_circuit_ids_and_urls, + }) + } + + #[tracing::instrument( + skip_all, + fields(l1_batch = % job_id) + )] + async fn update_database( + connection_pool: &ConnectionPool, + job_id: u32, + started_at: Instant, + blob_urls: BlobUrls, + artifacts: Self::OutputArtifacts, + ) -> anyhow::Result<()> { + let mut prover_connection = connection_pool.connection().await.unwrap(); + let blob_urls = match blob_urls { + BlobUrls::Aggregation(blobs) => blobs, + _ => unreachable!(), + }; + let mut transaction = prover_connection.start_transaction().await.unwrap(); + let dependent_jobs = blob_urls.circuit_ids_and_urls.len(); + let protocol_version_id = transaction + .fri_witness_generator_dal() + .protocol_version_for_l1_batch(artifacts.block_number) + .await; + match artifacts.next_aggregations.len() > 1 { + true => { + transaction + .fri_prover_jobs_dal() + .insert_prover_jobs( + artifacts.block_number, + blob_urls.circuit_ids_and_urls, + AggregationRound::NodeAggregation, + artifacts.depth, + protocol_version_id, + ) + .await; + transaction + .fri_witness_generator_dal() + .insert_node_aggregation_jobs( + artifacts.block_number, + artifacts.circuit_id, + Some(dependent_jobs as i32), + artifacts.depth, + &blob_urls.aggregations_urls, + protocol_version_id, + ) + .await; + } + false => { + let (_, blob_url) = blob_urls.circuit_ids_and_urls[0].clone(); + transaction + .fri_prover_jobs_dal() + .insert_prover_job( + artifacts.block_number, + artifacts.circuit_id, + artifacts.depth, + 0, + AggregationRound::NodeAggregation, + &blob_url, + true, + protocol_version_id, + ) + .await + } + } + + transaction + .fri_witness_generator_dal() + .mark_node_aggregation_as_successful(job_id, started_at.elapsed()) + .await; + + transaction.commit().await?; + + Ok(()) + } +} diff --git a/prover/crates/bin/witness_generator/src/node_aggregation/job_processor.rs b/prover/crates/bin/witness_generator/src/node_aggregation/job_processor.rs new file mode 100644 index 00000000000..a015462cd6f --- /dev/null +++ b/prover/crates/bin/witness_generator/src/node_aggregation/job_processor.rs @@ -0,0 +1,115 @@ +use std::time::Instant; + +use anyhow::Context as _; +use async_trait::async_trait; +use zksync_prover_dal::ProverDal; +use zksync_prover_fri_types::get_current_pod_name; +use zksync_queued_job_processor::JobProcessor; +use zksync_types::basic_fri_types::AggregationRound; + +use crate::{ + artifacts::ArtifactsManager, + metrics::WITNESS_GENERATOR_METRICS, + node_aggregation::{ + prepare_job, NodeAggregationArtifacts, NodeAggregationWitnessGenerator, + NodeAggregationWitnessGeneratorJob, + }, +}; + +#[async_trait] +impl JobProcessor for NodeAggregationWitnessGenerator { + type Job = NodeAggregationWitnessGeneratorJob; + type JobId = u32; + type JobArtifacts = NodeAggregationArtifacts; + + const SERVICE_NAME: &'static str = "fri_node_aggregation_witness_generator"; + + async fn get_next_job(&self) -> anyhow::Result> { + let mut prover_connection = self.prover_connection_pool.connection().await?; + let pod_name = get_current_pod_name(); + let Some(metadata) = prover_connection + .fri_witness_generator_dal() + .get_next_node_aggregation_job(self.protocol_version, &pod_name) + .await + else { + return Ok(None); + }; + tracing::info!("Processing node aggregation job {:?}", metadata.id); + Ok(Some(( + metadata.id, + prepare_job(metadata, &*self.object_store, self.keystore.clone()) + .await + .context("prepare_job()")?, + ))) + } + + async fn save_failure(&self, job_id: u32, _started_at: Instant, error: String) -> () { + self.prover_connection_pool + .connection() + .await + .unwrap() + .fri_witness_generator_dal() + .mark_node_aggregation_job_failed(&error, job_id) + .await; + } + + #[allow(clippy::async_yields_async)] + async fn process_job( + &self, + _job_id: &Self::JobId, + job: NodeAggregationWitnessGeneratorJob, + started_at: Instant, + ) -> tokio::task::JoinHandle> { + let object_store = self.object_store.clone(); + let max_circuits_in_flight = self.config.max_circuits_in_flight; + tokio::spawn(async move { + Ok(Self::process_job_impl(job, started_at, object_store, max_circuits_in_flight).await) + }) + } + + #[tracing::instrument( + skip_all, + fields(l1_batch = % artifacts.block_number, circuit_id = % artifacts.circuit_id) + )] + async fn save_result( + &self, + job_id: u32, + started_at: Instant, + artifacts: NodeAggregationArtifacts, + ) -> anyhow::Result<()> { + let blob_save_started_at = Instant::now(); + + let blob_urls = Self::save_artifacts(job_id, artifacts.clone(), &*self.object_store).await; + + WITNESS_GENERATOR_METRICS.blob_save_time[&AggregationRound::NodeAggregation.into()] + .observe(blob_save_started_at.elapsed()); + + Self::update_database( + &self.prover_connection_pool, + job_id, + started_at, + blob_urls, + artifacts, + ) + .await?; + Ok(()) + } + + fn max_attempts(&self) -> u32 { + self.config.max_attempts + } + + async fn get_job_attempts(&self, job_id: &u32) -> anyhow::Result { + let mut prover_storage = self + .prover_connection_pool + .connection() + .await + .context("failed to acquire DB connection for NodeAggregationWitnessGenerator")?; + prover_storage + .fri_witness_generator_dal() + .get_node_aggregation_job_attempts(*job_id) + .await + .map(|attempts| attempts.unwrap_or(0)) + .context("failed to get job attempts for NodeAggregationWitnessGenerator") + } +} diff --git a/prover/crates/bin/witness_generator/src/node_aggregation.rs b/prover/crates/bin/witness_generator/src/node_aggregation/mod.rs similarity index 52% rename from prover/crates/bin/witness_generator/src/node_aggregation.rs rename to prover/crates/bin/witness_generator/src/node_aggregation/mod.rs index 72bdebde572..047caa363a8 100644 --- a/prover/crates/bin/witness_generator/src/node_aggregation.rs +++ b/prover/crates/bin/witness_generator/src/node_aggregation/mod.rs @@ -1,7 +1,6 @@ use std::{sync::Arc, time::Instant}; use anyhow::Context as _; -use async_trait::async_trait; use circuit_definitions::circuit_definitions::recursion_layer::RECURSION_ARITY; use tokio::sync::Semaphore; use zkevm_test_harness::witness::recursive_aggregation::{ @@ -9,7 +8,7 @@ use zkevm_test_harness::witness::recursive_aggregation::{ }; use zksync_config::configs::FriWitnessGeneratorConfig; use zksync_object_store::ObjectStore; -use zksync_prover_dal::{ConnectionPool, Prover, ProverDal}; +use zksync_prover_dal::{ConnectionPool, Prover}; use zksync_prover_fri_types::{ circuit_definitions::{ boojum::field::goldilocks::GoldilocksField, @@ -19,25 +18,24 @@ use zksync_prover_fri_types::{ encodings::recursion_request::RecursionQueueSimulator, zkevm_circuits::recursion::leaf_layer::input::RecursionLeafParametersWitness, }, - get_current_pod_name, - 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 crate::{ + artifacts::ArtifactsManager, metrics::WITNESS_GENERATOR_METRICS, - utils::{ - load_proofs_for_job_ids, save_node_aggregations_artifacts, - save_recursive_layer_prover_input_artifacts, AggregationWrapper, - }, + utils::{load_proofs_for_job_ids, save_recursive_layer_prover_input_artifacts}, }; +mod artifacts; +mod job_processor; + +#[derive(Clone)] pub struct NodeAggregationArtifacts { circuit_id: u8, block_number: L1BatchNumber, @@ -46,12 +44,6 @@ pub struct NodeAggregationArtifacts { pub recursive_circuit_ids_and_urls: Vec<(u8, String)>, } -#[derive(Debug)] -struct BlobUrls { - node_aggregations_url: String, - circuit_ids_and_urls: Vec<(u8, String)>, -} - #[derive(Clone)] pub struct NodeAggregationWitnessGeneratorJob { circuit_id: u8, @@ -92,7 +84,7 @@ impl NodeAggregationWitnessGenerator { #[tracing::instrument( skip_all, - fields(l1_batch = %job.block_number, circuit_id = %job.circuit_id) + fields(l1_batch = % job.block_number, circuit_id = % job.circuit_id) )] pub async fn process_job_impl( job: NodeAggregationWitnessGeneratorJob, @@ -223,108 +215,9 @@ impl NodeAggregationWitnessGenerator { } } -#[async_trait] -impl JobProcessor for NodeAggregationWitnessGenerator { - type Job = NodeAggregationWitnessGeneratorJob; - type JobId = u32; - type JobArtifacts = NodeAggregationArtifacts; - - const SERVICE_NAME: &'static str = "fri_node_aggregation_witness_generator"; - - async fn get_next_job(&self) -> anyhow::Result> { - let mut prover_connection = self.prover_connection_pool.connection().await?; - let pod_name = get_current_pod_name(); - let Some(metadata) = prover_connection - .fri_witness_generator_dal() - .get_next_node_aggregation_job(self.protocol_version, &pod_name) - .await - else { - return Ok(None); - }; - tracing::info!("Processing node aggregation job {:?}", metadata.id); - Ok(Some(( - metadata.id, - prepare_job(metadata, &*self.object_store, self.keystore.clone()) - .await - .context("prepare_job()")?, - ))) - } - - async fn save_failure(&self, job_id: u32, _started_at: Instant, error: String) -> () { - self.prover_connection_pool - .connection() - .await - .unwrap() - .fri_witness_generator_dal() - .mark_node_aggregation_job_failed(&error, job_id) - .await; - } - - #[allow(clippy::async_yields_async)] - async fn process_job( - &self, - _job_id: &Self::JobId, - job: NodeAggregationWitnessGeneratorJob, - started_at: Instant, - ) -> tokio::task::JoinHandle> { - let object_store = self.object_store.clone(); - let max_circuits_in_flight = self.config.max_circuits_in_flight; - tokio::spawn(async move { - Ok(Self::process_job_impl(job, started_at, object_store, max_circuits_in_flight).await) - }) - } - - #[tracing::instrument( - skip_all, - fields(l1_batch = %artifacts.block_number, circuit_id = %artifacts.circuit_id) - )] - async fn save_result( - &self, - job_id: u32, - started_at: Instant, - artifacts: NodeAggregationArtifacts, - ) -> anyhow::Result<()> { - let block_number = artifacts.block_number; - let circuit_id = artifacts.circuit_id; - let depth = artifacts.depth; - let shall_continue_node_aggregations = artifacts.next_aggregations.len() > 1; - let blob_urls = save_artifacts(artifacts, &*self.object_store).await; - update_database( - &self.prover_connection_pool, - started_at, - job_id, - block_number, - depth, - circuit_id, - blob_urls, - shall_continue_node_aggregations, - ) - .await; - Ok(()) - } - - fn max_attempts(&self) -> u32 { - self.config.max_attempts - } - - async fn get_job_attempts(&self, job_id: &u32) -> anyhow::Result { - let mut prover_storage = self - .prover_connection_pool - .connection() - .await - .context("failed to acquire DB connection for NodeAggregationWitnessGenerator")?; - prover_storage - .fri_witness_generator_dal() - .get_node_aggregation_job_attempts(*job_id) - .await - .map(|attempts| attempts.unwrap_or(0)) - .context("failed to get job attempts for NodeAggregationWitnessGenerator") - } -} - #[tracing::instrument( skip_all, - fields(l1_batch = %metadata.block_number, circuit_id = %metadata.circuit_id) + fields(l1_batch = % metadata.block_number, circuit_id = % metadata.circuit_id) )] pub async fn prepare_job( metadata: NodeAggregationJobMetadata, @@ -332,7 +225,7 @@ pub async fn prepare_job( keystore: Keystore, ) -> anyhow::Result { let started_at = Instant::now(); - let artifacts = get_artifacts(&metadata, object_store).await; + let artifacts = NodeAggregationWitnessGenerator::get_artifacts(&metadata, object_store).await?; WITNESS_GENERATOR_METRICS.blob_fetch_time[&AggregationRound::NodeAggregation.into()] .observe(started_at.elapsed()); @@ -361,123 +254,3 @@ pub async fn prepare_job( all_leafs_layer_params: get_leaf_vk_params(&keystore).context("get_leaf_vk_params()")?, }) } - -#[allow(clippy::too_many_arguments)] -#[tracing::instrument( - skip_all, - fields(l1_batch = %block_number, circuit_id = %circuit_id) -)] -async fn update_database( - prover_connection_pool: &ConnectionPool, - started_at: Instant, - id: u32, - block_number: L1BatchNumber, - depth: u16, - circuit_id: u8, - blob_urls: BlobUrls, - shall_continue_node_aggregations: bool, -) { - let mut prover_connection = prover_connection_pool.connection().await.unwrap(); - let mut transaction = prover_connection.start_transaction().await.unwrap(); - let dependent_jobs = blob_urls.circuit_ids_and_urls.len(); - let protocol_version_id = transaction - .fri_witness_generator_dal() - .protocol_version_for_l1_batch(block_number) - .await; - match shall_continue_node_aggregations { - true => { - transaction - .fri_prover_jobs_dal() - .insert_prover_jobs( - block_number, - blob_urls.circuit_ids_and_urls, - AggregationRound::NodeAggregation, - depth, - protocol_version_id, - ) - .await; - transaction - .fri_witness_generator_dal() - .insert_node_aggregation_jobs( - block_number, - circuit_id, - Some(dependent_jobs as i32), - depth, - &blob_urls.node_aggregations_url, - protocol_version_id, - ) - .await; - } - false => { - let (_, blob_url) = blob_urls.circuit_ids_and_urls[0].clone(); - transaction - .fri_prover_jobs_dal() - .insert_prover_job( - block_number, - circuit_id, - depth, - 0, - AggregationRound::NodeAggregation, - &blob_url, - true, - protocol_version_id, - ) - .await - } - } - - transaction - .fri_witness_generator_dal() - .mark_node_aggregation_as_successful(id, started_at.elapsed()) - .await; - - transaction.commit().await.unwrap(); -} - -#[tracing::instrument( - skip_all, - fields(l1_batch = %metadata.block_number, circuit_id = %metadata.circuit_id) -)] -async fn get_artifacts( - metadata: &NodeAggregationJobMetadata, - object_store: &dyn ObjectStore, -) -> AggregationWrapper { - let key = AggregationsKey { - block_number: metadata.block_number, - circuit_id: metadata.circuit_id, - depth: metadata.depth, - }; - object_store.get(key).await.unwrap_or_else(|error| { - panic!( - "node aggregation job artifacts getting error. Key: {:?}, error: {:?}", - key, error - ) - }) -} - -#[tracing::instrument( - skip_all, - fields(l1_batch = %artifacts.block_number, circuit_id = %artifacts.circuit_id) -)] -async fn save_artifacts( - artifacts: NodeAggregationArtifacts, - object_store: &dyn ObjectStore, -) -> BlobUrls { - let started_at = Instant::now(); - let aggregations_urls = save_node_aggregations_artifacts( - artifacts.block_number, - artifacts.circuit_id, - artifacts.depth, - artifacts.next_aggregations, - object_store, - ) - .await; - - WITNESS_GENERATOR_METRICS.blob_save_time[&AggregationRound::NodeAggregation.into()] - .observe(started_at.elapsed()); - - BlobUrls { - node_aggregations_url: aggregations_urls, - circuit_ids_and_urls: artifacts.recursive_circuit_ids_and_urls, - } -} diff --git a/prover/crates/bin/witness_generator/src/recursion_tip/artifacts.rs b/prover/crates/bin/witness_generator/src/recursion_tip/artifacts.rs new file mode 100644 index 00000000000..8379fcf9f93 --- /dev/null +++ b/prover/crates/bin/witness_generator/src/recursion_tip/artifacts.rs @@ -0,0 +1,141 @@ +use std::{collections::HashMap, time::Instant}; + +use async_trait::async_trait; +use circuit_definitions::{ + circuit_definitions::recursion_layer::{ZkSyncRecursionLayerStorageType, ZkSyncRecursionProof}, + zkevm_circuits::scheduler::aux::BaseLayerCircuitType, +}; +use zkevm_test_harness::empty_node_proof; +use zksync_object_store::ObjectStore; +use zksync_prover_dal::{ConnectionPool, Prover, ProverDal}; +use zksync_prover_fri_types::{keys::FriCircuitKey, CircuitWrapper, FriProofWrapper}; +use zksync_types::{basic_fri_types::AggregationRound, L1BatchNumber}; + +use crate::{ + artifacts::{ArtifactsManager, BlobUrls}, + recursion_tip::{RecursionTipArtifacts, RecursionTipWitnessGenerator}, +}; + +#[async_trait] +impl ArtifactsManager for RecursionTipWitnessGenerator { + type InputMetadata = Vec<(u8, u32)>; + type InputArtifacts = Vec; + type OutputArtifacts = RecursionTipArtifacts; + + /// Loads all proofs for a given recursion tip's job ids. + /// Note that recursion tip may not have proofs for some specific circuits (because the batch didn't contain them). + /// In this scenario, we still need to pass a proof, but it won't be taken into account during proving. + /// For this scenario, we use an empty_proof, but any proof would suffice. + async fn get_artifacts( + metadata: &Vec<(u8, u32)>, + object_store: &dyn ObjectStore, + ) -> anyhow::Result> { + let job_mapping: HashMap = metadata + .clone() + .into_iter() + .map(|(leaf_circuit_id, job_id)| { + ( + ZkSyncRecursionLayerStorageType::from_leaf_u8_to_basic_u8(leaf_circuit_id), + job_id, + ) + }) + .collect(); + + let empty_proof = empty_node_proof().into_inner(); + + let mut proofs = Vec::new(); + for circuit_id in BaseLayerCircuitType::as_iter_u8() { + if job_mapping.contains_key(&circuit_id) { + let fri_proof_wrapper = object_store + .get(*job_mapping.get(&circuit_id).unwrap()) + .await + .unwrap_or_else(|_| { + panic!( + "Failed to load proof with circuit_id {} for recursion tip", + circuit_id + ) + }); + match fri_proof_wrapper { + FriProofWrapper::Base(_) => { + return Err(anyhow::anyhow!( + "Expected only recursive proofs for recursion tip, got Base for circuit {}", + circuit_id + )); + } + FriProofWrapper::Recursive(recursive_proof) => { + proofs.push(recursive_proof.into_inner()); + } + } + } else { + proofs.push(empty_proof.clone()); + } + } + Ok(proofs) + } + + async fn save_artifacts( + job_id: u32, + artifacts: Self::OutputArtifacts, + object_store: &dyn ObjectStore, + ) -> BlobUrls { + let key = FriCircuitKey { + block_number: L1BatchNumber(job_id), + circuit_id: 255, + sequence_number: 0, + depth: 0, + aggregation_round: AggregationRound::RecursionTip, + }; + + let blob_url = object_store + .put( + key, + &CircuitWrapper::Recursive(artifacts.recursion_tip_circuit.clone()), + ) + .await + .unwrap(); + + BlobUrls::Url(blob_url) + } + + async fn update_database( + connection_pool: &ConnectionPool, + job_id: u32, + started_at: Instant, + blob_urls: BlobUrls, + _artifacts: Self::OutputArtifacts, + ) -> anyhow::Result<()> { + let blob_url = match blob_urls { + BlobUrls::Url(url) => url, + _ => panic!("Unexpected blob urls type"), + }; + + let mut prover_connection = connection_pool.connection().await?; + let mut transaction = prover_connection.start_transaction().await?; + let protocol_version_id = transaction + .fri_witness_generator_dal() + .protocol_version_for_l1_batch(L1BatchNumber(job_id)) + .await; + transaction + .fri_prover_jobs_dal() + .insert_prover_job( + L1BatchNumber(job_id), + ZkSyncRecursionLayerStorageType::RecursionTipCircuit as u8, + 0, + 0, + AggregationRound::RecursionTip, + &blob_url, + false, + protocol_version_id, + ) + .await; + + transaction + .fri_witness_generator_dal() + .mark_recursion_tip_job_as_successful(L1BatchNumber(job_id), started_at.elapsed()) + .await; + + transaction.commit().await?; + + Ok(()) + } +} diff --git a/prover/crates/bin/witness_generator/src/recursion_tip/job_processor.rs b/prover/crates/bin/witness_generator/src/recursion_tip/job_processor.rs new file mode 100644 index 00000000000..f114724cfec --- /dev/null +++ b/prover/crates/bin/witness_generator/src/recursion_tip/job_processor.rs @@ -0,0 +1,130 @@ +use std::time::Instant; + +use anyhow::Context as _; +use async_trait::async_trait; +use zksync_prover_dal::ProverDal; +use zksync_prover_fri_types::get_current_pod_name; +use zksync_queued_job_processor::JobProcessor; +use zksync_types::{basic_fri_types::AggregationRound, L1BatchNumber}; + +use crate::{ + artifacts::ArtifactsManager, + metrics::WITNESS_GENERATOR_METRICS, + recursion_tip::{ + prepare_job, RecursionTipArtifacts, RecursionTipWitnessGenerator, + RecursionTipWitnessGeneratorJob, + }, +}; + +#[async_trait] +impl JobProcessor for RecursionTipWitnessGenerator { + type Job = RecursionTipWitnessGeneratorJob; + type JobId = L1BatchNumber; + type JobArtifacts = RecursionTipArtifacts; + + const SERVICE_NAME: &'static str = "recursion_tip_witness_generator"; + + async fn get_next_job(&self) -> anyhow::Result> { + let mut prover_connection = self.prover_connection_pool.connection().await?; + let pod_name = get_current_pod_name(); + let Some((l1_batch_number, number_of_final_node_jobs)) = prover_connection + .fri_witness_generator_dal() + .get_next_recursion_tip_witness_job(self.protocol_version, &pod_name) + .await + else { + return Ok(None); + }; + + let final_node_proof_job_ids = prover_connection + .fri_prover_jobs_dal() + .get_final_node_proof_job_ids_for(l1_batch_number) + .await; + + assert_eq!( + final_node_proof_job_ids.len(), + number_of_final_node_jobs as usize, + "recursion tip witness job was scheduled without all final node jobs being completed; expected {}, got {}", + number_of_final_node_jobs, final_node_proof_job_ids.len() + ); + + Ok(Some(( + l1_batch_number, + prepare_job( + l1_batch_number, + final_node_proof_job_ids, + &*self.object_store, + self.keystore.clone(), + ) + .await + .context("prepare_job()")?, + ))) + } + + async fn save_failure(&self, job_id: L1BatchNumber, _started_at: Instant, error: String) -> () { + self.prover_connection_pool + .connection() + .await + .unwrap() + .fri_witness_generator_dal() + .mark_recursion_tip_job_failed(&error, job_id) + .await; + } + + #[allow(clippy::async_yields_async)] + async fn process_job( + &self, + _job_id: &Self::JobId, + job: RecursionTipWitnessGeneratorJob, + started_at: Instant, + ) -> tokio::task::JoinHandle> { + tokio::task::spawn_blocking(move || Ok(Self::process_job_sync(job, started_at))) + } + + #[tracing::instrument( + skip_all, + fields(l1_batch = %job_id) + )] + async fn save_result( + &self, + job_id: L1BatchNumber, + started_at: Instant, + artifacts: RecursionTipArtifacts, + ) -> anyhow::Result<()> { + let blob_save_started_at = Instant::now(); + + let blob_urls = + Self::save_artifacts(job_id.0, artifacts.clone(), &*self.object_store).await; + + WITNESS_GENERATOR_METRICS.blob_save_time[&AggregationRound::RecursionTip.into()] + .observe(blob_save_started_at.elapsed()); + + Self::update_database( + &self.prover_connection_pool, + job_id.0, + started_at, + blob_urls, + artifacts, + ) + .await?; + + Ok(()) + } + + fn max_attempts(&self) -> u32 { + self.config.max_attempts + } + + async fn get_job_attempts(&self, job_id: &L1BatchNumber) -> anyhow::Result { + let mut prover_storage = self + .prover_connection_pool + .connection() + .await + .context("failed to acquire DB connection for RecursionTipWitnessGenerator")?; + prover_storage + .fri_witness_generator_dal() + .get_recursion_tip_witness_job_attempts(*job_id) + .await + .map(|attempts| attempts.unwrap_or(0)) + .context("failed to get job attempts for RecursionTipWitnessGenerator") + } +} diff --git a/prover/crates/bin/witness_generator/src/recursion_tip.rs b/prover/crates/bin/witness_generator/src/recursion_tip/mod.rs similarity index 58% rename from prover/crates/bin/witness_generator/src/recursion_tip.rs rename to prover/crates/bin/witness_generator/src/recursion_tip/mod.rs index 5e97631babb..4abb56a7d78 100644 --- a/prover/crates/bin/witness_generator/src/recursion_tip.rs +++ b/prover/crates/bin/witness_generator/src/recursion_tip/mod.rs @@ -1,7 +1,6 @@ use std::{sync::Arc, time::Instant}; use anyhow::Context; -use async_trait::async_trait; use circuit_definitions::{ circuit_definitions::recursion_layer::{ recursion_tip::RecursionTipCircuit, ZkSyncRecursionLayerStorageType, @@ -37,23 +36,20 @@ use zkevm_test_harness::{ }; use zksync_config::configs::FriWitnessGeneratorConfig; use zksync_object_store::ObjectStore; -use zksync_prover_dal::{ConnectionPool, Prover, ProverDal}; -use zksync_prover_fri_types::{ - get_current_pod_name, - keys::{ClosedFormInputKey, FriCircuitKey}, - CircuitWrapper, -}; +use zksync_prover_dal::{ConnectionPool, Prover}; +use zksync_prover_fri_types::keys::ClosedFormInputKey; 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 crate::{ - metrics::WITNESS_GENERATOR_METRICS, - utils::{load_proofs_for_recursion_tip, ClosedFormInputWrapper}, + artifacts::ArtifactsManager, metrics::WITNESS_GENERATOR_METRICS, utils::ClosedFormInputWrapper, }; +mod artifacts; +mod job_processor; + #[derive(Clone)] pub struct RecursionTipWitnessGeneratorJob { block_number: L1BatchNumber, @@ -65,6 +61,7 @@ pub struct RecursionTipWitnessGeneratorJob { node_vk: ZkSyncRecursionLayerVerificationKey, } +#[derive(Clone)] pub struct RecursionTipArtifacts { pub recursion_tip_circuit: ZkSyncRecursiveLayerCircuit, } @@ -138,148 +135,6 @@ impl RecursionTipWitnessGenerator { } } -#[async_trait] -impl JobProcessor for RecursionTipWitnessGenerator { - type Job = RecursionTipWitnessGeneratorJob; - type JobId = L1BatchNumber; - type JobArtifacts = RecursionTipArtifacts; - - const SERVICE_NAME: &'static str = "recursion_tip_witness_generator"; - - async fn get_next_job(&self) -> anyhow::Result> { - let mut prover_connection = self.prover_connection_pool.connection().await?; - let pod_name = get_current_pod_name(); - let Some((l1_batch_number, number_of_final_node_jobs)) = prover_connection - .fri_witness_generator_dal() - .get_next_recursion_tip_witness_job(self.protocol_version, &pod_name) - .await - else { - return Ok(None); - }; - - let final_node_proof_job_ids = prover_connection - .fri_prover_jobs_dal() - .get_final_node_proof_job_ids_for(l1_batch_number) - .await; - - assert_eq!( - final_node_proof_job_ids.len(), - number_of_final_node_jobs as usize, - "recursion tip witness job was scheduled without all final node jobs being completed; expected {}, got {}", - number_of_final_node_jobs, final_node_proof_job_ids.len() - ); - - Ok(Some(( - l1_batch_number, - prepare_job( - l1_batch_number, - final_node_proof_job_ids, - &*self.object_store, - self.keystore.clone(), - ) - .await - .context("prepare_job()")?, - ))) - } - - async fn save_failure(&self, job_id: L1BatchNumber, _started_at: Instant, error: String) -> () { - self.prover_connection_pool - .connection() - .await - .unwrap() - .fri_witness_generator_dal() - .mark_recursion_tip_job_failed(&error, job_id) - .await; - } - - #[allow(clippy::async_yields_async)] - async fn process_job( - &self, - _job_id: &Self::JobId, - job: RecursionTipWitnessGeneratorJob, - started_at: Instant, - ) -> tokio::task::JoinHandle> { - tokio::task::spawn_blocking(move || Ok(Self::process_job_sync(job, started_at))) - } - - #[tracing::instrument( - skip_all, - fields(l1_batch = %job_id) - )] - async fn save_result( - &self, - job_id: L1BatchNumber, - started_at: Instant, - artifacts: RecursionTipArtifacts, - ) -> anyhow::Result<()> { - let key = FriCircuitKey { - block_number: job_id, - circuit_id: 255, - sequence_number: 0, - depth: 0, - aggregation_round: AggregationRound::RecursionTip, - }; - let blob_save_started_at = Instant::now(); - - let recursion_tip_circuit_blob_url = self - .object_store - .put( - key, - &CircuitWrapper::Recursive(artifacts.recursion_tip_circuit), - ) - .await?; - - WITNESS_GENERATOR_METRICS.blob_save_time[&AggregationRound::RecursionTip.into()] - .observe(blob_save_started_at.elapsed()); - - let mut prover_connection = self.prover_connection_pool.connection().await?; - let mut transaction = prover_connection.start_transaction().await?; - let protocol_version_id = transaction - .fri_witness_generator_dal() - .protocol_version_for_l1_batch(job_id) - .await; - transaction - .fri_prover_jobs_dal() - .insert_prover_job( - job_id, - ZkSyncRecursionLayerStorageType::RecursionTipCircuit as u8, - 0, - 0, - AggregationRound::RecursionTip, - &recursion_tip_circuit_blob_url, - false, - protocol_version_id, - ) - .await; - - transaction - .fri_witness_generator_dal() - .mark_recursion_tip_job_as_successful(job_id, started_at.elapsed()) - .await; - - transaction.commit().await?; - Ok(()) - } - - fn max_attempts(&self) -> u32 { - self.config.max_attempts - } - - async fn get_job_attempts(&self, job_id: &L1BatchNumber) -> anyhow::Result { - let mut prover_storage = self - .prover_connection_pool - .connection() - .await - .context("failed to acquire DB connection for RecursionTipWitnessGenerator")?; - prover_storage - .fri_witness_generator_dal() - .get_recursion_tip_witness_job_attempts(*job_id) - .await - .map(|attempts| attempts.unwrap_or(0)) - .context("failed to get job attempts for RecursionTipWitnessGenerator") - } -} - #[tracing::instrument( skip_all, fields(l1_batch = %l1_batch_number) @@ -292,7 +147,8 @@ pub async fn prepare_job( ) -> anyhow::Result { let started_at = Instant::now(); let recursion_tip_proofs = - load_proofs_for_recursion_tip(final_node_proof_job_ids, object_store).await?; + RecursionTipWitnessGenerator::get_artifacts(&final_node_proof_job_ids, object_store) + .await?; WITNESS_GENERATOR_METRICS.blob_fetch_time[&AggregationRound::RecursionTip.into()] .observe(started_at.elapsed()); diff --git a/prover/crates/bin/witness_generator/src/scheduler/artifacts.rs b/prover/crates/bin/witness_generator/src/scheduler/artifacts.rs new file mode 100644 index 00000000000..b20a9764188 --- /dev/null +++ b/prover/crates/bin/witness_generator/src/scheduler/artifacts.rs @@ -0,0 +1,94 @@ +use std::time::Instant; + +use async_trait::async_trait; +use circuit_definitions::circuit_definitions::recursion_layer::ZkSyncRecursionLayerStorageType; +use zksync_object_store::ObjectStore; +use zksync_prover_dal::{ConnectionPool, Prover, ProverDal}; +use zksync_prover_fri_types::{keys::FriCircuitKey, CircuitWrapper, FriProofWrapper}; +use zksync_types::{basic_fri_types::AggregationRound, L1BatchNumber}; + +use crate::{ + artifacts::{ArtifactsManager, BlobUrls}, + scheduler::{SchedulerArtifacts, SchedulerWitnessGenerator}, +}; + +#[async_trait] +impl ArtifactsManager for SchedulerWitnessGenerator { + type InputMetadata = u32; + type InputArtifacts = FriProofWrapper; + type OutputArtifacts = SchedulerArtifacts; + + async fn get_artifacts( + metadata: &Self::InputMetadata, + object_store: &dyn ObjectStore, + ) -> anyhow::Result { + let artifacts = object_store.get(*metadata).await?; + + Ok(artifacts) + } + + async fn save_artifacts( + job_id: u32, + artifacts: Self::OutputArtifacts, + object_store: &dyn ObjectStore, + ) -> BlobUrls { + let key = FriCircuitKey { + block_number: L1BatchNumber(job_id), + circuit_id: 1, + sequence_number: 0, + depth: 0, + aggregation_round: AggregationRound::Scheduler, + }; + + let blob_url = object_store + .put( + key, + &CircuitWrapper::Recursive(artifacts.scheduler_circuit.clone()), + ) + .await + .unwrap(); + + BlobUrls::Url(blob_url) + } + + async fn update_database( + connection_pool: &ConnectionPool, + job_id: u32, + started_at: Instant, + blob_urls: BlobUrls, + _artifacts: Self::OutputArtifacts, + ) -> anyhow::Result<()> { + let blob_url = match blob_urls { + BlobUrls::Url(url) => url, + _ => panic!("Unexpected blob urls type"), + }; + + let mut prover_connection = connection_pool.connection().await?; + let mut transaction = prover_connection.start_transaction().await?; + let protocol_version_id = transaction + .fri_witness_generator_dal() + .protocol_version_for_l1_batch(L1BatchNumber(job_id)) + .await; + transaction + .fri_prover_jobs_dal() + .insert_prover_job( + L1BatchNumber(job_id), + ZkSyncRecursionLayerStorageType::SchedulerCircuit as u8, + 0, + 0, + AggregationRound::Scheduler, + &blob_url, + false, + protocol_version_id, + ) + .await; + + transaction + .fri_witness_generator_dal() + .mark_scheduler_job_as_successful(L1BatchNumber(job_id), started_at.elapsed()) + .await; + + transaction.commit().await?; + Ok(()) + } +} diff --git a/prover/crates/bin/witness_generator/src/scheduler/job_processor.rs b/prover/crates/bin/witness_generator/src/scheduler/job_processor.rs new file mode 100644 index 00000000000..fe4f2db4090 --- /dev/null +++ b/prover/crates/bin/witness_generator/src/scheduler/job_processor.rs @@ -0,0 +1,129 @@ +use std::time::Instant; + +use anyhow::Context as _; +use async_trait::async_trait; +use zksync_prover_dal::ProverDal; +use zksync_prover_fri_types::get_current_pod_name; +use zksync_queued_job_processor::JobProcessor; +use zksync_types::{basic_fri_types::AggregationRound, L1BatchNumber}; + +use crate::{ + artifacts::ArtifactsManager, + metrics::WITNESS_GENERATOR_METRICS, + scheduler::{ + prepare_job, SchedulerArtifacts, SchedulerWitnessGenerator, SchedulerWitnessGeneratorJob, + }, +}; + +#[async_trait] +impl JobProcessor for SchedulerWitnessGenerator { + type Job = SchedulerWitnessGeneratorJob; + type JobId = L1BatchNumber; + type JobArtifacts = SchedulerArtifacts; + + const SERVICE_NAME: &'static str = "fri_scheduler_witness_generator"; + + async fn get_next_job(&self) -> anyhow::Result> { + let mut prover_connection = self.prover_connection_pool.connection().await?; + let pod_name = get_current_pod_name(); + let Some(l1_batch_number) = prover_connection + .fri_witness_generator_dal() + .get_next_scheduler_witness_job(self.protocol_version, &pod_name) + .await + else { + return Ok(None); + }; + let recursion_tip_job_id = prover_connection + .fri_prover_jobs_dal() + .get_recursion_tip_proof_job_id(l1_batch_number) + .await + .context(format!( + "could not find recursion tip proof for l1 batch {}", + l1_batch_number + ))?; + + Ok(Some(( + l1_batch_number, + prepare_job( + l1_batch_number, + recursion_tip_job_id, + &*self.object_store, + self.keystore.clone(), + ) + .await + .context("prepare_job()")?, + ))) + } + + async fn save_failure(&self, job_id: L1BatchNumber, _started_at: Instant, error: String) -> () { + self.prover_connection_pool + .connection() + .await + .unwrap() + .fri_witness_generator_dal() + .mark_scheduler_job_failed(&error, job_id) + .await; + } + + #[allow(clippy::async_yields_async)] + async fn process_job( + &self, + _job_id: &Self::JobId, + job: SchedulerWitnessGeneratorJob, + started_at: Instant, + ) -> tokio::task::JoinHandle> { + tokio::task::spawn_blocking(move || { + let block_number = job.block_number; + let _span = tracing::info_span!("scheduler", %block_number).entered(); + Ok(Self::process_job_sync(job, started_at)) + }) + } + + #[tracing::instrument( + skip_all, + fields(l1_batch = %job_id) + )] + async fn save_result( + &self, + job_id: L1BatchNumber, + started_at: Instant, + artifacts: SchedulerArtifacts, + ) -> anyhow::Result<()> { + let blob_save_started_at = Instant::now(); + + let blob_urls = + Self::save_artifacts(job_id.0, artifacts.clone(), &*self.object_store).await; + + WITNESS_GENERATOR_METRICS.blob_save_time[&AggregationRound::Scheduler.into()] + .observe(blob_save_started_at.elapsed()); + + Self::update_database( + &self.prover_connection_pool, + job_id.0, + started_at, + blob_urls, + artifacts, + ) + .await?; + + Ok(()) + } + + fn max_attempts(&self) -> u32 { + self.config.max_attempts + } + + async fn get_job_attempts(&self, job_id: &L1BatchNumber) -> anyhow::Result { + let mut prover_storage = self + .prover_connection_pool + .connection() + .await + .context("failed to acquire DB connection for SchedulerWitnessGenerator")?; + prover_storage + .fri_witness_generator_dal() + .get_scheduler_witness_job_attempts(*job_id) + .await + .map(|attempts| attempts.unwrap_or(0)) + .context("failed to get job attempts for SchedulerWitnessGenerator") + } +} diff --git a/prover/crates/bin/witness_generator/src/scheduler.rs b/prover/crates/bin/witness_generator/src/scheduler/mod.rs similarity index 54% rename from prover/crates/bin/witness_generator/src/scheduler.rs rename to prover/crates/bin/witness_generator/src/scheduler/mod.rs index c6e43582bbd..10230b35c4f 100644 --- a/prover/crates/bin/witness_generator/src/scheduler.rs +++ b/prover/crates/bin/witness_generator/src/scheduler/mod.rs @@ -1,13 +1,12 @@ use std::{convert::TryInto, sync::Arc, time::Instant}; use anyhow::Context as _; -use async_trait::async_trait; use zkevm_test_harness::zkevm_circuits::recursion::{ leaf_layer::input::RecursionLeafParametersWitness, NUM_BASE_LAYER_CIRCUITS, }; use zksync_config::configs::FriWitnessGeneratorConfig; use zksync_object_store::ObjectStore; -use zksync_prover_dal::{ConnectionPool, Prover, ProverDal}; +use zksync_prover_dal::{ConnectionPool, Prover}; use zksync_prover_fri_types::{ circuit_definitions::{ boojum::{ @@ -21,18 +20,22 @@ use zksync_prover_fri_types::{ recursion_layer_proof_config, zkevm_circuits::scheduler::{input::SchedulerCircuitInstanceWitness, SchedulerConfig}, }, - get_current_pod_name, - keys::FriCircuitKey, - CircuitWrapper, FriProofWrapper, + 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 crate::{metrics::WITNESS_GENERATOR_METRICS, utils::SchedulerPartialInputWrapper}; +use crate::{ + artifacts::ArtifactsManager, metrics::WITNESS_GENERATOR_METRICS, + utils::SchedulerPartialInputWrapper, +}; + +mod artifacts; +mod job_processor; +#[derive(Clone)] pub struct SchedulerArtifacts { pub scheduler_circuit: ZkSyncRecursiveLayerCircuit, } @@ -121,143 +124,6 @@ impl SchedulerWitnessGenerator { } } -#[async_trait] -impl JobProcessor for SchedulerWitnessGenerator { - type Job = SchedulerWitnessGeneratorJob; - type JobId = L1BatchNumber; - type JobArtifacts = SchedulerArtifacts; - - const SERVICE_NAME: &'static str = "fri_scheduler_witness_generator"; - - async fn get_next_job(&self) -> anyhow::Result> { - let mut prover_connection = self.prover_connection_pool.connection().await?; - let pod_name = get_current_pod_name(); - let Some(l1_batch_number) = prover_connection - .fri_witness_generator_dal() - .get_next_scheduler_witness_job(self.protocol_version, &pod_name) - .await - else { - return Ok(None); - }; - let recursion_tip_job_id = prover_connection - .fri_prover_jobs_dal() - .get_recursion_tip_proof_job_id(l1_batch_number) - .await - .context(format!( - "could not find recursion tip proof for l1 batch {}", - l1_batch_number - ))?; - - Ok(Some(( - l1_batch_number, - prepare_job( - l1_batch_number, - recursion_tip_job_id, - &*self.object_store, - self.keystore.clone(), - ) - .await - .context("prepare_job()")?, - ))) - } - - async fn save_failure(&self, job_id: L1BatchNumber, _started_at: Instant, error: String) -> () { - self.prover_connection_pool - .connection() - .await - .unwrap() - .fri_witness_generator_dal() - .mark_scheduler_job_failed(&error, job_id) - .await; - } - - #[allow(clippy::async_yields_async)] - async fn process_job( - &self, - _job_id: &Self::JobId, - job: SchedulerWitnessGeneratorJob, - started_at: Instant, - ) -> tokio::task::JoinHandle> { - tokio::task::spawn_blocking(move || { - let block_number = job.block_number; - let _span = tracing::info_span!("scheduler", %block_number).entered(); - Ok(Self::process_job_sync(job, started_at)) - }) - } - - #[tracing::instrument( - skip_all, - fields(l1_batch = %job_id) - )] - async fn save_result( - &self, - job_id: L1BatchNumber, - started_at: Instant, - artifacts: SchedulerArtifacts, - ) -> anyhow::Result<()> { - let key = FriCircuitKey { - block_number: job_id, - circuit_id: 1, - sequence_number: 0, - depth: 0, - aggregation_round: AggregationRound::Scheduler, - }; - let blob_save_started_at = Instant::now(); - let scheduler_circuit_blob_url = self - .object_store - .put(key, &CircuitWrapper::Recursive(artifacts.scheduler_circuit)) - .await?; - WITNESS_GENERATOR_METRICS.blob_save_time[&AggregationRound::Scheduler.into()] - .observe(blob_save_started_at.elapsed()); - - let mut prover_connection = self.prover_connection_pool.connection().await?; - let mut transaction = prover_connection.start_transaction().await?; - let protocol_version_id = transaction - .fri_witness_generator_dal() - .protocol_version_for_l1_batch(job_id) - .await; - transaction - .fri_prover_jobs_dal() - .insert_prover_job( - job_id, - ZkSyncRecursionLayerStorageType::SchedulerCircuit as u8, - 0, - 0, - AggregationRound::Scheduler, - &scheduler_circuit_blob_url, - false, - protocol_version_id, - ) - .await; - - transaction - .fri_witness_generator_dal() - .mark_scheduler_job_as_successful(job_id, started_at.elapsed()) - .await; - - transaction.commit().await?; - Ok(()) - } - - fn max_attempts(&self) -> u32 { - self.config.max_attempts - } - - async fn get_job_attempts(&self, job_id: &L1BatchNumber) -> anyhow::Result { - let mut prover_storage = self - .prover_connection_pool - .connection() - .await - .context("failed to acquire DB connection for SchedulerWitnessGenerator")?; - prover_storage - .fri_witness_generator_dal() - .get_scheduler_witness_job_attempts(*job_id) - .await - .map(|attempts| attempts.unwrap_or(0)) - .context("failed to get job attempts for SchedulerWitnessGenerator") - } -} - #[tracing::instrument( skip_all, fields(l1_batch = %l1_batch_number) @@ -269,7 +135,8 @@ pub async fn prepare_job( keystore: Keystore, ) -> anyhow::Result { let started_at = Instant::now(); - let wrapper = object_store.get(recursion_tip_job_id).await?; + let wrapper = + SchedulerWitnessGenerator::get_artifacts(&recursion_tip_job_id, object_store).await?; let recursion_tip_proof = match wrapper { FriProofWrapper::Base(_) => Err(anyhow::anyhow!( "Expected only recursive proofs for scheduler l1 batch {l1_batch_number}, got Base" diff --git a/prover/crates/bin/witness_generator/src/utils.rs b/prover/crates/bin/witness_generator/src/utils.rs index f8656ac90f4..3ea2b539773 100644 --- a/prover/crates/bin/witness_generator/src/utils.rs +++ b/prover/crates/bin/witness_generator/src/utils.rs @@ -1,21 +1,14 @@ use std::{ - collections::HashMap, io::{BufWriter, Write as _}, sync::Arc, }; use circuit_definitions::{ - circuit_definitions::{ - base_layer::ZkSyncBaseLayerCircuit, - recursion_layer::{ZkSyncRecursionLayerStorageType, ZkSyncRecursionProof}, - }, + circuit_definitions::base_layer::ZkSyncBaseLayerCircuit, encodings::memory_query::MemoryQueueStateWitnesses, }; use once_cell::sync::Lazy; -use zkevm_test_harness::{ - boojum::field::goldilocks::GoldilocksField, empty_node_proof, - zkevm_circuits::scheduler::aux::BaseLayerCircuitType, -}; +use zkevm_test_harness::boojum::field::goldilocks::GoldilocksField; use zksync_multivm::utils::get_used_bootloader_memory_bytes; use zksync_object_store::{serialize_using_bincode, Bucket, ObjectStore, StoredObject}; use zksync_prover_fri_types::{ @@ -248,54 +241,3 @@ pub async fn load_proofs_for_job_ids( .map(|x| x.unwrap()) .collect() } - -/// Loads all proofs for a given recursion tip's job ids. -/// Note that recursion tip may not have proofs for some specific circuits (because the batch didn't contain them). -/// In this scenario, we still need to pass a proof, but it won't be taken into account during proving. -/// For this scenario, we use an empty_proof, but any proof would suffice. -#[tracing::instrument(skip_all)] -pub async fn load_proofs_for_recursion_tip( - job_ids: Vec<(u8, u32)>, - object_store: &dyn ObjectStore, -) -> anyhow::Result> { - let job_mapping: HashMap = job_ids - .into_iter() - .map(|(leaf_circuit_id, job_id)| { - ( - ZkSyncRecursionLayerStorageType::from_leaf_u8_to_basic_u8(leaf_circuit_id), - job_id, - ) - }) - .collect(); - - let empty_proof = empty_node_proof().into_inner(); - - let mut proofs = Vec::new(); - for circuit_id in BaseLayerCircuitType::as_iter_u8() { - if job_mapping.contains_key(&circuit_id) { - let fri_proof_wrapper = object_store - .get(*job_mapping.get(&circuit_id).unwrap()) - .await - .unwrap_or_else(|_| { - panic!( - "Failed to load proof with circuit_id {} for recursion tip", - circuit_id - ) - }); - match fri_proof_wrapper { - FriProofWrapper::Base(_) => { - return Err(anyhow::anyhow!( - "Expected only recursive proofs for recursion tip, got Base for circuit {}", - circuit_id - )); - } - FriProofWrapper::Recursive(recursive_proof) => { - proofs.push(recursive_proof.into_inner()); - } - } - } else { - proofs.push(empty_proof.clone()); - } - } - Ok(proofs) -} diff --git a/prover/crates/lib/keystore/src/keystore.rs b/prover/crates/lib/keystore/src/keystore.rs index ff14387bfda..28ce989287c 100644 --- a/prover/crates/lib/keystore/src/keystore.rs +++ b/prover/crates/lib/keystore/src/keystore.rs @@ -18,10 +18,11 @@ use serde::{Deserialize, Serialize}; use zkevm_test_harness::data_source::{in_memory_data_source::InMemoryDataSource, SetupDataSource}; use zksync_basic_types::basic_fri_types::AggregationRound; use zksync_prover_fri_types::ProverServiceDataKey; +use zksync_utils::env::Workspace; #[cfg(feature = "gpu")] use crate::GoldilocksGpuProverSetupData; -use crate::{utils::core_workspace_dir_or_current_dir, GoldilocksProverSetupData, VkCommitments}; +use crate::{GoldilocksProverSetupData, VkCommitments}; pub enum ProverServiceDataType { VerificationKey, @@ -42,31 +43,6 @@ pub struct Keystore { setup_data_path: PathBuf, } -fn get_base_path() -> PathBuf { - // This will return the path to the _core_ workspace locally, - // otherwise (e.g. in Docker) it will return `.` (which is usually equivalent to `/`). - // - // Note: at the moment of writing this function, it locates the prover workspace, and uses - // `..` to get to the core workspace, so the path returned is something like: - // `/path/to/workspace/zksync-era/prover/..` (or `.` for binaries). - let path = core_workspace_dir_or_current_dir(); - - // Check if we're in the folder equivalent to the core workspace root. - // Path we're actually checking is: - // `/path/to/workspace/zksync-era/prover/../prover/data/keys` - let new_path = path.join("prover/data/keys"); - if new_path.exists() { - return new_path; - } - - let mut components = path.components(); - // This removes the last component of `path`, so: - // for local workspace, we're removing `..` and putting ourselves back to the prover workspace. - // for binaries, we're removing `.` and getting the empty path. - components.next_back().unwrap(); - components.as_path().join("prover/data/keys") -} - impl Keystore { /// Base-dir is the location of smaller keys (like verification keys and finalization hints). /// Setup data path is used for the large setup keys. @@ -79,8 +55,33 @@ impl Keystore { /// Uses automatic detection of the base path, and assumes that setup keys /// are stored in the same directory. + /// + /// The "base" path is considered to be equivalent to the `prover/data/keys` + /// directory in the repository. pub fn locate() -> Self { - let base_path = get_base_path(); + // There might be several cases: + // - We're running from the prover workspace. + // - We're running from the core workspace. + // - We're running the binary from the docker. + let data_dir_path = match Workspace::locate() { + Workspace::None => { + // We're running a binary, likely in a docker. + // Keys can be in one of a few paths. + // We want to be very conservative here, and checking + // more locations than we likely need to not accidentally + // break something. + let paths = ["./prover/data", "./data", "/prover/data", "/data"]; + paths.iter().map(PathBuf::from).find(|path| path.exists()).unwrap_or_else(|| { + panic!("Failed to locate the prover data directory. Locations checked: {paths:?}") + }) + } + ws => { + // If we're running in the Cargo workspace, the data *must* be in `prover/data`. + ws.prover().join("data") + } + }; + let base_path = data_dir_path.join("keys"); + Self { basedir: base_path.clone(), setup_data_path: base_path, diff --git a/prover/crates/lib/keystore/src/utils.rs b/prover/crates/lib/keystore/src/utils.rs index 5cebf7aef77..10504292d64 100644 --- a/prover/crates/lib/keystore/src/utils.rs +++ b/prover/crates/lib/keystore/src/utils.rs @@ -1,5 +1,3 @@ -use std::path::PathBuf; - use anyhow::Context as _; use circuit_definitions::{ circuit_definitions::aux_layer::ZkSyncSnarkWrapperCircuit, @@ -22,7 +20,6 @@ use zksync_prover_fri_types::circuit_definitions::{ scheduler::aux::BaseLayerCircuitType, }, }; -use zksync_utils::locate_workspace; use crate::keystore::Keystore; @@ -115,24 +112,17 @@ pub fn calculate_snark_vk_hash(keystore: &Keystore) -> anyhow::Result { Ok(H256::from_slice(&computed_vk_hash)) } -/// Returns workspace of the core component, we assume that prover is one folder deeper. -/// Or fallback to current dir -pub fn core_workspace_dir_or_current_dir() -> PathBuf { - locate_workspace() - .map(|a| a.join("..")) - .unwrap_or_else(|| PathBuf::from(".")) -} - #[cfg(test)] mod tests { - use std::{path::PathBuf, str::FromStr}; + use std::str::FromStr; + + use zksync_utils::env::Workspace; use super::*; #[test] fn test_keyhash_generation() { - let mut path_to_input = PathBuf::from(std::env::var("CARGO_MANIFEST_DIR").unwrap()); - path_to_input.push("../../../data/historical_data"); + let path_to_input = Workspace::locate().prover().join("data/historical_data"); for entry in std::fs::read_dir(path_to_input.clone()).unwrap().flatten() { if entry.metadata().unwrap().is_dir() { diff --git a/zk_toolbox/Cargo.lock b/zk_toolbox/Cargo.lock index cd5d6a0b280..291c24dbf84 100644 --- a/zk_toolbox/Cargo.lock +++ b/zk_toolbox/Cargo.lock @@ -409,6 +409,18 @@ dependencies = [ "generic-array", ] +[[package]] +name = "blst" +version = "0.3.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4378725facc195f1a538864863f6de233b500a8862747e7f165078a419d5e874" +dependencies = [ + "cc", + "glob", + "threadpool", + "zeroize", +] + [[package]] name = "bs58" version = "0.5.1" @@ -631,7 +643,7 @@ dependencies = [ "hmac", "once_cell", "pbkdf2 0.12.2", - "rand", + "rand 0.8.5", "sha2", "thiserror", ] @@ -709,7 +721,7 @@ dependencies = [ "clap", "common", "ethers", - "rand", + "rand 0.8.5", "serde", "serde_json", "strum", @@ -857,7 +869,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ef2b4b23cddf68b89b8f8069890e8c270d54e2d5fe1b143820234805e4cb17ef" dependencies = [ "generic-array", - "rand_core", + "rand_core 0.6.4", "subtle", "zeroize", ] @@ -869,7 +881,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0dc92fb57ca44df6db8059111ab3af99a63d5d0f8375d9972e319a379c6bab76" dependencies = [ "generic-array", - "rand_core", + "rand_core 0.6.4", "subtle", "zeroize", ] @@ -903,6 +915,33 @@ dependencies = [ "cipher", ] +[[package]] +name = "curve25519-dalek" +version = "4.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97fb8b7c4503de7d6ae7b42ab72a5a59857b4c937ec27a3d4539dba95b5ab2be" +dependencies = [ + "cfg-if", + "cpufeatures", + "curve25519-dalek-derive", + "digest", + "fiat-crypto", + "rustc_version", + "subtle", + "zeroize", +] + +[[package]] +name = "curve25519-dalek-derive" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.68", +] + [[package]] name = "darling" version = "0.13.4" @@ -1120,6 +1159,31 @@ dependencies = [ "spki 0.7.3", ] +[[package]] +name = "ed25519" +version = "2.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "115531babc129696a58c64a4fef0a8bf9e9698629fb97e9e40767d235cfbcd53" +dependencies = [ + "pkcs8 0.10.2", + "signature 2.2.0", +] + +[[package]] +name = "ed25519-dalek" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a3daa8e81a3963a60642bcc1f90a670680bd4a77535faa384e9d1c79d620871" +dependencies = [ + "curve25519-dalek", + "ed25519", + "rand_core 0.6.4", + "serde", + "sha2", + "subtle", + "zeroize", +] + [[package]] name = "either" version = "1.13.0" @@ -1143,7 +1207,7 @@ dependencies = [ "generic-array", "group 0.12.1", "pkcs8 0.9.0", - "rand_core", + "rand_core 0.6.4", "sec1 0.3.0", "subtle", "zeroize", @@ -1162,7 +1226,7 @@ dependencies = [ "generic-array", "group 0.13.0", "pkcs8 0.10.2", - "rand_core", + "rand_core 0.6.4", "sec1 0.7.3", "subtle", "zeroize", @@ -1212,7 +1276,7 @@ dependencies = [ "hex", "k256 0.13.3", "log", - "rand", + "rand 0.8.5", "rlp", "serde", "sha3", @@ -1267,7 +1331,7 @@ dependencies = [ "hex", "hmac", "pbkdf2 0.11.0", - "rand", + "rand 0.8.5", "scrypt", "serde", "serde_json", @@ -1430,7 +1494,7 @@ dependencies = [ "num_enum 0.7.2", "once_cell", "open-fastrlp", - "rand", + "rand 0.8.5", "rlp", "serde", "serde_json", @@ -1535,7 +1599,7 @@ dependencies = [ "elliptic-curve 0.13.8", "eth-keystore", "ethers-core", - "rand", + "rand 0.8.5", "sha2", "thiserror", "tracing", @@ -1606,7 +1670,7 @@ version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d013fc25338cc558c5c2cfbad646908fb23591e2404481826742b651c9af7160" dependencies = [ - "rand_core", + "rand_core 0.6.4", "subtle", ] @@ -1616,10 +1680,28 @@ version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ded41244b729663b1e574f1b4fb731469f69f79c17667b5d776b16cda0479449" dependencies = [ - "rand_core", + "rand_core 0.6.4", "subtle", ] +[[package]] +name = "ff_ce" +version = "0.14.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b538e4231443a5b9c507caee3356f016d832cf7393d2d90f03ea3180d4e3fbc" +dependencies = [ + "byteorder", + "hex", + "rand 0.4.6", + "serde", +] + +[[package]] +name = "fiat-crypto" +version = "0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28dea519a9695b9977216879a3ebfddf92f1c08c05d984f8996aecd6ecdc811d" + [[package]] name = "findshlibs" version = "0.10.2" @@ -1639,7 +1721,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "835c052cb0c08c1acf6ffd71c022172e18723949c8282f2b9f27efbc51e64534" dependencies = [ "byteorder", - "rand", + "rand 0.8.5", "rustc-hex", "static_assertions", ] @@ -1711,6 +1793,12 @@ dependencies = [ "winapi", ] +[[package]] +name = "fuchsia-cprng" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a06f77d526c1a601b7c4cdd98f54b5eaabffc14d5f2f0296febdc7f357c6d3ba" + [[package]] name = "funty" version = "2.0.0" @@ -1899,7 +1987,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5dfbfb3a6cfbd390d5c9564ab283a0349b9b9fcd46a706c1eb10e0db70bfbac7" dependencies = [ "ff 0.12.1", - "rand_core", + "rand_core 0.6.4", "subtle", ] @@ -1910,7 +1998,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f0f9ef7462f7c099f518d754361858f86d8a07af53ba9af0fe635bbccb151a63" dependencies = [ "ff 0.13.0", - "rand_core", + "rand_core 0.6.4", "subtle", ] @@ -2740,7 +2828,7 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3ffa00dec017b5b1a8b7cf5e2c008bfda1aa7e0697ac1508b491fdf2622fb4d8" dependencies = [ - "rand", + "rand 0.8.5", ] [[package]] @@ -2823,7 +2911,7 @@ dependencies = [ "num-integer", "num-iter", "num-traits", - "rand", + "rand 0.8.5", "smallvec", "zeroize", ] @@ -3119,7 +3207,7 @@ dependencies = [ "once_cell", "opentelemetry", "percent-encoding", - "rand", + "rand 0.8.5", "serde_json", "thiserror", "tokio", @@ -3220,7 +3308,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7676374caaee8a325c9e7a2ae557f216c5563a171d6997b0ef8a65af35147700" dependencies = [ "base64ct", - "rand_core", + "rand_core 0.6.4", "subtle", ] @@ -3319,7 +3407,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "48e4cc64c2ad9ebe670cb8fd69dd50ae301650392e81c05f9bfcb2d5bdbc24b0" dependencies = [ "phf_shared 0.11.2", - "rand", + "rand 0.8.5", ] [[package]] @@ -3530,7 +3618,7 @@ dependencies = [ "bitflags 2.6.0", "lazy_static", "num-traits", - "rand", + "rand 0.8.5", "rand_chacha", "rand_xorshift", "regex-syntax 0.8.4", @@ -3680,6 +3768,19 @@ version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dc33ff2d4973d518d823d61aa239014831e521c75da58e3df4840d3f47749d09" +[[package]] +name = "rand" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "552840b97013b1a26992c11eac34bdd778e464601a4c2054b5f0bff7c6761293" +dependencies = [ + "fuchsia-cprng", + "libc", + "rand_core 0.3.1", + "rdrand", + "winapi", +] + [[package]] name = "rand" version = "0.8.5" @@ -3688,7 +3789,7 @@ checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" dependencies = [ "libc", "rand_chacha", - "rand_core", + "rand_core 0.6.4", ] [[package]] @@ -3698,9 +3799,24 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" dependencies = [ "ppv-lite86", - "rand_core", + "rand_core 0.6.4", +] + +[[package]] +name = "rand_core" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a6fdeb83b075e8266dcc8762c22776f6877a63111121f5f8c7411e5be7eed4b" +dependencies = [ + "rand_core 0.4.2", ] +[[package]] +name = "rand_core" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c33a3c44ca05fa6f1807d8e6743f3824e8509beca625669633be0acbdf509dc" + [[package]] name = "rand_core" version = "0.6.4" @@ -3716,7 +3832,7 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d25bf25ec5ae4a3f1b92f929810509a2f53d7dca2f50b794ff57e3face536c8f" dependencies = [ - "rand_core", + "rand_core 0.6.4", ] [[package]] @@ -3739,6 +3855,15 @@ dependencies = [ "crossbeam-utils", ] +[[package]] +name = "rdrand" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "678054eb77286b51581ba43620cc911abf02758c91f93f479767aed0f90458b2" +dependencies = [ + "rand_core 0.3.1", +] + [[package]] name = "redox_syscall" version = "0.4.1" @@ -3995,7 +4120,7 @@ dependencies = [ "num-traits", "pkcs1", "pkcs8 0.10.2", - "rand_core", + "rand_core 0.6.4", "signature 2.2.0", "spki 0.7.3", "subtle", @@ -4349,7 +4474,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "901f761681f97db3db836ef9e094acdd8756c40215326c194201941947164ef1" dependencies = [ "once_cell", - "rand", + "rand 0.8.5", "sentry-types", "serde", "serde_json", @@ -4396,7 +4521,7 @@ checksum = "da956cca56e0101998c8688bc65ce1a96f00673a0e58e663664023d4c7911e82" dependencies = [ "debugid", "hex", - "rand", + "rand 0.8.5", "serde", "serde_json", "thiserror", @@ -4586,7 +4711,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "74233d3b3b2f6d4b006dc19dee745e73e2a6bfb6f93607cd3b02bd5b00797d7c" dependencies = [ "digest", - "rand_core", + "rand_core 0.6.4", ] [[package]] @@ -4596,7 +4721,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "77549399552de45a898a580c1b41d445bf730df867cc44e6c0233bbc4b8329de" dependencies = [ "digest", - "rand_core", + "rand_core 0.6.4", ] [[package]] @@ -4840,7 +4965,7 @@ dependencies = [ "memchr", "once_cell", "percent-encoding", - "rand", + "rand 0.8.5", "rsa", "serde", "sha1", @@ -4879,7 +5004,7 @@ dependencies = [ "md-5", "memchr", "once_cell", - "rand", + "rand 0.8.5", "serde", "serde_json", "sha2", @@ -5145,6 +5270,15 @@ dependencies = [ "once_cell", ] +[[package]] +name = "threadpool" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d050e60b33d41c19108b32cea32164033a9013fe3b46cbd4457559bfbf77afaa" +dependencies = [ + "num_cpus", +] + [[package]] name = "time" version = "0.3.36" @@ -5397,7 +5531,7 @@ dependencies = [ "indexmap 1.9.3", "pin-project", "pin-project-lite", - "rand", + "rand 0.8.5", "slab", "tokio", "tokio-util", @@ -5540,7 +5674,7 @@ dependencies = [ "http 0.2.12", "httparse", "log", - "rand", + "rand 0.8.5", "rustls 0.21.12", "sha1", "thiserror", @@ -6277,6 +6411,7 @@ dependencies = [ "ethers", "human-panic", "lazy_static", + "secrecy", "serde", "serde_json", "serde_yaml", @@ -6290,6 +6425,8 @@ dependencies = [ "xshell", "zksync_basic_types", "zksync_config", + "zksync_consensus_crypto", + "zksync_consensus_roles", ] [[package]] @@ -6349,14 +6486,14 @@ dependencies = [ [[package]] name = "zksync_concurrency" -version = "0.1.0-rc.11" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0e31a9fc9a390b440cd12bbe040330dc64f64697a8a8ecbc3beb98cd0747909" +checksum = "c1c8cf6c689ab5922b52d81b775cd2d9cffbfc8fb8da65985e11b06546dfb3bf" dependencies = [ "anyhow", "once_cell", "pin-project", - "rand", + "rand 0.8.5", "sha3", "thiserror", "time", @@ -6371,7 +6508,7 @@ name = "zksync_config" version = "0.1.0" dependencies = [ "anyhow", - "rand", + "rand 0.8.5", "secrecy", "serde", "url", @@ -6381,14 +6518,59 @@ dependencies = [ "zksync_crypto_primitives", ] +[[package]] +name = "zksync_consensus_crypto" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc7baced4e811015038322dad10239f2d631d9e339e8d6b7b6e6b146bee30f41" +dependencies = [ + "anyhow", + "blst", + "ed25519-dalek", + "elliptic-curve 0.13.8", + "ff_ce", + "hex", + "k256 0.13.3", + "num-bigint", + "num-traits", + "rand 0.4.6", + "rand 0.8.5", + "sha3", + "thiserror", + "tracing", + "zeroize", +] + +[[package]] +name = "zksync_consensus_roles" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0aab4ddf62f6001903c5fe9f65afb1bdc42464928c9d1c6ce52e4d7e9944f5dc" +dependencies = [ + "anyhow", + "bit-vec", + "hex", + "num-bigint", + "prost 0.12.6", + "rand 0.8.5", + "serde", + "thiserror", + "tracing", + "zksync_concurrency", + "zksync_consensus_crypto", + "zksync_consensus_utils", + "zksync_protobuf", + "zksync_protobuf_build", +] + [[package]] name = "zksync_consensus_utils" -version = "0.1.0-rc.11" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2ff679f8b5f671d887a750b8107f3b5c01fd6085f68eef37ab01de8d2bd0736b" +checksum = "29e69dffc0fbc7c096548c997f5ca157a490b34b3d49fd524fa3d51840f7fb22" dependencies = [ "anyhow", - "rand", + "rand 0.8.5", "thiserror", "zksync_concurrency", ] @@ -6413,7 +6595,7 @@ dependencies = [ "anyhow", "blake2", "hex", - "rand", + "rand 0.8.5", "secp256k1", "serde", "serde_json", @@ -6434,9 +6616,9 @@ dependencies = [ [[package]] name = "zksync_protobuf" -version = "0.1.0-rc.11" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4f6ba3bf0aac20de18b4ae18a22d8c81b83f8f72e8fdec1c879525ecdacd2f5" +checksum = "df5467dfe2f845ca1fd6ceec623bbd32187589793d3c4023dcd2f5172369d198" dependencies = [ "anyhow", "bit-vec", @@ -6444,7 +6626,7 @@ dependencies = [ "prost 0.12.6", "prost-reflect", "quick-protobuf", - "rand", + "rand 0.8.5", "serde", "serde_json", "serde_yaml", @@ -6455,9 +6637,9 @@ dependencies = [ [[package]] name = "zksync_protobuf_build" -version = "0.1.0-rc.11" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7798c248b9a64505f0586bd5fadad6b26c999be4a8dec6b1a86b10b3888169c5" +checksum = "33d35280660b11be2a4ebdf531184eb729acebfdc3368d27176ec104f8bf9c5f" dependencies = [ "anyhow", "heck", @@ -6477,7 +6659,7 @@ dependencies = [ "anyhow", "hex", "prost 0.12.6", - "rand", + "rand 0.8.5", "secrecy", "serde_json", "serde_yaml", @@ -6539,7 +6721,6 @@ dependencies = [ "bigdecimal", "futures", "hex", - "itertools 0.10.5", "num", "once_cell", "reqwest 0.12.5", diff --git a/zk_toolbox/Cargo.toml b/zk_toolbox/Cargo.toml index 4a08776558e..33309872ea3 100644 --- a/zk_toolbox/Cargo.toml +++ b/zk_toolbox/Cargo.toml @@ -30,7 +30,9 @@ types = { path = "crates/types" } zksync_config = { path = "../core/lib/config" } zksync_protobuf_config = { path = "../core/lib/protobuf_config" } zksync_basic_types = { path = "../core/lib/basic_types" } -zksync_protobuf = "=0.1.0-rc.11" +zksync_consensus_roles = "=0.1.1" +zksync_consensus_crypto = "=0.1.1" +zksync_protobuf = "=0.1.1" # External dependencies anyhow = "1.0.82" @@ -59,3 +61,4 @@ toml = "0.8.12" url = { version = "2.5.0", features = ["serde"] } xshell = "0.2.6" clap-markdown = "0.1.4" +secrecy = "0.8.0" diff --git a/zk_toolbox/crates/common/src/external_node.rs b/zk_toolbox/crates/common/src/external_node.rs index 09115f92d5f..8a5cbc3cd14 100644 --- a/zk_toolbox/crates/common/src/external_node.rs +++ b/zk_toolbox/crates/common/src/external_node.rs @@ -9,6 +9,7 @@ pub fn run( config_path: &str, secrets_path: &str, en_config_path: &str, + consensus_args: Vec, additional_args: Vec, ) -> anyhow::Result<()> { let _dir = shell.push_dir(code_path); @@ -22,6 +23,7 @@ pub fn run( --external-node-config-path {en_config_path} " ) + .args(consensus_args) .args(additional_args) .env_remove("RUSTUP_TOOLCHAIN"), ) diff --git a/zk_toolbox/crates/common/src/lib.rs b/zk_toolbox/crates/common/src/lib.rs index 5a6f63e3a51..7be4af74070 100644 --- a/zk_toolbox/crates/common/src/lib.rs +++ b/zk_toolbox/crates/common/src/lib.rs @@ -15,8 +15,8 @@ pub mod server; pub mod wallets; pub use prerequisites::{ - check_general_prerequisites, check_prerequisites, GCLOUD_PREREQUISITES, GPU_PREREQUISITES, - WGET_PREREQUISITES, + check_general_prerequisites, check_prerequisites, GCLOUD_PREREQUISITE, GPU_PREREQUISITES, + PROVER_CLI_PREREQUISITE, WGET_PREREQUISITE, }; 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 87ec396d0e6..665096d8486 100644 --- a/zk_toolbox/crates/common/src/prerequisites.rs +++ b/zk_toolbox/crates/common/src/prerequisites.rs @@ -45,16 +45,22 @@ pub const GPU_PREREQUISITES: [Prerequisite; 3] = [ }, // CUDA GPU driver ]; -pub const WGET_PREREQUISITES: [Prerequisite; 1] = [Prerequisite { +pub const WGET_PREREQUISITE: [Prerequisite; 1] = [Prerequisite { name: "wget", download_link: "https://www.gnu.org/software/wget/", }]; -pub const GCLOUD_PREREQUISITES: [Prerequisite; 1] = [Prerequisite { +pub const GCLOUD_PREREQUISITE: [Prerequisite; 1] = [Prerequisite { name: "gcloud", download_link: "https://cloud.google.com/sdk/docs/install", }]; +pub const PROVER_CLI_PREREQUISITE: [Prerequisite; 1] = [Prerequisite { + name: "prover_cli", + download_link: + "https://github.com/matter-labs/zksync-era/tree/main/prover/crates/bin/prover_cli", +}]; + pub struct Prerequisite { name: &'static str, download_link: &'static str, diff --git a/zk_toolbox/crates/common/src/server.rs b/zk_toolbox/crates/common/src/server.rs index c65c8d4c13e..40da1cf8032 100644 --- a/zk_toolbox/crates/common/src/server.rs +++ b/zk_toolbox/crates/common/src/server.rs @@ -9,6 +9,7 @@ use crate::cmd::Cmd; pub struct Server { components: Option>, code_path: PathBuf, + uring: bool, } /// Possible server modes. @@ -20,10 +21,11 @@ pub enum ServerMode { impl Server { /// Creates a new instance of the server. - pub fn new(components: Option>, code_path: PathBuf) -> Self { + pub fn new(components: Option>, code_path: PathBuf, uring: bool) -> Self { Self { components, code_path, + uring, } } @@ -52,10 +54,12 @@ impl Server { additional_args.push("--genesis".to_string()); } + let uring = self.uring.then_some("--features=rocksdb/io-uring"); + let mut cmd = Cmd::new( cmd!( shell, - "cargo run --release --bin zksync_server -- + "cargo run --release --bin zksync_server {uring...} -- --genesis-path {genesis_path} --wallets-path {wallets_path} --config-path {general_path} diff --git a/zk_toolbox/crates/config/src/chain.rs b/zk_toolbox/crates/config/src/chain.rs index 54ed1f7d3f3..affc8ccc770 100644 --- a/zk_toolbox/crates/config/src/chain.rs +++ b/zk_toolbox/crates/config/src/chain.rs @@ -38,6 +38,8 @@ pub struct ChainConfigInternal { pub l1_batch_commit_data_generator_mode: L1BatchCommitmentMode, pub base_token: BaseToken, pub wallet_creation: WalletCreation, + #[serde(skip_serializing_if = "Option::is_none")] + pub legacy_bridge: Option, } /// Chain configuration file. This file is created in the chain @@ -58,6 +60,7 @@ pub struct ChainConfig { pub base_token: BaseToken, pub wallet_creation: WalletCreation, pub shell: OnceCell, + pub legacy_bridge: Option, } impl Serialize for ChainConfig { @@ -153,6 +156,7 @@ impl ChainConfig { l1_batch_commit_data_generator_mode: self.l1_batch_commit_data_generator_mode, base_token: self.base_token.clone(), wallet_creation: self.wallet_creation, + legacy_bridge: self.legacy_bridge, } } } diff --git a/zk_toolbox/crates/config/src/consensus_config.rs b/zk_toolbox/crates/config/src/consensus_config.rs new file mode 100644 index 00000000000..0bb4750d1fc --- /dev/null +++ b/zk_toolbox/crates/config/src/consensus_config.rs @@ -0,0 +1,18 @@ +use zksync_config::configs::consensus::ConsensusConfig; +use zksync_protobuf_config::encode_yaml_repr; + +use crate::{ + traits::{FileConfigWithDefaultName, SaveConfig}, + CONSENSUS_CONFIG_FILE, +}; + +impl FileConfigWithDefaultName for ConsensusConfig { + const FILE_NAME: &'static str = CONSENSUS_CONFIG_FILE; +} + +impl SaveConfig for ConsensusConfig { + fn save(&self, shell: &xshell::Shell, path: impl AsRef) -> anyhow::Result<()> { + let bytes = encode_yaml_repr::(self)?; + Ok(shell.write_file(path.as_ref(), bytes)?) + } +} diff --git a/zk_toolbox/crates/config/src/consensus_secrets.rs b/zk_toolbox/crates/config/src/consensus_secrets.rs new file mode 100644 index 00000000000..0e5c4592d2f --- /dev/null +++ b/zk_toolbox/crates/config/src/consensus_secrets.rs @@ -0,0 +1,14 @@ +use std::path::Path; + +use xshell::Shell; +use zksync_config::configs::consensus::ConsensusSecrets; +use zksync_protobuf_config::decode_yaml_repr; + +use crate::traits::ReadConfig; + +impl ReadConfig for ConsensusSecrets { + fn read(shell: &Shell, path: impl AsRef) -> anyhow::Result { + let path = shell.current_dir().join(path); + decode_yaml_repr::(&path, false) + } +} diff --git a/zk_toolbox/crates/config/src/consts.rs b/zk_toolbox/crates/config/src/consts.rs index 1e1c0998f00..80b204cc619 100644 --- a/zk_toolbox/crates/config/src/consts.rs +++ b/zk_toolbox/crates/config/src/consts.rs @@ -11,6 +11,8 @@ pub const GENESIS_FILE: &str = "genesis.yaml"; // Name of external node specific config pub const EN_CONFIG_FILE: &str = "external_node.yaml"; +// Name of consensus config +pub const CONSENSUS_CONFIG_FILE: &str = "consensus_config.yaml"; pub(crate) const ERC20_CONFIGS_FILE: &str = "erc20.yaml"; /// Name of the initial deployments config file pub(crate) const INITIAL_DEPLOYMENT_FILE: &str = "initial_deployments.yaml"; @@ -60,6 +62,8 @@ pub const DEFAULT_EXPLORER_WORKER_PORT: u16 = 3001; pub const DEFAULT_EXPLORER_API_PORT: u16 = 3002; /// Default port for the explorer data fetcher service pub const DEFAULT_EXPLORER_DATA_FETCHER_PORT: u16 = 3040; +/// Default port for consensus service +pub const DEFAULT_CONSENSUS_PORT: u16 = 3054; pub const EXPLORER_API_DOCKER_IMAGE: &str = "matterlabs/block-explorer-api"; pub const EXPLORER_DATA_FETCHER_DOCKER_IMAGE: &str = "matterlabs/block-explorer-data-fetcher"; diff --git a/zk_toolbox/crates/config/src/ecosystem.rs b/zk_toolbox/crates/config/src/ecosystem.rs index 76d85bb41e9..7ff65d4612d 100644 --- a/zk_toolbox/crates/config/src/ecosystem.rs +++ b/zk_toolbox/crates/config/src/ecosystem.rs @@ -173,6 +173,7 @@ impl EcosystemConfig { artifacts: config .artifacts_path .unwrap_or_else(|| self.get_chain_artifacts_path(name)), + legacy_bridge: config.legacy_bridge, }) } @@ -290,3 +291,10 @@ fn find_file(shell: &Shell, path_buf: PathBuf, file_name: &str) -> Result PathBuf { + let link_to_code = config.link_to_code.clone(); + let mut link_to_prover = link_to_code.into_os_string(); + link_to_prover.push("/prover"); + link_to_prover.into() +} diff --git a/zk_toolbox/crates/config/src/forge_interface/mod.rs b/zk_toolbox/crates/config/src/forge_interface/mod.rs index ea3d49c67ec..c7033c45ed2 100644 --- a/zk_toolbox/crates/config/src/forge_interface/mod.rs +++ b/zk_toolbox/crates/config/src/forge_interface/mod.rs @@ -4,3 +4,4 @@ pub mod deploy_l2_contracts; pub mod paymaster; pub mod register_chain; pub mod script_params; +pub mod setup_legacy_bridge; diff --git a/zk_toolbox/crates/config/src/forge_interface/script_params.rs b/zk_toolbox/crates/config/src/forge_interface/script_params.rs index fb16aa97e6a..e7e21ad132b 100644 --- a/zk_toolbox/crates/config/src/forge_interface/script_params.rs +++ b/zk_toolbox/crates/config/src/forge_interface/script_params.rs @@ -61,3 +61,9 @@ pub const ACCEPT_GOVERNANCE_SCRIPT_PARAMS: ForgeScriptParams = ForgeScriptParams output: "script-out/output-accept-admin.toml", script_path: "deploy-scripts/AcceptAdmin.s.sol", }; + +pub const SETUP_LEGACY_BRIDGE: ForgeScriptParams = ForgeScriptParams { + input: "script-config/setup-legacy-bridge.toml", + output: "script-out/setup-legacy-bridge.toml", + script_path: "deploy-scripts/dev/SetupLegacyBridge.s.sol", +}; diff --git a/zk_toolbox/crates/config/src/forge_interface/setup_legacy_bridge/mod.rs b/zk_toolbox/crates/config/src/forge_interface/setup_legacy_bridge/mod.rs new file mode 100644 index 00000000000..e8189c521fb --- /dev/null +++ b/zk_toolbox/crates/config/src/forge_interface/setup_legacy_bridge/mod.rs @@ -0,0 +1,20 @@ +use serde::{Deserialize, Serialize}; +use zksync_basic_types::{Address, L2ChainId, H256}; + +use crate::traits::ZkToolboxConfig; + +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct SetupLegacyBridgeInput { + pub bridgehub: Address, + pub diamond_proxy: Address, + pub shared_bridge_proxy: Address, + pub transparent_proxy_admin: Address, + pub erc20bridge_proxy: Address, + pub token_weth_address: Address, + pub chain_id: L2ChainId, + pub l2shared_bridge_address: Address, + pub create2factory_salt: H256, + pub create2factory_addr: Address, +} + +impl ZkToolboxConfig for SetupLegacyBridgeInput {} diff --git a/zk_toolbox/crates/config/src/general.rs b/zk_toolbox/crates/config/src/general.rs index 41c2e4c33cf..6498beb0f53 100644 --- a/zk_toolbox/crates/config/src/general.rs +++ b/zk_toolbox/crates/config/src/general.rs @@ -3,19 +3,21 @@ use std::path::{Path, PathBuf}; use anyhow::Context; use url::Url; use xshell::Shell; -use zksync_config::configs::object_store::ObjectStoreMode; pub use zksync_config::configs::GeneralConfig; +use zksync_config::configs::{consensus::Host, object_store::ObjectStoreMode}; use zksync_protobuf_config::{decode_yaml_repr, encode_yaml_repr}; use crate::{ consts::GENERAL_FILE, traits::{ConfigWithL2RpcUrl, FileConfigWithDefaultName, ReadConfig, SaveConfig}, + DEFAULT_CONSENSUS_PORT, }; pub struct RocksDbs { pub state_keeper: PathBuf, pub merkle_tree: PathBuf, pub protective_reads: PathBuf, + pub basic_witness_input_producer: PathBuf, } pub struct FileArtifacts { @@ -54,6 +56,15 @@ pub fn set_rocks_db_config(config: &mut GeneralConfig, rocks_dbs: RocksDbs) -> a .as_mut() .context("Protective reads config is not presented")? .db_path = rocks_dbs.protective_reads.to_str().unwrap().to_string(); + config + .basic_witness_input_producer_config + .as_mut() + .context("Basic witness input producer config is not presented")? + .db_path = rocks_dbs + .basic_witness_input_producer + .to_str() + .unwrap() + .to_string(); Ok(()) } @@ -104,6 +115,11 @@ pub fn set_file_artifacts(config: &mut GeneralConfig, file_artifacts: FileArtifa pub fn ports_config(config: &GeneralConfig) -> Option { let api = config.api_config.as_ref()?; let contract_verifier = config.contract_verifier.as_ref()?; + let consensus_port = if let Some(consensus_config) = config.clone().consensus_config { + consensus_config.server_addr.port() + } else { + DEFAULT_CONSENSUS_PORT + }; Some(PortsConfig { web3_json_rpc_http_port: api.web3_json_rpc.http_port, @@ -112,6 +128,7 @@ pub fn ports_config(config: &GeneralConfig) -> Option { merkle_tree_port: api.merkle_tree.port, prometheus_listener_port: api.prometheus.listener_port, contract_verifier_port: contract_verifier.port, + consensus_port, }) } @@ -128,6 +145,10 @@ pub fn update_ports(config: &mut GeneralConfig, ports_config: &PortsConfig) -> a .prometheus_config .as_mut() .context("Prometheus config is not presented")?; + if let Some(consensus) = config.consensus_config.as_mut() { + consensus.server_addr.set_port(ports_config.consensus_port); + update_port_in_host(&mut consensus.public_addr, ports_config.consensus_port)?; + } api.web3_json_rpc.http_port = ports_config.web3_json_rpc_http_port; update_port_in_url( @@ -162,6 +183,13 @@ fn update_port_in_url(http_url: &mut String, port: u16) -> anyhow::Result<()> { Ok(()) } +fn update_port_in_host(host: &mut Host, port: u16) -> anyhow::Result<()> { + let url = Url::parse(&format!("http://{}", host.0))?; + let host_str = url.host_str().context("Failed to get host")?; + host.0 = format!("{host_str}:{port}"); + Ok(()) +} + impl FileConfigWithDefaultName for GeneralConfig { const FILE_NAME: &'static str = GENERAL_FILE; } @@ -173,6 +201,7 @@ pub struct PortsConfig { pub merkle_tree_port: u16, pub prometheus_listener_port: u16, pub contract_verifier_port: u16, + pub consensus_port: u16, } impl PortsConfig { @@ -183,6 +212,7 @@ impl PortsConfig { self.merkle_tree_port += offset; self.prometheus_listener_port += offset; self.contract_verifier_port += offset; + self.consensus_port += offset; } pub fn next_empty_ports_config(&self) -> PortsConfig { @@ -193,6 +223,7 @@ impl PortsConfig { merkle_tree_port: self.merkle_tree_port + 100, prometheus_listener_port: self.prometheus_listener_port + 100, contract_verifier_port: self.contract_verifier_port + 100, + consensus_port: self.consensus_port + 100, } } } diff --git a/zk_toolbox/crates/config/src/lib.rs b/zk_toolbox/crates/config/src/lib.rs index 3c7443f2449..1a7c5bf1d7e 100644 --- a/zk_toolbox/crates/config/src/lib.rs +++ b/zk_toolbox/crates/config/src/lib.rs @@ -25,6 +25,8 @@ mod secrets; mod wallet_creation; mod wallets; +pub mod consensus_config; +pub mod consensus_secrets; pub mod docker_compose; pub mod explorer; pub mod explorer_compose; diff --git a/zk_toolbox/crates/config/src/wallet_creation.rs b/zk_toolbox/crates/config/src/wallet_creation.rs index a27d55f6f46..6cfdf08a36d 100644 --- a/zk_toolbox/crates/config/src/wallet_creation.rs +++ b/zk_toolbox/crates/config/src/wallet_creation.rs @@ -58,6 +58,10 @@ pub fn create_localhost_wallets( blob_operator: Wallet::from_mnemonic(ð_mnemonic.test_mnemonic, &base_path, 2)?, fee_account: Wallet::from_mnemonic(ð_mnemonic.test_mnemonic, &base_path, 3)?, governor: Wallet::from_mnemonic(ð_mnemonic.test_mnemonic, &base_path, 4)?, - token_multiplier_setter: Wallet::from_mnemonic(ð_mnemonic.test_mnemonic, &base_path, 5)?, + token_multiplier_setter: Some(Wallet::from_mnemonic( + ð_mnemonic.test_mnemonic, + &base_path, + 5, + )?), }) } diff --git a/zk_toolbox/crates/config/src/wallets.rs b/zk_toolbox/crates/config/src/wallets.rs index a2e5be87440..9c87453954e 100644 --- a/zk_toolbox/crates/config/src/wallets.rs +++ b/zk_toolbox/crates/config/src/wallets.rs @@ -15,7 +15,7 @@ pub struct WalletsConfig { pub blob_operator: Wallet, pub fee_account: Wallet, pub governor: Wallet, - pub token_multiplier_setter: Wallet, + pub token_multiplier_setter: Option, } impl WalletsConfig { @@ -27,7 +27,7 @@ impl WalletsConfig { blob_operator: Wallet::random(rng), fee_account: Wallet::random(rng), governor: Wallet::random(rng), - token_multiplier_setter: Wallet::random(rng), + token_multiplier_setter: Some(Wallet::random(rng)), } } @@ -39,7 +39,7 @@ impl WalletsConfig { blob_operator: Wallet::empty(), fee_account: Wallet::empty(), governor: Wallet::empty(), - token_multiplier_setter: Wallet::empty(), + token_multiplier_setter: Some(Wallet::empty()), } } pub fn deployer_private_key(&self) -> Option { diff --git a/zk_toolbox/crates/zk_inception/Cargo.toml b/zk_toolbox/crates/zk_inception/Cargo.toml index 01d0697d6b6..61983d59e6e 100644 --- a/zk_toolbox/crates/zk_inception/Cargo.toml +++ b/zk_toolbox/crates/zk_inception/Cargo.toml @@ -34,3 +34,6 @@ zksync_config.workspace = true slugify-rs.workspace = true zksync_basic_types.workspace = true clap-markdown.workspace = true +zksync_consensus_roles.workspace = true +zksync_consensus_crypto.workspace = true +secrecy.workspace = true diff --git a/zk_toolbox/crates/zk_inception/README.md b/zk_toolbox/crates/zk_inception/README.md index 25eeff40247..904b1421e3a 100644 --- a/zk_toolbox/crates/zk_inception/README.md +++ b/zk_toolbox/crates/zk_inception/README.md @@ -504,12 +504,19 @@ Run prover Possible values: `gateway`, `witness-generator`, `witness-vector-generator`, `prover`, `compressor`, `prover-job-monitor` +- `--docker` - Whether to run image of the component instead of binary. + + Possible values: `true`, `false` + - `--round ` Possible values: `all-rounds`, `basic-circuits`, `leaf-aggregation`, `node-aggregation`, `recursion-tip`, `scheduler` - `--threads ` +- `--max-allocation ` - in case you are running prover component, the value limits maximum + memory allocation of it in bytes. + ## `zk_inception prover init-bellman-cuda` Initialize bellman-cuda diff --git a/zk_toolbox/crates/zk_inception/src/commands/args/run_server.rs b/zk_toolbox/crates/zk_inception/src/commands/args/run_server.rs index 1e373319ec7..ebe407d4822 100644 --- a/zk_toolbox/crates/zk_inception/src/commands/args/run_server.rs +++ b/zk_toolbox/crates/zk_inception/src/commands/args/run_server.rs @@ -3,7 +3,7 @@ use serde::{Deserialize, Serialize}; use crate::messages::{ MSG_SERVER_ADDITIONAL_ARGS_HELP, MSG_SERVER_BUILD_HELP, MSG_SERVER_COMPONENTS_HELP, - MSG_SERVER_GENESIS_HELP, + MSG_SERVER_GENESIS_HELP, MSG_SERVER_URING_HELP, }; #[derive(Debug, Serialize, Deserialize, Parser)] @@ -17,4 +17,6 @@ pub struct RunServerArgs { additional_args: Vec, #[clap(long, help = MSG_SERVER_BUILD_HELP)] pub build: bool, + #[clap(help=MSG_SERVER_URING_HELP, long, default_missing_value = "true", num_args = 0..=1)] + pub uring: bool, } diff --git a/zk_toolbox/crates/zk_inception/src/commands/chain/args/create.rs b/zk_toolbox/crates/zk_inception/src/commands/chain/args/create.rs index 65f80928789..3ea15d10f8b 100644 --- a/zk_toolbox/crates/zk_inception/src/commands/chain/args/create.rs +++ b/zk_toolbox/crates/zk_inception/src/commands/chain/args/create.rs @@ -65,6 +65,8 @@ pub struct ChainCreateArgs { base_token_price_denominator: Option, #[clap(long, help = MSG_SET_AS_DEFAULT_HELP, default_missing_value = "true", num_args = 0..=1)] pub(crate) set_as_default: Option, + #[clap(long, default_value = "false")] + pub(crate) legacy_bridge: bool, } impl ChainCreateArgs { @@ -224,6 +226,7 @@ impl ChainCreateArgs { wallet_path, base_token, set_as_default, + legacy_bridge: self.legacy_bridge, }) } } @@ -238,6 +241,7 @@ pub struct ChainCreateArgsFinal { pub wallet_path: Option, pub base_token: BaseToken, pub set_as_default: bool, + pub legacy_bridge: bool, } #[derive(Debug, Clone, EnumIter, Display, PartialEq, Eq)] diff --git a/zk_toolbox/crates/zk_inception/src/commands/chain/create.rs b/zk_toolbox/crates/zk_inception/src/commands/chain/create.rs index abdea482db4..48a320ec27e 100644 --- a/zk_toolbox/crates/zk_inception/src/commands/chain/create.rs +++ b/zk_toolbox/crates/zk_inception/src/commands/chain/create.rs @@ -59,15 +59,24 @@ pub(crate) fn create_chain_inner( ecosystem_config: &EcosystemConfig, shell: &Shell, ) -> anyhow::Result<()> { + if args.legacy_bridge { + logger::warn("WARNING!!! You are creating a chain with legacy bridge, use it only for testing compatibility") + } let default_chain_name = args.chain_name.clone(); let chain_path = ecosystem_config.chains.join(&default_chain_name); let chain_configs_path = create_local_configs_dir(shell, &chain_path)?; - let chain_id = ecosystem_config.list_of_chains().len() as u32; + let (chain_id, legacy_bridge) = if args.legacy_bridge { + // Legacy bridge is distinguished by using the same chain id as ecosystem + (ecosystem_config.era_chain_id, Some(true)) + } else { + (L2ChainId::from(args.chain_id), None) + }; + let internal_id = ecosystem_config.list_of_chains().len() as u32; let chain_config = ChainConfig { - id: chain_id, + id: internal_id, name: default_chain_name.clone(), - chain_id: L2ChainId::from(args.chain_id), + chain_id, prover_version: args.prover_version, l1_network: ecosystem_config.l1_network, link_to_code: ecosystem_config.link_to_code.clone(), @@ -79,13 +88,14 @@ pub(crate) fn create_chain_inner( base_token: args.base_token, wallet_creation: args.wallet_creation, shell: OnceCell::from(shell.clone()), + legacy_bridge, }; create_wallets( shell, &chain_config.configs, &ecosystem_config.link_to_code, - chain_id, + internal_id, args.wallet_creation, args.wallet_path, )?; diff --git a/zk_toolbox/crates/zk_inception/src/commands/chain/deploy_l2_contracts.rs b/zk_toolbox/crates/zk_inception/src/commands/chain/deploy_l2_contracts.rs index 3625abfb15a..7545ec2ec26 100644 --- a/zk_toolbox/crates/zk_inception/src/commands/chain/deploy_l2_contracts.rs +++ b/zk_toolbox/crates/zk_inception/src/commands/chain/deploy_l2_contracts.rs @@ -125,12 +125,17 @@ pub async fn initialize_bridges( contracts_config: &mut ContractsConfig, forge_args: ForgeScriptArgs, ) -> anyhow::Result<()> { + let signature = if let Some(true) = chain_config.legacy_bridge { + Some("runDeployLegacySharedBridge") + } else { + Some("runDeploySharedBridge") + }; build_and_deploy( shell, chain_config, ecosystem_config, forge_args, - Some("runDeploySharedBridge"), + signature, |shell, out| { contracts_config.set_l2_shared_bridge(&InitializeBridgeOutput::read(shell, out)?) }, @@ -185,12 +190,17 @@ pub async fn deploy_l2_contracts( contracts_config: &mut ContractsConfig, forge_args: ForgeScriptArgs, ) -> anyhow::Result<()> { + let signature = if let Some(true) = chain_config.legacy_bridge { + Some("runWithLegacyBridge") + } else { + None + }; build_and_deploy( shell, chain_config, ecosystem_config, forge_args, - None, + signature, |shell, out| { contracts_config.set_l2_shared_bridge(&InitializeBridgeOutput::read(shell, out)?)?; contracts_config.set_default_l2_upgrade(&DefaultL2UpgradeOutput::read(shell, out)?)?; diff --git a/zk_toolbox/crates/zk_inception/src/commands/chain/genesis.rs b/zk_toolbox/crates/zk_inception/src/commands/chain/genesis.rs index 0eb40d630ae..bfa3f94916b 100644 --- a/zk_toolbox/crates/zk_inception/src/commands/chain/genesis.rs +++ b/zk_toolbox/crates/zk_inception/src/commands/chain/genesis.rs @@ -168,7 +168,7 @@ async fn initialize_databases( } fn run_server_genesis(chain_config: &ChainConfig, shell: &Shell) -> anyhow::Result<()> { - let server = Server::new(None, chain_config.link_to_code.clone()); + let server = Server::new(None, chain_config.link_to_code.clone(), false); server .run( shell, diff --git a/zk_toolbox/crates/zk_inception/src/commands/chain/init.rs b/zk_toolbox/crates/zk_inception/src/commands/chain/init.rs index 793fbbf31ae..734e5e54863 100644 --- a/zk_toolbox/crates/zk_inception/src/commands/chain/init.rs +++ b/zk_toolbox/crates/zk_inception/src/commands/chain/init.rs @@ -27,6 +27,7 @@ use crate::{ deploy_l2_contracts, deploy_paymaster, genesis::genesis, set_token_multiplier_setter::set_token_multiplier_setter, + setup_legacy_bridge::setup_legacy_bridge, }, portal::update_portal_config, }, @@ -34,11 +35,14 @@ use crate::{ messages::{ msg_initializing_chain, MSG_ACCEPTING_ADMIN_SPINNER, MSG_CHAIN_INITIALIZED, MSG_CHAIN_NOT_FOUND_ERR, MSG_DISTRIBUTING_ETH_SPINNER, MSG_GENESIS_DATABASE_ERR, - MSG_MINT_BASE_TOKEN_SPINNER, MSG_PORTAL_FAILED_TO_CREATE_CONFIG_ERR, + MSG_MINT_BASE_TOKEN_SPINNER, MSG_PORTAL_FAILED_TO_CREATE_CONFIG_ERR, MSG_PORTS_CONFIG_ERR, MSG_REGISTERING_CHAIN_SPINNER, MSG_SELECTED_CONFIG, - MSG_UPDATING_TOKEN_MULTIPLIER_SETTER_SPINNER, + MSG_UPDATING_TOKEN_MULTIPLIER_SETTER_SPINNER, MSG_WALLET_TOKEN_MULTIPLIER_SETTER_NOT_FOUND, + }, + utils::{ + consensus::{generate_consensus_keys, get_consensus_config, get_consensus_secrets}, + forge::{check_the_balance, fill_forge_private_key}, }, - utils::forge::{check_the_balance, fill_forge_private_key}, }; pub(crate) async fn run(args: InitArgs, shell: &Shell) -> anyhow::Result<()> { @@ -69,6 +73,12 @@ pub async fn init( let mut general_config = chain_config.get_general_config()?; apply_port_offset(init_args.port_offset, &mut general_config)?; + let ports = ports_config(&general_config).context(MSG_PORTS_CONFIG_ERR)?; + + let consensus_keys = generate_consensus_keys(); + let consensus_config = + get_consensus_config(chain_config, ports, Some(consensus_keys.clone()), None)?; + general_config.consensus_config = Some(consensus_config); general_config.save_with_base_path(shell, &chain_config.configs)?; let mut genesis_config = chain_config.get_genesis_config()?; @@ -85,6 +95,7 @@ pub async fn init( let mut secrets = chain_config.get_secrets_config()?; set_l1_rpc_url(&mut secrets, init_args.l1_rpc_url.clone())?; + secrets.consensus = Some(get_consensus_secrets(&consensus_keys)); secrets.save_with_base_path(shell, &chain_config.configs)?; let spinner = Spinner::new(MSG_REGISTERING_CHAIN_SPINNER); @@ -112,22 +123,25 @@ pub async fn init( .await?; spinner.finish(); - let spinner = Spinner::new(MSG_UPDATING_TOKEN_MULTIPLIER_SETTER_SPINNER); - set_token_multiplier_setter( - shell, - ecosystem_config, - chain_config.get_wallets_config()?.governor_private_key(), - contracts_config.l1.chain_admin_addr, - ecosystem_config - .get_wallets() - .unwrap() - .token_multiplier_setter - .address, - &init_args.forge_args.clone(), - init_args.l1_rpc_url.clone(), - ) - .await?; - spinner.finish(); + if chain_config.base_token != BaseToken::eth() { + let spinner = Spinner::new(MSG_UPDATING_TOKEN_MULTIPLIER_SETTER_SPINNER); + set_token_multiplier_setter( + shell, + ecosystem_config, + chain_config.get_wallets_config()?.governor_private_key(), + contracts_config.l1.chain_admin_addr, + chain_config + .get_wallets_config() + .unwrap() + .token_multiplier_setter + .context(MSG_WALLET_TOKEN_MULTIPLIER_SETTER_NOT_FOUND)? + .address, + &init_args.forge_args.clone(), + init_args.l1_rpc_url.clone(), + ) + .await?; + spinner.finish(); + } deploy_l2_contracts::deploy_l2_contracts( shell, @@ -139,6 +153,17 @@ pub async fn init( .await?; contracts_config.save_with_base_path(shell, &chain_config.configs)?; + if let Some(true) = chain_config.legacy_bridge { + setup_legacy_bridge( + shell, + chain_config, + ecosystem_config, + &contracts_config, + init_args.forge_args.clone(), + ) + .await?; + } + if init_args.deploy_paymaster { deploy_paymaster::deploy_paymaster( shell, diff --git a/zk_toolbox/crates/zk_inception/src/commands/chain/mod.rs b/zk_toolbox/crates/zk_inception/src/commands/chain/mod.rs index afc92d2288b..61a164c1655 100644 --- a/zk_toolbox/crates/zk_inception/src/commands/chain/mod.rs +++ b/zk_toolbox/crates/zk_inception/src/commands/chain/mod.rs @@ -16,6 +16,7 @@ pub mod deploy_paymaster; pub mod genesis; pub(crate) mod init; mod set_token_multiplier_setter; +mod setup_legacy_bridge; #[derive(Subcommand, Debug)] pub enum ChainCommands { diff --git a/zk_toolbox/crates/zk_inception/src/commands/chain/set_token_multiplier_setter.rs b/zk_toolbox/crates/zk_inception/src/commands/chain/set_token_multiplier_setter.rs index 0ab0d451f1f..f92391c22f4 100644 --- a/zk_toolbox/crates/zk_inception/src/commands/chain/set_token_multiplier_setter.rs +++ b/zk_toolbox/crates/zk_inception/src/commands/chain/set_token_multiplier_setter.rs @@ -15,7 +15,7 @@ use crate::{ messages::{ MSG_CHAIN_NOT_INITIALIZED, MSG_L1_SECRETS_MUST_BE_PRESENTED, MSG_TOKEN_MULTIPLIER_SETTER_UPDATED_TO, MSG_UPDATING_TOKEN_MULTIPLIER_SETTER_SPINNER, - MSG_WALLETS_CONFIG_MUST_BE_PRESENT, + MSG_WALLETS_CONFIG_MUST_BE_PRESENT, MSG_WALLET_TOKEN_MULTIPLIER_SETTER_NOT_FOUND, }, utils::forge::{check_the_balance, fill_forge_private_key}, }; @@ -47,6 +47,7 @@ pub async fn run(args: ForgeScriptArgs, shell: &Shell) -> anyhow::Result<()> { .get_wallets() .context(MSG_WALLETS_CONFIG_MUST_BE_PRESENT)? .token_multiplier_setter + .context(MSG_WALLET_TOKEN_MULTIPLIER_SETTER_NOT_FOUND)? .address; let spinner = Spinner::new(MSG_UPDATING_TOKEN_MULTIPLIER_SETTER_SPINNER); diff --git a/zk_toolbox/crates/zk_inception/src/commands/chain/setup_legacy_bridge.rs b/zk_toolbox/crates/zk_inception/src/commands/chain/setup_legacy_bridge.rs new file mode 100644 index 00000000000..925014fe4e6 --- /dev/null +++ b/zk_toolbox/crates/zk_inception/src/commands/chain/setup_legacy_bridge.rs @@ -0,0 +1,73 @@ +use anyhow::Context; +use common::{ + forge::{Forge, ForgeScriptArgs}, + spinner::Spinner, +}; +use config::{ + forge_interface::{ + script_params::SETUP_LEGACY_BRIDGE, setup_legacy_bridge::SetupLegacyBridgeInput, + }, + traits::SaveConfig, + ChainConfig, ContractsConfig, EcosystemConfig, +}; +use xshell::Shell; + +use crate::{ + messages::{MSG_DEPLOYING_PAYMASTER, MSG_L1_SECRETS_MUST_BE_PRESENTED}, + utils::forge::{check_the_balance, fill_forge_private_key}, +}; + +pub async fn setup_legacy_bridge( + shell: &Shell, + chain_config: &ChainConfig, + ecosystem_config: &EcosystemConfig, + contracts_config: &ContractsConfig, + forge_args: ForgeScriptArgs, +) -> anyhow::Result<()> { + let input = SetupLegacyBridgeInput { + bridgehub: contracts_config.ecosystem_contracts.bridgehub_proxy_addr, + diamond_proxy: contracts_config.l1.diamond_proxy_addr, + shared_bridge_proxy: contracts_config.bridges.shared.l1_address, + transparent_proxy_admin: contracts_config + .ecosystem_contracts + .transparent_proxy_admin_addr, + erc20bridge_proxy: contracts_config.bridges.erc20.l1_address, + token_weth_address: Default::default(), + chain_id: chain_config.chain_id, + l2shared_bridge_address: contracts_config + .bridges + .shared + .l2_address + .expect("Not fully initialized"), + create2factory_salt: contracts_config.create2_factory_salt, + create2factory_addr: contracts_config.create2_factory_addr, + }; + let foundry_contracts_path = chain_config.path_to_foundry(); + input.save(shell, SETUP_LEGACY_BRIDGE.input(&chain_config.link_to_code))?; + let secrets = chain_config.get_secrets_config()?; + + let mut forge = Forge::new(&foundry_contracts_path) + .script(&SETUP_LEGACY_BRIDGE.script(), forge_args.clone()) + .with_ffi() + .with_rpc_url( + secrets + .l1 + .context(MSG_L1_SECRETS_MUST_BE_PRESENTED)? + .l1_rpc_url + .expose_str() + .to_string(), + ) + .with_broadcast(); + + forge = fill_forge_private_key( + forge, + ecosystem_config.get_wallets()?.governor_private_key(), + )?; + + let spinner = Spinner::new(MSG_DEPLOYING_PAYMASTER); + check_the_balance(&forge).await?; + forge.run(shell)?; + spinner.finish(); + + Ok(()) +} diff --git a/zk_toolbox/crates/zk_inception/src/commands/external_node/args/run.rs b/zk_toolbox/crates/zk_inception/src/commands/external_node/args/run.rs index 1bc0c06728d..cd6ff4c7153 100644 --- a/zk_toolbox/crates/zk_inception/src/commands/external_node/args/run.rs +++ b/zk_toolbox/crates/zk_inception/src/commands/external_node/args/run.rs @@ -1,7 +1,9 @@ use clap::Parser; use serde::{Deserialize, Serialize}; -use crate::messages::{MSG_SERVER_ADDITIONAL_ARGS_HELP, MSG_SERVER_COMPONENTS_HELP}; +use crate::messages::{ + MSG_ENABLE_CONSENSUS_HELP, MSG_SERVER_ADDITIONAL_ARGS_HELP, MSG_SERVER_COMPONENTS_HELP, +}; #[derive(Debug, Serialize, Deserialize, Parser)] pub struct RunExternalNodeArgs { @@ -9,6 +11,8 @@ pub struct RunExternalNodeArgs { pub reinit: bool, #[clap(long, help = MSG_SERVER_COMPONENTS_HELP)] pub components: Option>, + #[clap(long, help = MSG_ENABLE_CONSENSUS_HELP, default_missing_value = "true", num_args = 0..=1)] + pub enable_consensus: Option, #[clap(long, short)] #[arg(trailing_var_arg = true, allow_hyphen_values = true, hide = false, help = MSG_SERVER_ADDITIONAL_ARGS_HELP)] pub additional_args: Vec, diff --git a/zk_toolbox/crates/zk_inception/src/commands/external_node/prepare_configs.rs b/zk_toolbox/crates/zk_inception/src/commands/external_node/prepare_configs.rs index 51101c22887..89e08418c6e 100644 --- a/zk_toolbox/crates/zk_inception/src/commands/external_node/prepare_configs.rs +++ b/zk_toolbox/crates/zk_inception/src/commands/external_node/prepare_configs.rs @@ -1,4 +1,4 @@ -use std::{path::Path, str::FromStr}; +use std::{collections::BTreeMap, path::Path, str::FromStr}; use anyhow::Context; use common::{config::global_config, logger}; @@ -8,14 +8,24 @@ use config::{ }; use xshell::Shell; use zksync_basic_types::url::SensitiveUrl; -use zksync_config::configs::{DatabaseSecrets, L1Secrets}; +use zksync_config::configs::{ + consensus::{ConsensusSecrets, NodeSecretKey, Secret}, + DatabaseSecrets, L1Secrets, +}; +use zksync_consensus_crypto::TextFmt; +use zksync_consensus_roles as roles; use crate::{ commands::external_node::args::prepare_configs::{PrepareConfigArgs, PrepareConfigFinal}, messages::{ - msg_preparing_en_config_is_done, MSG_CHAIN_NOT_INITIALIZED, MSG_PREPARING_EN_CONFIGS, + msg_preparing_en_config_is_done, MSG_CHAIN_NOT_INITIALIZED, + MSG_CONSENSUS_CONFIG_MISSING_ERR, MSG_CONSENSUS_SECRETS_MISSING_ERR, + MSG_CONSENSUS_SECRETS_NODE_KEY_MISSING_ERR, MSG_PORTS_CONFIG_ERR, MSG_PREPARING_EN_CONFIGS, + }, + utils::{ + consensus::{get_consensus_config, node_public_key}, + rocks_db::{recreate_rocksdb_dirs, RocksDBDirOption}, }, - utils::rocks_db::{recreate_rocksdb_dirs, RocksDBDirOption}, }; pub fn run(shell: &Shell, args: PrepareConfigArgs) -> anyhow::Result<()> { @@ -64,15 +74,45 @@ fn prepare_configs( gateway_url: None, }; let mut general_en = general.clone(); + let next_empty_ports_config = ports_config(&general) + .context(MSG_PORTS_CONFIG_ERR)? + .next_empty_ports_config(); + update_ports(&mut general_en, &next_empty_ports_config)?; + + // Set consensus config + let main_node_consensus_config = general + .consensus_config + .context(MSG_CONSENSUS_CONFIG_MISSING_ERR)?; + + let mut gossip_static_outbound = BTreeMap::new(); + let main_node_public_key = node_public_key( + &config + .get_secrets_config()? + .consensus + .context(MSG_CONSENSUS_SECRETS_MISSING_ERR)?, + )? + .context(MSG_CONSENSUS_SECRETS_NODE_KEY_MISSING_ERR)?; - update_ports( - &mut general_en, - &ports_config(&general) - .context("da")? - .next_empty_ports_config(), + gossip_static_outbound.insert(main_node_public_key, main_node_consensus_config.public_addr); + + let en_consensus_config = get_consensus_config( + config, + next_empty_ports_config, + None, + Some(gossip_static_outbound), )?; + general_en.consensus_config = Some(en_consensus_config.clone()); + en_consensus_config.save_with_base_path(shell, en_configs_path)?; + + // Set secrets config + let node_key = roles::node::SecretKey::generate().encode(); + let consensus_secrets = ConsensusSecrets { + validator_key: None, + attester_key: None, + node_key: Some(NodeSecretKey(Secret::new(node_key))), + }; let secrets = SecretsConfig { - consensus: None, + consensus: Some(consensus_secrets), database: Some(DatabaseSecrets { server_url: Some(args.db.full_url().into()), prover_url: None, diff --git a/zk_toolbox/crates/zk_inception/src/commands/external_node/run.rs b/zk_toolbox/crates/zk_inception/src/commands/external_node/run.rs index 9d3da466385..46328699e6d 100644 --- a/zk_toolbox/crates/zk_inception/src/commands/external_node/run.rs +++ b/zk_toolbox/crates/zk_inception/src/commands/external_node/run.rs @@ -32,6 +32,7 @@ async fn run_external_node( if args.reinit { init::init(shell, chain_config).await? } + let enable_consensus = args.enable_consensus.unwrap_or(false); let server = RunExternalNode::new(args.components.clone(), chain_config)?; - server.run(shell, args.additional_args.clone()) + server.run(shell, enable_consensus, args.additional_args.clone()) } diff --git a/zk_toolbox/crates/zk_inception/src/commands/prover/args/compressor_keys.rs b/zk_toolbox/crates/zk_inception/src/commands/prover/args/compressor_keys.rs new file mode 100644 index 00000000000..095dccf00b3 --- /dev/null +++ b/zk_toolbox/crates/zk_inception/src/commands/prover/args/compressor_keys.rs @@ -0,0 +1,22 @@ +use clap::Parser; +use common::Prompt; + +use crate::messages::MSG_SETUP_COMPRESSOR_KEY_PATH_PROMPT; + +#[derive(Debug, Clone, Parser, Default)] +pub struct CompressorKeysArgs { + #[clap(long)] + pub path: Option, +} + +impl CompressorKeysArgs { + pub fn fill_values_with_prompt(self, default: &str) -> CompressorKeysArgs { + let path = self.path.unwrap_or_else(|| { + Prompt::new(MSG_SETUP_COMPRESSOR_KEY_PATH_PROMPT) + .default(default) + .ask() + }); + + CompressorKeysArgs { path: Some(path) } + } +} diff --git a/zk_toolbox/crates/zk_inception/src/commands/prover/args/init.rs b/zk_toolbox/crates/zk_inception/src/commands/prover/args/init.rs index e8c9cf1888d..94fea1389d2 100644 --- a/zk_toolbox/crates/zk_inception/src/commands/prover/args/init.rs +++ b/zk_toolbox/crates/zk_inception/src/commands/prover/args/init.rs @@ -8,7 +8,10 @@ use url::Url; use xshell::Shell; use zksync_config::configs::fri_prover::CloudConnectionMode; -use super::init_bellman_cuda::InitBellmanCudaArgs; +use super::{ + compressor_keys::CompressorKeysArgs, init_bellman_cuda::InitBellmanCudaArgs, + setup_keys::SetupKeysArgs, +}; use crate::{ commands::prover::gcs::get_project_ids, consts::{DEFAULT_CREDENTIALS_FILE, DEFAULT_PROOF_STORE_DIR}, @@ -18,25 +21,24 @@ use crate::{ MSG_CREATE_GCS_BUCKET_LOCATION_PROMPT, MSG_CREATE_GCS_BUCKET_NAME_PROMTP, MSG_CREATE_GCS_BUCKET_PROJECT_ID_NO_PROJECTS_PROMPT, MSG_CREATE_GCS_BUCKET_PROJECT_ID_PROMPT, MSG_CREATE_GCS_BUCKET_PROMPT, - MSG_DOWNLOAD_SETUP_KEY_PROMPT, MSG_GETTING_PROOF_STORE_CONFIG, - MSG_GETTING_PUBLIC_STORE_CONFIG, MSG_PROOF_STORE_CONFIG_PROMPT, MSG_PROOF_STORE_DIR_PROMPT, + MSG_DOWNLOAD_SETUP_COMPRESSOR_KEY_PROMPT, MSG_GETTING_PROOF_STORE_CONFIG, + MSG_GETTING_PUBLIC_STORE_CONFIG, MSG_INITIALIZE_BELLMAN_CUDA_PROMPT, + MSG_PROOF_STORE_CONFIG_PROMPT, MSG_PROOF_STORE_DIR_PROMPT, MSG_PROOF_STORE_GCS_BUCKET_BASE_URL_ERR, MSG_PROOF_STORE_GCS_BUCKET_BASE_URL_PROMPT, MSG_PROOF_STORE_GCS_CREDENTIALS_FILE_PROMPT, MSG_PROVER_DB_NAME_HELP, - MSG_PROVER_DB_URL_HELP, MSG_SAVE_TO_PUBLIC_BUCKET_PROMPT, MSG_SETUP_KEY_PATH_PROMPT, + MSG_PROVER_DB_URL_HELP, MSG_SAVE_TO_PUBLIC_BUCKET_PROMPT, MSG_SETUP_KEYS_PROMPT, MSG_USE_DEFAULT_DATABASES_HELP, }, }; -#[derive(Debug, Clone, Serialize, Deserialize, Parser, Default)] +#[derive(Debug, Clone, Parser, Default)] pub struct ProverInitArgs { // Proof store object #[clap(long)] pub proof_store_dir: Option, #[clap(flatten)] - #[serde(flatten)] pub proof_store_gcs_config: ProofStorageGCSTmp, #[clap(flatten)] - #[serde(flatten)] pub create_gcs_bucket_config: ProofStorageGCSCreateBucketTmp, // Public store object @@ -45,20 +47,25 @@ pub struct ProverInitArgs { #[clap(long)] pub public_store_dir: Option, #[clap(flatten)] - #[serde(flatten)] pub public_store_gcs_config: PublicStorageGCSTmp, #[clap(flatten)] - #[serde(flatten)] pub public_create_gcs_bucket_config: PublicStorageGCSCreateBucketTmp, // Bellman cuda #[clap(flatten)] - #[serde(flatten)] pub bellman_cuda_config: InitBellmanCudaArgs, + #[clap(long, default_missing_value = "true", num_args = 0..=1)] + pub bellman_cuda: Option, + + #[clap(long, default_missing_value = "true", num_args = 0..=1)] + pub setup_compressor_keys: Option, + #[clap(flatten)] + pub compressor_keys_args: CompressorKeysArgs, #[clap(flatten)] - #[serde(flatten)] - pub setup_key_config: SetupKeyConfigTmp, + pub setup_keys_args: SetupKeysArgs, + #[clap(long, default_missing_value = "true", num_args = 0..=1)] + pub setup_keys: Option, #[clap(long)] pub setup_database: Option, @@ -137,7 +144,7 @@ pub struct PublicStorageGCSCreateBucketTmp { } #[derive(Clone, Debug, Serialize, Deserialize, Parser, Default)] -pub struct SetupKeyConfigTmp { +pub struct SetupCompressorKeyConfigTmp { #[clap(long)] pub download_key: Option, #[clap(long)] @@ -171,12 +178,6 @@ pub enum ProofStorageConfig { GCSCreateBucket(ProofStorageGCSCreateBucket), } -#[derive(Debug, Clone)] -pub struct SetupKeyConfig { - pub download_key: bool, - pub setup_key_path: String, -} - #[derive(Debug, Clone)] pub struct ProverDatabaseConfig { pub database_config: DatabaseConfig, @@ -187,8 +188,9 @@ pub struct ProverDatabaseConfig { pub struct ProverInitArgsFinal { pub proof_store: ProofStorageConfig, pub public_store: Option, - pub setup_key_config: SetupKeyConfig, - pub bellman_cuda_config: InitBellmanCudaArgs, + pub compressor_key_args: Option, + pub setup_keys: Option, + pub bellman_cuda_config: Option, pub cloud_type: CloudConnectionMode, pub database_config: Option, } @@ -197,20 +199,23 @@ impl ProverInitArgs { pub(crate) fn fill_values_with_prompt( &self, shell: &Shell, - setup_key_path: &str, + default_compressor_key_path: &str, chain_config: &ChainConfig, ) -> anyhow::Result { let proof_store = self.fill_proof_storage_values_with_prompt(shell)?; let public_store = self.fill_public_storage_values_with_prompt(shell)?; - let setup_key_config = self.fill_setup_key_values_with_prompt(setup_key_path); - let bellman_cuda_config = self.fill_bellman_cuda_values_with_prompt()?; + let compressor_key_args = + self.fill_setup_compressor_key_values_with_prompt(default_compressor_key_path); + let bellman_cuda_config = self.fill_bellman_cuda_values_with_prompt(); let cloud_type = self.get_cloud_type_with_prompt(); let database_config = self.fill_database_values_with_prompt(chain_config); + let setup_keys = self.fill_setup_keys_values_with_prompt(); Ok(ProverInitArgsFinal { proof_store, public_store, - setup_key_config, + compressor_key_args, + setup_keys, bellman_cuda_config, cloud_type, database_config, @@ -336,29 +341,38 @@ impl ProverInitArgs { } } - fn fill_setup_key_values_with_prompt(&self, setup_key_path: &str) -> SetupKeyConfig { - let download_key = self - .clone() - .setup_key_config - .download_key - .unwrap_or_else(|| { - PromptConfirm::new(MSG_DOWNLOAD_SETUP_KEY_PROMPT) - .default(true) - .ask() - }); - let setup_key_path = self - .clone() - .setup_key_config - .setup_key_path - .unwrap_or_else(|| { - Prompt::new(MSG_SETUP_KEY_PATH_PROMPT) - .default(setup_key_path) - .ask() - }); + fn fill_setup_compressor_key_values_with_prompt( + &self, + default_path: &str, + ) -> Option { + let download_key = self.clone().setup_compressor_keys.unwrap_or_else(|| { + PromptConfirm::new(MSG_DOWNLOAD_SETUP_COMPRESSOR_KEY_PROMPT) + .default(false) + .ask() + }); - SetupKeyConfig { - download_key, - setup_key_path, + if download_key { + Some( + self.compressor_keys_args + .clone() + .fill_values_with_prompt(default_path), + ) + } else { + None + } + } + + fn fill_setup_keys_values_with_prompt(&self) -> Option { + let args = self.setup_keys_args.clone(); + + if self.setup_keys.unwrap_or_else(|| { + PromptConfirm::new(MSG_SETUP_KEYS_PROMPT) + .default(false) + .ask() + }) { + Some(args) + } else { + None } } @@ -460,8 +474,17 @@ impl ProverInitArgs { }) } - fn fill_bellman_cuda_values_with_prompt(&self) -> anyhow::Result { - self.bellman_cuda_config.clone().fill_values_with_prompt() + fn fill_bellman_cuda_values_with_prompt(&self) -> Option { + let args = self.bellman_cuda_config.clone(); + if self.bellman_cuda.unwrap_or_else(|| { + PromptConfirm::new(MSG_INITIALIZE_BELLMAN_CUDA_PROMPT) + .default(false) + .ask() + }) { + Some(args) + } else { + None + } } fn get_cloud_type_with_prompt(&self) -> CloudConnectionMode { diff --git a/zk_toolbox/crates/zk_inception/src/commands/prover/args/init_bellman_cuda.rs b/zk_toolbox/crates/zk_inception/src/commands/prover/args/init_bellman_cuda.rs index 848457c5327..ba204b0be9e 100644 --- a/zk_toolbox/crates/zk_inception/src/commands/prover/args/init_bellman_cuda.rs +++ b/zk_toolbox/crates/zk_inception/src/commands/prover/args/init_bellman_cuda.rs @@ -30,7 +30,7 @@ impl std::fmt::Display for BellmanCudaPathSelection { } impl InitBellmanCudaArgs { - pub fn fill_values_with_prompt(self) -> anyhow::Result { + pub fn fill_values_with_prompt(self) -> InitBellmanCudaArgs { let bellman_cuda_dir = self.bellman_cuda_dir.unwrap_or_else(|| { match PromptSelect::new( MSG_BELLMAN_CUDA_ORIGIN_SELECT, @@ -43,8 +43,8 @@ impl InitBellmanCudaArgs { } }); - Ok(InitBellmanCudaArgs { + InitBellmanCudaArgs { bellman_cuda_dir: Some(bellman_cuda_dir), - }) + } } } 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 903ecdb81d9..39391977b84 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 compressor_keys; pub mod init; pub mod init_bellman_cuda; pub mod run; diff --git a/zk_toolbox/crates/zk_inception/src/commands/prover/args/run.rs b/zk_toolbox/crates/zk_inception/src/commands/prover/args/run.rs index 6bdd62c1d48..751cc48074f 100644 --- a/zk_toolbox/crates/zk_inception/src/commands/prover/args/run.rs +++ b/zk_toolbox/crates/zk_inception/src/commands/prover/args/run.rs @@ -1,8 +1,22 @@ +use anyhow::anyhow; use clap::{Parser, ValueEnum}; use common::{Prompt, PromptSelect}; +use config::ChainConfig; use strum::{EnumIter, IntoEnumIterator}; -use crate::messages::{MSG_ROUND_SELECT_PROMPT, MSG_RUN_COMPONENT_PROMPT, MSG_THREADS_PROMPT}; +use crate::{ + consts::{ + COMPRESSOR_BINARY_NAME, COMPRESSOR_DOCKER_IMAGE, PROVER_BINARY_NAME, PROVER_DOCKER_IMAGE, + PROVER_GATEWAY_BINARY_NAME, PROVER_GATEWAY_DOCKER_IMAGE, PROVER_JOB_MONITOR_BINARY_NAME, + PROVER_JOB_MONITOR_DOCKER_IMAGE, WITNESS_GENERATOR_BINARY_NAME, + WITNESS_GENERATOR_DOCKER_IMAGE, WITNESS_VECTOR_GENERATOR_BINARY_NAME, + WITNESS_VECTOR_GENERATOR_DOCKER_IMAGE, + }, + messages::{ + MSG_ROUND_SELECT_PROMPT, MSG_RUN_COMPONENT_PROMPT, MSG_THREADS_PROMPT, + MSG_WITNESS_GENERATOR_ROUND_ERR, + }, +}; #[derive(Debug, Clone, Parser, Default)] pub struct ProverRunArgs { @@ -12,6 +26,10 @@ pub struct ProverRunArgs { pub witness_generator_args: WitnessGeneratorArgs, #[clap(flatten)] pub witness_vector_generator_args: WitnessVectorGeneratorArgs, + #[clap(flatten)] + pub fri_prover_args: FriProverRunArgs, + #[clap(long)] + pub docker: Option, } #[derive( @@ -32,6 +50,108 @@ pub enum ProverComponent { ProverJobMonitor, } +impl ProverComponent { + pub fn image_name(&self) -> &'static str { + match self { + Self::Gateway => PROVER_GATEWAY_DOCKER_IMAGE, + Self::WitnessGenerator => WITNESS_GENERATOR_DOCKER_IMAGE, + Self::WitnessVectorGenerator => WITNESS_VECTOR_GENERATOR_DOCKER_IMAGE, + Self::Prover => PROVER_DOCKER_IMAGE, + Self::Compressor => COMPRESSOR_DOCKER_IMAGE, + Self::ProverJobMonitor => PROVER_JOB_MONITOR_DOCKER_IMAGE, + } + } + + pub fn binary_name(&self) -> &'static str { + match self { + Self::Gateway => PROVER_GATEWAY_BINARY_NAME, + Self::WitnessGenerator => WITNESS_GENERATOR_BINARY_NAME, + Self::WitnessVectorGenerator => WITNESS_VECTOR_GENERATOR_BINARY_NAME, + Self::Prover => PROVER_BINARY_NAME, + Self::Compressor => COMPRESSOR_BINARY_NAME, + Self::ProverJobMonitor => PROVER_JOB_MONITOR_BINARY_NAME, + } + } + + pub fn get_application_args(&self, in_docker: bool) -> anyhow::Result> { + let mut application_args = vec![]; + + if self == &Self::Prover || self == &Self::Compressor { + if in_docker { + application_args.push("--gpus=all".to_string()); + } else { + application_args.push("--features=gpu".to_string()); + } + } + + Ok(application_args) + } + + pub fn get_additional_args( + &self, + in_docker: bool, + args: ProverRunArgs, + chain: &ChainConfig, + ) -> anyhow::Result> { + let mut additional_args = vec![]; + if in_docker { + additional_args.push("--config-path=/configs/general.yaml".to_string()); + additional_args.push("--secrets-path=/configs/secrets.yaml".to_string()); + } else { + let general_config = chain + .path_to_general_config() + .into_os_string() + .into_string() + .map_err(|_| anyhow!("Failed to convert path to string"))?; + let secrets_config = chain + .path_to_secrets_config() + .into_os_string() + .into_string() + .map_err(|_| anyhow!("Failed to convert path to string"))?; + + additional_args.push(format!("--config-path={}", general_config)); + additional_args.push(format!("--secrets-path={}", secrets_config)); + } + + match self { + Self::WitnessGenerator => { + additional_args.push( + match args + .witness_generator_args + .round + .expect(MSG_WITNESS_GENERATOR_ROUND_ERR) + { + WitnessGeneratorRound::AllRounds => "--all_rounds", + WitnessGeneratorRound::BasicCircuits => "--round=basic_circuits", + WitnessGeneratorRound::LeafAggregation => "--round=leaf_aggregation", + WitnessGeneratorRound::NodeAggregation => "--round=node_aggregation", + WitnessGeneratorRound::RecursionTip => "--round=recursion_tip", + WitnessGeneratorRound::Scheduler => "--round=scheduler", + } + .to_string(), + ); + } + Self::WitnessVectorGenerator => { + additional_args.push(format!( + "--threads={}", + args.witness_vector_generator_args.threads.unwrap_or(1) + )); + } + Self::Prover => { + if args.fri_prover_args.max_allocation.is_some() { + additional_args.push(format!( + "--max-allocation={}", + args.fri_prover_args.max_allocation.unwrap() + )); + }; + } + _ => {} + }; + + Ok(additional_args) + } +} + #[derive(Debug, Clone, Parser, Default)] pub struct WitnessGeneratorArgs { #[clap(long)] @@ -76,8 +196,15 @@ impl WitnessVectorGeneratorArgs { } } +#[derive(Debug, Clone, Parser, Default)] +pub struct FriProverRunArgs { + /// Memory allocation limit in bytes (for prover component) + #[clap(long)] + pub max_allocation: Option, +} + impl ProverRunArgs { - pub fn fill_values_with_prompt(&self) -> anyhow::Result { + pub fn fill_values_with_prompt(self) -> anyhow::Result { let component = self.component.unwrap_or_else(|| { PromptSelect::new(MSG_RUN_COMPONENT_PROMPT, ProverComponent::iter()).ask() }); @@ -90,10 +217,18 @@ impl ProverRunArgs { .witness_vector_generator_args .fill_values_with_prompt(component)?; + let docker = self.docker.unwrap_or_else(|| { + Prompt::new("Do you want to run Docker image for the component?") + .default("false") + .ask() + }); + Ok(ProverRunArgs { component: Some(component), witness_generator_args, witness_vector_generator_args, + fri_prover_args: self.fri_prover_args, + docker: Some(docker), }) } } 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 index 4839c03eb42..155977b8812 100644 --- 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 @@ -2,7 +2,7 @@ use clap::{Parser, ValueEnum}; use common::PromptSelect; use strum::{EnumIter, IntoEnumIterator}; -use crate::messages::{MSG_SETUP_KEYS_DOWNLOAD_HELP, MSG_SETUP_KEYS_REGION_PROMPT}; +use crate::messages::{MSG_SETUP_KEYS_DOWNLOAD_SELECTION_PROMPT, MSG_SETUP_KEYS_REGION_PROMPT}; #[derive(Debug, Clone, Parser, Default)] pub struct SetupKeysArgs { @@ -33,9 +33,9 @@ pub enum Region { 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()); + let mode = self.mode.unwrap_or_else(|| { + PromptSelect::new(MSG_SETUP_KEYS_DOWNLOAD_SELECTION_PROMPT, Mode::iter()).ask() + }); if mode == Mode::Download { let region = self.region.unwrap_or_else(|| { diff --git a/zk_toolbox/crates/zk_inception/src/commands/prover/compressor_keys.rs b/zk_toolbox/crates/zk_inception/src/commands/prover/compressor_keys.rs new file mode 100644 index 00000000000..fd83fccfebf --- /dev/null +++ b/zk_toolbox/crates/zk_inception/src/commands/prover/compressor_keys.rs @@ -0,0 +1,73 @@ +use anyhow::Context; +use common::{ + check_prerequisites, cmd::Cmd, config::global_config, spinner::Spinner, WGET_PREREQUISITE, +}; +use config::{get_link_to_prover, EcosystemConfig, GeneralConfig}; +use xshell::{cmd, Shell}; + +use super::args::compressor_keys::CompressorKeysArgs; +use crate::messages::{ + MSG_CHAIN_NOT_FOUND_ERR, MSG_DOWNLOADING_SETUP_COMPRESSOR_KEY_SPINNER, + MSG_PROOF_COMPRESSOR_CONFIG_NOT_FOUND_ERR, MSG_SETUP_KEY_PATH_ERROR, +}; + +pub(crate) async fn run(shell: &Shell, args: CompressorKeysArgs) -> 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)?; + let mut general_config = chain_config.get_general_config()?; + + let default_path = get_default_compressor_keys_path(&ecosystem_config)?; + let args = args.fill_values_with_prompt(&default_path); + + download_compressor_key( + shell, + &mut general_config, + &args.path.context(MSG_SETUP_KEY_PATH_ERROR)?, + )?; + + chain_config.save_general_config(&general_config)?; + + Ok(()) +} + +pub(crate) fn download_compressor_key( + shell: &Shell, + general_config: &mut GeneralConfig, + path: &str, +) -> anyhow::Result<()> { + check_prerequisites(shell, &WGET_PREREQUISITE, false); + let spinner = Spinner::new(MSG_DOWNLOADING_SETUP_COMPRESSOR_KEY_SPINNER); + let mut compressor_config: zksync_config::configs::FriProofCompressorConfig = general_config + .proof_compressor_config + .as_ref() + .expect(MSG_PROOF_COMPRESSOR_CONFIG_NOT_FOUND_ERR) + .clone(); + compressor_config.universal_setup_path = path.to_string(); + general_config.proof_compressor_config = Some(compressor_config.clone()); + + let url = compressor_config.universal_setup_download_url; + let path = std::path::Path::new(path); + let parent = path.parent().expect(MSG_SETUP_KEY_PATH_ERROR); + let file_name = path.file_name().expect(MSG_SETUP_KEY_PATH_ERROR); + + Cmd::new(cmd!(shell, "wget {url} -P {parent}")).run()?; + + if file_name != "setup_2^24.key" { + Cmd::new(cmd!(shell, "mv {parent}/setup_2^24.key {path}")).run()?; + } + + spinner.finish(); + Ok(()) +} + +pub fn get_default_compressor_keys_path( + ecosystem_config: &EcosystemConfig, +) -> anyhow::Result { + let link_to_prover = get_link_to_prover(ecosystem_config); + let path = link_to_prover.join("keys/setup/setup_2^24.key"); + let string = path.to_str().unwrap(); + + Ok(String::from(string)) +} 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 700209f5ffc..f28c44504b5 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::{check_prerequisites, cmd::Cmd, logger, spinner::Spinner, GCLOUD_PREREQUISITES}; +use common::{check_prerequisites, cmd::Cmd, logger, spinner::Spinner, GCLOUD_PREREQUISITE}; use xshell::{cmd, Shell}; use zksync_config::{configs::object_store::ObjectStoreMode, ObjectStoreConfig}; @@ -14,7 +14,7 @@ pub(crate) fn create_gcs_bucket( shell: &Shell, config: ProofStorageGCSCreateBucket, ) -> anyhow::Result { - check_prerequisites(shell, &GCLOUD_PREREQUISITES, false); + check_prerequisites(shell, &GCLOUD_PREREQUISITE, false); let bucket_name = config.bucket_name; let location = config.location; 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 7aadd04bf6b..20e68274587 100644 --- a/zk_toolbox/crates/zk_inception/src/commands/prover/init.rs +++ b/zk_toolbox/crates/zk_inception/src/commands/prover/init.rs @@ -2,47 +2,46 @@ use std::path::PathBuf; use anyhow::Context; use common::{ - 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}; -use zksync_config::{ - configs::{object_store::ObjectStoreMode, GeneralConfig}, - ObjectStoreConfig, +use config::{ + copy_configs, get_link_to_prover, set_prover_database, traits::SaveConfigWithBasePath, + EcosystemConfig, }; +use xshell::{cmd, Shell}; +use zksync_config::{configs::object_store::ObjectStoreMode, ObjectStoreConfig}; use super::{ args::init::{ProofStorageConfig, ProverInitArgs}, + compressor_keys::{download_compressor_key, get_default_compressor_keys_path}, gcs::create_gcs_bucket, init_bellman_cuda::run as init_bellman_cuda, - utils::get_link_to_prover, + setup_keys, }; use crate::{ + commands::prover::args::init::ProofStorageFileBacked, consts::{PROVER_MIGRATIONS, PROVER_STORE_MAX_RETRIES}, messages::{ - MSG_CHAIN_NOT_FOUND_ERR, MSG_DOWNLOADING_SETUP_KEY_SPINNER, - MSG_FAILED_TO_DROP_PROVER_DATABASE_ERR, MSG_GENERAL_CONFIG_NOT_FOUND_ERR, - MSG_INITIALIZING_DATABASES_SPINNER, MSG_INITIALIZING_PROVER_DATABASE, - MSG_PROOF_COMPRESSOR_CONFIG_NOT_FOUND_ERR, MSG_PROVER_CONFIG_NOT_FOUND_ERR, - MSG_PROVER_INITIALIZED, MSG_SETUP_KEY_PATH_ERROR, + MSG_CHAIN_NOT_FOUND_ERR, MSG_FAILED_TO_DROP_PROVER_DATABASE_ERR, + MSG_GENERAL_CONFIG_NOT_FOUND_ERR, MSG_INITIALIZING_DATABASES_SPINNER, + MSG_INITIALIZING_PROVER_DATABASE, MSG_PROVER_CONFIG_NOT_FOUND_ERR, MSG_PROVER_INITIALIZED, + MSG_SETUP_KEY_PATH_ERROR, }, }; pub(crate) async fn run(args: ProverInitArgs, shell: &Shell) -> anyhow::Result<()> { let ecosystem_config = EcosystemConfig::from_file(shell)?; - let setup_key_path = get_default_setup_key_path(&ecosystem_config)?; + let default_compressor_key_path = get_default_compressor_keys_path(&ecosystem_config)?; let chain_config = ecosystem_config .load_chain(global_config().chain_name.clone()) .context(MSG_CHAIN_NOT_FOUND_ERR)?; - let args = args.fill_values_with_prompt(shell, &setup_key_path, &chain_config)?; + let args = args.fill_values_with_prompt(shell, &default_compressor_key_path, &chain_config)?; if chain_config.get_general_config().is_err() || chain_config.get_secrets_config().is_err() { copy_configs(shell, &ecosystem_config.link_to_code, &chain_config.configs)?; @@ -55,12 +54,13 @@ pub(crate) async fn run(args: ProverInitArgs, shell: &Shell) -> anyhow::Result<( let proof_object_store_config = get_object_store_config(shell, Some(args.proof_store))?; let public_object_store_config = get_object_store_config(shell, args.public_store)?; - if args.setup_key_config.download_key { - download_setup_key( - shell, - &general_config, - &args.setup_key_config.setup_key_path, - )?; + if let Some(args) = args.compressor_key_args { + let path = args.path.context(MSG_SETUP_KEY_PATH_ERROR)?; + download_compressor_key(shell, &mut general_config, &path)?; + } + + if let Some(args) = args.setup_keys { + setup_keys::run(args, shell).await?; } let mut prover_config = general_config @@ -78,15 +78,11 @@ pub(crate) async fn run(args: ProverInitArgs, shell: &Shell) -> anyhow::Result<( prover_config.cloud_type = args.cloud_type; general_config.prover_config = Some(prover_config); - let mut proof_compressor_config = general_config - .proof_compressor_config - .expect(MSG_PROOF_COMPRESSOR_CONFIG_NOT_FOUND_ERR); - proof_compressor_config.universal_setup_path = args.setup_key_config.setup_key_path; - general_config.proof_compressor_config = Some(proof_compressor_config); - chain_config.save_general_config(&general_config)?; - init_bellman_cuda(shell, args.bellman_cuda_config).await?; + if let Some(args) = args.bellman_cuda_config { + init_bellman_cuda(shell, args).await?; + } if let Some(prover_db) = &args.database_config { let spinner = Spinner::new(MSG_INITIALIZING_DATABASES_SPINNER); @@ -109,53 +105,16 @@ pub(crate) async fn run(args: ProverInitArgs, shell: &Shell) -> anyhow::Result<( Ok(()) } -fn download_setup_key( - shell: &Shell, - 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 - .as_ref() - .expect(MSG_PROOF_COMPRESSOR_CONFIG_NOT_FOUND_ERR) - .clone(); - let url = compressor_config.universal_setup_download_url; - let path = std::path::Path::new(path); - let parent = path.parent().expect(MSG_SETUP_KEY_PATH_ERROR); - let file_name = path.file_name().expect(MSG_SETUP_KEY_PATH_ERROR); - - Cmd::new(cmd!(shell, "wget {url} -P {parent}")).run()?; - - if file_name != "setup_2^24.key" { - Cmd::new(cmd!(shell, "mv {parent}/setup_2^24.key {path}")).run()?; - } - - spinner.finish(); - Ok(()) -} - -fn get_default_setup_key_path(ecosystem_config: &EcosystemConfig) -> anyhow::Result { - let link_to_prover = get_link_to_prover(ecosystem_config); - let path = link_to_prover.join("keys/setup/setup_2^24.key"); - let string = path.to_str().unwrap(); - - Ok(String::from(string)) -} - fn get_object_store_config( shell: &Shell, config: Option, ) -> anyhow::Result> { let object_store = match config { - Some(ProofStorageConfig::FileBacked(config)) => Some(ObjectStoreConfig { - mode: ObjectStoreMode::FileBacked { - file_backed_base_path: config.proof_store_dir, - }, - max_retries: PROVER_STORE_MAX_RETRIES, - local_mirror_path: None, - }), + Some(ProofStorageConfig::FileBacked(config)) => Some(init_file_backed_proof_storage( + shell, + &EcosystemConfig::from_file(shell)?, + config, + )?), Some(ProofStorageConfig::GCS(config)) => Some(ObjectStoreConfig { mode: ObjectStoreMode::GCSWithCredentialFile { bucket_base_url: config.bucket_base_url, @@ -198,3 +157,27 @@ async fn initialize_prover_database( Ok(()) } + +fn init_file_backed_proof_storage( + shell: &Shell, + ecosystem_config: &EcosystemConfig, + config: ProofStorageFileBacked, +) -> anyhow::Result { + let proof_store_dir = config.proof_store_dir.clone(); + let prover_path = get_link_to_prover(ecosystem_config); + + let proof_store_dir = prover_path.join(proof_store_dir).join("witness_inputs"); + + let cmd = Cmd::new(cmd!(shell, "mkdir -p {proof_store_dir}")); + cmd.run()?; + + let object_store_config = ObjectStoreConfig { + mode: ObjectStoreMode::FileBacked { + file_backed_base_path: config.proof_store_dir, + }, + max_retries: PROVER_STORE_MAX_RETRIES, + local_mirror_path: None, + }; + + Ok(object_store_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 5ed1473a33f..615ef841488 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 @@ -17,7 +17,7 @@ pub(crate) async fn run(shell: &Shell, args: InitBellmanCudaArgs) -> anyhow::Res let mut ecosystem_config = EcosystemConfig::from_file(shell)?; - let args = args.fill_values_with_prompt()?; + let args = args.fill_values_with_prompt(); let bellman_cuda_dir = args.bellman_cuda_dir.unwrap_or("".to_string()); let bellman_cuda_dir = if bellman_cuda_dir.is_empty() { 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 4fb90dcfd02..d9e443cdae0 100644 --- a/zk_toolbox/crates/zk_inception/src/commands/prover/mod.rs +++ b/zk_toolbox/crates/zk_inception/src/commands/prover/mod.rs @@ -1,16 +1,19 @@ -use args::{init::ProverInitArgs, init_bellman_cuda::InitBellmanCudaArgs, run::ProverRunArgs}; +use args::{ + compressor_keys::CompressorKeysArgs, init::ProverInitArgs, + init_bellman_cuda::InitBellmanCudaArgs, run::ProverRunArgs, +}; use clap::Subcommand; use xshell::Shell; use crate::commands::prover::args::setup_keys::SetupKeysArgs; mod args; +mod compressor_keys; mod gcs; mod init; mod init_bellman_cuda; mod run; mod setup_keys; -mod utils; #[derive(Subcommand, Debug)] pub enum ProverCommands { @@ -24,6 +27,9 @@ pub enum ProverCommands { /// Initialize bellman-cuda #[command(alias = "cuda")] InitBellmanCuda(Box), + /// Download compressor keys + #[command(alias = "ck")] + CompressorKeys(CompressorKeysArgs), } pub(crate) async fn run(shell: &Shell, args: ProverCommands) -> anyhow::Result<()> { @@ -32,5 +38,6 @@ pub(crate) async fn run(shell: &Shell, args: ProverCommands) -> anyhow::Result<( 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, + ProverCommands::CompressorKeys(args) => compressor_keys::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 a819c3322a8..5f4bf2f4a67 100644 --- a/zk_toolbox/crates/zk_inception/src/commands/prover/run.rs +++ b/zk_toolbox/crates/zk_inception/src/commands/prover/run.rs @@ -1,22 +1,18 @@ -use anyhow::Context; +use std::path::PathBuf; + +use anyhow::{anyhow, Context}; use common::{check_prerequisites, cmd::Cmd, config::global_config, logger, GPU_PREREQUISITES}; -use config::{ChainConfig, EcosystemConfig}; +use config::{get_link_to_prover, ChainConfig, EcosystemConfig}; use xshell::{cmd, Shell}; -use super::{ - args::run::{ - ProverComponent, ProverRunArgs, WitnessGeneratorArgs, WitnessGeneratorRound, - WitnessVectorGeneratorArgs, - }, - utils::get_link_to_prover, -}; +use super::args::run::{ProverComponent, ProverRunArgs}; use crate::messages::{ MSG_BELLMAN_CUDA_DIR_ERR, MSG_CHAIN_NOT_FOUND_ERR, MSG_MISSING_COMPONENT_ERR, MSG_RUNNING_COMPRESSOR, MSG_RUNNING_COMPRESSOR_ERR, MSG_RUNNING_PROVER, MSG_RUNNING_PROVER_ERR, MSG_RUNNING_PROVER_GATEWAY, MSG_RUNNING_PROVER_GATEWAY_ERR, MSG_RUNNING_PROVER_JOB_MONITOR, - MSG_RUNNING_WITNESS_GENERATOR, MSG_RUNNING_WITNESS_GENERATOR_ERR, - MSG_RUNNING_WITNESS_VECTOR_GENERATOR, MSG_RUNNING_WITNESS_VECTOR_GENERATOR_ERR, - MSG_WITNESS_GENERATOR_ROUND_ERR, + MSG_RUNNING_PROVER_JOB_MONITOR_ERR, MSG_RUNNING_WITNESS_GENERATOR, + MSG_RUNNING_WITNESS_GENERATOR_ERR, MSG_RUNNING_WITNESS_VECTOR_GENERATOR, + MSG_RUNNING_WITNESS_VECTOR_GENERATOR_ERR, }; pub(crate) async fn run(args: ProverRunArgs, shell: &Shell) -> anyhow::Result<()> { @@ -29,114 +25,123 @@ pub(crate) async fn run(args: ProverRunArgs, shell: &Shell) -> anyhow::Result<() let link_to_prover = get_link_to_prover(&ecosystem_config); shell.change_dir(link_to_prover.clone()); - match args.component { - Some(ProverComponent::Gateway) => run_gateway(shell, &chain)?, - Some(ProverComponent::WitnessGenerator) => { - run_witness_generator(shell, &chain, args.witness_generator_args)? + let component = args.component.context(anyhow!(MSG_MISSING_COMPONENT_ERR))?; + let in_docker = args.docker.unwrap_or(false); + + let application_args = component.get_application_args(in_docker)?; + let additional_args = component.get_additional_args(in_docker, args, &chain)?; + + let (message, error) = match component { + ProverComponent::WitnessGenerator => ( + MSG_RUNNING_WITNESS_GENERATOR, + MSG_RUNNING_WITNESS_GENERATOR_ERR, + ), + ProverComponent::WitnessVectorGenerator => ( + MSG_RUNNING_WITNESS_VECTOR_GENERATOR, + MSG_RUNNING_WITNESS_VECTOR_GENERATOR_ERR, + ), + ProverComponent::Prover => { + if !in_docker { + check_prerequisites(shell, &GPU_PREREQUISITES, false); + } + (MSG_RUNNING_PROVER, MSG_RUNNING_PROVER_ERR) } - Some(ProverComponent::WitnessVectorGenerator) => { - run_witness_vector_generator(shell, &chain, args.witness_vector_generator_args)? + ProverComponent::Compressor => { + if !in_docker { + check_prerequisites(shell, &GPU_PREREQUISITES, false); + shell.set_var( + "BELLMAN_CUDA_DIR", + ecosystem_config + .bellman_cuda_dir + .clone() + .expect(MSG_BELLMAN_CUDA_DIR_ERR), + ); + } + (MSG_RUNNING_COMPRESSOR, MSG_RUNNING_COMPRESSOR_ERR) } - Some(ProverComponent::Prover) => run_prover(shell, &chain)?, - Some(ProverComponent::Compressor) => run_compressor(shell, &chain, &ecosystem_config)?, - Some(ProverComponent::ProverJobMonitor) => run_prover_job_monitor(shell, &chain)?, - None => anyhow::bail!(MSG_MISSING_COMPONENT_ERR), + ProverComponent::ProverJobMonitor => ( + MSG_RUNNING_PROVER_JOB_MONITOR, + MSG_RUNNING_PROVER_JOB_MONITOR_ERR, + ), + ProverComponent::Gateway => (MSG_RUNNING_PROVER_GATEWAY, MSG_RUNNING_PROVER_GATEWAY_ERR), + }; + + if in_docker { + let path_to_configs = chain.configs.clone(); + let path_to_prover = get_link_to_prover(&ecosystem_config); + update_setup_data_path(&chain, "prover/data/keys".to_string())?; + run_dockerized_component( + shell, + component.image_name(), + &application_args, + &additional_args, + message, + error, + &path_to_configs, + &path_to_prover, + )? + } else { + update_setup_data_path(&chain, "data/keys".to_string())?; + run_binary_component( + shell, + component.binary_name(), + &application_args, + &additional_args, + message, + error, + )? } Ok(()) } -fn run_gateway(shell: &Shell, chain: &ChainConfig) -> anyhow::Result<()> { - logger::info(MSG_RUNNING_PROVER_GATEWAY); - let config_path = chain.path_to_general_config(); - let secrets_path = chain.path_to_secrets_config(); - - let mut cmd = Cmd::new(cmd!(shell, "cargo run --release --bin zksync_prover_fri_gateway -- --config-path={config_path} --secrets-path={secrets_path}")); - cmd = cmd.with_force_run(); - cmd.run().context(MSG_RUNNING_PROVER_GATEWAY_ERR) -} - -fn run_witness_generator( +#[allow(clippy::too_many_arguments)] +fn run_dockerized_component( shell: &Shell, - chain: &ChainConfig, - args: WitnessGeneratorArgs, + image_name: &str, + application_args: &[String], + args: &[String], + message: &'static str, + error: &'static str, + path_to_configs: &PathBuf, + path_to_prover: &PathBuf, ) -> anyhow::Result<()> { - logger::info(MSG_RUNNING_WITNESS_GENERATOR); - let config_path = chain.path_to_general_config(); - let secrets_path = chain.path_to_secrets_config(); - let round = args.round.expect(MSG_WITNESS_GENERATOR_ROUND_ERR); + logger::info(message); - let round_str = match round { - WitnessGeneratorRound::AllRounds => "--all_rounds", - WitnessGeneratorRound::BasicCircuits => "--round=basic_circuits", - WitnessGeneratorRound::LeafAggregation => "--round=leaf_aggregation", - WitnessGeneratorRound::NodeAggregation => "--round=node_aggregation", - WitnessGeneratorRound::RecursionTip => "--round=recursion_tip", - WitnessGeneratorRound::Scheduler => "--round=scheduler", - }; + let mut cmd = Cmd::new(cmd!( + shell, + "docker run --net=host -v {path_to_prover}/data/keys:/prover/data/keys -v {path_to_prover}/artifacts:/artifacts -v {path_to_configs}:/configs {application_args...} {image_name} {args...}" + )); - let mut cmd = Cmd::new(cmd!(shell, "cargo run --release --bin zksync_witness_generator -- {round_str} --config-path={config_path} --secrets-path={secrets_path}")); cmd = cmd.with_force_run(); - cmd.run().context(MSG_RUNNING_WITNESS_GENERATOR_ERR) + cmd.run().context(error) } -fn run_witness_vector_generator( +fn run_binary_component( shell: &Shell, - chain: &ChainConfig, - args: WitnessVectorGeneratorArgs, + binary_name: &str, + application_args: &[String], + args: &[String], + message: &'static str, + error: &'static str, ) -> anyhow::Result<()> { - logger::info(MSG_RUNNING_WITNESS_VECTOR_GENERATOR); - let config_path = chain.path_to_general_config(); - let secrets_path = chain.path_to_secrets_config(); + logger::info(message); - let threads = args.threads.unwrap_or(1).to_string(); - let mut cmd = Cmd::new(cmd!(shell, "cargo run --release --bin zksync_witness_vector_generator -- --config-path={config_path} --secrets-path={secrets_path} --threads={threads}")); + let mut cmd = Cmd::new(cmd!( + shell, + "cargo run {application_args...} --release --bin {binary_name} -- {args...}" + )); cmd = cmd.with_force_run(); - cmd.run().context(MSG_RUNNING_WITNESS_VECTOR_GENERATOR_ERR) + cmd.run().context(error) } -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(); - - let mut cmd = Cmd::new( - cmd!(shell, "cargo run --features gpu --release --bin zksync_prover_fri -- --config-path={config_path} --secrets-path={secrets_path}"), - ); - cmd = cmd.with_force_run(); - cmd.run().context(MSG_RUNNING_PROVER_ERR) -} - -fn run_compressor( - shell: &Shell, - 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(); - - shell.set_var( - "BELLMAN_CUDA_DIR", - ecosystem - .bellman_cuda_dir - .clone() - .expect(MSG_BELLMAN_CUDA_DIR_ERR), - ); - - let mut cmd = Cmd::new(cmd!(shell, "cargo run --features gpu --release --bin zksync_proof_fri_compressor -- --config-path={config_path} --secrets-path={secrets_path}")); - cmd = cmd.with_force_run(); - cmd.run().context(MSG_RUNNING_COMPRESSOR_ERR) -} - -fn run_prover_job_monitor(shell: &Shell, chain: &ChainConfig) -> anyhow::Result<()> { - logger::info(MSG_RUNNING_PROVER_JOB_MONITOR); - let config_path = chain.path_to_general_config(); - let secrets_path = chain.path_to_secrets_config(); - - let mut cmd = Cmd::new(cmd!(shell, "cargo run --release --bin zksync_prover_job_monitor -- --config-path={config_path} --secrets-path={secrets_path}")); - cmd = cmd.with_force_run(); - cmd.run().context(MSG_RUNNING_PROVER_JOB_MONITOR) +fn update_setup_data_path(chain: &ChainConfig, path: String) -> anyhow::Result<()> { + let mut general_config = chain.get_general_config()?; + general_config + .prover_config + .as_mut() + .expect("Prover config not found") + .setup_data_path = path; + chain.save_general_config(&general_config)?; + Ok(()) } 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 index 09d9f76a47c..ae0480e872d 100644 --- a/zk_toolbox/crates/zk_inception/src/commands/prover/setup_keys.rs +++ b/zk_toolbox/crates/zk_inception/src/commands/prover/setup_keys.rs @@ -1,12 +1,10 @@ use anyhow::Ok; use common::{ - check_prerequisites, cmd::Cmd, logger, spinner::Spinner, GCLOUD_PREREQUISITES, - GPU_PREREQUISITES, + check_prerequisites, cmd::Cmd, logger, spinner::Spinner, GCLOUD_PREREQUISITE, GPU_PREREQUISITES, }; -use config::EcosystemConfig; +use config::{get_link_to_prover, 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}, @@ -33,7 +31,7 @@ pub(crate) async fn run(args: SetupKeysArgs, shell: &Shell) -> anyhow::Result<() spinner.finish(); logger::outro(MSG_SK_GENERATED); } else { - check_prerequisites(shell, &GCLOUD_PREREQUISITES, false); + check_prerequisites(shell, &GCLOUD_PREREQUISITE, false); let link_to_setup_keys = get_link_to_prover(&ecosystem_config).join("data/keys"); let path_to_keys_buckets = diff --git a/zk_toolbox/crates/zk_inception/src/commands/prover/utils.rs b/zk_toolbox/crates/zk_inception/src/commands/prover/utils.rs deleted file mode 100644 index 4dae70863dc..00000000000 --- a/zk_toolbox/crates/zk_inception/src/commands/prover/utils.rs +++ /dev/null @@ -1,10 +0,0 @@ -use std::path::PathBuf; - -use config::EcosystemConfig; - -pub(crate) fn get_link_to_prover(config: &EcosystemConfig) -> PathBuf { - let link_to_code = config.link_to_code.clone(); - let mut link_to_prover = link_to_code.into_os_string(); - link_to_prover.push("/prover"); - link_to_prover.into() -} diff --git a/zk_toolbox/crates/zk_inception/src/commands/server.rs b/zk_toolbox/crates/zk_inception/src/commands/server.rs index b5a09ed0437..f96bc3aeebc 100644 --- a/zk_toolbox/crates/zk_inception/src/commands/server.rs +++ b/zk_toolbox/crates/zk_inception/src/commands/server.rs @@ -35,7 +35,11 @@ fn run_server( chain_config: &ChainConfig, shell: &Shell, ) -> anyhow::Result<()> { - let server = Server::new(args.components.clone(), chain_config.link_to_code.clone()); + let server = Server::new( + args.components.clone(), + chain_config.link_to_code.clone(), + args.uring, + ); if args.build { server.build(shell)?; diff --git a/zk_toolbox/crates/zk_inception/src/consts.rs b/zk_toolbox/crates/zk_inception/src/consts.rs index 7db976c6103..22e570a5439 100644 --- a/zk_toolbox/crates/zk_inception/src/consts.rs +++ b/zk_toolbox/crates/zk_inception/src/consts.rs @@ -1,3 +1,5 @@ +use std::net::{IpAddr, Ipv4Addr}; + pub const AMOUNT_FOR_DISTRIBUTION_TO_WALLETS: u128 = 1000000000000000000000; pub const MINIMUM_BALANCE_FOR_WALLET: u128 = 5000000000000000000; @@ -9,9 +11,45 @@ pub const DEFAULT_PROOF_STORE_DIR: &str = "artifacts"; pub const BELLMAN_CUDA_DIR: &str = "era-bellman-cuda"; pub const L2_BASE_TOKEN_ADDRESS: &str = "0x000000000000000000000000000000000000800A"; +#[allow(non_upper_case_globals)] +const kB: usize = 1024; + +/// Max payload size for consensus in bytes +pub const MAX_PAYLOAD_SIZE: usize = 2_500_000; +/// Max batch size for consensus in bytes +/// Compute a default batch size, so operators are not caught out by the missing setting +/// while we're still working on batch syncing. The batch interval is ~1 minute, +/// so there will be ~60 blocks, and an Ethereum Merkle proof is ~1kB, but under high +/// traffic there can be thousands of huge transactions that quickly fill up blocks +/// and there could be more blocks in a batch then expected. We chose a generous +/// limit so as not to prevent any legitimate batch from being transmitted. +pub const MAX_BATCH_SIZE: usize = MAX_PAYLOAD_SIZE * 5000 + kB; +/// Gossip dynamic inbound limit for consensus +pub const GOSSIP_DYNAMIC_INBOUND_LIMIT: usize = 100; + +/// Public address for consensus +pub const CONSENSUS_PUBLIC_ADDRESS_HOST: IpAddr = IpAddr::V4(Ipv4Addr::UNSPECIFIED); +/// Server address for consensus +pub const CONSENSUS_SERVER_ADDRESS_HOST: IpAddr = IpAddr::V4(Ipv4Addr::LOCALHOST); + /// Path to the JS runtime config for the block-explorer-app docker container to be mounted to pub const EXPLORER_APP_DOCKER_CONFIG_PATH: &str = "/usr/src/app/packages/app/dist/config.js"; pub const EXPLORER_APP_DOCKER_IMAGE: &str = "matterlabs/block-explorer-app"; /// Path to the JS runtime config for the dapp-portal docker container to be mounted to pub const PORTAL_DOCKER_CONFIG_PATH: &str = "/usr/src/app/dist/config.js"; pub const PORTAL_DOCKER_IMAGE: &str = "matterlabs/dapp-portal"; + +pub const PROVER_GATEWAY_DOCKER_IMAGE: &str = "matterlabs/prover-fri-gateway:latest2.0"; +pub const WITNESS_GENERATOR_DOCKER_IMAGE: &str = "matterlabs/witness-generator:latest2.0"; +pub const WITNESS_VECTOR_GENERATOR_DOCKER_IMAGE: &str = + "matterlabs/witness-vector-generator:latest2.0"; +pub const PROVER_DOCKER_IMAGE: &str = "matterlabs/prover-gpu-fri:latest2.0"; +pub const COMPRESSOR_DOCKER_IMAGE: &str = "matterlabs/proof-fri-gpu-compressor:latest2.0"; +pub const PROVER_JOB_MONITOR_DOCKER_IMAGE: &str = "matterlabs/prover-job-monitor:latest2.0"; + +pub const PROVER_GATEWAY_BINARY_NAME: &str = "zksync_prover_fri_gateway"; +pub const WITNESS_GENERATOR_BINARY_NAME: &str = "zksync_witness_generator"; +pub const WITNESS_VECTOR_GENERATOR_BINARY_NAME: &str = "zksync_witness_vector_generator"; +pub const PROVER_BINARY_NAME: &str = "zksync_prover_fri"; +pub const COMPRESSOR_BINARY_NAME: &str = "zksync_proof_fri_compressor"; +pub const PROVER_JOB_MONITOR_BINARY_NAME: &str = "zksync_prover_job_monitor"; diff --git a/zk_toolbox/crates/zk_inception/src/defaults.rs b/zk_toolbox/crates/zk_inception/src/defaults.rs index 544e2837740..6c3821eed85 100644 --- a/zk_toolbox/crates/zk_inception/src/defaults.rs +++ b/zk_toolbox/crates/zk_inception/src/defaults.rs @@ -14,6 +14,7 @@ lazy_static! { pub const ROCKS_DB_STATE_KEEPER: &str = "state_keeper"; pub const ROCKS_DB_TREE: &str = "tree"; pub const ROCKS_DB_PROTECTIVE_READS: &str = "protective_reads"; +pub const ROCKS_DB_BASIC_WITNESS_INPUT_PRODUCER: &str = "basic_witness_input_producer"; pub const EN_ROCKS_DB_PREFIX: &str = "en"; pub const MAIN_ROCKS_DB_PREFIX: &str = "main"; diff --git a/zk_toolbox/crates/zk_inception/src/external_node.rs b/zk_toolbox/crates/zk_inception/src/external_node.rs index ef62738a7d2..5ff4ce07025 100644 --- a/zk_toolbox/crates/zk_inception/src/external_node.rs +++ b/zk_toolbox/crates/zk_inception/src/external_node.rs @@ -6,6 +6,7 @@ use config::{ SecretsConfig, }; use xshell::Shell; +use zksync_config::configs::consensus::ConsensusConfig; use crate::messages::MSG_FAILED_TO_RUN_SERVER_ERR; @@ -15,6 +16,7 @@ pub struct RunExternalNode { general_config: PathBuf, secrets: PathBuf, en_config: PathBuf, + consensus_config: PathBuf, } impl RunExternalNode { @@ -29,6 +31,7 @@ impl RunExternalNode { let general_config = GeneralConfig::get_path_with_base_path(&en_path); let secrets = SecretsConfig::get_path_with_base_path(&en_path); let enconfig = ENConfig::get_path_with_base_path(&en_path); + let consensus_config = ConsensusConfig::get_path_with_base_path(&en_path); Ok(Self { components, @@ -36,17 +39,29 @@ impl RunExternalNode { general_config, secrets, en_config: enconfig, + consensus_config, }) } - pub fn run(&self, shell: &Shell, mut additional_args: Vec) -> anyhow::Result<()> { + pub fn run( + &self, + shell: &Shell, + enable_consensus: bool, + mut additional_args: Vec, + ) -> anyhow::Result<()> { let code_path = self.code_path.to_str().unwrap(); let config_general_config = &self.general_config.to_str().unwrap(); let en_config = &self.en_config.to_str().unwrap(); let secrets = &self.secrets.to_str().unwrap(); + let consensus_config = &self.consensus_config.to_str().unwrap(); if let Some(components) = self.components() { additional_args.push(format!("--components={}", components)) } + let mut consensus_args = vec![]; + if enable_consensus { + consensus_args.push("--enable-consensus".to_string()); + consensus_args.push(format!("--consensus-path={}", consensus_config)) + } common::external_node::run( shell, @@ -54,6 +69,7 @@ impl RunExternalNode { config_general_config, secrets, en_config, + consensus_args, additional_args, ) .context(MSG_FAILED_TO_RUN_SERVER_ERR) diff --git a/zk_toolbox/crates/zk_inception/src/messages.rs b/zk_toolbox/crates/zk_inception/src/messages.rs index cca3e3b549b..c5b77f63eba 100644 --- a/zk_toolbox/crates/zk_inception/src/messages.rs +++ b/zk_toolbox/crates/zk_inception/src/messages.rs @@ -5,7 +5,7 @@ use ethers::{ utils::format_ether, }; -pub(super) const MSG_SETUP_KEYS_DOWNLOAD_HELP: &str = +pub(super) const MSG_SETUP_KEYS_DOWNLOAD_SELECTION_PROMPT: &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?"; @@ -157,6 +157,8 @@ pub(super) const MSG_CHAIN_ID_VALIDATOR_ERR: &str = "Invalid chain id"; pub(super) const MSG_BASE_TOKEN_ADDRESS_VALIDATOR_ERR: &str = "Invalid base token address"; pub(super) const MSG_WALLET_CREATION_VALIDATOR_ERR: &str = "Localhost wallet is not supported for external networks"; +pub(super) const MSG_WALLET_TOKEN_MULTIPLIER_SETTER_NOT_FOUND: &str = + "Token Multiplier Setter not found. Specify it in a wallet config"; /// Chain genesis related messages pub(super) const MSG_L1_SECRETS_MUST_BE_PRESENTED: &str = "L1 secret must be presented"; @@ -218,10 +220,12 @@ pub(super) const MSG_DEPLOYING_PAYMASTER: &str = "Deploying paymaster"; /// Run server related messages pub(super) const MSG_SERVER_COMPONENTS_HELP: &str = "Components of server to run"; +pub(super) const MSG_ENABLE_CONSENSUS_HELP: &str = "Enable consensus"; pub(super) const MSG_SERVER_GENESIS_HELP: &str = "Run server in genesis mode"; pub(super) const MSG_SERVER_ADDITIONAL_ARGS_HELP: &str = "Additional arguments that can be passed through the CLI"; pub(super) const MSG_SERVER_BUILD_HELP: &str = "Build server but don't run it"; +pub(super) const MSG_SERVER_URING_HELP: &str = "Enables uring support for RocksDB"; /// Accept ownership related messages pub(super) const MSG_ACCEPTING_GOVERNANCE_SPINNER: &str = "Accepting governance..."; @@ -303,6 +307,11 @@ pub(super) fn msg_preparing_en_config_is_done(path: &Path) -> String { pub(super) const MSG_EXTERNAL_NODE_CONFIG_NOT_INITIALIZED: &str = "External node is not initialized"; +pub(super) const MSG_CONSENSUS_CONFIG_MISSING_ERR: &str = "Consensus config is missing"; +pub(super) const MSG_CONSENSUS_SECRETS_MISSING_ERR: &str = "Consensus secrets config is missing"; +pub(super) const MSG_CONSENSUS_SECRETS_NODE_KEY_MISSING_ERR: &str = "Consensus node key is missing"; + +pub(super) const MSG_PORTS_CONFIG_ERR: &str = "Failed to get ports config"; pub(super) const MSG_STARTING_EN: &str = "Starting external node"; @@ -311,6 +320,7 @@ pub(super) const MSG_GENERATING_SK_SPINNER: &str = "Generating setup keys..."; pub(super) const MSG_SK_GENERATED: &str = "Setup keys generated successfully"; pub(super) const MSG_MISSING_COMPONENT_ERR: &str = "Missing component"; pub(super) const MSG_RUNNING_PROVER_GATEWAY: &str = "Running gateway"; +pub(super) const MSG_RUNNING_PROVER_JOB_MONITOR_ERR: &str = "Failed to run prover job monitor"; pub(super) const MSG_RUNNING_PROVER_JOB_MONITOR: &str = "Running prover job monitor"; pub(super) const MSG_RUNNING_WITNESS_GENERATOR: &str = "Running witness generator"; pub(super) const MSG_RUNNING_WITNESS_VECTOR_GENERATOR: &str = "Running witness vector generator"; @@ -344,9 +354,13 @@ pub(super) const MSG_CREATE_GCS_BUCKET_NAME_PROMTP: &str = "What do you want to pub(super) const MSG_CREATE_GCS_BUCKET_LOCATION_PROMPT: &str = "What location do you want to use? Find available locations at https://cloud.google.com/storage/docs/locations"; pub(super) const MSG_PROOF_COMPRESSOR_CONFIG_NOT_FOUND_ERR: &str = "Proof compressor config not found"; -pub(super) const MSG_DOWNLOADING_SETUP_KEY_SPINNER: &str = "Downloading setup key..."; -pub(super) const MSG_DOWNLOAD_SETUP_KEY_PROMPT: &str = "Do you want to download the setup key?"; -pub(super) const MSG_SETUP_KEY_PATH_PROMPT: &str = "Provide the path to the setup key:"; +pub(super) const MSG_DOWNLOADING_SETUP_COMPRESSOR_KEY_SPINNER: &str = + "Downloading compressor setup key..."; +pub(super) const MSG_DOWNLOAD_SETUP_COMPRESSOR_KEY_PROMPT: &str = + "Do you want to download the setup key for compressor?"; +pub(super) const MSG_INITIALIZE_BELLMAN_CUDA_PROMPT: &str = + "Do you want to initialize bellman-cuda?"; +pub(super) const MSG_SETUP_COMPRESSOR_KEY_PATH_PROMPT: &str = "Provide the path to the setup key:"; pub(super) const MSG_GETTING_GCP_PROJECTS_SPINNER: &str = "Getting GCP projects..."; pub(super) const MSG_GETTING_PROOF_STORE_CONFIG: &str = "Getting proof store configuration..."; pub(super) const MSG_GETTING_PUBLIC_STORE_CONFIG: &str = "Getting public store configuration..."; @@ -368,6 +382,7 @@ pub(super) const MSG_BELLMAN_CUDA_SELECTION_CLONE: &str = "Clone for me (recomme pub(super) const MSG_BELLMAN_CUDA_SELECTION_PATH: &str = "I have the code already"; pub(super) const MSG_CLOUD_TYPE_PROMPT: &str = "Select the cloud connection mode:"; pub(super) const MSG_THREADS_PROMPT: &str = "Provide the number of threads:"; +pub(super) const MSG_SETUP_KEYS_PROMPT: &str = "Do you want to setup keys?"; pub(super) fn msg_bucket_created(bucket_name: &str) -> String { format!("Bucket created successfully with url: gs://{bucket_name}") diff --git a/zk_toolbox/crates/zk_inception/src/utils/consensus.rs b/zk_toolbox/crates/zk_inception/src/utils/consensus.rs new file mode 100644 index 00000000000..06848334a6e --- /dev/null +++ b/zk_toolbox/crates/zk_inception/src/utils/consensus.rs @@ -0,0 +1,124 @@ +use std::{ + collections::{BTreeMap, BTreeSet}, + net::SocketAddr, +}; + +use config::{ChainConfig, PortsConfig}; +use secrecy::{ExposeSecret, Secret}; +use zksync_config::configs::consensus::{ + AttesterPublicKey, AttesterSecretKey, ConsensusConfig, ConsensusSecrets, GenesisSpec, Host, + NodePublicKey, NodeSecretKey, ProtocolVersion, ValidatorPublicKey, ValidatorSecretKey, + WeightedAttester, WeightedValidator, +}; +use zksync_consensus_crypto::{Text, TextFmt}; +use zksync_consensus_roles as roles; + +use crate::consts::{ + CONSENSUS_PUBLIC_ADDRESS_HOST, CONSENSUS_SERVER_ADDRESS_HOST, GOSSIP_DYNAMIC_INBOUND_LIMIT, + MAX_BATCH_SIZE, MAX_PAYLOAD_SIZE, +}; + +#[derive(Debug, Clone)] +pub struct ConsensusSecretKeys { + validator_key: roles::validator::SecretKey, + attester_key: roles::attester::SecretKey, + node_key: roles::node::SecretKey, +} + +pub struct ConsensusPublicKeys { + validator_key: roles::validator::PublicKey, + attester_key: roles::attester::PublicKey, +} + +pub fn get_consensus_config( + chain_config: &ChainConfig, + ports: PortsConfig, + consensus_keys: Option, + gossip_static_outbound: Option>, +) -> anyhow::Result { + let genesis_spec = + consensus_keys.map(|consensus_keys| get_genesis_specs(chain_config, &consensus_keys)); + + let public_addr = SocketAddr::new(CONSENSUS_PUBLIC_ADDRESS_HOST, ports.consensus_port); + let server_addr = SocketAddr::new(CONSENSUS_SERVER_ADDRESS_HOST, ports.consensus_port); + + Ok(ConsensusConfig { + server_addr, + public_addr: Host(public_addr.encode()), + genesis_spec, + max_payload_size: MAX_PAYLOAD_SIZE, + gossip_dynamic_inbound_limit: GOSSIP_DYNAMIC_INBOUND_LIMIT, + max_batch_size: MAX_BATCH_SIZE, + gossip_static_inbound: BTreeSet::new(), + gossip_static_outbound: gossip_static_outbound.unwrap_or_default(), + rpc: None, + }) +} + +pub fn generate_consensus_keys() -> ConsensusSecretKeys { + ConsensusSecretKeys { + validator_key: roles::validator::SecretKey::generate(), + attester_key: roles::attester::SecretKey::generate(), + node_key: roles::node::SecretKey::generate(), + } +} + +fn get_consensus_public_keys(consensus_keys: &ConsensusSecretKeys) -> ConsensusPublicKeys { + ConsensusPublicKeys { + validator_key: consensus_keys.validator_key.public(), + attester_key: consensus_keys.attester_key.public(), + } +} + +pub fn get_genesis_specs( + chain_config: &ChainConfig, + consensus_keys: &ConsensusSecretKeys, +) -> GenesisSpec { + let public_keys = get_consensus_public_keys(consensus_keys); + let validator_key = public_keys.validator_key.encode(); + let attester_key = public_keys.attester_key.encode(); + + let validator = WeightedValidator { + key: ValidatorPublicKey(validator_key.clone()), + weight: 1, + }; + let attester = WeightedAttester { + key: AttesterPublicKey(attester_key), + weight: 1, + }; + let leader = ValidatorPublicKey(validator_key); + + GenesisSpec { + chain_id: chain_config.chain_id, + protocol_version: ProtocolVersion(1), + validators: vec![validator], + attesters: vec![attester], + leader, + registry_address: None, + } +} + +pub fn get_consensus_secrets(consensus_keys: &ConsensusSecretKeys) -> ConsensusSecrets { + let validator_key = consensus_keys.validator_key.encode(); + let attester_key = consensus_keys.attester_key.encode(); + let node_key = consensus_keys.node_key.encode(); + + ConsensusSecrets { + validator_key: Some(ValidatorSecretKey(Secret::new(validator_key))), + attester_key: Some(AttesterSecretKey(Secret::new(attester_key))), + node_key: Some(NodeSecretKey(Secret::new(node_key))), + } +} + +pub fn node_public_key(secrets: &ConsensusSecrets) -> anyhow::Result> { + Ok(node_key(secrets)?.map(|node_secret_key| NodePublicKey(node_secret_key.public().encode()))) +} +fn node_key(secrets: &ConsensusSecrets) -> anyhow::Result> { + read_secret_text(secrets.node_key.as_ref().map(|x| &x.0)) +} + +fn read_secret_text(text: Option<&Secret>) -> anyhow::Result> { + text.map(|text| Text::new(text.expose_secret()).decode()) + .transpose() + .map_err(|_| anyhow::format_err!("invalid format")) +} diff --git a/zk_toolbox/crates/zk_inception/src/utils/mod.rs b/zk_toolbox/crates/zk_inception/src/utils/mod.rs index a84f0a336de..229d3908dc3 100644 --- a/zk_toolbox/crates/zk_inception/src/utils/mod.rs +++ b/zk_toolbox/crates/zk_inception/src/utils/mod.rs @@ -1,2 +1,3 @@ +pub mod consensus; pub mod forge; pub mod rocks_db; diff --git a/zk_toolbox/crates/zk_inception/src/utils/rocks_db.rs b/zk_toolbox/crates/zk_inception/src/utils/rocks_db.rs index 17cffa66e39..1b7e29dd972 100644 --- a/zk_toolbox/crates/zk_inception/src/utils/rocks_db.rs +++ b/zk_toolbox/crates/zk_inception/src/utils/rocks_db.rs @@ -4,8 +4,8 @@ use config::RocksDbs; use xshell::Shell; use crate::defaults::{ - EN_ROCKS_DB_PREFIX, MAIN_ROCKS_DB_PREFIX, ROCKS_DB_PROTECTIVE_READS, ROCKS_DB_STATE_KEEPER, - ROCKS_DB_TREE, + EN_ROCKS_DB_PREFIX, MAIN_ROCKS_DB_PREFIX, ROCKS_DB_BASIC_WITNESS_INPUT_PRODUCER, + ROCKS_DB_PROTECTIVE_READS, ROCKS_DB_STATE_KEEPER, ROCKS_DB_TREE, }; pub enum RocksDBDirOption { @@ -37,9 +37,13 @@ pub fn recreate_rocksdb_dirs( .join(option.prefix()) .join(ROCKS_DB_PROTECTIVE_READS); shell.remove_path(&protective_reads)?; + let basic_witness_input_producer = rocks_db_path + .join(option.prefix()) + .join(ROCKS_DB_BASIC_WITNESS_INPUT_PRODUCER); Ok(RocksDbs { state_keeper: shell.create_dir(state_keeper)?, merkle_tree: shell.create_dir(merkle_tree)?, protective_reads: shell.create_dir(protective_reads)?, + basic_witness_input_producer: shell.create_dir(basic_witness_input_producer)?, }) } diff --git a/zk_toolbox/crates/zk_supervisor/README.md b/zk_toolbox/crates/zk_supervisor/README.md index c3fac876ace..865bd2f0d57 100644 --- a/zk_toolbox/crates/zk_supervisor/README.md +++ b/zk_toolbox/crates/zk_supervisor/README.md @@ -32,7 +32,9 @@ This document contains the help content for the `zk_supervisor` command-line pro - [`zk_supervisor fmt rustfmt`↴](#zk_supervisor-fmt-rustfmt) - [`zk_supervisor fmt contract`↴](#zk_supervisor-fmt-contract) - [`zk_supervisor fmt prettier`↴](#zk_supervisor-fmt-prettier) -- [`zk_supervisor prover-version`↴](#zk_supervisor-prover-version) +- [`zk_supervisor prover info`↴](#zk_supervisor-prover-info) +- [`zk_supervisor prover insert-version`↴](#zk_supervisor-prover-insert-version) +- [`zk_supervisor prover insert-batch`↴](#zk_supervisor-prover-insert-batch) ## `zk_supervisor` @@ -348,11 +350,35 @@ Format code Possible values: `md`, `sol`, `js`, `ts`, `rs` -## `zk_supervisor prover-version` +## `zk_supervisor prover info` -Protocol version used by provers +Prints prover protocol version, snark wrapper and prover database URL -**Usage:** `zk_supervisor prover-version` +**Usage:** `zk_supervisor prover info` + +## `zk_supervisor prover insert-version` + +Inserts protocol version into prover database. + +**Usage:** `zk_supervisor prover insert-version [OPTIONS]` + +###### **Options:** + +- `--version ` — Protocol version in semantic format(`x.y.z`). Major version should be 0. +- `--snark-wrapper ` — Snark wrapper hash. +- `--default` - use default values for protocol version and snark wrapper hash (the ones found in zksync-era). + +## `zk_supervisor prover insert-batch` + +Inserts batch into prover database. + +**Usage:** `zk_supervisor prover insert-batch` + +###### **Options:** + +- `--number ` — Number of the batch to insert. +- `--version ` — Protocol version in semantic format(`x.y.z`). Major version should be 0. +- `--default` - use default value for protocol version (the one found in zksync-era).
diff --git a/zk_toolbox/crates/zk_supervisor/src/commands/database/reset.rs b/zk_toolbox/crates/zk_supervisor/src/commands/database/reset.rs index 5e32a8e5ae4..f0262cecb95 100644 --- a/zk_toolbox/crates/zk_supervisor/src/commands/database/reset.rs +++ b/zk_toolbox/crates/zk_supervisor/src/commands/database/reset.rs @@ -20,14 +20,14 @@ pub async fn run(shell: &Shell, args: DatabaseCommonArgs) -> anyhow::Result<()> return Ok(()); } - let ecoseystem_config = EcosystemConfig::from_file(shell)?; + let ecosystem_config = EcosystemConfig::from_file(shell)?; logger::info(msg_database_info(MSG_DATABASE_RESET_GERUND)); let dals = get_dals(shell, &args.selected_dals, &args.urls)?; for dal in dals { logger::info(msg_database_loading(MSG_DATABASE_RESET_GERUND, &dal.path)); - reset_database(shell, ecoseystem_config.link_to_code.clone(), dal).await?; + reset_database(shell, ecosystem_config.link_to_code.clone(), dal).await?; } logger::outro(msg_database_success(MSG_DATABASE_RESET_PAST)); diff --git a/zk_toolbox/crates/zk_supervisor/src/commands/mod.rs b/zk_toolbox/crates/zk_supervisor/src/commands/mod.rs index e45512d50d8..875f2982c95 100644 --- a/zk_toolbox/crates/zk_supervisor/src/commands/mod.rs +++ b/zk_toolbox/crates/zk_supervisor/src/commands/mod.rs @@ -4,6 +4,6 @@ pub mod database; pub mod fmt; pub mod lint; pub(crate) mod lint_utils; -pub mod prover_version; +pub mod prover; pub mod snapshot; pub mod test; diff --git a/zk_toolbox/crates/zk_supervisor/src/commands/prover/args/insert_batch.rs b/zk_toolbox/crates/zk_supervisor/src/commands/prover/args/insert_batch.rs new file mode 100644 index 00000000000..e837bbe9eb8 --- /dev/null +++ b/zk_toolbox/crates/zk_supervisor/src/commands/prover/args/insert_batch.rs @@ -0,0 +1,40 @@ +use clap::Parser; + +#[derive(Debug, Parser)] +pub struct InsertBatchArgs { + #[clap(long)] + pub number: Option, + #[clap(long, default_value = "false")] + pub default: bool, + #[clap(long)] + pub version: Option, +} + +#[derive(Debug)] +pub struct InsertBatchArgsFinal { + pub number: u32, + pub version: String, +} + +impl InsertBatchArgs { + pub(crate) fn fill_values_with_prompts(self, era_version: String) -> InsertBatchArgsFinal { + let number = self.number.unwrap_or_else(|| { + common::Prompt::new("Enter the number of the batch to insert").ask() + }); + + if self.default { + return InsertBatchArgsFinal { + number, + version: era_version, + }; + } + + let version = self.version.unwrap_or_else(|| { + common::Prompt::new("Enter the version of the batch to insert") + .default(&era_version) + .ask() + }); + + InsertBatchArgsFinal { number, version } + } +} diff --git a/zk_toolbox/crates/zk_supervisor/src/commands/prover/args/insert_version.rs b/zk_toolbox/crates/zk_supervisor/src/commands/prover/args/insert_version.rs new file mode 100644 index 00000000000..97e60fb38f8 --- /dev/null +++ b/zk_toolbox/crates/zk_supervisor/src/commands/prover/args/insert_version.rs @@ -0,0 +1,49 @@ +use clap::Parser; + +#[derive(Debug, Parser)] +pub struct InsertVersionArgs { + #[clap(long, default_value = "false")] + pub default: bool, + #[clap(long)] + pub version: Option, + #[clap(long)] + pub snark_wrapper: Option, +} + +#[derive(Debug)] +pub struct InsertVersionArgsFinal { + pub snark_wrapper: String, + pub version: String, +} + +impl InsertVersionArgs { + pub(crate) fn fill_values_with_prompts( + self, + era_version: String, + snark_wrapper: String, + ) -> InsertVersionArgsFinal { + if self.default { + return InsertVersionArgsFinal { + snark_wrapper, + version: era_version, + }; + } + + let version = self.version.unwrap_or_else(|| { + common::Prompt::new("Enter the version of the protocol to insert") + .default(&era_version) + .ask() + }); + + let snark_wrapper = self.snark_wrapper.unwrap_or_else(|| { + common::Prompt::new("Enter the snark wrapper of the protocol to insert") + .default(&snark_wrapper) + .ask() + }); + + InsertVersionArgsFinal { + snark_wrapper, + version, + } + } +} diff --git a/zk_toolbox/crates/zk_supervisor/src/commands/prover/args/mod.rs b/zk_toolbox/crates/zk_supervisor/src/commands/prover/args/mod.rs new file mode 100644 index 00000000000..0984546136c --- /dev/null +++ b/zk_toolbox/crates/zk_supervisor/src/commands/prover/args/mod.rs @@ -0,0 +1,2 @@ +pub mod insert_batch; +pub mod insert_version; diff --git a/zk_toolbox/crates/zk_supervisor/src/commands/prover/info.rs b/zk_toolbox/crates/zk_supervisor/src/commands/prover/info.rs new file mode 100644 index 00000000000..6a7d7ddeda8 --- /dev/null +++ b/zk_toolbox/crates/zk_supervisor/src/commands/prover/info.rs @@ -0,0 +1,95 @@ +use std::{ + fs, + path::{Path, PathBuf}, +}; + +use anyhow::Context as _; +use common::{config::global_config, logger}; +use config::{ChainConfig, EcosystemConfig}; +use xshell::{cmd, Shell}; + +use crate::messages::MSG_CHAIN_NOT_FOUND_ERR; + +pub async fn run(shell: &Shell) -> anyhow::Result<()> { + let ecosystem_config = EcosystemConfig::from_file(shell)?; + let chain_config = ecosystem_config + .load_chain(global_config().chain_name.clone()) + .expect(MSG_CHAIN_NOT_FOUND_ERR); + + let link_to_code = ecosystem_config.link_to_code; + let link_to_prover = link_to_code.join("prover"); + + let protocol_version = get_protocol_version(shell, &link_to_prover).await?; + let snark_wrapper = get_snark_wrapper(&link_to_prover).await?; + let prover_url = get_database_url(&chain_config).await?; + + logger::info(format!( + " +=============================== \n +Current prover setup information: \n +Protocol version: {} \n +Snark wrapper: {} \n +Database URL: {}\n +===============================", + protocol_version, snark_wrapper, prover_url + )); + + Ok(()) +} + +pub(crate) async fn get_protocol_version( + shell: &Shell, + link_to_prover: &PathBuf, +) -> anyhow::Result { + shell.change_dir(link_to_prover); + let protocol_version = cmd!(shell, "cargo run --release --bin prover_version").read()?; + + Ok(protocol_version) +} + +pub(crate) async fn get_snark_wrapper(link_to_prover: &Path) -> anyhow::Result { + let path = link_to_prover.join("data/keys/commitments.json"); + let file = fs::File::open(path).expect("Could not find commitments file in zksync-era"); + let json: serde_json::Value = + serde_json::from_reader(file).expect("Could not parse commitments.json"); + + let snark_wrapper = json + .get("snark_wrapper") + .expect("Could not find snark_wrapper in commitments.json"); + + let mut snark_wrapper = snark_wrapper.to_string(); + snark_wrapper.pop(); + snark_wrapper.remove(0); + + Ok(snark_wrapper) +} + +pub(crate) async fn get_database_url(chain: &ChainConfig) -> anyhow::Result { + let prover_url = chain + .get_secrets_config()? + .database + .context("Database secrets not found")? + .prover_url()? + .expose_url() + .to_string(); + Ok(prover_url) +} + +pub fn parse_version(version: &str) -> anyhow::Result<(&str, &str)> { + let splitted: Vec<&str> = version.split(".").collect(); + + assert_eq!(splitted.len(), 3, "Invalid version format"); + assert_eq!(splitted[0], "0", "Invalid major version, expected 0"); + + splitted[1] + .parse::() + .context("Could not parse minor version")?; + splitted[2] + .parse::() + .context("Could not parse patch version")?; + + let minor = splitted[1]; + let patch = splitted[2]; + + Ok((minor, patch)) +} diff --git a/zk_toolbox/crates/zk_supervisor/src/commands/prover/insert_batch.rs b/zk_toolbox/crates/zk_supervisor/src/commands/prover/insert_batch.rs new file mode 100644 index 00000000000..b1c02c9a9fe --- /dev/null +++ b/zk_toolbox/crates/zk_supervisor/src/commands/prover/insert_batch.rs @@ -0,0 +1,46 @@ +use common::{ + check_prerequisites, cmd::Cmd, config::global_config, logger, PROVER_CLI_PREREQUISITE, +}; +use config::{get_link_to_prover, EcosystemConfig}; +use xshell::{cmd, Shell}; + +use crate::{ + commands::prover::{ + args::insert_batch::{InsertBatchArgs, InsertBatchArgsFinal}, + info, + }, + messages::MSG_CHAIN_NOT_FOUND_ERR, +}; + +pub async fn run(shell: &Shell, args: InsertBatchArgs) -> anyhow::Result<()> { + check_prerequisites(shell, &PROVER_CLI_PREREQUISITE, false); + + let ecosystem_config = EcosystemConfig::from_file(shell)?; + let chain_config = ecosystem_config + .load_chain(global_config().chain_name.clone()) + .expect(MSG_CHAIN_NOT_FOUND_ERR); + + let version = info::get_protocol_version(shell, &get_link_to_prover(&ecosystem_config)).await?; + let prover_url = info::get_database_url(&chain_config).await?; + + let InsertBatchArgsFinal { number, version } = args.fill_values_with_prompts(version); + + let (minor, patch) = info::parse_version(&version)?; + + logger::info(format!( + "Inserting protocol version {}, batch number {} into the database", + version, number + )); + + let number = number.to_string(); + + let cmd = Cmd::new(cmd!( + shell, + "prover_cli {prover_url} insert-batch --version={minor} --patch={patch} --number={number}" + )); + cmd.run()?; + + logger::info("Done."); + + Ok(()) +} diff --git a/zk_toolbox/crates/zk_supervisor/src/commands/prover/insert_version.rs b/zk_toolbox/crates/zk_supervisor/src/commands/prover/insert_version.rs new file mode 100644 index 00000000000..16bbdf13df4 --- /dev/null +++ b/zk_toolbox/crates/zk_supervisor/src/commands/prover/insert_version.rs @@ -0,0 +1,46 @@ +use common::{ + check_prerequisites, cmd::Cmd, config::global_config, logger, PROVER_CLI_PREREQUISITE, +}; +use config::{get_link_to_prover, EcosystemConfig}; +use xshell::{cmd, Shell}; + +use crate::{ + commands::prover::{ + args::insert_version::{InsertVersionArgs, InsertVersionArgsFinal}, + info, + }, + messages::MSG_CHAIN_NOT_FOUND_ERR, +}; + +pub async fn run(shell: &Shell, args: InsertVersionArgs) -> anyhow::Result<()> { + check_prerequisites(shell, &PROVER_CLI_PREREQUISITE, false); + + let ecosystem_config = EcosystemConfig::from_file(shell)?; + let chain_config = ecosystem_config + .load_chain(global_config().chain_name.clone()) + .expect(MSG_CHAIN_NOT_FOUND_ERR); + + let version = info::get_protocol_version(shell, &get_link_to_prover(&ecosystem_config)).await?; + let snark_wrapper = info::get_snark_wrapper(&get_link_to_prover(&ecosystem_config)).await?; + + let prover_url = info::get_database_url(&chain_config).await?; + + let InsertVersionArgsFinal { + version, + snark_wrapper, + } = args.fill_values_with_prompts(version, snark_wrapper); + + let (minor, patch) = info::parse_version(&version)?; + + logger::info(format!( + "Inserting protocol version {}, snark wrapper {} into the database", + version, snark_wrapper + )); + + let cmd = Cmd::new(cmd!(shell, "prover_cli {prover_url} insert-version --version={minor} --patch={patch} --snark-wrapper={snark_wrapper}")); + cmd.run()?; + + logger::info("Done."); + + Ok(()) +} diff --git a/zk_toolbox/crates/zk_supervisor/src/commands/prover/mod.rs b/zk_toolbox/crates/zk_supervisor/src/commands/prover/mod.rs new file mode 100644 index 00000000000..364f8fe93ef --- /dev/null +++ b/zk_toolbox/crates/zk_supervisor/src/commands/prover/mod.rs @@ -0,0 +1,22 @@ +use clap::Subcommand; +use xshell::Shell; + +mod args; +pub mod info; +pub mod insert_batch; +pub mod insert_version; + +#[derive(Subcommand, Debug)] +pub enum ProverCommands { + Info, + InsertBatch(args::insert_batch::InsertBatchArgs), + InsertVersion(args::insert_version::InsertVersionArgs), +} + +pub async fn run(shell: &Shell, args: ProverCommands) -> anyhow::Result<()> { + match args { + ProverCommands::Info => info::run(shell).await, + ProverCommands::InsertBatch(args) => insert_batch::run(shell, args).await, + ProverCommands::InsertVersion(args) => insert_version::run(shell, args).await, + } +} diff --git a/zk_toolbox/crates/zk_supervisor/src/commands/prover_version.rs b/zk_toolbox/crates/zk_supervisor/src/commands/prover_version.rs deleted file mode 100644 index 8740e7c873a..00000000000 --- a/zk_toolbox/crates/zk_supervisor/src/commands/prover_version.rs +++ /dev/null @@ -1,40 +0,0 @@ -use std::{fs, path::Path}; - -use common::logger; -use config::EcosystemConfig; -use xshell::{cmd, Shell}; - -pub async fn run(shell: &Shell) -> anyhow::Result<()> { - let link_to_code = EcosystemConfig::from_file(shell)?.link_to_code; - let link_to_prover = link_to_code.join("prover"); - - let protocol_version = get_protocol_version(shell, &link_to_prover).await?; - let snark_wrapper = get_snark_wrapper(&link_to_prover).await?; - - logger::info(format!( - "Current protocol version found in zksync-era: {}, snark_wrapper: {}", - protocol_version, snark_wrapper - )); - - Ok(()) -} - -async fn get_protocol_version(shell: &Shell, link_to_prover: &Path) -> anyhow::Result { - shell.change_dir(link_to_prover); - let protocol_version = cmd!(shell, "cargo run --release --bin prover_version").read()?; - - Ok(protocol_version) -} - -async fn get_snark_wrapper(link_to_prover: &Path) -> anyhow::Result { - let path = link_to_prover.join("data/keys/commitments.json"); - let file = fs::File::open(path).expect("Could not find commitments file in zksync-era"); - let json: serde_json::Value = - serde_json::from_reader(file).expect("Could not parse commitments.json"); - - let snark_wrapper = json - .get("snark_wrapper") - .expect("Could not find snark_wrapper in commitments.json"); - - Ok(snark_wrapper.to_string()) -} diff --git a/zk_toolbox/crates/zk_supervisor/src/commands/test/args/integration.rs b/zk_toolbox/crates/zk_supervisor/src/commands/test/args/integration.rs index 292c7d7d715..435dddfc360 100644 --- a/zk_toolbox/crates/zk_supervisor/src/commands/test/args/integration.rs +++ b/zk_toolbox/crates/zk_supervisor/src/commands/test/args/integration.rs @@ -1,7 +1,7 @@ use clap::Parser; use serde::{Deserialize, Serialize}; -use crate::messages::{MSG_NO_DEPS_HELP, MSG_TESTS_EXTERNAL_NODE_HELP}; +use crate::messages::{MSG_NO_DEPS_HELP, MSG_TESTS_EXTERNAL_NODE_HELP, MSG_TEST_PATTERN_HELP}; #[derive(Debug, Serialize, Deserialize, Parser)] pub struct IntegrationArgs { @@ -9,4 +9,6 @@ pub struct IntegrationArgs { pub external_node: bool, #[clap(short, long, help = MSG_NO_DEPS_HELP)] pub no_deps: bool, + #[clap(short, long, help = MSG_TEST_PATTERN_HELP)] + pub test_pattern: Option, } diff --git a/zk_toolbox/crates/zk_supervisor/src/commands/test/integration.rs b/zk_toolbox/crates/zk_supervisor/src/commands/test/integration.rs index e1ec932ca7f..fb3e1436acc 100644 --- a/zk_toolbox/crates/zk_supervisor/src/commands/test/integration.rs +++ b/zk_toolbox/crates/zk_supervisor/src/commands/test/integration.rs @@ -39,9 +39,13 @@ pub async fn run(shell: &Shell, args: IntegrationArgs) -> anyhow::Result<()> { .init_test_wallet(&ecosystem_config, &chain_config) .await?; - let mut command = cmd!(shell, "yarn jest --forceExit --testTimeout 120000") - .env("CHAIN_NAME", ecosystem_config.current_chain()) - .env("MASTER_WALLET_PK", wallets.get_test_pk(&chain_config)?); + let test_pattern = args.test_pattern; + let mut command = cmd!( + shell, + "yarn jest --forceExit --testTimeout 120000 -t {test_pattern...}" + ) + .env("CHAIN_NAME", ecosystem_config.current_chain()) + .env("MASTER_WALLET_PK", wallets.get_test_pk(&chain_config)?); if args.external_node { command = command.env("EXTERNAL_NODE", format!("{:?}", args.external_node)) diff --git a/zk_toolbox/crates/zk_supervisor/src/commands/test/loadtest.rs b/zk_toolbox/crates/zk_supervisor/src/commands/test/loadtest.rs new file mode 100644 index 00000000000..5a2a87871b5 --- /dev/null +++ b/zk_toolbox/crates/zk_supervisor/src/commands/test/loadtest.rs @@ -0,0 +1,52 @@ +use anyhow::Context; +use common::{cmd::Cmd, config::global_config, logger}; +use config::EcosystemConfig; +use xshell::{cmd, Shell}; + +use crate::messages::MSG_CHAIN_NOT_FOUND_ERR; + +pub fn run(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)?; + + let general_api = chain_config + .get_general_config()? + .api_config + .context("API config is not found")?; + + let mut command = cmd!(shell, "cargo run --release --bin loadnext") + .env( + "L2_CHAIN_ID", + chain_config + .get_genesis_config()? + .l2_chain_id + .as_u64() + .to_string(), + ) + .env( + "MAIN_TOKEN", + format!( + "{:?}", + ecosystem_config + .get_erc20_tokens() + .first() + .context("NO Erc20 tokens were deployed")? + .address + ), + ) + .env("L2_RPC_ADDRESS", general_api.web3_json_rpc.http_url) + .env("L2_WS_RPC_ADDRESS", general_api.web3_json_rpc.ws_url); + + if global_config().verbose { + command = command.env("RUST_LOG", "loadnext=info") + } + + Cmd::new(command).with_force_run().run()?; + + logger::outro("Loadtest success"); + + Ok(()) +} diff --git a/zk_toolbox/crates/zk_supervisor/src/commands/test/mod.rs b/zk_toolbox/crates/zk_supervisor/src/commands/test/mod.rs index a536302afc1..712e2f75eef 100644 --- a/zk_toolbox/crates/zk_supervisor/src/commands/test/mod.rs +++ b/zk_toolbox/crates/zk_supervisor/src/commands/test/mod.rs @@ -6,15 +6,16 @@ use clap::Subcommand; use xshell::Shell; use crate::messages::{ - MSG_BUILD_ABOUT, MSG_INTEGRATION_TESTS_ABOUT, MSG_L1_CONTRACTS_ABOUT, MSG_PROVER_TEST_ABOUT, - MSG_RECOVERY_TEST_ABOUT, MSG_REVERT_TEST_ABOUT, MSG_RUST_TEST_ABOUT, MSG_TEST_WALLETS_INFO, - MSG_UPGRADE_TEST_ABOUT, + MSG_BUILD_ABOUT, MSG_INTEGRATION_TESTS_ABOUT, MSG_L1_CONTRACTS_ABOUT, MSG_LOADTEST_ABOUT, + MSG_PROVER_TEST_ABOUT, MSG_RECOVERY_TEST_ABOUT, MSG_REVERT_TEST_ABOUT, MSG_RUST_TEST_ABOUT, + MSG_TEST_WALLETS_INFO, MSG_UPGRADE_TEST_ABOUT, }; mod args; mod build; mod integration; mod l1_contracts; +mod loadtest; mod prover; mod recovery; mod revert; @@ -43,6 +44,8 @@ pub enum TestCommands { Prover, #[clap(about = MSG_TEST_WALLETS_INFO)] Wallet, + #[clap(about = MSG_LOADTEST_ABOUT)] + Loadtest, } pub async fn run(shell: &Shell, args: TestCommands) -> anyhow::Result<()> { @@ -56,5 +59,6 @@ pub async fn run(shell: &Shell, args: TestCommands) -> anyhow::Result<()> { TestCommands::L1Contracts => l1_contracts::run(shell), TestCommands::Prover => prover::run(shell), TestCommands::Wallet => wallet::run(shell), + TestCommands::Loadtest => loadtest::run(shell), } } diff --git a/zk_toolbox/crates/zk_supervisor/src/commands/test/recovery.rs b/zk_toolbox/crates/zk_supervisor/src/commands/test/recovery.rs index 030d2896603..c69a9826d56 100644 --- a/zk_toolbox/crates/zk_supervisor/src/commands/test/recovery.rs +++ b/zk_toolbox/crates/zk_supervisor/src/commands/test/recovery.rs @@ -21,7 +21,7 @@ pub async fn run(shell: &Shell, args: RecoveryArgs) -> anyhow::Result<()> { shell.change_dir(ecosystem_config.link_to_code.join(RECOVERY_TESTS_PATH)); logger::info(MSG_RECOVERY_TEST_RUN_INFO); - Server::new(None, ecosystem_config.link_to_code.clone()).build(shell)?; + Server::new(None, ecosystem_config.link_to_code.clone(), false).build(shell)?; if !args.no_deps { install_and_build_dependencies(shell, &ecosystem_config)?; 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 ad1318cfa76..3ac331becc9 100644 --- a/zk_toolbox/crates/zk_supervisor/src/commands/test/rust.rs +++ b/zk_toolbox/crates/zk_supervisor/src/commands/test/rust.rs @@ -12,8 +12,8 @@ use crate::{ 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, + MSG_CHAIN_NOT_FOUND_ERR, MSG_POSTGRES_CONFIG_NOT_FOUND_ERR, MSG_RESETTING_TEST_DATABASES, + MSG_UNIT_TESTS_RUN_SUCCESS, MSG_USING_CARGO_NEXTEST, }, }; @@ -61,13 +61,8 @@ pub async fn run(shell: &Shell, args: RustArgs) -> anyhow::Result<()> { let _dir_guard = shell.push_dir(&link_to_code); - let cmd = if nextest_is_installed(shell)? { - logger::info(MSG_USING_CARGO_NEXTEST); - cmd!(shell, "cargo nextest run --release") - } else { - logger::error(MSG_CARGO_NEXTEST_MISSING_ERR); - cmd!(shell, "cargo test --release") - }; + logger::info(MSG_USING_CARGO_NEXTEST); + let cmd = cmd!(shell, "cargo nextest run --release"); let cmd = if let Some(options) = args.options { Cmd::new(cmd.args(options.split_whitespace())).with_force_run() @@ -84,15 +79,6 @@ pub async fn run(shell: &Shell, args: RustArgs) -> anyhow::Result<()> { Ok(()) } -fn nextest_is_installed(shell: &Shell) -> anyhow::Result { - let out = String::from_utf8( - Cmd::new(cmd!(shell, "cargo install --list")) - .run_with_output()? - .stdout, - )?; - Ok(out.contains("cargo-nextest")) -} - async fn reset_test_databases( shell: &Shell, link_to_code: &Path, diff --git a/zk_toolbox/crates/zk_supervisor/src/main.rs b/zk_toolbox/crates/zk_supervisor/src/main.rs index a8722787b5f..32aefa7fcad 100644 --- a/zk_toolbox/crates/zk_supervisor/src/main.rs +++ b/zk_toolbox/crates/zk_supervisor/src/main.rs @@ -1,6 +1,6 @@ use clap::{Parser, Subcommand}; use commands::{ - contracts::ContractsArgs, database::DatabaseCommands, lint::LintArgs, + contracts::ContractsArgs, database::DatabaseCommands, lint::LintArgs, prover::ProverCommands, snapshot::SnapshotCommands, test::TestCommands, }; use common::{ @@ -49,8 +49,8 @@ enum SupervisorSubcommands { Fmt(FmtArgs), #[command(hide = true)] Markdown, - #[command(about = MSG_PROVER_VERSION_ABOUT)] - ProverVersion, + #[command(subcommand, about = MSG_PROVER_VERSION_ABOUT)] + Prover(ProverCommands), #[command(about = MSG_CONTRACTS_ABOUT)] Contracts(ContractsArgs), } @@ -109,7 +109,7 @@ async fn run_subcommand(args: Supervisor, shell: &Shell) -> anyhow::Result<()> { } SupervisorSubcommands::Lint(args) => commands::lint::run(shell, args)?, SupervisorSubcommands::Fmt(args) => commands::fmt::run(shell.clone(), args).await?, - SupervisorSubcommands::ProverVersion => commands::prover_version::run(shell).await?, + SupervisorSubcommands::Prover(command) => commands::prover::run(shell, command).await?, SupervisorSubcommands::Contracts(args) => commands::contracts::run(shell, args)?, } Ok(()) diff --git a/zk_toolbox/crates/zk_supervisor/src/messages.rs b/zk_toolbox/crates/zk_supervisor/src/messages.rs index ff9cc104a50..311a6e11c32 100644 --- a/zk_toolbox/crates/zk_supervisor/src/messages.rs +++ b/zk_toolbox/crates/zk_supervisor/src/messages.rs @@ -92,12 +92,13 @@ pub(super) const MSG_TEST_RUST_OPTIONS_HELP: &str = "Cargo test flags"; pub(super) const MSG_BUILD_ABOUT: &str = "Build all test dependencies"; pub(super) const MSG_TESTS_EXTERNAL_NODE_HELP: &str = "Run tests for external node"; pub(super) const MSG_NO_DEPS_HELP: &str = "Do not install or build dependencies"; +pub(super) const MSG_TEST_PATTERN_HELP: &str = + "Run just the tests matching a pattern. Same as the -t flag on jest."; pub(super) const MSG_NO_KILL_HELP: &str = "The test will not kill all the nodes during execution"; pub(super) const MSG_TESTS_RECOVERY_SNAPSHOT_HELP: &str = "Run recovery from a snapshot instead of genesis"; pub(super) const MSG_UNIT_TESTS_RUN_SUCCESS: &str = "Unit tests ran successfully"; pub(super) const MSG_USING_CARGO_NEXTEST: &str = "Using cargo-nextest for running tests"; -pub(super) const MSG_CARGO_NEXTEST_MISSING_ERR: &str = "cargo-nextest is missing, please run 'cargo install cargo-nextest'. Falling back to 'cargo test'"; pub(super) const MSG_L1_CONTRACTS_ABOUT: &str = "Run L1 contracts tests"; pub(super) const MSG_L1_CONTRACTS_TEST_SUCCESS: &str = "L1 contracts tests ran successfully"; pub(super) const MSG_PROVER_TEST_ABOUT: &str = "Run prover tests"; @@ -199,3 +200,5 @@ pub(super) const MSG_RUNNING_CONTRACTS_FMT_SPINNER: &str = "Running prettier for pub(super) const MSG_TEST_WALLETS_INFO: &str = "Print test wallets information"; pub(super) const MSG_DESERIALIZE_TEST_WALLETS_ERR: &str = "Impossible to deserialize test wallets"; pub(super) const MSG_WALLETS_TEST_SUCCESS: &str = "Wallets test success"; + +pub(super) const MSG_LOADTEST_ABOUT: &str = "Run loadtest";