From b3648b90df2432cecab8048bc3d66a1c469c1ebb Mon Sep 17 00:00:00 2001 From: Max Revitt Date: Fri, 22 Nov 2024 15:58:45 +0000 Subject: [PATCH] fix(kurtosis): upgrade, params.yml reinstate --- .github/scripts/test_resequence.sh | 8 ++--- .github/workflows/ci_zkevm.yml | 44 +++++++++++++-------------- .github/workflows/test-resequence.yml | 14 ++++----- 3 files changed, 31 insertions(+), 35 deletions(-) diff --git a/.github/scripts/test_resequence.sh b/.github/scripts/test_resequence.sh index b36bc878236..d59c780a33c 100755 --- a/.github/scripts/test_resequence.sh +++ b/.github/scripts/test_resequence.sh @@ -50,7 +50,7 @@ wait_for_l1_batch() { current_batch=$(cast logs --rpc-url "$(kurtosis port print cdk-v1 el-1-geth-lighthouse rpc)" --address 0x1Fe038B54aeBf558638CA51C91bC8cCa06609e91 --from-block 0 --json | jq -r '.[] | select(.topics[0] == "0x3e54d0825ed78523037d00a81759237eb436ce774bd546993ee67a1b67b6e766") | .topics[1]' | tail -n 1 | sed 's/^0x//') current_batch=$((16#$current_batch)) elif [ "$batch_type" = "verified" ]; then - current_batch=$(cast rpc zkevm_verifiedBatchNumber --rpc-url "$(kurtosis port print cdk-v1 cdk-erigon-node-001 rpc)" | sed 's/^"//;s/"$//') + current_batch=$(cast rpc zkevm_verifiedBatchNumber --rpc-url "$(kurtosis port print cdk-v1 cdk-erigon-rpc-001 rpc)" | sed 's/^"//;s/"$//') else echo "Invalid batch type. Use 'virtual' or 'verified'." return 1 @@ -121,7 +121,7 @@ kurtosis service exec cdk-v1 cdk-erigon-sequencer-001 "nohup cdk-erigon --pprof= sleep 30 echo "Running loadtest using polycli" -/usr/local/bin/polycli loadtest --rpc-url "$(kurtosis port print cdk-v1 cdk-erigon-node-001 rpc)" --private-key "0x12d7de8621a77640c9241b2595ba78ce443d05e94090365ab3bb5e19df82c625" --verbosity 600 --requests 2000 --rate-limit 500 --mode uniswapv3 --legacy +/usr/local/bin/polycli loadtest --rpc-url "$(kurtosis port print cdk-v1 cdk-erigon-rpc-001 rpc)" --private-key "0x12d7de8621a77640c9241b2595ba78ce443d05e94090365ab3bb5e19df82c625" --verbosity 600 --requests 2000 --rate-limit 500 --mode uniswapv3 --legacy echo "Waiting for batch virtualization" if ! wait_for_l1_batch 600 "virtual"; then @@ -174,13 +174,13 @@ echo "Getting block hash from sequencer" sequencer_hash=$(cast block $comparison_block --rpc-url "$(kurtosis port print cdk-v1 cdk-erigon-sequencer-001 rpc)" | grep "hash" | awk '{print $2}') # wait for block to be available on sync node -if ! wait_for_l2_block_number $comparison_block "$(kurtosis port print cdk-v1 cdk-erigon-node-001 rpc)"; then +if ! wait_for_l2_block_number $comparison_block "$(kurtosis port print cdk-v1 cdk-erigon-rpc-001 rpc)"; then echo "Failed to wait for batch verification" exit 1 fi echo "Getting block hash from node" -node_hash=$(cast block $comparison_block --rpc-url "$(kurtosis port print cdk-v1 cdk-erigon-node-001 rpc)" | grep "hash" | awk '{print $2}') +node_hash=$(cast block $comparison_block --rpc-url "$(kurtosis port print cdk-v1 cdk-erigon-rpc-001 rpc)" | grep "hash" | awk '{print $2}') echo "Sequencer block hash: $sequencer_hash" echo "Node block hash: $node_hash" diff --git a/.github/workflows/ci_zkevm.yml b/.github/workflows/ci_zkevm.yml index 02ed91b9218..b2f6980ea7a 100644 --- a/.github/workflows/ci_zkevm.yml +++ b/.github/workflows/ci_zkevm.yml @@ -89,12 +89,6 @@ jobs: - name: Install Foundry uses: foundry-rs/foundry-toolchain@v1 - - name: Install yq - run: | - sudo curl -L https://github.com/mikefarah/yq/releases/download/v4.44.2/yq_linux_amd64 -o /usr/local/bin/yq - sudo chmod +x /usr/local/bin/yq - /usr/local/bin/yq --version - - name: Build docker image working-directory: ./cdk-erigon run: docker build -t cdk-erigon:local --file Dockerfile . @@ -106,16 +100,19 @@ jobs: sed -i '/zkevm.sequencer-non-empty-batch-seal-time:/d' templates/cdk-erigon/config.yml sed -i '/sentry.drop-useless-peers:/d' templates/cdk-erigon/config.yml sed -i '/zkevm.l2-datastreamer-timeout:/d' templates/cdk-erigon/config.yml - - name: Configure Kurtosis CDK + + + - name: Create params.yml overrides working-directory: ./kurtosis-cdk run: | - /usr/local/bin/yq -i '.args.data_availability_mode = "${{ matrix.da-mode }}"' params.yml - /usr/local/bin/yq -i '.args.cdk_erigon_node_image = "cdk-erigon:local"' params.yml + echo 'args:' > params.yml + echo ' data_availability_mode: '"${{ matrix.da-mode }}" >> params.yml + echo ' cdk_erigon_node_image: cdk-erigon:local' >> params.yml - name: Deploy Kurtosis CDK package working-directory: ./kurtosis-cdk run: | - kurtosis run --enclave cdk-v1 --image-download always . '{"args": {"data_availability_mode": "${{ matrix.da-mode }}", "cdk_erigon_node_image": "cdk-erigon:local"}}' + kurtosis run --enclave cdk-v1 --image-download always --args-file params.yml . - name: Run process with CPU monitoring working-directory: ./cdk-erigon @@ -137,7 +134,7 @@ jobs: - name: Monitor verified batches working-directory: ./kurtosis-cdk shell: bash - run: timeout 900s .github/scripts/monitor-verified-batches.sh --rpc-url $(kurtosis port print cdk-v1 cdk-erigon-node-001 rpc) --target 20 --timeout 900 + run: timeout 900s .github/scripts/monitor-verified-batches.sh --rpc-url $(kurtosis port print cdk-v1 cdk-erigon-rpc-001 rpc) --target 20 --timeout 900 - name: Set up Docker Buildx uses: docker/setup-buildx-action@v2 @@ -147,7 +144,7 @@ jobs: kurtosis files download cdk-v1 bridge-config-artifact echo "BRIDGE_ADDRESS=$(/usr/local/bin/yq '.NetworkConfig.PolygonBridgeAddress' bridge-config-artifact/bridge-config.toml)" >> $GITHUB_ENV echo "ETH_RPC_URL=$(kurtosis port print cdk-v1 el-1-geth-lighthouse rpc)" >> $GITHUB_ENV - echo "L2_RPC_URL=$(kurtosis port print cdk-v1 cdk-erigon-node-001 rpc)" >> $GITHUB_ENV + echo "L2_RPC_URL=$(kurtosis port print cdk-v1 cdk-erigon-rpc-001 rpc)" >> $GITHUB_ENV echo "BRIDGE_API_URL=$(kurtosis port print cdk-v1 zkevm-bridge-service-001 rpc)" >> $GITHUB_ENV - name: Clone bridge repository @@ -187,7 +184,7 @@ jobs: run: | mkdir -p ci_logs cd ci_logs - kurtosis service logs cdk-v1 cdk-erigon-node-001 --all > cdk-erigon-node-001.log + kurtosis service logs cdk-v1 cdk-erigon-rpc-001 --all > cdk-erigon-rpc-001.log kurtosis service logs cdk-v1 cdk-erigon-sequencer-001 --all > cdk-erigon-sequencer-001.log kurtosis service logs cdk-v1 zkevm-agglayer-001 --all > zkevm-agglayer-001.log kurtosis service logs cdk-v1 zkevm-prover-001 --all > zkevm-prover-001.log @@ -222,12 +219,6 @@ jobs: - name: Install Foundry uses: foundry-rs/foundry-toolchain@v1 - - name: Install yq - run: | - sudo curl -L https://github.com/mikefarah/yq/releases/download/v4.44.2/yq_linux_amd64 -o /usr/local/bin/yq - sudo chmod +x /usr/local/bin/yq - /usr/local/bin/yq --version - - name: Install polycli run: | tmp_dir=$(mktemp -d) && curl -L https://github.com/0xPolygon/polygon-cli/releases/download/v0.1.48/polycli_v0.1.48_linux_amd64.tar.gz | tar -xz -C "$tmp_dir" && mv "$tmp_dir"/* /usr/local/bin/polycli && rm -rf "$tmp_dir" @@ -258,15 +249,22 @@ jobs: sed -i 's/"shanghaiTime": [0-9]\+/"shanghaiTime": 0/' ./templates/cdk-erigon/chainspec.json sed -i 's/"cancunTime": [0-9]\+/"cancunTime": 0/' ./templates/cdk-erigon/chainspec.json sed -i '/"terminalTotalDifficulty"/d' ./templates/cdk-erigon/chainspec.json - + + - name: Create params.yml overrides + working-directory: ./kurtosis-cdk + run: | + echo 'args:' > params.yml + echo ' erigon_strict_mode: false' >> params.yml + echo ' cdk_erigon_node_image: cdk-erigon:local' >> params.yml + - name: Deploy Kurtosis CDK package working-directory: ./kurtosis-cdk run: | - kurtosis run --enclave cdk-v1 --image-download always . '{"args": {"erigon_strict_mode": false, "cdk_erigon_node_image": "cdk-erigon:local"}}' + kurtosis run --enclave cdk-v1 --image-download always --args-file params.yml . - name: Dynamic gas fee tx load test working-directory: ./kurtosis-cdk - run: /usr/local/bin/polycli loadtest --rpc-url "$(kurtosis port print cdk-v1 cdk-erigon-node-001 rpc)" --private-key "0x12d7de8621a77640c9241b2595ba78ce443d05e94090365ab3bb5e19df82c625" --verbosity 700 --requests 500 --rate-limit 50 --mode uniswapv3 + run: /usr/local/bin/polycli loadtest --rpc-url "$(kurtosis port print cdk-v1 cdk-erigon-rpc-001 rpc)" --private-key "0x12d7de8621a77640c9241b2595ba78ce443d05e94090365ab3bb5e19df82c625" --verbosity 700 --requests 500 --rate-limit 50 --mode uniswapv3 - name: Upload logs uses: actions/upload-artifact@v3 @@ -280,7 +278,7 @@ jobs: run: | mkdir -p ci_logs cd ci_logs - kurtosis service logs cdk-v1 cdk-erigon-node-001 --all > cdk-erigon-node-001.log + kurtosis service logs cdk-v1 cdk-erigon-rpc-001 --all > cdk-erigon-rpc-001.log kurtosis service logs cdk-v1 cdk-erigon-sequencer-001 --all > cdk-erigon-sequencer-001.log - name: Upload logs diff --git a/.github/workflows/test-resequence.yml b/.github/workflows/test-resequence.yml index 9df3494f438..eece01ceb94 100644 --- a/.github/workflows/test-resequence.yml +++ b/.github/workflows/test-resequence.yml @@ -34,11 +34,6 @@ jobs: - name: Install Foundry uses: foundry-rs/foundry-toolchain@v1 - - name: Install yq - run: | - sudo curl -L https://github.com/mikefarah/yq/releases/download/v4.44.2/yq_linux_amd64 -o /usr/local/bin/yq - sudo chmod +x /usr/local/bin/yq - /usr/local/bin/yq --version - name: Install polycli run: | tmp_dir=$(mktemp -d) && curl -L https://github.com/0xPolygon/polygon-cli/releases/download/v0.1.48/polycli_v0.1.48_linux_amd64.tar.gz | tar -xz -C "$tmp_dir" && mv "$tmp_dir"/* /usr/local/bin/polycli && rm -rf "$tmp_dir" @@ -56,10 +51,13 @@ jobs: sed -i '/sentry.drop-useless-peers:/d' templates/cdk-erigon/config.yml sed -i '/zkevm.pool-manager-url/d' templates/cdk-erigon/config.yml sed -i '/zkevm.l2-datastreamer-timeout:/d' templates/cdk-erigon/config.yml - - name: Configure Kurtosis CDK + + - name: Create params.yml overrides working-directory: ./kurtosis-cdk run: | - /usr/local/bin/yq -i '.args.cdk_erigon_node_image = "cdk-erigon:local"' params.yml + echo 'args:' > params.yml + echo ' cdk_erigon_node_image: cdk-erigon:local' >> params.yml + - name: Deploy Kurtosis CDK package working-directory: ./kurtosis-cdk run: kurtosis run --enclave cdk-v1 --args-file params.yml --image-download always . @@ -80,7 +78,7 @@ jobs: run: | mkdir -p ci_logs cd ci_logs - kurtosis service logs cdk-v1 cdk-erigon-node-001 --all > cdk-erigon-node-001.log + kurtosis service logs cdk-v1 cdk-erigon-rpc-001 --all > cdk-erigon-rpc-001.log kurtosis service logs cdk-v1 cdk-erigon-sequencer-001 --all > cdk-erigon-sequencer-001.log kurtosis service logs cdk-v1 zkevm-agglayer-001 --all > zkevm-agglayer-001.log kurtosis service logs cdk-v1 zkevm-prover-001 --all > zkevm-prover-001.log