Nightly #58
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Nightly | |
| on: | |
| schedule: | |
| - cron: '0 6 * * *' # Run this workflow every day at 6 AM Paris time (UTC+2). | |
| workflow_dispatch: | |
| inputs: | |
| param_file: | |
| description: This parameter file will be used when running Antithesis tests | |
| required: false | |
| type: string | |
| default: .github/tests/antithesis/fork12-cdk-erigon-validium.yml | |
| concurrency: | |
| group: nightly-${{ github.event.pull_request.number || github.ref }} | |
| cancel-in-progress: true | |
| env: | |
| ENCLAVE_NAME: cdk | |
| # Antithesis parameters. | |
| ANTITHESIS_REGISTRY: us-central1-docker.pkg.dev | |
| ANTITHESIS_REPOSITORY: molten-verve-216720/polygon-repository | |
| ANTITHESIS_TENANT: polygon | |
| ANTITHESIS_NOTEBOOK: polygon | |
| # This parameter file will be used when running Antithesis tests using the nightly schedule. | |
| DEFAULT_ANTITHESIS_PARAM_FILE: .github/tests/antithesis/fork12-cdk-erigon-validium.yml | |
| jobs: | |
| list-ymls: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 5 | |
| outputs: | |
| matrix: ${{ steps.set-matrix.outputs.matrix }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Generate test combinations | |
| working-directory: .github/tests | |
| run: ./combine-ymls.sh | |
| - id: set-matrix | |
| run: | | |
| files=$(ls -R ./.github/tests/combinations/*.yml ./.github/tests/nightly/**/*.yml | grep -Ev "sovereign|anvil|gas-token|pless-zkevm-node") | |
| matrix=$(echo "$files" | jq -R -s -c 'split("\n")[:-1]') | |
| echo "matrix=$matrix" >> $GITHUB_OUTPUT | |
| run-with-args: | |
| needs: list-ymls | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 30 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| file_name: ${{ fromJson(needs.list-ymls.outputs.matrix) }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Login to Docker Hub | |
| uses: docker/login-action@v3 | |
| with: | |
| username: ${{ secrets.DOCKERHUB_USERNAME }} | |
| password: ${{ secrets.DOCKERHUB_TOKEN }} | |
| if: ${{ env.DOCKERHUB_USERNAME && env.DOCKERHUB_TOKEN }} | |
| env: | |
| DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} | |
| DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }} | |
| - name: Install Kurtosis CDK tools | |
| uses: ./.github/actions/setup-kurtosis-cdk | |
| - name: Generate test combinations | |
| working-directory: .github/tests | |
| run: ./combine-ymls.sh | |
| - name: Create Enclave | |
| run: kurtosis enclave create ${{ env.ENCLAVE_NAME }} | |
| - name: Run Starlark | |
| run: kurtosis run --enclave=${{ env.ENCLAVE_NAME }} --args-file=${{ matrix.file_name }} --show-enclave-inspect=false . | |
| - name: Inspect enclave | |
| run: kurtosis enclave inspect ${{ env.ENCLAVE_NAME }} | |
| - name: Verify static ports | |
| run: | | |
| if [[ ${{ matrix.file_name }} == "./.github/tests/static-ports/default-static-ports.yml" ]]; then | |
| echo "Making sure public ports start by a 5 as defined by the static ports in the input_parser.star file." | |
| ports=$(kurtosis enclave inspect ${{ env.ENCLAVE_NAME }} | sed -n '/^========================================== User Services ==========================================$/,$ p' | tail -n +3) | |
| if ! wrong_ports=$(echo "$ports" | grep -vE '127.0.0.1:5|none'); then | |
| echo "✅ Default static ports are set correctly." | |
| exit 0 | |
| else | |
| echo "wrong_ports: $wrong_ports" | |
| echo "❌ Default static ports are not set correctly." | |
| exit 1 | |
| fi | |
| else | |
| echo "Skipping." | |
| fi | |
| - name: Monitor CDK chain verified batches (Central RPC) | |
| run: | | |
| result=$(yq --raw-output '.args.consensus_contract_type' ${{ matrix.file_name }}) | |
| if [[ "$result" == "pessimistic" ]]; then | |
| echo "Skipping block verification as consensus is pessimistic." | |
| else | |
| sequencer_type=$(yq --raw-output '.args.sequencer_type' ${{ matrix.file_name }}) | |
| rpc_name="" | |
| if [[ "$sequencer_type" == "erigon" ]]; then | |
| rpc_name="cdk-erigon-rpc-001" | |
| elif [[ "$sequencer_type" == "zkevm" ]]; then | |
| rpc_name="zkevm-node-rpc-001" | |
| elif [[ "$sequencer_type" == "null" ]]; then | |
| rpc_name="cdk-erigon-rpc-001" | |
| else | |
| echo "Unknown sequencer type: $sequencer_type" | |
| exit 1 | |
| fi | |
| echo "RPC name: $rpc_name" | |
| ./.github/scripts/monitor-cdk-chain.sh \ | |
| --enclave ${{ env.ENCLAVE_NAME }} \ | |
| --rpc-url $(kurtosis port print ${{ env.ENCLAVE_NAME }} $rpc_name rpc) | |
| fi | |
| - name: Monitor CDK chain verified batches (zkEVM Permissionless RPC) | |
| run: | | |
| result=$(yq --raw-output '.args.consensus_contract_type' ${{ matrix.file_name }}) | |
| if [[ "$result" == "pessimistic" ]]; then | |
| echo "Skipping block verification as consensus is pessimistic." | |
| else | |
| result=$(yq --raw-output '.args.additional_services // [] | contains(["pless_zkevm_node"])' ${{ matrix.file_name }}) | |
| if [[ "$result" == "true" ]]; then | |
| ./.github/scripts/monitor-cdk-chain.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 | |
| fi | |
| - name: Monitor OP rollup finalized blocks (OP CL RPC) | |
| run: | | |
| result=$(yq --raw-output '.deployment_stages.deploy_optimism_rollup' ${{ matrix.file_name }}) | |
| if [[ "$result" == "true" ]]; then | |
| ./.github/scripts/monitor-op-rollup.sh \ | |
| --enclave ${{ env.ENCLAVE_NAME }} \ | |
| --cl-rpc-url $(kurtosis port print ${{ env.ENCLAVE_NAME }} op-cl-1-op-node-op-geth-op-kurtosis http) | |
| else | |
| echo "Skipping block verification as there is no OP rollup in the environment" | |
| - name: Dump enclave | |
| if: ${{ !cancelled() }} | |
| run: kurtosis enclave dump ${{ env.ENCLAVE_NAME }} ./dump | |
| - name: Generate archive name | |
| if: ${{ !cancelled() }} | |
| run: | | |
| file_name=$(basename "${{ matrix.file_name }}" ".yml") | |
| archive_name="dump_run_with_args_${file_name}_${{ github.run_id }}" | |
| echo "ARCHIVE_NAME=${archive_name}" >> "$GITHUB_ENV" | |
| echo "Generated archive name: ${archive_name}" | |
| - name: Upload enclave dump | |
| if: ${{ !cancelled() }} | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ${{ env.ARCHIVE_NAME }} | |
| path: ./dump | |
| pre-deployed-gas-token: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 30 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Login to Docker Hub | |
| uses: docker/login-action@v3 | |
| with: | |
| username: ${{ secrets.DOCKERHUB_USERNAME }} | |
| password: ${{ secrets.DOCKERHUB_TOKEN }} |