diff --git a/.github/scripts/compare-default-params.sh b/.github/scripts/compare-default-params.sh deleted file mode 100755 index b245905b3..000000000 --- a/.github/scripts/compare-default-params.sh +++ /dev/null @@ -1,62 +0,0 @@ -#!/bin/bash - -# This script compares default parameters specified in three files: `input_parser.star`, -# `kurtosis.yml` and `params.yml` where `params.yml` is the source of truth for default parameters. -# The script outputs the differences between the specified parameters in each file compared to `params.yml`. - -INPUT_PARSER_PATH="input_parser.star" -PARAMS_YML_PATH="params.yml" - -# Extracting default parameters from the different files. -echo "Extracting default parameters from input_parser.star..." -if ! sed -n '/^DEFAULT_ARGS = {/,/^}/ { s/DEFAULT_ARGS = //; s/}/}/; p; }' "$INPUT_PARSER_PATH" | yq -S --yaml-output >.input_parser.star; then - echo "Error: Failed to extract parameters from input_parser.star." - exit 1 -fi - -echo "Extracting default parameters from params.yml..." -if ! yq -S --yaml-output .args "$PARAMS_YML_PATH" >.params.yml; then - echo "Error: Failed to extract parameters from params.yml." - exit 1 -fi - -# Function to compare files and output differences in a structured format -compare_with_source_of_truth() { - local file1=.params.yml - local file2=$1 - - echo - echo "🔍 Comparing $file1 and $file2..." - differences=$(diff "$file1" "$file2" | grep -E '^[<>]') - if [ -z "$differences" ]; then - echo "No differences found." - else - diff_count=$(echo "$differences" | grep -c '^<') - echo - echo "$diff_count differences found:" - echo - - # Print differences for file1 - echo "📄 $file1 (source of truth)" - echo "--------------------------------------------------------------------------------" - while IFS= read -r line; do - if [[ $line == "<"* ]]; then - echo "${line:2}" - fi - done <<<"$differences" - - echo - # Print differences for file - echo "📄 $file2 (🚨 to be updated 🚨)" - echo "--------------------------------------------------------------------------------" - while IFS= read -r line; do - if [[ $line == ">"* ]]; then - echo "${line:2}" - fi - done <<<"$differences" - exit 1 - fi -} - -echo -compare_with_source_of_truth .input_parser.star diff --git a/.github/scripts/monitor-verified-batches.sh b/.github/scripts/monitor-verified-batches.sh index 5e87843bb..29c315857 100755 --- a/.github/scripts/monitor-verified-batches.sh +++ b/.github/scripts/monitor-verified-batches.sh @@ -5,7 +5,8 @@ # Function to display usage information. usage() { - echo "Usage: $0 --rpc-url --target --timeout " + echo "Usage: $0 --enclave --rpc-url --target --timeout " + echo " --enclave: The name of the Kurtosis enclave." echo " --rpc-url: The RPC URL to query." echo " --target: The target number of verified batches." echo " --timeout: The script timeout in seconds." @@ -13,6 +14,7 @@ usage() { } # Initialize variables. +enclave="" rpc_url="" target="10" timeout="900" # 15 minutes. @@ -21,6 +23,10 @@ timeout="900" # 15 minutes. while [[ $# -gt 0 ]]; do key="$1" case $key in + --enclave) + enclave="$2" + shift 2 + ;; --rpc-url) rpc_url="$2" shift 2 @@ -34,19 +40,26 @@ while [[ $# -gt 0 ]]; do shift 2 ;; *) + echo "Error: unknown argument: $key" usage ;; esac done # Check if the required argument is provided. +if [ -z "$enclave" ]; then + echo "Error: enclave name is required." + usage +fi + if [ -z "$rpc_url" ]; then - echo "Error: RPC URL is required." + echo "Error: rpc url is required." usage fi # Print script parameters for debug purposes. echo "Running script with values:" +echo "- Enclave: $enclave" echo "- RPC URL: $rpc_url" echo "- Target: $target" echo "- Timeout: $timeout" @@ -60,10 +73,14 @@ gas_price_factor=1 # Main loop to monitor batch verification. while true; do # Check if there are any stopped services. - if kurtosis enclave inspect "$ENCLAVE_NAME" | grep STOPPED ; then - echo "It looks like there is a stopped service in the enclave. Something must have halted" - kurtosis enclave inspect "$ENCLAVE_NAME" - kurtosis enclave inspect "$ENCLAVE_NAME" --full-uuids | grep STOPPED | awk '{print $2 "--" $1}' | while read -r container; do echo "Printing logs for $container"; docker logs --tail 50 "$container"; done + stopped_services="$(kurtosis enclave inspect "$enclave" | grep STOPPED)" + if [[ -n "$stopped_services" ]]; then + echo "It looks like there is at least one stopped service in the enclave... Something must have halted..." + echo "$stopped_services" + echo + + kurtosis enclave inspect "$enclave" --full-uuids | grep STOPPED | awk '{print $2 "--" $1}' \ + | while read -r container; do echo "Printing logs for $container"; docker logs --tail 50 "$container"; done exit 1 fi diff --git a/.github/tests/.gitignore b/.github/tests/.gitignore deleted file mode 100644 index 4af4ca323..000000000 --- a/.github/tests/.gitignore +++ /dev/null @@ -1 +0,0 @@ -combinations/ diff --git a/.github/tests/README.md b/.github/tests/README.md index 1d2fa6ef5..73fad0264 100644 --- a/.github/tests/README.md +++ b/.github/tests/README.md @@ -18,6 +18,7 @@ Here is an example: $ ./combine-ymls.sh Creating combinations... - combinations/fork11-new-cdk-stack-cdk-validium.yml +- combinations/fork11-legacy-zkevm-stack-rollup.yml - combinations/fork11-new-cdk-stack-rollup.yml - combinations/fork12-new-cdk-stack-cdk-validium.yml - combinations/fork12-new-cdk-stack-rollup.yml diff --git a/.github/tests/attach-second-cdk.yml b/.github/tests/attach-second-cdk.yml new file mode 100644 index 000000000..8e6da6f28 --- /dev/null +++ b/.github/tests/attach-second-cdk.yml @@ -0,0 +1,26 @@ +deployment_stages: + deploy_l1: false + deploy_agglayer: false + +args: + deployment_suffix: "-002" + zkevm_rollup_chain_id: 20202 + zkevm_rollup_id: 2 + + # The following accounts have been generated using the following command: + # polycli wallet inspect --mnemonic 'bless share truly shadow primary sun relief border van gallery stairs edit reflect gentle athlete main device smile response rescue mirror floor say people' --addresses 9 | tee keys.txt | jq -r '.Addresses[] | [.ETHAddress, .HexPrivateKey] | @tsv' | awk 'BEGIN{split("sequencer,aggregator,claimtxmanager,timelock,admin,loadtest,agglayer,dac,proofsigner",roles,",")} {print "zkevm_l2_" roles[NR] "_address: \"" $1 "\""; print "zkevm_l2_" roles[NR] "_private_key: \"0x" $2 "\"\n"}' + # Note that admin and agglayer accounts have been removed since we're using the default accounts. + zkevm_l2_sequencer_address: "0xA670342930242407b9984e467353044f8472055e" + zkevm_l2_sequencer_private_key: "0x902ed4ce26b536617a4f26da5e0cd0ef61b514a076b4bd766d6ab8b97efbb8c1" + zkevm_l2_aggregator_address: "0xfC419a9d9Fe0DfA4Cf9971AcD1Fbcd356DD768FD" + zkevm_l2_aggregator_private_key: "0xa70db9fb4b84a6ba18c03cd2266116dd110538d6c4c88e67ca35a29b910da25d" + zkevm_l2_claimtxmanager_address: "0x93F63c24735f45Cd0266E87353071B64dd86bc05" + zkevm_l2_claimtxmanager_private_key: "0x38718f22097afba13be48d818964326c9c5c48133f51e3c3bfd6faf05f813b34" + zkevm_l2_timelock_address: "0xDB22C6f61A82d6AA6d3607289fC93774AC09413a" + zkevm_l2_timelock_private_key: "0xae4a69010583a09709baa563fa66f9e6f2dacf9e9c84b89932406b9a0521b561" + zkevm_l2_loadtest_address: "0xD5278fC3Dc72A226d5C04c3d2C85fd397A46fA08" + zkevm_l2_loadtest_private_key: "0xef4db4f97684b8307adc332ed6c1bc82d66d160f08e7427d082d66a23889625e" + zkevm_l2_dac_address: "0xDa07AAD7226B136bc24157Dc4Ff5A813490E20D0" + zkevm_l2_dac_private_key: "0x992c9ab11d5eab6b6c2634b8bb0b85f3d8d1acf25024dc99c359cb2afd9b40a7" + zkevm_l2_proofsigner_address: "0xf1a661D7b601Ec46a040f57193cC99aB8c4132FA" + zkevm_l2_proofsigner_private_key: "0xc7fe3a006d75ba9326d9792523385abb49057c66aee0b8b4248821a89713f975" diff --git a/.github/tests/combinations/fork11-legacy-zkevm-stack-rollup.yml b/.github/tests/combinations/fork11-legacy-zkevm-stack-rollup.yml new file mode 100644 index 000000000..bacc089c2 --- /dev/null +++ b/.github/tests/combinations/fork11-legacy-zkevm-stack-rollup.yml @@ -0,0 +1,11 @@ +args: + zkevm_contracts_image: leovct/zkevm-contracts:v7.0.0-rc.2-fork.11 + zkevm_prover_image: hermeznetwork/zkevm-prover:v7.0.2-fork.11 + cdk_erigon_node_image: hermeznetwork/cdk-erigon:acceptance-2.0.0-beta26-0f01107 + zkevm_node_image: hermeznetwork/zkevm-node:v0.7.0-fork11-RC1 + additional_services: + - tx_spammer + data_availability_mode: rollup + sequencer_type: zkevm +deployment_stages: + deploy_cdk_erigon_node: false diff --git a/.github/tests/combinations/fork11-new-cdk-stack-cdk-validium.yml b/.github/tests/combinations/fork11-new-cdk-stack-cdk-validium.yml new file mode 100644 index 000000000..3f82861b4 --- /dev/null +++ b/.github/tests/combinations/fork11-new-cdk-stack-cdk-validium.yml @@ -0,0 +1,9 @@ +args: + zkevm_contracts_image: leovct/zkevm-contracts:v7.0.0-rc.2-fork.11 + zkevm_prover_image: hermeznetwork/zkevm-prover:v7.0.2-fork.11 + cdk_erigon_node_image: hermeznetwork/cdk-erigon:acceptance-2.0.0-beta26-0f01107 + zkevm_node_image: hermeznetwork/zkevm-node:v0.7.0-fork11-RC1 + additional_services: + - tx_spammer + data_availability_mode: cdk-validium + sequencer_type: erigon diff --git a/.github/tests/combinations/fork11-new-cdk-stack-rollup.yml b/.github/tests/combinations/fork11-new-cdk-stack-rollup.yml new file mode 100644 index 000000000..bb8d502a0 --- /dev/null +++ b/.github/tests/combinations/fork11-new-cdk-stack-rollup.yml @@ -0,0 +1,9 @@ +args: + zkevm_contracts_image: leovct/zkevm-contracts:v7.0.0-rc.2-fork.11 + zkevm_prover_image: hermeznetwork/zkevm-prover:v7.0.2-fork.11 + cdk_erigon_node_image: hermeznetwork/cdk-erigon:acceptance-2.0.0-beta26-0f01107 + zkevm_node_image: hermeznetwork/zkevm-node:v0.7.0-fork11-RC1 + additional_services: + - tx_spammer + data_availability_mode: rollup + sequencer_type: erigon diff --git a/.github/tests/combinations/fork12-new-cdk-stack-cdk-validium.yml b/.github/tests/combinations/fork12-new-cdk-stack-cdk-validium.yml new file mode 100644 index 000000000..a994e0101 --- /dev/null +++ b/.github/tests/combinations/fork12-new-cdk-stack-cdk-validium.yml @@ -0,0 +1,8 @@ +args: + zkevm_contracts_image: leovct/zkevm-contracts:v8.0.0-rc.4-fork.12 + zkevm_prover_image: hermeznetwork/zkevm-prover:v8.0.0-RC12-fork.12 + cdk_erigon_node_image: hermeznetwork/cdk-erigon:0948e33 + additional_services: + - tx_spammer + data_availability_mode: cdk-validium + sequencer_type: erigon diff --git a/.github/tests/combinations/fork12-new-cdk-stack-rollup.yml b/.github/tests/combinations/fork12-new-cdk-stack-rollup.yml new file mode 100644 index 000000000..07ac0e672 --- /dev/null +++ b/.github/tests/combinations/fork12-new-cdk-stack-rollup.yml @@ -0,0 +1,8 @@ +args: + zkevm_contracts_image: leovct/zkevm-contracts:v8.0.0-rc.4-fork.12 + zkevm_prover_image: hermeznetwork/zkevm-prover:v8.0.0-RC12-fork.12 + cdk_erigon_node_image: hermeznetwork/cdk-erigon:0948e33 + additional_services: + - tx_spammer + data_availability_mode: rollup + sequencer_type: erigon diff --git a/.github/tests/combinations/fork9-legacy-zkevm-stack-cdk-validium.yml b/.github/tests/combinations/fork9-legacy-zkevm-stack-cdk-validium.yml new file mode 100644 index 000000000..0cebb44cf --- /dev/null +++ b/.github/tests/combinations/fork9-legacy-zkevm-stack-cdk-validium.yml @@ -0,0 +1,13 @@ +args: + zkevm_contracts_image: leovct/zkevm-contracts:v6.0.0-rc.1-fork.9 + zkevm_prover_image: hermeznetwork/zkevm-prover:v6.0.6 + cdk_erigon_node_image: hermeznetwork/cdk-erigon:0948e33 + zkevm_node_image: hermeznetwork/zkevm-node:v0.7.3-RC1 + cdk_validium_node_image: 0xpolygon/cdk-validium-node:0.7.0-cdk + additional_services: + - pless_zkevm_node + - tx_spammer + data_availability_mode: cdk-validium + sequencer_type: zkevm +deployment_stages: + deploy_cdk_erigon_node: false diff --git a/.github/tests/combinations/fork9-legacy-zkevm-stack-rollup.yml b/.github/tests/combinations/fork9-legacy-zkevm-stack-rollup.yml new file mode 100644 index 000000000..e78fb3a47 --- /dev/null +++ b/.github/tests/combinations/fork9-legacy-zkevm-stack-rollup.yml @@ -0,0 +1,13 @@ +args: + zkevm_contracts_image: leovct/zkevm-contracts:v6.0.0-rc.1-fork.9 + zkevm_prover_image: hermeznetwork/zkevm-prover:v6.0.6 + cdk_erigon_node_image: hermeznetwork/cdk-erigon:0948e33 + zkevm_node_image: hermeznetwork/zkevm-node:v0.7.3-RC1 + cdk_validium_node_image: 0xpolygon/cdk-validium-node:0.7.0-cdk + additional_services: + - pless_zkevm_node + - tx_spammer + data_availability_mode: rollup + sequencer_type: zkevm +deployment_stages: + deploy_cdk_erigon_node: false diff --git a/.github/tests/combinations/fork9-new-cdk-stack-cdk-validium.yml b/.github/tests/combinations/fork9-new-cdk-stack-cdk-validium.yml new file mode 100644 index 000000000..43905b8d8 --- /dev/null +++ b/.github/tests/combinations/fork9-new-cdk-stack-cdk-validium.yml @@ -0,0 +1,11 @@ +args: + zkevm_contracts_image: leovct/zkevm-contracts:v6.0.0-rc.1-fork.9 + zkevm_prover_image: hermeznetwork/zkevm-prover:v6.0.6 + cdk_erigon_node_image: hermeznetwork/cdk-erigon:0948e33 + zkevm_node_image: hermeznetwork/zkevm-node:v0.7.3-RC1 + cdk_validium_node_image: 0xpolygon/cdk-validium-node:0.7.0-cdk + additional_services: + - pless_zkevm_node + - tx_spammer + data_availability_mode: cdk-validium + sequencer_type: erigon diff --git a/.github/tests/combinations/fork9-new-cdk-stack-rollup.yml b/.github/tests/combinations/fork9-new-cdk-stack-rollup.yml new file mode 100644 index 000000000..d469af88e --- /dev/null +++ b/.github/tests/combinations/fork9-new-cdk-stack-rollup.yml @@ -0,0 +1,11 @@ +args: + zkevm_contracts_image: leovct/zkevm-contracts:v6.0.0-rc.1-fork.9 + zkevm_prover_image: hermeznetwork/zkevm-prover:v6.0.6 + cdk_erigon_node_image: hermeznetwork/cdk-erigon:0948e33 + zkevm_node_image: hermeznetwork/zkevm-node:v0.7.3-RC1 + cdk_validium_node_image: 0xpolygon/cdk-validium-node:0.7.0-cdk + additional_services: + - pless_zkevm_node + - tx_spammer + data_availability_mode: rollup + sequencer_type: erigon diff --git a/.github/tests/components/legacy-zkevm-stack.yml b/.github/tests/components/legacy-zkevm-stack.yml index 079da85d6..2c8bbfa89 100644 --- a/.github/tests/components/legacy-zkevm-stack.yml +++ b/.github/tests/components/legacy-zkevm-stack.yml @@ -1,6 +1,8 @@ # legacy zkevm stack: # - zkevm-node sequencer # - zkevm-node sequence-sender and aggregator -deploy_cdk_erigon_node: false +deployment_stages: + deploy_cdk_erigon_node: false + args: sequencer_type: zkevm diff --git a/.github/tests/pless-zkevm-node/cardona-sepolia-testnet-pless-zkevm-node.yml b/.github/tests/pless-zkevm-node/cardona-sepolia-testnet-pless-zkevm-node.yml index 6042b9735..ba802ad1e 100644 --- a/.github/tests/pless-zkevm-node/cardona-sepolia-testnet-pless-zkevm-node.yml +++ b/.github/tests/pless-zkevm-node/cardona-sepolia-testnet-pless-zkevm-node.yml @@ -1,10 +1,11 @@ -deploy_l1: false -deploy_zkevm_contracts_on_l1: false -deploy_databases: false -deploy_cdk_central_environment: false -deploy_cdk_bridge_infra: false -deploy_agglayer: false -deploy_cdk_erigon_node: false +deployment_stages: + deploy_l1: false + deploy_zkevm_contracts_on_l1: false + deploy_databases: false + deploy_cdk_central_environment: false + deploy_cdk_bridge_infra: false + deploy_agglayer: false + deploy_cdk_erigon_node: false args: additional_services: diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index c1b0cd3c2..56c8c9d58 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -38,7 +38,10 @@ jobs: - name: Monitor verified batches (CDK Erigon Permissionless RPC) working-directory: .github/scripts - run: ./monitor-verified-batches.sh --rpc-url $(kurtosis port print ${{ env.ENCLAVE_NAME }} cdk-erigon-node-001 rpc) + run: | + ./monitor-verified-batches.sh \ + --enclave ${{ env.ENCLAVE_NAME }} \ + --rpc-url $(kurtosis port print ${{ env.ENCLAVE_NAME }} cdk-erigon-node-001 rpc) - name: Dump enclave logs if: failure() @@ -65,7 +68,7 @@ jobs: - id: set-matrix # List all yml files in the .github/tests directory, as well as test combinations, except for the additional-services.yml file. - run: echo "matrix=$(ls -R params.yml ./.github/tests/combinations/*.yml | grep -v 'additional-services.yml' | jq -R -s -c 'split("\n")[:-1]')" >> $GITHUB_OUTPUT + run: echo "matrix=$(ls -R ./.github/tests/combinations/*.yml | grep -v 'additional-services.yml' | jq -R -s -c 'split("\n")[:-1]')" >> $GITHUB_OUTPUT run-with-args: needs: list-ymls @@ -106,13 +109,17 @@ jobs: exit 1 fi echo "RPC name: $rpc_name" - ./.github/scripts/monitor-verified-batches.sh --rpc-url $(kurtosis port print ${{ env.ENCLAVE_NAME }} $rpc_name rpc) + ./.github/scripts/monitor-verified-batches.sh \ + --enclave ${{ env.ENCLAVE_NAME }} \ + --rpc-url $(kurtosis port print ${{ env.ENCLAVE_NAME }} $rpc_name rpc) - name: Monitor verified batches (zkEVM Permissionless RPC) run: | result=$(yq --raw-output '.args.additional_services // [] | contains(["pless_zkevm_node"])' ${{ matrix.file_name }}) if [[ "$result" == "true" ]]; then - ./.github/scripts/monitor-verified-batches.sh --rpc-url $(kurtosis port print ${{ env.ENCLAVE_NAME }} zkevm-node-rpc-pless-001 rpc) + ./.github/scripts/monitor-verified-batches.sh \ + --enclave ${{ env.ENCLAVE_NAME }} \ + --rpc-url $(kurtosis port print ${{ env.ENCLAVE_NAME }} zkevm-node-rpc-pless-001 rpc) else echo "Skipping batch verification as there is no zkevm permissionless RPC in the environment" fi @@ -150,6 +157,13 @@ jobs: - name: Inspect enclave run: kurtosis enclave inspect ${{ env.ENCLAVE_NAME }} + + - name: Monitor verified batches (CDK Erigon Permissionless RPC) + working-directory: .github/scripts + run: | + ./monitor-verified-batches.sh \ + --enclave ${{ env.ENCLAVE_NAME }} \ + --rpc-url $(kurtosis port print ${{ env.ENCLAVE_NAME }} cdk-erigon-node-001 rpc) - name: Verify Arpeggio RPC run: | @@ -230,12 +244,10 @@ jobs: uses: ./.github/actions/setup-kurtosis-cdk - name: Deploy L1 chain and a first CDK L2 chain (cdk-erigon sequencer + cdk stack) - run: | - kurtosis run --enclave=${{ env.ENCLAVE_NAME }} --show-enclave-inspect=false --args-file=params.yml . + run: kurtosis run --enclave=${{ env.ENCLAVE_NAME }} --show-enclave-inspect=false . - name: Attach a second CDK L2 chain (cdk-erigon sequencer + cdk stack) - run: | - kurtosis run --enclave=${{ env.ENCLAVE_NAME }} --show-enclave-inspect=false --args-file=agglayer-attach-cdk-params.yml . + run: kurtosis run --enclave=${{ env.ENCLAVE_NAME }} --args-file=./.github/tests/attach-second-cdk.yml --show-enclave-inspect=false . - name: Update the agglayer config run: | @@ -250,14 +262,33 @@ jobs: # Restart the agglayer service. kurtosis service stop ${{ env.ENCLAVE_NAME }} agglayer kurtosis service start ${{ env.ENCLAVE_NAME }} agglayer + + - name: Inspect enclave + run: kurtosis enclave inspect ${{ env.ENCLAVE_NAME }} + + - name: Check if there is any stopped service + run: | + if kurtosis enclave inspect ${{ env.ENCLAVE_NAME }} | grep STOPPED ; then + echo "It looks like there is a stopped service in the enclave. Something must have halted" + kurtosis enclave inspect ${{ env.ENCLAVE_NAME }} + kurtosis enclave inspect ${{ env.ENCLAVE_NAME }} --full-uuids | grep STOPPED | awk '{print $2 "--" $1}' \ + | while read -r container; do echo "Printing logs for $container"; docker logs --tail 50 "$container"; done + exit 1 + fi - name: Monitor verified batches of the first L2 chain (CDK Erigon Permissionless RPC) working-directory: .github/scripts - run: ./monitor-verified-batches.sh --rpc-url "$(kurtosis port print ${{ env.ENCLAVE_NAME }} cdk-erigon-node-001 rpc)" + run: | + ./monitor-verified-batches.sh \ + --enclave ${{ env.ENCLAVE_NAME }} \ + --rpc-url "$(kurtosis port print ${{ env.ENCLAVE_NAME }} cdk-erigon-node-001 rpc)" - name: Monitor verified batches of the second L2 chain (CDK Erigon Permissionless RPC) working-directory: .github/scripts - run: ./monitor-verified-batches.sh --rpc-url "$(kurtosis port print ${{ env.ENCLAVE_NAME }} cdk-erigon-node-002 rpc)" + run: | + ./monitor-verified-batches.sh \ + --enclave ${{ env.ENCLAVE_NAME }} \ + --rpc-url "$(kurtosis port print ${{ env.ENCLAVE_NAME }} cdk-erigon-node-002 rpc)" - name: Dump enclave logs if: failure() diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index a113443f2..e616040bc 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -51,15 +51,3 @@ jobs: - name: Run shellcheck run: find . -type f -name '*.sh' | sort | xargs -I {} shellcheck {} - - compare-default-parameters: - runs-on: ubuntu-latest - timeout-minutes: 5 - steps: - - uses: actions/checkout@v4 - - - name: Install yq - run: pip3 install yq - - - name: Compare default parameters - run: .github/scripts/compare-default-params.sh diff --git a/.gitignore b/.gitignore index 61d161952..59b0c14b8 100644 --- a/.gitignore +++ b/.gitignore @@ -3,11 +3,6 @@ bridge-deposits.json claimable-txs.json proof.json -# compare default parameters -.input_parser.star -.kurtosis.yml -.params.yml - # docs .vscode .code diff --git a/README.md b/README.md index d814e8eda..0b190c1cf 100644 --- a/README.md +++ b/README.md @@ -15,11 +15,29 @@ Specifically, this package will deploy: ## Table of Contents - [Getting Started](#getting-started) +- [Supported Configurations](#supported-configurations) - [Advanced Use Cases](#advanced-use-cases) - [Contact](#contact) - [License](#license) - [Contribution](#contribution) +## Supported Configurations + +The package is flexible and supports various configurations for deploying and testing the Polygon CDK stack. The table provided illustrates the different combinations of sequencers and sequence sender/aggregator components that can be used, along with their current support status in Kurtosis. + +> The team is actively working on enabling the use cases that are currently not possible. + +| Stack | Sequencer | Sequence Sender / Aggregator | Supported by Kurtosis? | +| ----- | --------- | ---------------------------- | ---------------------- | +| New CDK stack | [cdk-erigon](https://github.com/0xPolygonHermez/cdk-erigon) | [cdk-node](https://github.com/0xPolygon/cdk) | ✅ | +| New sequencer with new zkevm stack | [cdk-erigon](https://github.com/0xPolygonHermez/cdk-erigon) | [zkevm-sequence-sender](https://github.com/0xPolygonHermez/zkevm-sequence-sender) + [zkevm-aggregator](https://github.com/0xPolygonHermez/zkevm-aggregator) | ❌ (WIP) - Check the [kurtosis-cdk-erigon](https://github.com/xavier-romero/kurtosis-cdk-erigon) package | +| New sequencer with legacy zkevm stack | [cdk-erigon](https://github.com/0xPolygonHermez/cdk-erigon) | [zkevm-node](https://github.com/0xPolygonHermez/zkevm-node) | ❌ (WIP) | +| Legacy sequencer with new cdk stack | [zkevm-node](https://github.com/0xPolygonHermez/zkevm-node) | [cdk-node](https://github.com/0xPolygon/cdk) | ❌ (WIP) | +| Legacy sequencer with new zkevm stack | [zkevm-node](https://github.com/0xPolygonHermez/zkevm-node) | [zkevm-sequence-sender](https://github.com/0xPolygonHermez/zkevm-sequence-sender) + [zkevm-aggregator](https://github.com/0xPolygonHermez/zkevm-aggregator) | ❌ (WIP) | +| Legacy zkevm stack | [zkevm-node](https://github.com/0xPolygonHermez/zkevm-node) | [zkevm-node](https://github.com/0xPolygonHermez/zkevm-node) | ✅ | + +To understand how to configure Kurtosis for these use cases, refer to the [documentation](.github/tests/README.md) and review the test files located in the `.github/tests/` directory. + ## Getting Started ### Prerequisites @@ -35,32 +53,18 @@ If you intend to interact with and debug the stack, you may also want to conside ### Deploy -Once that is good and installed on your system, you can run the following command to deploy the complete CDK stack locally. The default deployment includes zkevm-contracts ([fork 9](https://github.com/0xPolygonHermez/zkevm-contracts/releases/tag/v6.0.0-rc.1-fork.9)), [cdk-erigon](https://github.com/0xPolygonHermez/cdk-erigon) as the sequencer, and [cdk-node](https://github.com/0xPolygon/cdk) functioning as the sequence sender and aggregator. This process typically takes around eight to ten minutes. +Once that is good and installed on your system, you can run the following command to deploy the complete CDK stack locally. This process typically takes around eight to ten minutes. + +The default deployment includes [cdk-erigon](https://github.com/0xPolygonHermez/cdk-erigon) as the sequencer, and [cdk-node](https://github.com/0xPolygon/cdk) functioning as the sequence sender and aggregator. You can verify the default versions of these components and the default fork ID by reviewing input_parser.star. You can check the default versions of the deployed components and the default fork ID by looking at +[input_parser.star](./input_parser.star). ```bash kurtosis clean --all -kurtosis run --enclave cdk-v1 --args-file params.yml . +kurtosis run --enclave cdk . ``` ![CDK Erigon Architecture Diagram](./docs/architecture-diagram/cdk-erigon-architecture-diagram.png) -It is also possible to deploy the CDK stack using the legacy zkevm-node sequencer and/or the new zkevm or the legacy zkevm-node sequencer sender and aggregator by modyfing the configuration file `params.yml`. - -For example, the CDK stack can be alternatively deployed using zkevm-contracts ([fork 9](https://github.com/0xPolygonHermez/zkevm-contracts/releases/tag/v6.0.0-rc.1-fork.9)), with the legacy [zkevm-node](https://github.com/0xPolygonHermez/zkevm-node) serving as the sequencer, sequence sender and aggregator. - -```bash -yq -Y --in-place '.deploy_cdk_erigon_node = false' params.yml -yq -Y --in-place '.args.sequencer_type = "zkevm"' params.yml -kurtosis run --enclave cdk-v1 --args-file params.yml . -``` - -
-Click to view the architecture diagram of the legacy CDK stack - -![zkEVM Node Architecture Diagram](./docs/architecture-diagram/zkevm-node-architecture-diagram.png) - -
- ### Interact Let's do a simple L2 RPC test call. @@ -68,13 +72,15 @@ Let's do a simple L2 RPC test call. First, you will need to figure out which port Kurtosis is using for the RPC. You can get a general feel for the entire network layout by running the following command: ```bash -kurtosis enclave inspect cdk-v1 +kurtosis enclave inspect cdk ``` -That output, while quite useful, might also be a little overwhelming. Let's store the RPC URL in an environment variable. Note that you may need to adjust the various commands slightly if you deployed the legacy [zkevm-node](https://github.com/0xPolygonHermez/zkevm-node) as the sequencer. You should target the `zkevm-node-rpc-001` service instead of `cdk-erigon-node-001`. +That output, while quite useful, might also be a little overwhelming. Let's store the RPC URL in an environment variable. + +> You may need to adjust the various commands slightly if you deployed the legacy [zkevm-node](https://github.com/0xPolygonHermez/zkevm-node) as the sequencer. You should target the `zkevm-node-rpc-001` service instead of `cdk-erigon-node-001`. ```bash -export ETH_RPC_URL="$(kurtosis port print cdk-v1 cdk-erigon-node-001 rpc)" +export ETH_RPC_URL="$(kurtosis port print cdk cdk-erigon-node-001 rpc)" ``` That is the same environment variable that `cast` uses, so you should now be able to run this command. Note that the steps below will assume you have the [Foundry toolchain](https://book.getfoundry.sh/getting-started/installation) installed. @@ -107,13 +113,13 @@ polycli loadtest --rpc-url "$ETH_RPC_URL" --legacy --private-key "$PK" --verbosi Pretty often, you will want to check the output from the service. Here is how you can grab some logs: ```bash -kurtosis service logs cdk-v1 agglayer --follow +kurtosis service logs cdk agglayer --follow ``` In other cases, if you see an error, you might want to get a shell in the service to be able to poke around. ```bash -kurtosis service shell cdk-v1 contracts-001 +kurtosis service shell cdk contracts-001 jq . /opt/zkevm/combined.json ``` @@ -130,7 +136,7 @@ If the number of verified batches is increasing, then it means the system works To access the `zkevm-bridge` user interface, open this URL in your web browser. ```bash -open "$(kurtosis port print cdk-v1 zkevm-bridge-proxy-001 web-ui)" +open "$(kurtosis port print cdk zkevm-bridge-proxy-001 web-ui)" ``` When everything is done, you might want to clean up with this command which stops the local devnet and deletes it. diff --git a/agglayer-attach-cdk-params.yml b/agglayer-attach-cdk-params.yml deleted file mode 100644 index c829bcc52..000000000 --- a/agglayer-attach-cdk-params.yml +++ /dev/null @@ -1,184 +0,0 @@ ---- -# Deployment parameters. -# The deployment process is divided into various stages. - -# Deploy local L1. -deploy_l1: false - -# Deploy zkevm contracts on L1 (and also fund accounts). -deploy_zkevm_contracts_on_l1: true - -# Deploy zkevm node and cdk peripheral databases. -deploy_databases: true - -# Deploy cdk central/trusted environment. -deploy_cdk_central_environment: true - -# Deploy cdk/bridge infrastructure. -deploy_cdk_bridge_infra: true - -# Deploy agglayer. -deploy_agglayer: false - -# Deploy cdk-erigon node. -deploy_cdk_erigon_node: true - -args: - # Suffix appended to service names. - # Note: It should be a string. - deployment_suffix: "-002" - - # The global log level that all components of the stack should log at. - # Valid values are "error", "warn", "info", "debug", and "trace". - global_log_level: info - - # The type of the sequencer to deploy. - # Options: - # - 'erigon': Use the new sequencer (https://github.com/0xPolygonHermez/cdk-erigon). - # - 'zkevm': Use the legacy sequencer (https://github.com/0xPolygonHermez/zkevm-node). - sequencer_type: erigon - - # The type of data availability to use. - # Options: - # - 'rollup': Transaction data is stored on-chain on L1. - # - 'cdk-validium': Transaction data is stored off-chain using the CDK DA layer and a DAC. - # In the future, we would like to support external DA protocols such as Avail, Celestia and Near. - data_availability_mode: cdk-validium - - # Additional services to run alongside the network. - # Options: - # - arpeggio - # - blockscout - # - blutgang - # - erpc - # - pless_zkevm_node - # - prometheus_grafana - # - tx_spammer - additional_services: [] - - # FORK 12 IMAGES - # yq .args .github/tests/forks/fork12.yml - zkevm_contracts_image: leovct/zkevm-contracts:v8.0.0-rc.4-fork.12 - zkevm_prover_image: hermeznetwork/zkevm-prover:v8.0.0-RC12-fork.12 - cdk_erigon_node_image: hermeznetwork/cdk-erigon:0948e33 - - # FORK 11 IMAGES - # yq .args .github/tests/forks/fork11.yml - # zkevm_contracts_image: leovct/zkevm-contracts:v7.0.0-rc.2-fork.11 - # zkevm_prover_image: hermeznetwork/zkevm-prover:v7.0.2-fork.11 - # cdk_erigon_node_image: hermeznetwork/cdk-erigon:acceptance-2.0.0-beta26-0f01107 - - zkevm_node_image: hermeznetwork/zkevm-node:v0.7.3-RC1 - cdk_validium_node_image: 0xpolygon/cdk-validium-node:0.7.0-cdk - - cdk_node_image: ghcr.io/0xpolygon/cdk:0.3.0-beta4 - zkevm_da_image: 0xpolygon/cdk-data-availability:0.0.10 - # agglayer_image: nulyjkdhthz/agglayer-rs:pr-318 - agglayer_image: ghcr.io/agglayer/agglayer-rs:pr-96 - zkevm_bridge_service_image: hermeznetwork/zkevm-bridge-service:v0.6.0-RC1 - zkevm_bridge_ui_image: leovct/zkevm-bridge-ui:multi-network - zkevm_bridge_proxy_image: haproxy:3.0-bookworm - zkevm_sequence_sender_image: hermeznetwork/zkevm-sequence-sender:v0.2.0-RC12 - zkevm_pool_manager_image: hermeznetwork/zkevm-pool-manager:v0.1.1 - - # Port configuration. - zkevm_hash_db_port: 50061 - zkevm_executor_port: 50071 - zkevm_aggregator_port: 50081 - zkevm_pprof_port: 6060 - prometheus_port: 9091 - zkevm_data_streamer_port: 6900 - zkevm_rpc_http_port: 8123 - zkevm_rpc_ws_port: 8133 - zkevm_bridge_rpc_port: 8080 - zkevm_bridge_grpc_port: 9090 - zkevm_bridge_ui_port: 80 - agglayer_port: 4444 - zkevm_dac_port: 8484 - zkevm_pool_manager_port: 8545 - - # Addresses and private keys of the different components. - # They have been generated using the following command: - # polycli wallet inspect --mnemonic 'lab code glass agree maid neutral vessel horror deny frequent favorite soft gate galaxy proof vintage once figure diary virtual scissors marble shrug drop' --addresses 9 | tee keys.txt | jq -r '.Addresses[] | [.ETHAddress, .HexPrivateKey] | @tsv' | awk 'BEGIN{split("sequencer,aggregator,claimtxmanager,timelock,admin,loadtest,agglayer,dac,proofsigner",roles,",")} {print "zkevm_l2_" roles[NR] "_address: \"" $1 "\""; print "zkevm_l2_" roles[NR] "_private_key: \"0x" $2 "\"\n"}' - zkevm_l2_sequencer_address: "0xF4ee37aAc3ccd6B71A4a795700b065d2CA479581" - zkevm_l2_sequencer_private_key: "39fa0e0993fdde70f16434fe5085cc7992bb82aa8acc765acc9f8c79d7751350" - - zkevm_l2_aggregator_address: "0x78DE6D4fD4848d7A79cBB5117FED025e2d482bED" - zkevm_l2_aggregator_private_key: "a624aee34e44e828a03bd8ecbeca5807d9187351e6772995b82c15f5610a4cf2" - - zkevm_l2_claimtxmanager_address: "0xf909b5F902D19CACB8B06c037bEf0a5345E99331" - zkevm_l2_claimtxmanager_private_key: "410affbfff4ba53a8784d3c71f983feeb410d3be0e4f7fec4dba1612bbcc4acf" - - zkevm_l2_timelock_address: "0x901b68102f6C695D62692499EB92e2B02E69A106" - zkevm_l2_timelock_private_key: "58397f0a1789f1d97cb9d9eb986fb05831d18b410b496d7baf66bac9baa7c952" - - zkevm_l2_admin_address: "0xE34aaF64b29273B7D567FCFc40544c014EEe9970" - zkevm_l2_admin_private_key: "0x12d7de8621a77640c9241b2595ba78ce443d05e94090365ab3bb5e19df82c625" - - zkevm_l2_loadtest_address: "0x2d1bd6e35fD386066fDebbf54eb75B436DFa93b4" - zkevm_l2_loadtest_private_key: "c63cd87974fc7742a5f92df58e365517e4ef134864cd8b1d600d1fdf3d3d5049" - - zkevm_l2_agglayer_address: "0x351e560852ee001d5D19b5912a269F849f59479a" - zkevm_l2_agglayer_private_key: "0x1d45f90c0a9814d8b8af968fa0677dab2a8ff0266f33b136e560fe420858a419" - - zkevm_l2_dac_address: "0xfA2542aca48930aae82C9291f1F029a189C6921b" - zkevm_l2_dac_private_key: "3d7ca1abd8651954b6d060e06c2d2cee72cb95252f2ec48c0034c3fb078eecf1" - - zkevm_l2_proofsigner_address: "0x101026E7dADbDd880Bef32884eb63A414C939bb6" - zkevm_l2_proofsigner_private_key: "f46b741e1571a2186b7f4f0a9c6dc25697b36eabbe7ea03da3a3f1b2d060b56c" - - # Keystore password. - zkevm_l2_keystore_password: pSnv6Dh5s9ahuzGzH9RoCDrKAMddaX3m - - ## L1 configuration. - l1_chain_id: 271828 - l1_preallocated_mnemonic: code code code code code code code code code code code quality - l1_funding_amount: 100ether - l1_rpc_url: http://el-1-geth-lighthouse:8545 - l1_ws_url: ws://el-1-geth-lighthouse:8546 - # https://github.com/ethpandaops/ethereum-package/tree/main?tab=readme-ov-file#configuration - l1_additional_services: [ - # blockscout, # block explorer - # dora, # beaconchain explorer - # el_forkmon, # fork monitor tool - ] - l1_preset: minimal - l1_seconds_per_slot: 1 - - ## Rollup configuration. - - # The chain id of the new rollup. - zkevm_rollup_chain_id: 20202 - - # The rollup ID. - # This should increment by 1 with each additional CDKs being created using the rollup manager contract. - zkevm_rollup_id: 2 - - # By default a mock verifier is deployed. Change to true to deploye a real verifier which will require a real prover - zkevm_use_real_verifier: false - - # If erigon is being used as the sequencer, - # This flag will enable a stateless executor to verify the execution of the batches. - erigon_strict_mode: true - - # The address of the rollup manager contract on L1. - # If specified, the rollup data will be retrieved from this contract instead of using the contracts service. - # zkevm_rollup_manager_address: "" - # # The block number at which the rollup manager contract was deployed. - # zkevm_rollup_manager_block_number: 0 - # # The address of the global exit root contract on L2. - # zkevm_global_exit_root_l2_address: "" - # # The address of the Polygon data committee contract on L1. - # polygon_data_committee_address: "" - - polygon_zkevm_explorer: https://explorer.private/ - l1_explorer_url: https://sepolia.etherscan.io/ - - # If this is true, we will automatically deploy an ERC20 contract on - # L1 to be used at the gasTokenAddress - zkevm_use_gas_token_contract: false - - ## Permissionless node configuration. - trusted_sequencer_node_uri: zkevm-node-sequencer-001:6900 - zkevm_aggregator_host: zkevm-node-aggregator-001 - genesis_file: templates/permissionless-node/genesis.json diff --git a/cdk_bridge_infra.star b/cdk_bridge_infra.star index 743682d34..1d0bfe97c 100644 --- a/cdk_bridge_infra.star +++ b/cdk_bridge_infra.star @@ -33,7 +33,7 @@ def run(plan, args): zkevm_bridge_package.start_bridge_ui(plan, args, bridge_ui_config_artifact) # Start the bridge UI reverse proxy. This is only relevant / needed if we have a fake l1 - if args["deploy_l1"]: + if args["use_local_l1"]: proxy_config_artifact = create_reverse_proxy_config_artifact(plan, args) zkevm_bridge_package.start_reverse_proxy(plan, args, proxy_config_artifact) diff --git a/ethereum.star b/ethereum.star index 642934f35..eb66d8732 100644 --- a/ethereum.star +++ b/ethereum.star @@ -19,12 +19,7 @@ def run(plan, args): "preregistered_validator_keys_mnemonic": args[ "l1_preallocated_mnemonic" ], - # This setting reduces the number of seconds per slot on the Beacon chain to, - # allowing for faster progression through slots and epochs. "preset": args["l1_preset"], - # The "minimal" preset will pin up a network with minimal preset. It will take - # approximately 192 seconds to get to finalized epoch vs 1536 seconds with "mainnet" - # preset (default). "seconds_per_slot": args["l1_seconds_per_slot"], }, "additional_services": args["l1_additional_services"], diff --git a/input_parser.star b/input_parser.star index fdf6a35b8..a7c86f451 100644 --- a/input_parser.star +++ b/input_parser.star @@ -1,89 +1,259 @@ constants = import_module("./src/package_io/constants.star") -DEFAULT_ARGS = { - "deployment_suffix": "-001", - "global_log_level": "info", - "sequencer_type": "erigon", - "data_availability_mode": "cdk-validium", - "additional_services": [], - "zkevm_contracts_image": "leovct/zkevm-contracts:v8.0.0-rc.4-fork.12", - "zkevm_prover_image": "hermeznetwork/zkevm-prover:v8.0.0-RC12-fork.12", - "zkevm_node_image": "hermeznetwork/zkevm-node:v0.7.3-RC1", - "cdk_validium_node_image": "0xpolygon/cdk-validium-node:0.7.0-cdk", - "cdk_node_image": "ghcr.io/0xpolygon/cdk:0.3.0-beta4", - "zkevm_da_image": "0xpolygon/cdk-data-availability:0.0.10", +# The deployment process is divided into various stages. +# You can deploy the whole stack and then only deploy a subset of the components to perform an +# an upgrade or to test a new version of a component. +DEFAULT_DEPLOYMENT_STAGES = { + # Deploy a local L1 chain using the ethereum-package. + # Set to false to use an external L1 like Sepolia. + # Note that it will require a few additional parameters. + "deploy_l1": True, + # Deploy zkevm contracts on L1 (as well as fund accounts). + # Set to false to use pre-deployed zkevm contracts. + # Note that it will require a few additional parameters. + "deploy_zkevm_contracts_on_l1": True, + # Deploy databases. + "deploy_databases": True, + # Deploy CDK central/trusted environment. + "deploy_cdk_central_environment": True, + # Deploy CDK bridge infrastructure. + "deploy_cdk_bridge_infra": True, + # Deploy the agglayer. + "deploy_agglayer": True, + # Deploy cdk-erigon node. + # TODO: Remove this parameter to incorporate cdk-erigon inside the central environment. + "deploy_cdk_erigon_node": True, +} + +DEFAULT_IMAGES = { "agglayer_image": "ghcr.io/agglayer/agglayer-rs:pr-96", + "cdk_erigon_node_image": "hermeznetwork/cdk-erigon:0948e33", + "cdk_node_image": "ghcr.io/0xpolygon/cdk:0.3.0-beta4", + "cdk_validium_node_image": "0xpolygon/cdk-validium-node:0.7.0-cdk", + "zkevm_bridge_proxy_image": "haproxy:3.0-bookworm", "zkevm_bridge_service_image": "hermeznetwork/zkevm-bridge-service:v0.6.0-RC1", "zkevm_bridge_ui_image": "leovct/zkevm-bridge-ui:multi-network", - "zkevm_bridge_proxy_image": "haproxy:3.0-bookworm", - "zkevm_sequence_sender_image": "hermeznetwork/zkevm-sequence-sender:v0.2.0-RC12", - "cdk_erigon_node_image": "hermeznetwork/cdk-erigon:0948e33", + "zkevm_contracts_image": "leovct/zkevm-contracts:v8.0.0-rc.4-fork.12", + "zkevm_da_image": "0xpolygon/cdk-data-availability:0.0.10", + "zkevm_node_image": "hermeznetwork/zkevm-node:v0.7.3-RC1", "zkevm_pool_manager_image": "hermeznetwork/zkevm-pool-manager:v0.1.1", - "zkevm_hash_db_port": 50061, - "zkevm_executor_port": 50071, - "zkevm_aggregator_port": 50081, - "zkevm_pprof_port": 6060, + "zkevm_prover_image": "hermeznetwork/zkevm-prover:v8.0.0-RC12-fork.12", + "zkevm_sequence_sender_image": "hermeznetwork/zkevm-sequence-sender:v0.2.0-RC12", +} + +DEFAULT_PORTS = { + "agglayer_port": 4444, "prometheus_port": 9091, - "zkevm_data_streamer_port": 6900, - "zkevm_rpc_http_port": 8123, - "zkevm_rpc_ws_port": 8133, - "zkevm_bridge_rpc_port": 8080, + "zkevm_aggregator_port": 50081, "zkevm_bridge_grpc_port": 9090, + "zkevm_bridge_rpc_port": 8080, "zkevm_bridge_ui_port": 80, - "agglayer_port": 4444, "zkevm_dac_port": 8484, + "zkevm_data_streamer_port": 6900, + "zkevm_executor_port": 50071, + "zkevm_hash_db_port": 50061, "zkevm_pool_manager_port": 8545, - "zkevm_l2_sequencer_address": "0x5b06837A43bdC3dD9F114558DAf4B26ed49842Ed", - "zkevm_l2_sequencer_private_key": "0x183c492d0ba156041a7f31a1b188958a7a22eebadca741a7fe64436092dc3181", - "zkevm_l2_aggregator_address": "0xCae5b68Ff783594bDe1b93cdE627c741722c4D4d", - "zkevm_l2_aggregator_private_key": "0x2857ca0e7748448f3a50469f7ffe55cde7299d5696aedd72cfe18a06fb856970", - "zkevm_l2_claimtxmanager_address": "0x5f5dB0D4D58310F53713eF4Df80ba6717868A9f8", - "zkevm_l2_claimtxmanager_private_key": "0x8d5c9ecd4ba2a195db3777c8412f8e3370ae9adffac222a54a84e116c7f8b934", - "zkevm_l2_timelock_address": "0x130aA39Aa80407BD251c3d274d161ca302c52B7A", - "zkevm_l2_timelock_private_key": "0x80051baf5a0a749296b9dcdb4a38a264d2eea6d43edcf012d20b5560708cf45f", + "zkevm_pprof_port": 6060, + "zkevm_rpc_http_port": 8123, + "zkevm_rpc_ws_port": 8133, +} + +# Addresses and private keys of the different components. +# They have been generated using the following command: +# polycli wallet inspect --mnemonic 'lab code glass agree maid neutral vessel horror deny frequent favorite soft gate galaxy proof vintage once figure diary virtual scissors marble shrug drop' --addresses 9 | tee keys.txt | jq -r '.Addresses[] | [.ETHAddress, .HexPrivateKey] | @tsv' | awk 'BEGIN{split("sequencer,aggregator,claimtxmanager,timelock,admin,loadtest,agglayer,dac,proofsigner",roles,",")} {print "zkevm_l2_" roles[NR] "_address: \"" $1 "\""; print "zkevm_l2_" roles[NR] "_private_key: \"0x" $2 "\"\n"}' +DEFAULT_ACCOUNTS = { + # Admin "zkevm_l2_admin_address": "0xE34aaF64b29273B7D567FCFc40544c014EEe9970", "zkevm_l2_admin_private_key": "0x12d7de8621a77640c9241b2595ba78ce443d05e94090365ab3bb5e19df82c625", - "zkevm_l2_loadtest_address": "0x81457240ff5b49CaF176885ED07e3E7BFbE9Fb81", - "zkevm_l2_loadtest_private_key": "0xd7df6d64c569ffdfe7c56e6b34e7a2bdc7b7583db74512a9ffe26fe07faaa5de", + # Agglayer "zkevm_l2_agglayer_address": "0x351e560852ee001d5D19b5912a269F849f59479a", "zkevm_l2_agglayer_private_key": "0x1d45f90c0a9814d8b8af968fa0677dab2a8ff0266f33b136e560fe420858a419", + # Aggregator + "zkevm_l2_aggregator_address": "0xCae5b68Ff783594bDe1b93cdE627c741722c4D4d", + "zkevm_l2_aggregator_private_key": "0x2857ca0e7748448f3a50469f7ffe55cde7299d5696aedd72cfe18a06fb856970", + # L2 claim transaction manager + "zkevm_l2_claimtxmanager_address": "0x5f5dB0D4D58310F53713eF4Df80ba6717868A9f8", + "zkevm_l2_claimtxmanager_private_key": "0x8d5c9ecd4ba2a195db3777c8412f8e3370ae9adffac222a54a84e116c7f8b934", + # L2 data availability committee "zkevm_l2_dac_address": "0x5951F5b2604c9B42E478d5e2B2437F44073eF9A6", "zkevm_l2_dac_private_key": "0x85d836ee6ea6f48bae27b31535e6fc2eefe056f2276b9353aafb294277d8159b", + # L2 loadtester + "zkevm_l2_loadtest_address": "0x81457240ff5b49CaF176885ED07e3E7BFbE9Fb81", + "zkevm_l2_loadtest_private_key": "0xd7df6d64c569ffdfe7c56e6b34e7a2bdc7b7583db74512a9ffe26fe07faaa5de", + # L2 proof signer "zkevm_l2_proofsigner_address": "0x7569cc70950726784c8D3bB256F48e43259Cb445", "zkevm_l2_proofsigner_private_key": "0x77254a70a02223acebf84b6ed8afddff9d3203e31ad219b2bf900f4780cf9b51", - "zkevm_l2_keystore_password": "pSnv6Dh5s9ahuzGzH9RoCDrKAMddaX3m", + # L2 sequencer + "zkevm_l2_sequencer_address": "0x5b06837A43bdC3dD9F114558DAf4B26ed49842Ed", + "zkevm_l2_sequencer_private_key": "0x183c492d0ba156041a7f31a1b188958a7a22eebadca741a7fe64436092dc3181", + # L2 timelock + "zkevm_l2_timelock_address": "0x130aA39Aa80407BD251c3d274d161ca302c52B7A", + "zkevm_l2_timelock_private_key": "0x80051baf5a0a749296b9dcdb4a38a264d2eea6d43edcf012d20b5560708cf45f", +} + +DEFAULT_L1_ARGS = { + # The L1 network identifier. "l1_chain_id": 271828, + # This mnemonic will: + # a) be used to create keystores for all the types of validators that we have, and + # b) be used to generate a CL genesis.ssz that has the children validator keys already + # preregistered as validators "l1_preallocated_mnemonic": "code code code code code code code code code code code quality", - "l1_funding_amount": "100ether", + # The L1 HTTP RPC endpoint. "l1_rpc_url": "http://el-1-geth-lighthouse:8545", + # The L1 WS RPC endpoint. "l1_ws_url": "ws://el-1-geth-lighthouse:8546", + # The additional services to spin up. + # Default: [] + # Options: + # - assertoor + # - broadcaster + # - tx_spammer + # - blob_spammer + # - custom_flood + # - goomy_blob + # - el_forkmon + # - blockscout + # - beacon_metrics_gazer + # - dora + # - full_beaconchain_explorer + # - prometheus_grafana + # - blobscan + # - dugtrio + # - blutgang + # - forky + # - apache + # - tracoor + # Check the ethereum-package for more details: https://github.com/ethpandaops/ethereum-package "l1_additional_services": [], + # Preset for the network. + # Default: "mainnet" + # Options: + # - mainnet + # - minimal + # "minimal" preset will spin up a network with minimal preset. This is useful for rapid testing and development. + # 192 seconds to get to finalized epoch vs 1536 seconds with mainnet defaults + # Please note that minimal preset requires alternative client images. "l1_preset": "minimal", + # Number of seconds per slot on the Beacon chain + # Default: 12 "l1_seconds_per_slot": 1, + # The amount of ETH sent to the admin, sequence, aggregator and sequencer addresses. + "l1_funding_amount": "100ether", +} + +DEFAULT_ROLLUP_ARGS = { + # The keystore password. + "zkevm_l2_keystore_password": "pSnv6Dh5s9ahuzGzH9RoCDrKAMddaX3m", + # The rollup network identifier. "zkevm_rollup_chain_id": 10101, + # The unique identifier for the rollup within the RollupManager contract. + # This setting sets the rollup as the first rollup. "zkevm_rollup_id": 1, + # By default a mock verifier is deployed. + # Change to true to deploy a real verifier which will require a real prover. + # Note: This will require a lot of memory to run! "zkevm_use_real_verifier": False, + # This flag will enable a stateless executor to verify the execution of the batches. + # Set to true to run erigon as the sequencer. "erigon_strict_mode": True, - "polygon_zkevm_explorer": "https://explorer.private/", - "l1_explorer_url": "https://sepolia.etherscan.io/", + # Set to true to automatically deploy an ERC20 contract on L1 to be used as the gas token on the rollup. "zkevm_use_gas_token_contract": False, +} + +DEFAULT_PLESS_ZKEVM_NODE_ARGS = { "trusted_sequencer_node_uri": "zkevm-node-sequencer-001:6900", "zkevm_aggregator_host": "zkevm-node-aggregator-001", "genesis_file": "templates/permissionless-node/genesis.json", } +DEFAULT_ARGS = ( + { + # Suffix appended to service names. + # Note: It should be a string. + "deployment_suffix": "-001", + # The global log level that all components of the stack should log at. + # Valid values are "error", "warn", "info", "debug", and "trace". + "global_log_level": "info", + # The type of the sequencer to deploy. + # Options: + # - 'erigon': Use the new sequencer (https://github.com/0xPolygonHermez/cdk-erigon). + # - 'zkevm': Use the legacy sequencer (https://github.com/0xPolygonHermez/zkevm-node). + "sequencer_type": "erigon", + # The type of data availability to use. + # Options: + # - 'rollup': Transaction data is stored on-chain on L1. + # - 'cdk-validium': Transaction data is stored off-chain using the CDK DA layer and a DAC. + # In the future, we would like to support external DA protocols such as Avail, Celestia and Near. + "data_availability_mode": "cdk-validium", + # Additional services to run alongside the network. + # Options: + # - arpeggio + # - blockscout + # - blutgang + # - erpc + # - pless_zkevm_node + # - prometheus_grafana + # - tx_spammer + "additional_services": [], + # Only relevant when deploying to an external L1. + "polygon_zkevm_explorer": "https://explorer.private/", + "l1_explorer_url": "https://sepolia.etherscan.io/", + } + | DEFAULT_IMAGES + | DEFAULT_PORTS + | DEFAULT_ACCOUNTS + | DEFAULT_L1_ARGS + | DEFAULT_ROLLUP_ARGS + | DEFAULT_PLESS_ZKEVM_NODE_ARGS +) + # A list of fork identifiers currently supported by Kurtosis CDK. SUPPORTED_FORK_IDS = [9, 11, 12] -def parse_args(args): - args = DEFAULT_ARGS | args - validate_global_log_level(args["global_log_level"]) - fork_id = get_fork_id(args["zkevm_contracts_image"]) - return args | { +def parse_args(plan, args): + # Merge the provided args with defaults. + deployment_stages = DEFAULT_DEPLOYMENT_STAGES | args.get("deployment_stages", {}) + args = DEFAULT_ARGS | args.get("args", {}) + + # Validation step. + global_log_level = args.get("global_log_level", "") + validate_global_log_level(global_log_level) + + # Determine fork id from the zkevm contracts image tag. + zkevm_contracts_image = args.get("zkevm_contracts_image", "") + fork_id = get_fork_id(zkevm_contracts_image) + + # Determine sequencer and l2 rpc names. + sequencer_type = args.get("sequencer_type", "") + sequencer_name = get_sequencer_name(sequencer_type) + + plan.print( + "DEBUG: " + str(deployment_stages.get("deploy_cdk_erigon_node", False)) + ) # DEBUG + deploy_cdk_erigon_node = deployment_stages.get("deploy_cdk_erigon_node", False) + l2_rpc_name = get_l2_rpc_name(deploy_cdk_erigon_node) + + # Remove deployment stages from the args struct. + # This prevents updating already deployed services when updating the deployment stages. + if "deployment_stages" in args: + args.pop("deployment_stages") + + args = args | { + "l2_rpc_name": l2_rpc_name, + "sequencer_name": sequencer_name, "zkevm_rollup_fork_id": fork_id, + "deploy_agglayer": deployment_stages.get( + "deploy_agglayer", False + ), # hacky but works fine for now. } + # Sort dictionaries for debug purposes. + sorted_deployment_stages = sort_dict_by_values(deployment_stages) + sorted_args = sort_dict_by_values(args) + return (sorted_deployment_stages, sorted_args) + def validate_global_log_level(global_log_level): if global_log_level not in ( @@ -133,3 +303,30 @@ def get_fork_id(zkevm_contracts_image): if fork_id not in SUPPORTED_FORK_IDS: fail("The fork id '{}' is not supported by Kurtosis CDK".format(fork_id)) return fork_id + + +def get_sequencer_name(sequencer_type): + if sequencer_type == constants.SEQUENCER_TYPE.CDK_ERIGON: + return constants.SEQUENCER_NAME.CDK_ERIGON + elif sequencer_type == constants.SEQUENCER_TYPE.ZKEVM: + return constants.SEQUENCER_NAME.ZKEVM + else: + fail( + "Unsupported sequencer type: '{}', please use '{}' or '{}'".format( + sequencer_type, + constants.SEQUENCER_TYPE.CDK_ERIGON, + constants.SEQUENCER_TYPE.ZKEVM, + ) + ) + + +def get_l2_rpc_name(deploy_cdk_erigon_node): + if deploy_cdk_erigon_node: + return "cdk-erigon-node" + else: + return "zkevm-node-rpc" + + +def sort_dict_by_values(d): + sorted_items = sorted(d.items(), key=lambda x: x[0]) + return {k: v for k, v in sorted_items} diff --git a/main.star b/main.star index c698aa579..a24081fdc 100644 --- a/main.star +++ b/main.star @@ -1,14 +1,17 @@ +constants = import_module("./src/package_io/constants.star") +input_parser = import_module("./input_parser.star") + +# Main service packages. +agglayer_package = "./agglayer.star" cdk_bridge_infra_package = "./cdk_bridge_infra.star" cdk_central_environment_package = "./cdk_central_environment.star" -cdk_erigon_package = import_module("./cdk_erigon.star") +cdk_erigon_package = "./cdk_erigon.star" databases_package = "./databases.star" deploy_zkevm_contracts_package = "./deploy_zkevm_contracts.star" ethereum_package = "./ethereum.star" -input_parser = "./input_parser.star" -zkevm_pool_manager_package = import_module("./zkevm_pool_manager.star") -agglayer_package = "./agglayer.star" +zkevm_pool_manager_package = "./zkevm_pool_manager.star" -# Additional services packages. +# Additional service packages. arpeggio_package = "./src/additional_services/arpeggio.star" blockscout_package = "./src/additional_services/blockscout.star" blutgang_package = "./src/additional_services/blutgang.star" @@ -20,43 +23,21 @@ prometheus_package = "./src/additional_services/prometheus.star" tx_spammer_package = "./src/additional_services/tx_spammer.star" -TX_SPAMMER_IMG = "leovct/toolbox:0.0.3" - - -def run( - plan, - deploy_l1=True, - deploy_zkevm_contracts_on_l1=True, - deploy_databases=True, - deploy_cdk_central_environment=True, - deploy_cdk_bridge_infra=True, - deploy_agglayer=True, - deploy_cdk_erigon_node=True, - args={}, -): - args = import_module(input_parser).parse_args(args) - args = args | {"deploy_agglayer": deploy_agglayer} # hacky but works fine for now. - plan.print("Deploying CDK environment with parameters: " + str(args)) - - if deploy_cdk_erigon_node: - args["l2_rpc_name"] = "cdk-erigon-node" - else: - args["l2_rpc_name"] = "zkevm-node-rpc" - - if args["sequencer_type"] == "erigon": - args["sequencer_name"] = "cdk-erigon-sequencer" - else: - args["sequencer_name"] = "zkevm-node-sequencer" +def run(plan, args={}): + # Parse args. + (deployment_stages, args) = input_parser.parse_args(plan, args) + plan.print("Deploying the following components: " + str(deployment_stages)) + plan.print("Deploying CDK stack with the following configuration: " + str(args)) # Deploy a local L1. - if deploy_l1: + if deployment_stages.get("deploy_l1", False): plan.print("Deploying a local L1") import_module(ethereum_package).run(plan, args) else: plan.print("Skipping the deployment of a local L1") # Deploy zkevm contracts on L1. - if deploy_zkevm_contracts_on_l1: + if deployment_stages.get("deploy_zkevm_contracts_on_l1", False): plan.print("Deploying zkevm contracts on L1") import_module(deploy_zkevm_contracts_package).run(plan, args) else: @@ -75,7 +56,7 @@ def run( plan.print("Skipping the deployment of helper service to retrieve rollup data") # Deploy databases. - if deploy_databases: + if deployment_stages.get("deploy_databases", False): plan.print("Deploying databases") import_module(databases_package).run( plan, @@ -87,7 +68,7 @@ def run( # Get the genesis file. genesis_artifact = "" - if deploy_cdk_central_environment: + if deployment_stages.get("deploy_cdk_central_environment", False): plan.print("Getting genesis file...") genesis_artifact = plan.store_service_files( name="genesis", @@ -96,26 +77,26 @@ def run( ) # Deploy cdk central/trusted environment. - if deploy_cdk_central_environment: + if deployment_stages.get("deploy_cdk_central_environment", False): # Deploy cdk-erigon sequencer node. # TODO this is a little weird if the erigon sequencer is deployed before the exector? if args["sequencer_type"] == "erigon": plan.print("Deploying cdk-erigon sequencer") - cdk_erigon_package.run_sequencer(plan, args) + import_module(cdk_erigon_package).run_sequencer(plan, args) else: plan.print("Skipping the deployment of cdk-erigon sequencer") # Deploy zkevm-pool-manager service. - if deploy_cdk_erigon_node: + if deployment_stages.get("deploy_cdk_erigon_node", False): plan.print("Deploying zkevm-pool-manager service") - zkevm_pool_manager_package.run_zkevm_pool_manager(plan, args) + import_module(zkevm_pool_manager_package).run_zkevm_pool_manager(plan, args) else: plan.print("Skipping the deployment of zkevm-pool-manager service") # Deploy cdk-erigon node. - if deploy_cdk_erigon_node: + if deployment_stages.get("deploy_cdk_erigon_node", False): plan.print("Deploying cdk-erigon node") - cdk_erigon_package.run_rpc(plan, args) + import_module(cdk_erigon_package).run_rpc(plan, args) else: plan.print("Skipping the deployment of cdk-erigon node") @@ -129,15 +110,16 @@ def run( plan.print("Skipping the deployment of cdk central/trusted environment") # Deploy cdk/bridge infrastructure. - if deploy_cdk_bridge_infra: + if deployment_stages.get("deploy_cdk_bridge_infra", False): plan.print("Deploying cdk/bridge infrastructure") - args["deploy_l1"] = deploy_l1 - import_module(cdk_bridge_infra_package).run(plan, args) + import_module(cdk_bridge_infra_package).run( + plan, args | {"use_local_l1": deployment_stages.get("deploy_l1", False)} + ) else: plan.print("Skipping the deployment of cdk/bridge infrastructure") # Deploy the agglayer. - if deploy_agglayer: + if deployment_stages.get("deploy_agglayer", False): plan.print("Deploying the agglayer") import_module(agglayer_package).run(plan, args) else: @@ -202,7 +184,7 @@ def deploy_helper_service(plan, args): plan.add_service( name=helper_service_name, config=ServiceConfig( - image=TX_SPAMMER_IMG, + image=constants.TX_SPAMMER_IMG, files={"/opt/zkevm": get_rollup_info_artifact}, # These two lines are only necessary to deploy to any Kubernetes environment (e.g. GKE). entrypoint=["bash", "-c"], diff --git a/params.yml b/params.yml deleted file mode 100644 index 5a173d89c..000000000 --- a/params.yml +++ /dev/null @@ -1,183 +0,0 @@ ---- -# Deployment parameters. -# The deployment process is divided into various stages. - -# Deploy local L1. -deploy_l1: true - -# Deploy zkevm contracts on L1 (and also fund accounts). -deploy_zkevm_contracts_on_l1: true - -# Deploy zkevm node and cdk peripheral databases. -deploy_databases: true - -# Deploy cdk central/trusted environment. -deploy_cdk_central_environment: true - -# Deploy cdk/bridge infrastructure. -deploy_cdk_bridge_infra: true - -# Deploy agglayer. -deploy_agglayer: true - -# Deploy cdk-erigon node. -deploy_cdk_erigon_node: true - -args: - # Suffix appended to service names. - # Note: It should be a string. - deployment_suffix: "-001" - - # The global log level that all components of the stack should log at. - # Valid values are "error", "warn", "info", "debug", and "trace". - global_log_level: info - - # The type of the sequencer to deploy. - # Options: - # - 'erigon': Use the new sequencer (https://github.com/0xPolygonHermez/cdk-erigon). - # - 'zkevm': Use the legacy sequencer (https://github.com/0xPolygonHermez/zkevm-node). - sequencer_type: erigon - - # The type of data availability to use. - # Options: - # - 'rollup': Transaction data is stored on-chain on L1. - # - 'cdk-validium': Transaction data is stored off-chain using the CDK DA layer and a DAC. - # In the future, we would like to support external DA protocols such as Avail, Celestia and Near. - data_availability_mode: cdk-validium - - # Additional services to run alongside the network. - # Options: - # - arpeggio - # - blockscout - # - blutgang - # - erpc - # - pless_zkevm_node - # - prometheus_grafana - # - tx_spammer - additional_services: [] - - # FORK 12 IMAGES - # yq .args .github/tests/forks/fork12.yml - zkevm_contracts_image: leovct/zkevm-contracts:v8.0.0-rc.4-fork.12 - zkevm_prover_image: hermeznetwork/zkevm-prover:v8.0.0-RC12-fork.12 - cdk_erigon_node_image: hermeznetwork/cdk-erigon:0948e33 - - # FORK 11 IMAGES - # yq .args .github/tests/forks/fork11.yml - # zkevm_contracts_image: leovct/zkevm-contracts:v7.0.0-rc.2-fork.11 - # zkevm_prover_image: hermeznetwork/zkevm-prover:v7.0.2-fork.11 - # cdk_erigon_node_image: hermeznetwork/cdk-erigon:acceptance-2.0.0-beta26-0f01107 - - zkevm_node_image: hermeznetwork/zkevm-node:v0.7.3-RC1 - cdk_validium_node_image: 0xpolygon/cdk-validium-node:0.7.0-cdk - - cdk_node_image: ghcr.io/0xpolygon/cdk:0.3.0-beta4 - zkevm_da_image: 0xpolygon/cdk-data-availability:0.0.10 - # agglayer_image: nulyjkdhthz/agglayer-rs:pr-318 - agglayer_image: ghcr.io/agglayer/agglayer-rs:pr-96 - zkevm_bridge_service_image: hermeznetwork/zkevm-bridge-service:v0.6.0-RC1 - zkevm_bridge_ui_image: leovct/zkevm-bridge-ui:multi-network - zkevm_bridge_proxy_image: haproxy:3.0-bookworm - zkevm_sequence_sender_image: hermeznetwork/zkevm-sequence-sender:v0.2.0-RC12 - zkevm_pool_manager_image: hermeznetwork/zkevm-pool-manager:v0.1.1 - - # Port configuration. - zkevm_hash_db_port: 50061 - zkevm_executor_port: 50071 - zkevm_aggregator_port: 50081 - zkevm_pprof_port: 6060 - prometheus_port: 9091 - zkevm_data_streamer_port: 6900 - zkevm_rpc_http_port: 8123 - zkevm_rpc_ws_port: 8133 - zkevm_bridge_rpc_port: 8080 - zkevm_bridge_grpc_port: 9090 - zkevm_bridge_ui_port: 80 - agglayer_port: 4444 - zkevm_dac_port: 8484 - zkevm_pool_manager_port: 8545 - - # Addresses and private keys of the different components. - # They have been generated using the following command: - # polycli wallet inspect --mnemonic 'lab code glass agree maid neutral vessel horror deny frequent favorite soft gate galaxy proof vintage once figure diary virtual scissors marble shrug drop' --addresses 9 | tee keys.txt | jq -r '.Addresses[] | [.ETHAddress, .HexPrivateKey] | @tsv' | awk 'BEGIN{split("sequencer,aggregator,claimtxmanager,timelock,admin,loadtest,agglayer,dac,proofsigner",roles,",")} {print "zkevm_l2_" roles[NR] "_address: \"" $1 "\""; print "zkevm_l2_" roles[NR] "_private_key: \"0x" $2 "\"\n"}' - zkevm_l2_sequencer_address: "0x5b06837A43bdC3dD9F114558DAf4B26ed49842Ed" - zkevm_l2_sequencer_private_key: "0x183c492d0ba156041a7f31a1b188958a7a22eebadca741a7fe64436092dc3181" - - zkevm_l2_aggregator_address: "0xCae5b68Ff783594bDe1b93cdE627c741722c4D4d" - zkevm_l2_aggregator_private_key: "0x2857ca0e7748448f3a50469f7ffe55cde7299d5696aedd72cfe18a06fb856970" - - zkevm_l2_claimtxmanager_address: "0x5f5dB0D4D58310F53713eF4Df80ba6717868A9f8" - zkevm_l2_claimtxmanager_private_key: "0x8d5c9ecd4ba2a195db3777c8412f8e3370ae9adffac222a54a84e116c7f8b934" - - zkevm_l2_timelock_address: "0x130aA39Aa80407BD251c3d274d161ca302c52B7A" - zkevm_l2_timelock_private_key: "0x80051baf5a0a749296b9dcdb4a38a264d2eea6d43edcf012d20b5560708cf45f" - - zkevm_l2_admin_address: "0xE34aaF64b29273B7D567FCFc40544c014EEe9970" - zkevm_l2_admin_private_key: "0x12d7de8621a77640c9241b2595ba78ce443d05e94090365ab3bb5e19df82c625" - - zkevm_l2_loadtest_address: "0x81457240ff5b49CaF176885ED07e3E7BFbE9Fb81" - zkevm_l2_loadtest_private_key: "0xd7df6d64c569ffdfe7c56e6b34e7a2bdc7b7583db74512a9ffe26fe07faaa5de" - - zkevm_l2_agglayer_address: "0x351e560852ee001d5D19b5912a269F849f59479a" - zkevm_l2_agglayer_private_key: "0x1d45f90c0a9814d8b8af968fa0677dab2a8ff0266f33b136e560fe420858a419" - - zkevm_l2_dac_address: "0x5951F5b2604c9B42E478d5e2B2437F44073eF9A6" - zkevm_l2_dac_private_key: "0x85d836ee6ea6f48bae27b31535e6fc2eefe056f2276b9353aafb294277d8159b" - - zkevm_l2_proofsigner_address: "0x7569cc70950726784c8D3bB256F48e43259Cb445" - zkevm_l2_proofsigner_private_key: "0x77254a70a02223acebf84b6ed8afddff9d3203e31ad219b2bf900f4780cf9b51" - - # Keystore password. - zkevm_l2_keystore_password: pSnv6Dh5s9ahuzGzH9RoCDrKAMddaX3m - - ## L1 configuration. - l1_chain_id: 271828 - l1_preallocated_mnemonic: code code code code code code code code code code code quality - l1_funding_amount: 100ether - l1_rpc_url: http://el-1-geth-lighthouse:8545 - l1_ws_url: ws://el-1-geth-lighthouse:8546 - # https://github.com/ethpandaops/ethereum-package/tree/main?tab=readme-ov-file#configuration - l1_additional_services: [ - # blockscout, # block explorer - # dora, # beaconchain explorer - # el_forkmon, # fork monitor tool - ] - l1_preset: minimal - l1_seconds_per_slot: 1 - - ## Rollup configuration. - - # The chain id of the new rollup. - zkevm_rollup_chain_id: 10101 - - # The rollupID of the CDK. - zkevm_rollup_id: 1 - - # By default a mock verifier is deployed. Change to true to deploye a real verifier which will require a real prover - zkevm_use_real_verifier: false - - # If erigon is being used as the sequencer, - # This flag will enable a stateless executor to verify the execution of the batches. - erigon_strict_mode: true - - # The address of the rollup manager contract on L1. - # If specified, the rollup data will be retrieved from this contract instead of using the contracts service. - # zkevm_rollup_manager_address: "" - # # The block number at which the rollup manager contract was deployed. - # zkevm_rollup_manager_block_number: 0 - # # The address of the global exit root contract on L2. - # zkevm_global_exit_root_l2_address: "" - # # The address of the Polygon data committee contract on L1. - # polygon_data_committee_address: "" - - polygon_zkevm_explorer: https://explorer.private/ - l1_explorer_url: https://sepolia.etherscan.io/ - - # If this is true, we will automatically deploy an ERC20 contract on - # L1 to be used at the gasTokenAddress - zkevm_use_gas_token_contract: false - - ## Permissionless node configuration. - trusted_sequencer_node_uri: zkevm-node-sequencer-001:6900 - zkevm_aggregator_host: zkevm-node-aggregator-001 - genesis_file: templates/permissionless-node/genesis.json diff --git a/scripts/reset_postgres.sh b/scripts/reset_postgres.sh index 45c98b263..0781546bc 100755 --- a/scripts/reset_postgres.sh +++ b/scripts/reset_postgres.sh @@ -7,7 +7,7 @@ # 1. kurtosis clean --all (clear existing resources) # 2. update PGPASSWORD, PGUSER, and PGHOST params per your use case (modify configs) # 3. run ./scripts/reset_postgres.sh (drop/recreate dbs and permissions) -# 4. kurtosis run --enclave cdk-v1 --args-file params.yml . (deploy with fresh dbs) +# 4. kurtosis run --enclave cdk-v1 . (deploy with fresh dbs) DB_NAMES=("event_db" "pool_db" "prover_db" "state_db" "bridge_db" "dac_db" "pool_manager_db") DB_USERS=("event_user" "pool_user" "prover_user" "state_user" "bridge_user" "dac_user" "pool_manager_user") diff --git a/src/additional_services/tx_spammer.star b/src/additional_services/tx_spammer.star index 7dc4a017e..514e31fe6 100644 --- a/src/additional_services/tx_spammer.star +++ b/src/additional_services/tx_spammer.star @@ -1,14 +1,13 @@ +constants = import_module("../../src/package_io/constants.star") service_package = import_module("../../lib/service.star") -TX_SPAMMER_IMG = "leovct/toolbox:0.0.2" - def run(plan, args): tx_spammer_config_artifacts = get_tx_spammer_config(plan, args) plan.add_service( name="tx-spammer" + args["deployment_suffix"], config=ServiceConfig( - image=TX_SPAMMER_IMG, + image=constants.TX_SPAMMER_IMG, files={ "/opt/scripts": Directory(artifact_names=[tx_spammer_config_artifacts]), }, @@ -28,11 +27,9 @@ def get_tx_spammer_config(plan, args): contract_setup_addresses = service_package.get_contract_setup_addresses(plan, args) - zkevm_rpc_service = plan.get_service( - args["l2_rpc_name"] + args["deployment_suffix"] - ) - zkevm_rpc_url = "http://{}:{}".format( - zkevm_rpc_service.ip_address, zkevm_rpc_service.ports["rpc"].number + l2_rpc_service = plan.get_service(args["l2_rpc_name"] + args["deployment_suffix"]) + l2_rpc_url = "http://{}:{}".format( + l2_rpc_service.ip_address, l2_rpc_service.ports["rpc"].number ) zkevm_bridge_service = plan.get_service( @@ -48,7 +45,7 @@ def get_tx_spammer_config(plan, args): "spam.sh": struct( template=spam_script_template, data={ - "rpc_url": zkevm_rpc_url, + "rpc_url": l2_rpc_url, "private_key": args["zkevm_l2_admin_private_key"], }, ), @@ -58,7 +55,7 @@ def get_tx_spammer_config(plan, args): "zkevm_l2_admin_private_key": args["zkevm_l2_admin_private_key"], "zkevm_l2_admin_address": args["zkevm_l2_admin_address"], "l1_rpc_url": args["l1_rpc_url"], - "l2_rpc_url": zkevm_rpc_url, + "l2_rpc_url": l2_rpc_url, "zkevm_bridge_api_url": zkevm_bridge_api_url, } | contract_setup_addresses, diff --git a/src/package_io/constants.star b/src/package_io/constants.star index f0cbf6ff8..4ddb45397 100644 --- a/src/package_io/constants.star +++ b/src/package_io/constants.star @@ -5,3 +5,15 @@ GLOBAL_LOG_LEVEL = struct( debug="debug", trace="trace", ) + +SEQUENCER_TYPE = struct( + CDK_ERIGON="erigon", + ZKEVM="zkevm", +) + +SEQUENCER_NAME = struct( + CDK_ERIGON="cdk-erigon-sequencer", + ZKEVM="zkevm-node-sequencer", +) + +TX_SPAMMER_IMG = "leovct/toolbox:0.0.4"