From 71c870dfbc3694196f6837b50e2ab4c6ecf3819a Mon Sep 17 00:00:00 2001 From: dan moore Date: Wed, 10 Jul 2024 10:56:57 -0500 Subject: [PATCH 01/17] revert regression git action changes --- .../monitor-cdk-verified-batches/action.yml | 21 -------- .../batch_verification_monitor.sh | 44 --------------- .github/actions/setup-kurtosis-cdk/action.yml | 33 ------------ action.yml | 53 ++++++++++++++----- 4 files changed, 40 insertions(+), 111 deletions(-) delete mode 100644 .github/actions/monitor-cdk-verified-batches/action.yml delete mode 100755 .github/actions/monitor-cdk-verified-batches/batch_verification_monitor.sh delete mode 100644 .github/actions/setup-kurtosis-cdk/action.yml diff --git a/.github/actions/monitor-cdk-verified-batches/action.yml b/.github/actions/monitor-cdk-verified-batches/action.yml deleted file mode 100644 index 83372bd7..00000000 --- a/.github/actions/monitor-cdk-verified-batches/action.yml +++ /dev/null @@ -1,21 +0,0 @@ ---- -name: monitor-cdk-verified-batches -description: Check that batches are being verified in a CDK environment - -inputs: - verified_batches_target: - description: The minimum number of batches to be verified - required: false - default: '30' - timeout: - description: The script timeout in seconds - required: false - default: '600' # 10 minutes - -runs: - using: "composite" - steps: - - name: Check that batches are being verified - working-directory: .github/actions/monitor-cdk-verified-batches - shell: bash - run: ./batch_verification_monitor.sh ${{ inputs.verified_batches_target }} ${{ inputs.timeout }} diff --git a/.github/actions/monitor-cdk-verified-batches/batch_verification_monitor.sh b/.github/actions/monitor-cdk-verified-batches/batch_verification_monitor.sh deleted file mode 100755 index 1f6be669..00000000 --- a/.github/actions/monitor-cdk-verified-batches/batch_verification_monitor.sh +++ /dev/null @@ -1,44 +0,0 @@ -#!/bin/bash - -# This script monitors the verification progress of zkEVM batches. - -# Check if the required arguments are provided. -if [ "$#" -lt 2 ]; then - echo "Usage: $0 [rpc_service]" - exit 1 -fi - -# The number of batches to be verified. -verified_batches_target="$1" - -# The script timeout (in seconds). -timeout="$2" - -# Name of RPC service to query -rpc_service="$3" - -if [[ -z "$rpc_service" ]]; then - rpc_service="zkevm-node-rpc-001" -fi - -start_time=$(date +%s) -end_time=$((start_time + timeout)) - -rpc_url="$(kurtosis port print cdk-v1 $rpc_service http-rpc)" -while true; do - verified_batches="$(cast to-dec "$(cast rpc --rpc-url "$rpc_url" zkevm_verifiedBatchNumber | sed 's/"//g')")" - echo "[$(date '+%Y-%m-%d %H:%M:%S')] Verified Batches: $verified_batches" - - current_time=$(date +%s) - if (( current_time > end_time )); then - echo "[$(date '+%Y-%m-%d %H:%M:%S')] ❌ Exiting... Timeout reached!" - exit 1 - fi - - if (( verified_batches > verified_batches_target )); then - echo "[$(date '+%Y-%m-%d %H:%M:%S')] ✅ Exiting... $verified_batches batches were verified!" - exit 0 - fi - - sleep 10 -done \ No newline at end of file diff --git a/.github/actions/setup-kurtosis-cdk/action.yml b/.github/actions/setup-kurtosis-cdk/action.yml deleted file mode 100644 index fa04daaf..00000000 --- a/.github/actions/setup-kurtosis-cdk/action.yml +++ /dev/null @@ -1,33 +0,0 @@ ---- -name: kurtosis-cdk-setup -description: Install tools to deploy the CDK stack with Kurtosis - -inputs: - kurtosis-version: - description: The version of kurtosis - required: false - default: '0.90.1' # https://github.com/kurtosis-tech/kurtosis/releases - -runs: - using: "composite" - steps: - - name: Install kurtosis - shell: bash - run: | - echo "deb [trusted=yes] https://apt.fury.io/kurtosis-tech/ /" | sudo tee /etc/apt/sources.list.d/kurtosis.list - sudo apt update - sudo apt install kurtosis-cli=${{ inputs.kurtosis-version }} - kurtosis version - - - name: Disable kurtosis analytics - shell: bash - run: kurtosis analytics disable - - - name: Install yq - shell: bash - run: | - pip3 install yq - yq --version - - - name: Install foundry - uses: foundry-rs/foundry-toolchain@v1 diff --git a/action.yml b/action.yml index 9301c478..eaf7caad 100644 --- a/action.yml +++ b/action.yml @@ -30,7 +30,7 @@ inputs: kurtosis_cdk: description: 0xPolygon/kurtosis-cdk (release tag) required: false - default: 'v0.2.0' + default: 'v0.2.3' runs: using: "composite" @@ -99,11 +99,26 @@ runs: echo "Skipping building cdk-validium-node as release tag provided: ${{ inputs.zkevm_node }}" fi - # Install tools - - name: Install Kurtosis CDK tools - uses: ./.github/actions/setup-kurtosis-cdk - with: - kurtosis-version: ${{ inputs.kurtosis_cli }} + - name: Install kurtosis + shell: bash + run: | + echo "deb [trusted=yes] https://apt.fury.io/kurtosis-tech/ /" | sudo tee /etc/apt/sources.list.d/kurtosis.list + sudo apt update + sudo apt install kurtosis-cli=${{ inputs.kurtosis_cli }} + kurtosis version + + - name: Disable kurtosis analytics + shell: bash + run: kurtosis analytics disable + + - name: Install yq + shell: bash + run: | + pip3 install yq + yq --version + + - name: Install foundry + uses: foundry-rs/foundry-toolchain@v1 - name: Install polycli shell: bash @@ -162,24 +177,36 @@ runs: node_docker_hub="0xpolygon/cdk-validium-node" fi - cat params.yml - yq -Y --in-place ".args.zkevm_agglayer_image = \"$agglayer_docker_hub:$agglayer_tag\"" params.yml yq -Y --in-place ".args.zkevm_bridge_service_image = \"$bridge_service_docker_hub:$bridge_service_tag\"" params.yml yq -Y --in-place ".args.zkevm_bridge_ui_image = \"$bridge_ui_docker_hub:$bridge_ui_tag\"" params.yml yq -Y --in-place ".args.zkevm_da_image = \"$dac_docker_hub:$dac_tag\"" params.yml yq -Y --in-place ".args.zkevm_node_image = \"$node_docker_hub:$node_tag\"" params.yml - cat params.yml - - name: Deploy Kurtosis CDK package shell: bash run: kurtosis run --enclave cdk-v1 --args-file params.yml --image-download always . - - name: Monitor verified batches - uses: ./.github/actions/monitor-verified-batches + - name: Check that batches are being verified + run: | + timeout_minutes=10 + end_time=$((start_time + timeout_minutes*60)) + export ETH_RPC_URL="$(kurtosis port print cdk-v1 zkevm-node-rpc-001 http-rpc)" + while [ $(date +'%M' | sed 's/^0*//') -lt $end_time ]; do + current_time=$(date +%s) + if (( current_time > end_time )); then + echo "[$(date '+%Y-%m-%d %H:%M:%S')] ❌ Exiting... Timeout reached. No batches were verified." + exit 1 + fi + verified_batches=$(cast to-dec $(cast rpc zkevm_verifiedBatchNumber | sed 's/"//g')) + echo "[$(date '+%Y-%m-%d %H:%M:%S')] Verified Batches: $verified_batches" + if (( verified_batches > 30 )); then + echo "[$(date '+%Y-%m-%d %H:%M:%S')] ✅ Exiting... Confirmed verified batches incrementing." + exit 0 + fi + sleep 10 + done - # Perform loadtest. - name: Perform load test shell: bash run: | From 889b5aeb5479f276600099ae459aa988a0feb7ef Mon Sep 17 00:00:00 2001 From: dan moore Date: Wed, 10 Jul 2024 10:58:11 -0500 Subject: [PATCH 02/17] observability fix --- action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/action.yml b/action.yml index eaf7caad..990206ca 100644 --- a/action.yml +++ b/action.yml @@ -1,5 +1,5 @@ name: Regression Tests - Polygon CDK -description: Deploy a local Polygon CDK devnet using Kurtosis and perform series of regression tests +description: Deploy a local Polygon CDK devnet, using Kurtosis, and perform series of regression tests author: devtools@polygon.technology inputs: From 5011118897f97c263d5b97a1c1ce833a6ac9b31b Mon Sep 17 00:00:00 2001 From: dan moore Date: Wed, 10 Jul 2024 11:02:55 -0500 Subject: [PATCH 03/17] make shell cmd all --- action.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/action.yml b/action.yml index 990206ca..20c9e142 100644 --- a/action.yml +++ b/action.yml @@ -188,6 +188,7 @@ runs: run: kurtosis run --enclave cdk-v1 --args-file params.yml --image-download always . - name: Check that batches are being verified + shell: bash run: | timeout_minutes=10 end_time=$((start_time + timeout_minutes*60)) From 1e93491a6871e4146fb1c16643a313a97819c386 Mon Sep 17 00:00:00 2001 From: dan moore Date: Wed, 10 Jul 2024 11:11:17 -0500 Subject: [PATCH 04/17] fix unnecessary double quotes --- action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/action.yml b/action.yml index 20c9e142..e62a7c8e 100644 --- a/action.yml +++ b/action.yml @@ -131,7 +131,7 @@ runs: # Deploy components. - name: Use specific version of kurtosis-cdk shell: bash - run: git checkout "${{ inputs.kurtosis_cdk }}" + run: git checkout ${{ inputs.kurtosis_cdk }} - name: Use local docker containers shell: bash From 32699fd8791a680282a58d557283c34faa5157a0 Mon Sep 17 00:00:00 2001 From: dan moore Date: Wed, 10 Jul 2024 11:25:38 -0500 Subject: [PATCH 05/17] more ci fixes --- action.yml | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/action.yml b/action.yml index e62a7c8e..7d3fcfb8 100644 --- a/action.yml +++ b/action.yml @@ -117,8 +117,18 @@ runs: pip3 install yq yq --version - - name: Install foundry - uses: foundry-rs/foundry-toolchain@v1 + - name: Install Foundry + shell: bash + run: | + curl -LO https://github.com/foundry-rs/foundry/releases/download/nightly-de33b6af53005037b463318d2628b5cfcaf39916/foundry_nightly_linux_amd64.tar.gz + tar -xzvf foundry_nightly_linux_amd64.tar.gz + + - name: Clone internal kurtosis-cdk repo + shell: bash + run: | + git clone https://github.com/0xPolygon/kurtosis-cdk.git + cd kurtosis-cdk + git checkout "${{ inputs.kurtosis_cdk }}" - name: Install polycli shell: bash @@ -128,14 +138,11 @@ runs: make install export PATH="$HOME/go/bin:$PATH" - # Deploy components. - - name: Use specific version of kurtosis-cdk - shell: bash - run: git checkout ${{ inputs.kurtosis_cdk }} - - name: Use local docker containers shell: bash run: | + cd kurtosis-cdk + # When short commit hash given, reference custom image built earlier tagged 'local'. if [[ ${{ inputs.zkevm_agglayer }} =~ ^[0-9a-fA-F]{7}$ ]]; then agglayer_tag="local" @@ -185,7 +192,9 @@ runs: - name: Deploy Kurtosis CDK package shell: bash - run: kurtosis run --enclave cdk-v1 --args-file params.yml --image-download always . + run: | + cd kurtosis-cdk + kurtosis run --enclave cdk-v1 --args-file params.yml --image-download always . - name: Check that batches are being verified shell: bash From c3b9f4db951139e05c5604cbea87bf8ee6863763 Mon Sep 17 00:00:00 2001 From: dan moore Date: Wed, 10 Jul 2024 11:59:02 -0500 Subject: [PATCH 06/17] final tests --- action.yml | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/action.yml b/action.yml index 7d3fcfb8..b4e61368 100644 --- a/action.yml +++ b/action.yml @@ -200,23 +200,27 @@ runs: shell: bash run: | timeout_minutes=10 + start_time=$(date +%s) end_time=$((start_time + timeout_minutes*60)) export ETH_RPC_URL="$(kurtosis port print cdk-v1 zkevm-node-rpc-001 http-rpc)" - while [ $(date +'%M' | sed 's/^0*//') -lt $end_time ]; do + + while (( $(date +%s) <= end_time )); do current_time=$(date +%s) - if (( current_time > end_time )); then - echo "[$(date '+%Y-%m-%d %H:%M:%S')] ❌ Exiting... Timeout reached. No batches were verified." - exit 1 - fi + verified_batches=$(cast to-dec $(cast rpc zkevm_verifiedBatchNumber | sed 's/"//g')) echo "[$(date '+%Y-%m-%d %H:%M:%S')] Verified Batches: $verified_batches" + if (( verified_batches > 30 )); then echo "[$(date '+%Y-%m-%d %H:%M:%S')] ✅ Exiting... Confirmed verified batches incrementing." exit 0 fi + sleep 10 done + echo "[$(date '+%Y-%m-%d %H:%M:%S')] ❌ Exiting... Timeout reached. No batches were verified." + exit 1 + - name: Perform load test shell: bash run: | From b4d1ebc2c6087186e0f5b6d81ad765182c8960d2 Mon Sep 17 00:00:00 2001 From: dan moore Date: Wed, 10 Jul 2024 12:38:59 -0500 Subject: [PATCH 07/17] foundry install alt --- action.yml | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/action.yml b/action.yml index b4e61368..bb3e7ee3 100644 --- a/action.yml +++ b/action.yml @@ -117,11 +117,8 @@ runs: pip3 install yq yq --version - - name: Install Foundry - shell: bash - run: | - curl -LO https://github.com/foundry-rs/foundry/releases/download/nightly-de33b6af53005037b463318d2628b5cfcaf39916/foundry_nightly_linux_amd64.tar.gz - tar -xzvf foundry_nightly_linux_amd64.tar.gz + - name: Install foundry + uses: foundry-rs/foundry-toolchain@v1 - name: Clone internal kurtosis-cdk repo shell: bash From cc4f4904c8c3b8228be2aa8917757db989926bc8 Mon Sep 17 00:00:00 2001 From: dan moore Date: Wed, 10 Jul 2024 14:39:08 -0500 Subject: [PATCH 08/17] please --- action.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/action.yml b/action.yml index bb3e7ee3..d70dc4a1 100644 --- a/action.yml +++ b/action.yml @@ -221,6 +221,8 @@ runs: - name: Perform load test shell: bash run: | + cd kurtosis-cdk + export PATH="$HOME/go/bin:$PATH" export ETH_RPC_URL="$(kurtosis port print cdk-v1 zkevm-node-rpc-001 http-rpc)" export PK="$(yq .args.zkevm_l2_admin_private_key params.yml)" polycli loadtest --rpc-url "$ETH_RPC_URL" --legacy --private-key "$PK" --verbosity 700 --requests 500 --rate-limit 5 --mode t From cc196517fe184749318aa921432f08b067c5c92f Mon Sep 17 00:00:00 2001 From: dan moore Date: Wed, 10 Jul 2024 15:03:05 -0500 Subject: [PATCH 09/17] remove load test from regression check temp --- action.yml | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/action.yml b/action.yml index d70dc4a1..2750089f 100644 --- a/action.yml +++ b/action.yml @@ -217,14 +217,3 @@ runs: echo "[$(date '+%Y-%m-%d %H:%M:%S')] ❌ Exiting... Timeout reached. No batches were verified." exit 1 - - - name: Perform load test - shell: bash - run: | - cd kurtosis-cdk - export PATH="$HOME/go/bin:$PATH" - export ETH_RPC_URL="$(kurtosis port print cdk-v1 zkevm-node-rpc-001 http-rpc)" - export PK="$(yq .args.zkevm_l2_admin_private_key params.yml)" - polycli loadtest --rpc-url "$ETH_RPC_URL" --legacy --private-key "$PK" --verbosity 700 --requests 500 --rate-limit 5 --mode t - polycli loadtest --rpc-url "$ETH_RPC_URL" --legacy --private-key "$PK" --verbosity 700 --requests 500 --rate-limit 10 --mode t - polycli loadtest --rpc-url "$ETH_RPC_URL" --legacy --private-key "$PK" --verbosity 700 --requests 500 --rate-limit 10 --mode 2 From 8c6f98238cc381a4e72ce032707d4ff6152c9545 Mon Sep 17 00:00:00 2001 From: dan moore Date: Thu, 11 Jul 2024 12:29:58 -0500 Subject: [PATCH 10/17] revert permissionless config changes --- .github/workflows/test-nightly.yml | 263 ++++++++++++++++++ .../permissionless-node/node-config.toml | 8 +- 2 files changed, 267 insertions(+), 4 deletions(-) create mode 100644 .github/workflows/test-nightly.yml diff --git a/.github/workflows/test-nightly.yml b/.github/workflows/test-nightly.yml new file mode 100644 index 00000000..69c36364 --- /dev/null +++ b/.github/workflows/test-nightly.yml @@ -0,0 +1,263 @@ +--- +name: TestNightly + +on: + push: + +jobs: + # Deploy the CDK environment in one step. + monolithic: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-go@v5 + with: + go-version: 1.21 + cache-dependency-path: scripts/zkevm-config-diff/go.sum + + - name: Install Kurtosis CDK tools + uses: ./.github/actions/setup-kurtosis-cdk + + - name: Enable workload + run: yq -Y --in-place '.apply_workload = true' params.yml + + - name: Deploy Kurtosis CDK package + run: kurtosis run --enclave cdk-v1 --args-file params.yml --image-download always . + + - name: Monitor verified batches + uses: ./.github/actions/monitor-cdk-verified-batches + + # Compare configs. + - name: Dump configs + working-directory: ./scripts/zkevm-config-diff + run: | + mkdir -p default-configs kurtosis-cdk-configs + sh zkevm_config.sh dump default ./default-configs + echo + sh zkevm_config.sh dump kurtosis-cdk ./kurtosis-cdk-configs + - name: Compare configs + working-directory: ./scripts/zkevm-config-diff + run: sh zkevm_config.sh compare configs ./default-configs ./kurtosis-cdk-configs + + - name: Diff configs + working-directory: ./scripts/zkevm-config-diff + run: diff -r ./default-configs ./kurtosis-cdk-configs || true + + + # Deploy the CDK environment incrementally, stage by stage. + incremental: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Install Kurtosis CDK tools + uses: ./.github/actions/setup-kurtosis-cdk + + - name: Disable all deployment steps + run: yq -Y --in-place 'with_entries(if .value | type == "boolean" then .value = false else . end)' params.yml + + - name: Deploy L1 + run: | + yq -Y --in-place '.deploy_l1 = true' params.yml + kurtosis run --enclave cdk-v1 --args-file params.yml . + yq -Y --in-place '.deploy_l1 = false' params.yml # reset + - name: Deploy zkEVM contracts on L1 + run: | + yq -Y --in-place '.deploy_zkevm_contracts_on_l1 = true' params.yml + kurtosis run --enclave cdk-v1 --args-file params.yml --image-download always . + yq -Y --in-place '.deploy_zkevm_contracts_on_l1 = false' params.yml # reset + - name: Deploy zkEVM node and cdk peripheral databases + run: | + yq -Y --in-place '.deploy_databases = true' params.yml + kurtosis run --enclave cdk-v1 --args-file params.yml . + yq -Y --in-place '.deploy_databases = false' params.yml # reset + - name: Deploy CDK central environment + run: | + yq -Y --in-place '.deploy_cdk_central_environment = true' params.yml + kurtosis run --enclave cdk-v1 --args-file params.yml . + yq -Y --in-place '.deploy_cdk_central_environment = false' params.yml # reset + - name: Deploy CDK bridge infrastructure + run: | + yq -Y --in-place '.deploy_cdk_bridge_infra = true' params.yml + kurtosis run --enclave cdk-v1 --args-file params.yml . + yq -Y --in-place '.deploy_cdk_bridge_infra = false' params.yml # reset + - name: Deploy zkEVM permissionless node + run: | + # Retrieve genesis file. + kurtosis files download cdk-v1 genesis /tmp + cp /tmp/genesis.json templates/permissionless-node/genesis.json + # Deploy permisionless node. + yq -Y --in-place '.deploy_zkevm_permissionless_node = true' params.yml + kurtosis run --enclave cdk-v1 --args-file params.yml . + yq -Y --in-place '.deploy_zkevm_permissionless_node = false' params.yml # reset + - name: Deploy CDK erigon node + run: | + yq -Y --in-place '.deploy_cdk_erigon_node = true' params.yml + kurtosis run --enclave cdk-v1 --args-file params.yml . + yq -Y --in-place '.deploy_cdk_erigon_node = false' params.yml # reset + - name: Deploy observability stack + run: | + yq -Y --in-place '.deploy_observability = true' params.yml + kurtosis run --enclave cdk-v1 --args-file params.yml . + yq -Y --in-place '.deploy_observability = false' params.yml # reset + - name: Deploy Blockscout stack + run: | + yq -Y --in-place '.deploy_l2_blockscout = true' params.yml + kurtosis run --enclave cdk-v1 --args-file params.yml . + yq -Y --in-place '.deploy_l2_blockscout = false' params.yml # reset + - name: Deploy ETH load balancer + run: | + yq -Y --in-place '.deploy_blutgang = true' params.yml + kurtosis run --enclave cdk-v1 --args-file params.yml . + yq -Y --in-place '.deploy_blutgang = false' params.yml # reset + - name: Apply workload + run: | + yq -Y --in-place '.apply_workload = true' params.yml + kurtosis run --enclave cdk-v1 --args-file params.yml . + yq -Y --in-place '.apply_workload = false' params.yml # reset + - name: Monitor verified batches + uses: ./.github/actions/monitor-cdk-verified-batches + + + # Deploy the CDK environment without specifying any parameter file. + configless: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Install Kurtosis CDK tools + uses: ./.github/actions/setup-kurtosis-cdk + + # Deploy components. + - name: Deploy Kurtosis CDK package + run: kurtosis run --enclave cdk-v1 --image-download always . + + - name: Monitor verified batches + uses: ./.github/actions/monitor-cdk-verified-batches + + # Deploy the CDK environment with the gas token feature enabled. + gas-token: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Install Kurtosis CDK tools + uses: ./.github/actions/setup-kurtosis-cdk + + - name: Enable gas token feature + run: yq -Y --in-place '.args.zkevm_use_gas_token_contract = true' params.yml + + - name: Deploy Kurtosis CDK package + run: kurtosis run --enclave cdk-v1 --args-file params.yml --image-download always . + + - name: Monitor verified batches + uses: ./.github/actions/monitor-cdk-verified-batches + + # Deploy the CDK environment against a local l1 chain with pre-deployed zkevm contracts. + pre-deployed-contracts: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Install Kurtosis CDK tools + uses: ./.github/actions/setup-kurtosis-cdk + + - name: Deploy L1 and zkEVM contracts + run: | + # Disable all deployment steps. + yq -Y --in-place 'with_entries(if .value | type == "boolean" then .value = false else . end)' params.yml + # Only deploy l1 and zkevm contracts. + yq -Y --in-place '(.deploy_l1 = true) | (.deploy_zkevm_contracts_on_l1 = true)' params.yml + kurtosis run --enclave cdk-v1 --args-file params.yml --image-download always . + - name: Specify the rollup manager contract address and a few other parameters + run: | + zkevm_rollup_manager_address=$(kurtosis service exec cdk-v1 contracts-001 "cat /opt/zkevm/combined.json" | tail -n +2 | jq .polygonRollupManagerAddress) + yq -Y --in-place ".args.zkevm_rollup_manager_address = $zkevm_rollup_manager_address" params.yml + zkevm_rollup_manager_block_number=$(kurtosis service exec cdk-v1 contracts-001 "cat /opt/zkevm/combined.json" | tail -n +2 | jq .deploymentRollupManagerBlockNumber) + yq -Y --in-place ".args.zkevm_rollup_manager_block_number = $zkevm_rollup_manager_block_number" params.yml + zkevm_global_exit_root_l2_address=$(kurtosis service exec cdk-v1 contracts-001 "cat /opt/zkevm/combined.json" | tail -n +2 | jq .polygonZkEVMGlobalExitRootL2Address) + yq -Y --in-place ".args.zkevm_global_exit_root_l2_address = $zkevm_global_exit_root_l2_address" params.yml + polygon_data_committee_address=$(kurtosis service exec cdk-v1 contracts-001 "cat /opt/zkevm/combined.json" | tail -n +2 | jq .polygonDataCommitteeAddress) + yq -Y --in-place ".args.polygon_data_committee_address = $polygon_data_committee_address" params.yml + zkevm_admin_address=$(kurtosis service exec cdk-v1 contracts-001 "cat /opt/zkevm/combined.json" | tail -n +2 | jq .admin) + yq -Y --in-place ".args.zkevm_admin_address = $zkevm_admin_address" params.yml + - name: Deploy the rest of the components + run: | + # Do not deploy l1 and zkevm contracts. + yq -Y --in-place '(.deploy_l1 = false) | (.deploy_zkevm_contracts_on_l1 = false)' params.yml + # Deploy databases, cdk central/trusted environment, cdk/bridge infra and observability stack. + yq -Y --in-place '(.deploy_databases = true) | (.deploy_cdk_central_environment = true) | (.deploy_cdk_bridge_infra = true) | (.deploy_observability = true)' params.yml + kurtosis run --enclave cdk-v1 --args-file params.yml --image-download always . + - name: Monitor verified batches + uses: ./.github/actions/monitor-cdk-verified-batches + + # Deploy a standalone permisionless node against Sepolia. + permisionless-node: + # Prevent this job to run on forks. + if: github.repository == '0xPolygon/kurtosis-cdk' + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Install Kurtosis CDK tools + uses: ./.github/actions/setup-kurtosis-cdk + + - name: Configure permisionless node parameters + run: | + yq -Y --in-place '.args.l1_rpc_url = "${{ secrets.ALCHEMY_SEPOLIA_RPC_URL }}"' params.yml + yq -Y --in-place '.args.genesis_file = "templates/permissionless-node/test-genesis.json"' params.yml + - name: Deploy the permisionless node + run: | + # Disable all steps except permisionless node. + yq -Y --in-place 'with_entries(if .key == "deploy_zkevm_permissionless_node" then .value = true elif .value | type == "boolean" then .value = false else . end)' params.yml + kurtosis run --enclave cdk-v1 --args-file params.yml --image-download always . + # Deploy the CDK environment in rollup mode (data availability). + rollup-da-mode: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Install Kurtosis CDK tools + uses: ./.github/actions/setup-kurtosis-cdk + + - name: Set rollup data availability mode + run: yq -Y --in-place '.args.data_availability_mode = "rollup"' params.yml + + - name: Deploy Kurtosis CDK package + run: kurtosis run --enclave cdk-v1 --image-download always . + + - name: Monitor verified batches + uses: ./.github/actions/monitor-cdk-verified-batches + + # Deploy the CDK environment in cdk-validium mode (data availability). + cdk-validium-da-mode: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Install Kurtosis CDK tools + uses: ./.github/actions/setup-kurtosis-cdk + + - name: Set cdk-validium data availability mode + run: yq -Y --in-place '.args.data_availability_mode = "cdk-validium"' params.yml + + - name: Deploy Kurtosis CDK package + run: kurtosis run --enclave cdk-v1 --image-download always . + + - name: Monitor verified batches + uses: ./.github/actions/monitor-cdk-verified-batches + + # Deploy the CDK environment with cdk-erigon as a sequencer. + cdk-erigon-sequencer: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Install Kurtosis CDK tools + uses: ./.github/actions/setup-kurtosis-cdk + + - name: Deploy Kurtosis CDK package + run: kurtosis run --enclave cdk-v1 --args-file cdk-erigon-sequencer-params.yml --image-download always . + + - name: Monitor verified batches + uses: ./.github/actions/monitor-cdk-verified-batches diff --git a/templates/permissionless-node/node-config.toml b/templates/permissionless-node/node-config.toml index 17ea87c7..3f312b10 100644 --- a/templates/permissionless-node/node-config.toml +++ b/templates/permissionless-node/node-config.toml @@ -10,7 +10,7 @@ Outputs = ["stderr"] [State.DB] User = "{{.state_db.user}}" Password = "{{.state_db.password}}" - Name = "{{.state_db.name}}" + Name = "state_db" Host = "{{.state_db.hostname}}" Port = "{{.state_db.port}}" EnableLog = false @@ -54,7 +54,7 @@ GlobalQueue = 1024 [Pool.DB] User = "{{.pool_db.user}}" Password = "{{.pool_db.password}}" - Name = "{{.pool_db.name}}" + Name = "pool_db" Host = "{{.pool_db.hostname}}" Port = "{{.pool_db.port}}" EnableLog = false @@ -129,7 +129,7 @@ ProfilingEnabled = true [EventLog.DB] User = "{{.event_db.user}}" Password = "{{.event_db.password}}" - Name = "{{.event_db.name}}" + Name = "event_db" Host = "{{.event_db.hostname}}" Port = "{{.event_db.port}}" EnableLog = true @@ -138,7 +138,7 @@ ProfilingEnabled = true [HashDB] User = "{{.prover_db.user}}" Password = "{{.prover_db.password}}" -Name = "{{.prover_db.name}}" +Name = "executor_db" Host = "{{.prover_db.hostname}}" Port = "{{.prover_db.port}}" EnableLog = false From 06304ba329e5c5bf40501d8c7c74d6a616a4affc Mon Sep 17 00:00:00 2001 From: dan moore Date: Thu, 11 Jul 2024 12:38:14 -0500 Subject: [PATCH 11/17] test nightly --- .github/workflows/nightly.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 24087923..ac09b614 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -21,6 +21,7 @@ jobs: with: go-version: 1.21 cache-dependency-path: scripts/zkevm-config-diff/go.sum + repository: 0xPolygon/kurtosis-cdk - name: Install Kurtosis CDK tools uses: ./.github/actions/setup-kurtosis-cdk From 550094319aa09071f011cb4b8bdadfe9e4cafdf2 Mon Sep 17 00:00:00 2001 From: dan moore Date: Thu, 11 Jul 2024 12:47:15 -0500 Subject: [PATCH 12/17] test again --- .github/workflows/nightly.yml | 1 - .github/workflows/test-nightly.yml | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index ac09b614..24087923 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -21,7 +21,6 @@ jobs: with: go-version: 1.21 cache-dependency-path: scripts/zkevm-config-diff/go.sum - repository: 0xPolygon/kurtosis-cdk - name: Install Kurtosis CDK tools uses: ./.github/actions/setup-kurtosis-cdk diff --git a/.github/workflows/test-nightly.yml b/.github/workflows/test-nightly.yml index 69c36364..fe3ea1d4 100644 --- a/.github/workflows/test-nightly.yml +++ b/.github/workflows/test-nightly.yml @@ -14,6 +14,7 @@ jobs: with: go-version: 1.21 cache-dependency-path: scripts/zkevm-config-diff/go.sum + repository: 0xPolygon/kurtosis-cdk - name: Install Kurtosis CDK tools uses: ./.github/actions/setup-kurtosis-cdk From 3c8e56019578a37f0d7c7b2ae647e35c930952db Mon Sep 17 00:00:00 2001 From: dan moore Date: Thu, 11 Jul 2024 13:01:13 -0500 Subject: [PATCH 13/17] try singular action file --- .github/workflows/test-nightly.yml | 391 ++++++++++++++++++++++++++--- 1 file changed, 356 insertions(+), 35 deletions(-) diff --git a/.github/workflows/test-nightly.yml b/.github/workflows/test-nightly.yml index fe3ea1d4..9da2cfc2 100644 --- a/.github/workflows/test-nightly.yml +++ b/.github/workflows/test-nightly.yml @@ -14,10 +14,27 @@ jobs: with: go-version: 1.21 cache-dependency-path: scripts/zkevm-config-diff/go.sum - repository: 0xPolygon/kurtosis-cdk - - name: Install Kurtosis CDK tools - uses: ./.github/actions/setup-kurtosis-cdk + - name: Install kurtosis + shell: bash + run: | + echo "deb [trusted=yes] https://apt.fury.io/kurtosis-tech/ /" | sudo tee /etc/apt/sources.list.d/kurtosis.list + sudo apt update + sudo apt install kurtosis-cli=${{ inputs.kurtosis_cli }} + kurtosis version + + - name: Disable kurtosis analytics + shell: bash + run: kurtosis analytics disable + + - name: Install yq + shell: bash + run: | + pip3 install yq + yq --version + + - name: Install foundry + uses: foundry-rs/foundry-toolchain@v1 - name: Enable workload run: yq -Y --in-place '.apply_workload = true' params.yml @@ -25,8 +42,28 @@ jobs: - name: Deploy Kurtosis CDK package run: kurtosis run --enclave cdk-v1 --args-file params.yml --image-download always . - - name: Monitor verified batches - uses: ./.github/actions/monitor-cdk-verified-batches + - name: Check that batches are being verified + shell: bash + run: | + timeout_minutes=10 + start_time=$(date +%s) + end_time=$((start_time + timeout_minutes*60)) + export ETH_RPC_URL="$(kurtosis port print cdk-v1 zkevm-node-rpc-001 http-rpc)" + while (( $(date +%s) <= end_time )); do + current_time=$(date +%s) + + verified_batches=$(cast to-dec $(cast rpc zkevm_verifiedBatchNumber | sed 's/"//g')) + echo "[$(date '+%Y-%m-%d %H:%M:%S')] Verified Batches: $verified_batches" + + if (( verified_batches > 30 )); then + echo "[$(date '+%Y-%m-%d %H:%M:%S')] ✅ Exiting... Confirmed verified batches incrementing." + exit 0 + fi + + sleep 10 + done + echo "[$(date '+%Y-%m-%d %H:%M:%S')] ❌ Exiting... Timeout reached. No batches were verified." + exit 1 # Compare configs. - name: Dump configs @@ -51,8 +88,26 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Install Kurtosis CDK tools - uses: ./.github/actions/setup-kurtosis-cdk + - name: Install kurtosis + shell: bash + run: | + echo "deb [trusted=yes] https://apt.fury.io/kurtosis-tech/ /" | sudo tee /etc/apt/sources.list.d/kurtosis.list + sudo apt update + sudo apt install kurtosis-cli=${{ inputs.kurtosis_cli }} + kurtosis version + + - name: Disable kurtosis analytics + shell: bash + run: kurtosis analytics disable + + - name: Install yq + shell: bash + run: | + pip3 install yq + yq --version + + - name: Install foundry + uses: foundry-rs/foundry-toolchain@v1 - name: Disable all deployment steps run: yq -Y --in-place 'with_entries(if .value | type == "boolean" then .value = false else . end)' params.yml @@ -116,8 +171,28 @@ jobs: yq -Y --in-place '.apply_workload = true' params.yml kurtosis run --enclave cdk-v1 --args-file params.yml . yq -Y --in-place '.apply_workload = false' params.yml # reset - - name: Monitor verified batches - uses: ./.github/actions/monitor-cdk-verified-batches + - name: Check that batches are being verified + shell: bash + run: | + timeout_minutes=10 + start_time=$(date +%s) + end_time=$((start_time + timeout_minutes*60)) + export ETH_RPC_URL="$(kurtosis port print cdk-v1 zkevm-node-rpc-001 http-rpc)" + while (( $(date +%s) <= end_time )); do + current_time=$(date +%s) + + verified_batches=$(cast to-dec $(cast rpc zkevm_verifiedBatchNumber | sed 's/"//g')) + echo "[$(date '+%Y-%m-%d %H:%M:%S')] Verified Batches: $verified_batches" + + if (( verified_batches > 30 )); then + echo "[$(date '+%Y-%m-%d %H:%M:%S')] ✅ Exiting... Confirmed verified batches incrementing." + exit 0 + fi + + sleep 10 + done + echo "[$(date '+%Y-%m-%d %H:%M:%S')] ❌ Exiting... Timeout reached. No batches were verified." + exit 1 # Deploy the CDK environment without specifying any parameter file. @@ -126,15 +201,53 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Install Kurtosis CDK tools - uses: ./.github/actions/setup-kurtosis-cdk + - name: Install kurtosis + shell: bash + run: | + echo "deb [trusted=yes] https://apt.fury.io/kurtosis-tech/ /" | sudo tee /etc/apt/sources.list.d/kurtosis.list + sudo apt update + sudo apt install kurtosis-cli=${{ inputs.kurtosis_cli }} + kurtosis version + + - name: Disable kurtosis analytics + shell: bash + run: kurtosis analytics disable + + - name: Install yq + shell: bash + run: | + pip3 install yq + yq --version + + - name: Install foundry + uses: foundry-rs/foundry-toolchain@v1 # Deploy components. - name: Deploy Kurtosis CDK package run: kurtosis run --enclave cdk-v1 --image-download always . - - name: Monitor verified batches - uses: ./.github/actions/monitor-cdk-verified-batches + - name: Check that batches are being verified + shell: bash + run: | + timeout_minutes=10 + start_time=$(date +%s) + end_time=$((start_time + timeout_minutes*60)) + export ETH_RPC_URL="$(kurtosis port print cdk-v1 zkevm-node-rpc-001 http-rpc)" + while (( $(date +%s) <= end_time )); do + current_time=$(date +%s) + + verified_batches=$(cast to-dec $(cast rpc zkevm_verifiedBatchNumber | sed 's/"//g')) + echo "[$(date '+%Y-%m-%d %H:%M:%S')] Verified Batches: $verified_batches" + + if (( verified_batches > 30 )); then + echo "[$(date '+%Y-%m-%d %H:%M:%S')] ✅ Exiting... Confirmed verified batches incrementing." + exit 0 + fi + + sleep 10 + done + echo "[$(date '+%Y-%m-%d %H:%M:%S')] ❌ Exiting... Timeout reached. No batches were verified." + exit 1 # Deploy the CDK environment with the gas token feature enabled. gas-token: @@ -142,8 +255,26 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Install Kurtosis CDK tools - uses: ./.github/actions/setup-kurtosis-cdk + - name: Install kurtosis + shell: bash + run: | + echo "deb [trusted=yes] https://apt.fury.io/kurtosis-tech/ /" | sudo tee /etc/apt/sources.list.d/kurtosis.list + sudo apt update + sudo apt install kurtosis-cli=${{ inputs.kurtosis_cli }} + kurtosis version + + - name: Disable kurtosis analytics + shell: bash + run: kurtosis analytics disable + + - name: Install yq + shell: bash + run: | + pip3 install yq + yq --version + + - name: Install foundry + uses: foundry-rs/foundry-toolchain@v1 - name: Enable gas token feature run: yq -Y --in-place '.args.zkevm_use_gas_token_contract = true' params.yml @@ -151,8 +282,28 @@ jobs: - name: Deploy Kurtosis CDK package run: kurtosis run --enclave cdk-v1 --args-file params.yml --image-download always . - - name: Monitor verified batches - uses: ./.github/actions/monitor-cdk-verified-batches + - name: Check that batches are being verified + shell: bash + run: | + timeout_minutes=10 + start_time=$(date +%s) + end_time=$((start_time + timeout_minutes*60)) + export ETH_RPC_URL="$(kurtosis port print cdk-v1 zkevm-node-rpc-001 http-rpc)" + while (( $(date +%s) <= end_time )); do + current_time=$(date +%s) + + verified_batches=$(cast to-dec $(cast rpc zkevm_verifiedBatchNumber | sed 's/"//g')) + echo "[$(date '+%Y-%m-%d %H:%M:%S')] Verified Batches: $verified_batches" + + if (( verified_batches > 30 )); then + echo "[$(date '+%Y-%m-%d %H:%M:%S')] ✅ Exiting... Confirmed verified batches incrementing." + exit 0 + fi + + sleep 10 + done + echo "[$(date '+%Y-%m-%d %H:%M:%S')] ❌ Exiting... Timeout reached. No batches were verified." + exit 1 # Deploy the CDK environment against a local l1 chain with pre-deployed zkevm contracts. pre-deployed-contracts: @@ -160,8 +311,26 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Install Kurtosis CDK tools - uses: ./.github/actions/setup-kurtosis-cdk + - name: Install kurtosis + shell: bash + run: | + echo "deb [trusted=yes] https://apt.fury.io/kurtosis-tech/ /" | sudo tee /etc/apt/sources.list.d/kurtosis.list + sudo apt update + sudo apt install kurtosis-cli=${{ inputs.kurtosis_cli }} + kurtosis version + + - name: Disable kurtosis analytics + shell: bash + run: kurtosis analytics disable + + - name: Install yq + shell: bash + run: | + pip3 install yq + yq --version + + - name: Install foundry + uses: foundry-rs/foundry-toolchain@v1 - name: Deploy L1 and zkEVM contracts run: | @@ -189,8 +358,28 @@ jobs: # Deploy databases, cdk central/trusted environment, cdk/bridge infra and observability stack. yq -Y --in-place '(.deploy_databases = true) | (.deploy_cdk_central_environment = true) | (.deploy_cdk_bridge_infra = true) | (.deploy_observability = true)' params.yml kurtosis run --enclave cdk-v1 --args-file params.yml --image-download always . - - name: Monitor verified batches - uses: ./.github/actions/monitor-cdk-verified-batches + - name: Check that batches are being verified + shell: bash + run: | + timeout_minutes=10 + start_time=$(date +%s) + end_time=$((start_time + timeout_minutes*60)) + export ETH_RPC_URL="$(kurtosis port print cdk-v1 zkevm-node-rpc-001 http-rpc)" + while (( $(date +%s) <= end_time )); do + current_time=$(date +%s) + + verified_batches=$(cast to-dec $(cast rpc zkevm_verifiedBatchNumber | sed 's/"//g')) + echo "[$(date '+%Y-%m-%d %H:%M:%S')] Verified Batches: $verified_batches" + + if (( verified_batches > 30 )); then + echo "[$(date '+%Y-%m-%d %H:%M:%S')] ✅ Exiting... Confirmed verified batches incrementing." + exit 0 + fi + + sleep 10 + done + echo "[$(date '+%Y-%m-%d %H:%M:%S')] ❌ Exiting... Timeout reached. No batches were verified." + exit 1 # Deploy a standalone permisionless node against Sepolia. permisionless-node: @@ -200,8 +389,26 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Install Kurtosis CDK tools - uses: ./.github/actions/setup-kurtosis-cdk + - name: Install kurtosis + shell: bash + run: | + echo "deb [trusted=yes] https://apt.fury.io/kurtosis-tech/ /" | sudo tee /etc/apt/sources.list.d/kurtosis.list + sudo apt update + sudo apt install kurtosis-cli=${{ inputs.kurtosis_cli }} + kurtosis version + + - name: Disable kurtosis analytics + shell: bash + run: kurtosis analytics disable + + - name: Install yq + shell: bash + run: | + pip3 install yq + yq --version + + - name: Install foundry + uses: foundry-rs/foundry-toolchain@v1 - name: Configure permisionless node parameters run: | @@ -218,8 +425,26 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Install Kurtosis CDK tools - uses: ./.github/actions/setup-kurtosis-cdk + - name: Install kurtosis + shell: bash + run: | + echo "deb [trusted=yes] https://apt.fury.io/kurtosis-tech/ /" | sudo tee /etc/apt/sources.list.d/kurtosis.list + sudo apt update + sudo apt install kurtosis-cli=${{ inputs.kurtosis_cli }} + kurtosis version + + - name: Disable kurtosis analytics + shell: bash + run: kurtosis analytics disable + + - name: Install yq + shell: bash + run: | + pip3 install yq + yq --version + + - name: Install foundry + uses: foundry-rs/foundry-toolchain@v1 - name: Set rollup data availability mode run: yq -Y --in-place '.args.data_availability_mode = "rollup"' params.yml @@ -227,8 +452,28 @@ jobs: - name: Deploy Kurtosis CDK package run: kurtosis run --enclave cdk-v1 --image-download always . - - name: Monitor verified batches - uses: ./.github/actions/monitor-cdk-verified-batches + - name: Check that batches are being verified + shell: bash + run: | + timeout_minutes=10 + start_time=$(date +%s) + end_time=$((start_time + timeout_minutes*60)) + export ETH_RPC_URL="$(kurtosis port print cdk-v1 zkevm-node-rpc-001 http-rpc)" + while (( $(date +%s) <= end_time )); do + current_time=$(date +%s) + + verified_batches=$(cast to-dec $(cast rpc zkevm_verifiedBatchNumber | sed 's/"//g')) + echo "[$(date '+%Y-%m-%d %H:%M:%S')] Verified Batches: $verified_batches" + + if (( verified_batches > 30 )); then + echo "[$(date '+%Y-%m-%d %H:%M:%S')] ✅ Exiting... Confirmed verified batches incrementing." + exit 0 + fi + + sleep 10 + done + echo "[$(date '+%Y-%m-%d %H:%M:%S')] ❌ Exiting... Timeout reached. No batches were verified." + exit 1 # Deploy the CDK environment in cdk-validium mode (data availability). cdk-validium-da-mode: @@ -236,8 +481,26 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Install Kurtosis CDK tools - uses: ./.github/actions/setup-kurtosis-cdk + - name: Install kurtosis + shell: bash + run: | + echo "deb [trusted=yes] https://apt.fury.io/kurtosis-tech/ /" | sudo tee /etc/apt/sources.list.d/kurtosis.list + sudo apt update + sudo apt install kurtosis-cli=${{ inputs.kurtosis_cli }} + kurtosis version + + - name: Disable kurtosis analytics + shell: bash + run: kurtosis analytics disable + + - name: Install yq + shell: bash + run: | + pip3 install yq + yq --version + + - name: Install foundry + uses: foundry-rs/foundry-toolchain@v1 - name: Set cdk-validium data availability mode run: yq -Y --in-place '.args.data_availability_mode = "cdk-validium"' params.yml @@ -245,8 +508,28 @@ jobs: - name: Deploy Kurtosis CDK package run: kurtosis run --enclave cdk-v1 --image-download always . - - name: Monitor verified batches - uses: ./.github/actions/monitor-cdk-verified-batches + - name: Check that batches are being verified + shell: bash + run: | + timeout_minutes=10 + start_time=$(date +%s) + end_time=$((start_time + timeout_minutes*60)) + export ETH_RPC_URL="$(kurtosis port print cdk-v1 zkevm-node-rpc-001 http-rpc)" + while (( $(date +%s) <= end_time )); do + current_time=$(date +%s) + + verified_batches=$(cast to-dec $(cast rpc zkevm_verifiedBatchNumber | sed 's/"//g')) + echo "[$(date '+%Y-%m-%d %H:%M:%S')] Verified Batches: $verified_batches" + + if (( verified_batches > 30 )); then + echo "[$(date '+%Y-%m-%d %H:%M:%S')] ✅ Exiting... Confirmed verified batches incrementing." + exit 0 + fi + + sleep 10 + done + echo "[$(date '+%Y-%m-%d %H:%M:%S')] ❌ Exiting... Timeout reached. No batches were verified." + exit 1 # Deploy the CDK environment with cdk-erigon as a sequencer. cdk-erigon-sequencer: @@ -254,11 +537,49 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Install Kurtosis CDK tools - uses: ./.github/actions/setup-kurtosis-cdk + - name: Install kurtosis + shell: bash + run: | + echo "deb [trusted=yes] https://apt.fury.io/kurtosis-tech/ /" | sudo tee /etc/apt/sources.list.d/kurtosis.list + sudo apt update + sudo apt install kurtosis-cli=${{ inputs.kurtosis_cli }} + kurtosis version + + - name: Disable kurtosis analytics + shell: bash + run: kurtosis analytics disable + + - name: Install yq + shell: bash + run: | + pip3 install yq + yq --version + + - name: Install foundry + uses: foundry-rs/foundry-toolchain@v1 - name: Deploy Kurtosis CDK package run: kurtosis run --enclave cdk-v1 --args-file cdk-erigon-sequencer-params.yml --image-download always . - - name: Monitor verified batches - uses: ./.github/actions/monitor-cdk-verified-batches + - name: Check that batches are being verified + shell: bash + run: | + timeout_minutes=10 + start_time=$(date +%s) + end_time=$((start_time + timeout_minutes*60)) + export ETH_RPC_URL="$(kurtosis port print cdk-v1 zkevm-node-rpc-001 http-rpc)" + while (( $(date +%s) <= end_time )); do + current_time=$(date +%s) + + verified_batches=$(cast to-dec $(cast rpc zkevm_verifiedBatchNumber | sed 's/"//g')) + echo "[$(date '+%Y-%m-%d %H:%M:%S')] Verified Batches: $verified_batches" + + if (( verified_batches > 30 )); then + echo "[$(date '+%Y-%m-%d %H:%M:%S')] ✅ Exiting... Confirmed verified batches incrementing." + exit 0 + fi + + sleep 10 + done + echo "[$(date '+%Y-%m-%d %H:%M:%S')] ❌ Exiting... Timeout reached. No batches were verified." + exit 1 From a3764453cc574a9438bfdda9ed1008b2408b1d0a Mon Sep 17 00:00:00 2001 From: dan moore Date: Thu, 11 Jul 2024 13:04:20 -0500 Subject: [PATCH 14/17] no env vars --- .github/workflows/test-nightly.yml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/test-nightly.yml b/.github/workflows/test-nightly.yml index 9da2cfc2..97482540 100644 --- a/.github/workflows/test-nightly.yml +++ b/.github/workflows/test-nightly.yml @@ -20,7 +20,7 @@ jobs: run: | echo "deb [trusted=yes] https://apt.fury.io/kurtosis-tech/ /" | sudo tee /etc/apt/sources.list.d/kurtosis.list sudo apt update - sudo apt install kurtosis-cli=${{ inputs.kurtosis_cli }} + sudo apt install kurtosis-cli=0.90.1 kurtosis version - name: Disable kurtosis analytics @@ -93,7 +93,7 @@ jobs: run: | echo "deb [trusted=yes] https://apt.fury.io/kurtosis-tech/ /" | sudo tee /etc/apt/sources.list.d/kurtosis.list sudo apt update - sudo apt install kurtosis-cli=${{ inputs.kurtosis_cli }} + sudo apt install kurtosis-cli=0.90.1 kurtosis version - name: Disable kurtosis analytics @@ -206,7 +206,7 @@ jobs: run: | echo "deb [trusted=yes] https://apt.fury.io/kurtosis-tech/ /" | sudo tee /etc/apt/sources.list.d/kurtosis.list sudo apt update - sudo apt install kurtosis-cli=${{ inputs.kurtosis_cli }} + sudo apt install kurtosis-cli=0.90.1 kurtosis version - name: Disable kurtosis analytics @@ -260,7 +260,7 @@ jobs: run: | echo "deb [trusted=yes] https://apt.fury.io/kurtosis-tech/ /" | sudo tee /etc/apt/sources.list.d/kurtosis.list sudo apt update - sudo apt install kurtosis-cli=${{ inputs.kurtosis_cli }} + sudo apt install kurtosis-cli=0.90.1 kurtosis version - name: Disable kurtosis analytics @@ -316,7 +316,7 @@ jobs: run: | echo "deb [trusted=yes] https://apt.fury.io/kurtosis-tech/ /" | sudo tee /etc/apt/sources.list.d/kurtosis.list sudo apt update - sudo apt install kurtosis-cli=${{ inputs.kurtosis_cli }} + sudo apt install kurtosis-cli=0.90.1 kurtosis version - name: Disable kurtosis analytics @@ -394,7 +394,7 @@ jobs: run: | echo "deb [trusted=yes] https://apt.fury.io/kurtosis-tech/ /" | sudo tee /etc/apt/sources.list.d/kurtosis.list sudo apt update - sudo apt install kurtosis-cli=${{ inputs.kurtosis_cli }} + sudo apt install kurtosis-cli=0.90.1 kurtosis version - name: Disable kurtosis analytics @@ -430,7 +430,7 @@ jobs: run: | echo "deb [trusted=yes] https://apt.fury.io/kurtosis-tech/ /" | sudo tee /etc/apt/sources.list.d/kurtosis.list sudo apt update - sudo apt install kurtosis-cli=${{ inputs.kurtosis_cli }} + sudo apt install kurtosis-cli=0.90.1 kurtosis version - name: Disable kurtosis analytics @@ -486,7 +486,7 @@ jobs: run: | echo "deb [trusted=yes] https://apt.fury.io/kurtosis-tech/ /" | sudo tee /etc/apt/sources.list.d/kurtosis.list sudo apt update - sudo apt install kurtosis-cli=${{ inputs.kurtosis_cli }} + sudo apt install kurtosis-cli=0.90.1 kurtosis version - name: Disable kurtosis analytics @@ -542,7 +542,7 @@ jobs: run: | echo "deb [trusted=yes] https://apt.fury.io/kurtosis-tech/ /" | sudo tee /etc/apt/sources.list.d/kurtosis.list sudo apt update - sudo apt install kurtosis-cli=${{ inputs.kurtosis_cli }} + sudo apt install kurtosis-cli=0.90.1 kurtosis version - name: Disable kurtosis analytics From c4feb644fa5526b5a6b2aa1eab8c1014680010e4 Mon Sep 17 00:00:00 2001 From: dan moore Date: Thu, 11 Jul 2024 13:22:57 -0500 Subject: [PATCH 15/17] print db configs to debug: --- databases.star | 2 ++ 1 file changed, 2 insertions(+) diff --git a/databases.star b/databases.star index e2df7c92..b3b4ebb6 100644 --- a/databases.star +++ b/databases.star @@ -143,9 +143,11 @@ def create_postgres_service(plan, db_configs, suffix): def run(plan, suffix): db_configs = get_db_configs(suffix) + plan.print("DB Configs: ", db_configs) create_postgres_service(plan, db_configs, suffix) def run_pless(plan, suffix): db_configs = get_pless_db_configs(suffix) + plan.print("DB Configs: ", db_configs) create_postgres_service(plan, db_configs, _pless_suffix(suffix)) From 9df6c77acd865c409e4c4b33ae8eb2aeaf44b214 Mon Sep 17 00:00:00 2001 From: dan moore Date: Thu, 11 Jul 2024 13:25:35 -0500 Subject: [PATCH 16/17] cmon --- databases.star | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/databases.star b/databases.star index b3b4ebb6..f29a6c1b 100644 --- a/databases.star +++ b/databases.star @@ -143,11 +143,11 @@ def create_postgres_service(plan, db_configs, suffix): def run(plan, suffix): db_configs = get_db_configs(suffix) - plan.print("DB Configs: ", db_configs) + plan.print("DB Configs: " + str(db_configs)) create_postgres_service(plan, db_configs, suffix) def run_pless(plan, suffix): db_configs = get_pless_db_configs(suffix) - plan.print("DB Configs: ", db_configs) + plan.print("DB Configs: " + str(db_configs)) create_postgres_service(plan, db_configs, _pless_suffix(suffix)) From a4e6d5e95e04279c02590932c48b95d0c582b322 Mon Sep 17 00:00:00 2001 From: dan moore Date: Thu, 11 Jul 2024 13:34:22 -0500 Subject: [PATCH 17/17] adjust permissionless database set --- databases.star | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/databases.star b/databases.star index f29a6c1b..689096e7 100644 --- a/databases.star +++ b/databases.star @@ -99,7 +99,7 @@ def get_pless_db_configs(suffix): else _service_name(_pless_suffix(suffix)), "port": POSTGRES_PORT, } - for k, v in PERMISSIONLESS_DATABASES.items() + for k, v in TRUSTED_DATABASES.items() } return configs