Repository: 0xPolygon/cdk
Pull request #310: fix: update Kurtosis CDK references and Docker images
Author: login: Stefan-Ethernal
Labels: name: ci
Created: 2025-03-14T12:20:46Z | Merged: 2025-03-18T15:34:36Z

## Description

Currently the e2e from branch release/v0.5.x are failing due kurtosis-cdk changes. This PR fix it.

The FEP and PP are splitted to reduce the complexity of pass both of them with same combination of agglayer + kurtosis_cdk



Diff:
diff --git a/.github/workflows/test-e2e-multi_pp.yml b/.github/workflows/test-e2e-multi_pp.yml
index fd19256f3..b3014d6d8 100644
--- a/.github/workflows/test-e2e-multi_pp.yml
+++ b/.github/workflows/test-e2e-multi_pp.yml
@@ -7,6 +7,7 @@ on:
   workflow_dispatch: {}
 
 jobs:
+  
   test-e2e-multi_pp:
     strategy:
       fail-fast: false
diff --git a/.github/workflows/test-e2e-pp.yml b/.github/workflows/test-e2e-pp.yml
new file mode 100644
index 000000000..e8b1ce9f8
--- /dev/null
+++ b/.github/workflows/test-e2e-pp.yml
@@ -0,0 +1,106 @@
+name: Test e2e pp
+on: 
+  push:
+    branches:
+      - '**'
+  workflow_dispatch: {}
+
+
+jobs:
+  build-cdk-image:
+    runs-on: ubuntu-latest
+    timeout-minutes: 10
+    steps:
+    - name: Checkout code
+      uses: actions/checkout@v4
+
+    - uses: actions/setup-go@v5
+      with:
+        go-version: 1.23.x
+
+    - name: Build cdk docker image
+      run: make build-docker
+    
+    - name: Save cdk image to archive
+      run: docker save --output /tmp/cdk.tar cdk
+    
+    - name: Upload archive
+      uses: actions/upload-artifact@v4
+      with:
+        name: cdk
+        path: /tmp/cdk.tar
+
+  test-e2e:
+    runs-on: ubuntu-latest
+    timeout-minutes: 30
+    needs: build-cdk-image
+    strategy:
+      fail-fast: false
+      matrix:
+        e2e-group:
+          - "fork12-pessimistic"
+    steps:
+    - name: Checkout Code
+      uses: actions/checkout@v4
+    
+    - name: Checkout Kurtosis CDK
+      uses: actions/checkout@v4
+      with:
+        repository: 0xPolygon/kurtosis-cdk
+        path: kurtosis-cdk
+        ref: v0.2.31
+    
+    - name: Install Kurtosis CDK tools
+      uses: ./kurtosis-cdk/.github/actions/setup-kurtosis-cdk
+    
+    - name: Install polycli
+      run: |
+        POLYCLI_VERSION="${{ vars.POLYCLI_VERSION }}"
+        tmp_dir=$(mktemp -d) 
+        curl -L "https://github.com/0xPolygon/polygon-cli/releases/download/${POLYCLI_VERSION}/polycli_${POLYCLI_VERSION}_linux_amd64.tar.gz" | tar -xz -C "$tmp_dir" 
+        mv "$tmp_dir"/* /usr/local/bin/polycli 
+        rm -rf "$tmp_dir"
+        sudo chmod +x /usr/local/bin/polycli
+        /usr/local/bin/polycli version
+
+    - name: Setup Bats and bats libs
+      uses: bats-core/bats-action@2.0.0
+    
+    - name: Download cdk archive
+      uses: actions/download-artifact@v4
+      with:
+        name: cdk
+        path: /tmp
+    
+    - name: Load cdk image
+      run: |
+        docker load --input /tmp/cdk.tar
+        docker image ls -a
+
+    - name: Run e2e tests
+      run: make test-e2e-${{ matrix.e2e-group }}
+      working-directory: test
+      env:
+        KURTOSIS_FOLDER: ${{ github.workspace }}/kurtosis-cdk
+        BATS_LIB_PATH: /usr/lib/
+        agglayer_prover_sp1_key: ${{ secrets.SP1_PRIVATE_KEY }}
+
+    
+    - name: Dump enclave logs
+      if: failure()
+      run: kurtosis dump ./dump
+
+    - name: Generate archive name
+      if: failure()
+      run: |
+        archive_name="dump_run_with_args_${{matrix.e2e-group}}_${{ github.run_id }}"
+        echo "ARCHIVE_NAME=${archive_name}" >> "$GITHUB_ENV"
+        echo "Generated archive name: ${archive_name}"
+        kurtosis service exec cdk cdk-node-001 'cat /etc/cdk/cdk-node-config.toml' > ./dump/cdk-node-config.toml
+
+    - name: Upload logs
+      if: failure()
+      uses: actions/upload-artifact@v4
+      with:
+        name: ${{ env.ARCHIVE_NAME }}
+        path: ./dump
diff --git a/.github/workflows/test-e2e.yml b/.github/workflows/test-e2e.yml
index 0e36194c6..e7dd8aac6 100644
--- a/.github/workflows/test-e2e.yml
+++ b/.github/workflows/test-e2e.yml
@@ -42,7 +42,6 @@ jobs:
           - "fork11-rollup"
           - "fork12-validium"
           - "fork12-rollup"
-          - "fork12-pessimistic"
     steps:
     - name: Checkout Code
       uses: actions/checkout@v4
@@ -52,7 +51,7 @@ jobs:
       with:
         repository: 0xPolygon/kurtosis-cdk
         path: kurtosis-cdk
-        ref: v0.2.31
+        ref: v0.3.3
     
     - name: Install Kurtosis CDK tools
       uses: ./kurtosis-cdk/.github/actions/setup-kurtosis-cdk
diff --git a/test/combinations/fork11-rollup.yml b/test/combinations/fork11-rollup.yml
index ef28985f7..eab92ba40 100644
--- a/test/combinations/fork11-rollup.yml
+++ b/test/combinations/fork11-rollup.yml
@@ -2,14 +2,12 @@ deployment_stages:
   deploy_l2_contracts: true
 
 args:
-  agglayer_image: ghcr.io/agglayer/agglayer:0.2.0-rc.19
   zkevm_contracts_image: leovct/zkevm-contracts:v7.0.0-rc.2-fork.11-patch.1
-  zkevm_prover_image: hermeznetwork/zkevm-prover:v7.0.2-fork.11
-  zkevm_node_image: hermeznetwork/zkevm-node:v0.7.0-fork11-RC1
+  agglayer_image: ghcr.io/agglayer/agglayer:0.2.0-rc.19
+  zkevm_prover_image: hermeznetwork/zkevm-prover:v7.0.4-hotfix.2-fork.11
+  zkevm_node_image: hermeznetwork/zkevm-node:v0.7.0-fork11
   cdk_node_image: cdk:latest
   gas_token_enabled: true
   gas_token_address: ""
   consensus_contract_type: rollup
   sequencer_type: erigon
-  # This is just a workaround, since the Kurtosis is deploying the agglayer even in the FEP setup
-  agglayer_prover_sp1_key: {{.agglayer_prover_sp1_key}}
diff --git a/test/combinations/fork12-cdk-validium.yml b/test/combinations/fork12-cdk-validium.yml
index b0437e74a..da4487dde 100644
--- a/test/combinations/fork12-cdk-validium.yml
+++ b/test/combinations/fork12-cdk-validium.yml
@@ -2,13 +2,10 @@ deployment_stages:
   deploy_l2_contracts: true
 
 args:
-  zkevm_contracts_image: leovct/zkevm-contracts:v8.0.0-rc.4-fork.12-patch.1
-  zkevm_prover_image: hermeznetwork/zkevm-prover:v8.0.0-RC12-fork.12
-  cdk_erigon_node_image: hermeznetwork/cdk-erigon:v2.61.14-RC1-amd64
+  zkevm_contracts_image: leovct/zkevm-contracts:v9.0.0-rc.6-pp-fork.12
+  zkevm_prover_image: hermeznetwork/zkevm-prover:v8.0.0-RC16-fork.12
   cdk_node_image: cdk:latest
   gas_token_enabled: true
   gas_token_address: ""
   consensus_contract_type: cdk-validium
   sequencer_type: erigon
-  # This is just a workaround, since the Kurtosis is deploying the agglayer even in the FEP setup
-  agglayer_prover_sp1_key: {{.agglayer_prover_sp1_key}}
diff --git a/test/combinations/fork12-pessimistic-multi-attach-second-cdk.yml b/test/combinations/fork12-pessimistic-multi-attach-second-cdk.yml
index 28ab383b0..e6a082ba1 100644
--- a/test/combinations/fork12-pessimistic-multi-attach-second-cdk.yml
+++ b/test/combinations/fork12-pessimistic-multi-attach-second-cdk.yml
@@ -25,7 +25,6 @@ args:
   zkevm_l2_proofsigner_address: "0xf1a661D7b601Ec46a040f57193cC99aB8c4132FA"
   zkevm_l2_proofsigner_private_key: "0xc7fe3a006d75ba9326d9792523385abb49057c66aee0b8b4248821a89713f975"
 
-
   cdk_node_image: cdk:latest
   cdk_erigon_node_image: hermeznetwork/cdk-erigon:v2.61.14-RC1-amd64
   zkevm_contracts_image: leovct/zkevm-contracts:v9.0.0-rc.5-pp-fork.12
@@ -37,4 +36,3 @@ args:
   zkevm_use_real_verifier: false
   enable_normalcy: true
   verifier_program_vkey: 0x00766aa16a6efe4ac05c0fe21d4b50f9631dbd1a2663a982da861427085ea2ea
-
diff --git a/test/combinations/fork12-pessimistic-multi.yml b/test/combinations/fork12-pessimistic-multi.yml
index b46283048..64314c6e8 100644
--- a/test/combinations/fork12-pessimistic-multi.yml
+++ b/test/combinations/fork12-pessimistic-multi.yml
@@ -1,8 +1,9 @@
 args:
+  verbosity: debug
   cdk_node_image: cdk:latest
-  agglayer_image: ghcr.io/agglayer/agglayer:main
-  cdk_erigon_node_image: hermeznetwork/cdk-erigon:v2.61.9-RC1
-  zkevm_contracts_image: leovct/zkevm-contracts:v9.0.0-rc.5-pp-fork.12
+  agglayer_image: ghcr.io/agglayer/agglayer@sha256:5715855f2cc6834bd84a99a33937915164648547d21bfb55198948b0ae4e0fad
+  cdk_erigon_node_image: hermeznetwork/cdk-erigon:v2.61.16-hotfix2
+  zkevm_contracts_image: leovct/zkevm-contracts:v9.0.0-rc.6-pp-fork.12
   additional_services: []
   consensus_contract_type: pessimistic
   sequencer_type: erigon
@@ -11,7 +12,4 @@ args:
   zkevm_use_real_verifier: false
   enable_normalcy: true
   verifier_program_vkey: 0x00766aa16a6efe4ac05c0fe21d4b50f9631dbd1a2663a982da861427085ea2ea
-  agglayer_prover_sp1_key: {{.agglayer_prover_sp1_key}}
-
-
-
+  agglayer_prover_sp1_key: {{.agglayer_prover_sp1_key}}
\ No newline at end of file
diff --git a/test/combinations/fork12-pessimistic.yml b/test/combinations/fork12-pessimistic.yml
index bb653fe6c..dc2318c9a 100644
--- a/test/combinations/fork12-pessimistic.yml
+++ b/test/combinations/fork12-pessimistic.yml
@@ -1,18 +1,18 @@
 args:
-  agglayer_image: ghcr.io/agglayer/agglayer:main
-  cdk_erigon_node_image: hermeznetwork/cdk-erigon:v2.61.14-RC1-amd64
-  zkevm_contracts_image: leovct/zkevm-contracts:v9.0.0-rc.5-pp-fork.12
+  verbosity: debug
   cdk_node_image: cdk:latest
-  zkevm_bridge_proxy_image: haproxy:3.1-bookworm
-  zkevm_bridge_service_image: hermeznetwork/zkevm-bridge-service:v0.6.0-RC5
-  zkevm_bridge_ui_image: leovct/zkevm-bridge-ui:multi-network
+  agglayer_image: ghcr.io/agglayer/agglayer@sha256:5715855f2cc6834bd84a99a33937915164648547d21bfb55198948b0ae4e0fad
+  cdk_erigon_node_image: hermeznetwork/cdk-erigon:v2.61.16-hotfix2
+  zkevm_contracts_image: leovct/zkevm-contracts:v9.0.0-rc.5-pp-fork.12
+  zkevm_prover_image: hermeznetwork/zkevm-prover:v8.0.0-RC16-fork.12
   additional_services: []
   consensus_contract_type: pessimistic
   sequencer_type: erigon
   erigon_strict_mode: false
   gas_token_enabled: true
-  gas_token_address: ""
+  gas_token_address: ''
   zkevm_use_real_verifier: false
+  agglayer_prover_primary_prover: mock-prover
   enable_normalcy: true
+  agglayer_prover_sp1_key: {{.agglayer_prover_sp1_key}}
   verifier_program_vkey: 0x00766aa16a6efe4ac05c0fe21d4b50f9631dbd1a2663a982da861427085ea2ea
-  
\ No newline at end of file
diff --git a/test/combinations/fork12-rollup.yml b/test/combinations/fork12-rollup.yml
index 4d10ba139..077e9a801 100644
--- a/test/combinations/fork12-rollup.yml
+++ b/test/combinations/fork12-rollup.yml
@@ -2,12 +2,10 @@ deployment_stages:
   deploy_l2_contracts: true
 
 args:
-  zkevm_contracts_image: leovct/zkevm-contracts:v8.0.0-rc.4-fork.12-patch.1
+  zkevm_contracts_image: leovct/zkevm-contracts:v9.0.0-rc.6-pp-fork.12
   zkevm_prover_image: hermeznetwork/zkevm-prover:v8.0.0-RC16-fork.12
-  cdk_erigon_node_image: hermeznetwork/cdk-erigon:v2.61.14-RC1-amd64
   cdk_node_image: cdk:latest
   gas_token_enabled: true
   gas_token_address: ""
   consensus_contract_type: rollup
   sequencer_type: erigon
-  agglayer_prover_sp1_key: {{.agglayer_prover_sp1_key}}
diff --git a/test/combinations/fork9-cdk-validium.yml b/test/combinations/fork9-cdk-validium.yml
index 788df9624..152f25ad1 100644
--- a/test/combinations/fork9-cdk-validium.yml
+++ b/test/combinations/fork9-cdk-validium.yml
@@ -2,10 +2,10 @@ deployment_stages:
   deploy_l2_contracts: true
 
 args:
-  agglayer_image: ghcr.io/agglayer/agglayer:0.2.0-rc.19
   zkevm_contracts_image: leovct/zkevm-contracts:v6.0.0-rc.1-fork.9-patch.1
-  zkevm_prover_image: hermeznetwork/zkevm-prover:v6.0.6
-  zkevm_node_image: hermeznetwork/zkevm-node:v0.7.3-RC1
+  agglayer_image: ghcr.io/agglayer/agglayer:0.2.0-rc.19
+  zkevm_prover_image: hermeznetwork/zkevm-prover:v6.0.8
+  zkevm_node_image: hermeznetwork/zkevm-node:v0.7.3
   cdk_validium_node_image: 0xpolygon/cdk-validium-node:0.7.0-cdk
   consensus_contract_type: cdk-validium
   cdk_node_image: cdk:latest
@@ -13,6 +13,3 @@ args:
   gas_token_address: ""
   additional_services:
     - pless_zkevm_node
-  sequencer_type: erigon
-  # This is just a workaround, since the Kurtosis is deploying the agglayer even in the FEP setup
-  agglayer_prover_sp1_key: {{.agglayer_prover_sp1_key}}
diff --git a/test/config/kurtosis-cdk-node-config.toml.template b/test/config/kurtosis-cdk-node-config.toml.template
index 45b938a2e..c96224105 100644
--- a/test/config/kurtosis-cdk-node-config.toml.template
+++ b/test/config/kurtosis-cdk-node-config.toml.template
@@ -1,7 +1,7 @@
 PathRWData = "{{.zkevm_path_rw_data}}/"
 L1URL="{{.l1_rpc_url}}"
 L2URL="http://{{.l2_rpc_name}}{{.deployment_suffix}}:{{.zkevm_rpc_http_port}}"
-AggLayerURL="{{.agglayer_url}}"
+AggLayerURL="{{.agglayer_readrpc_url}}"
 
 ForkId = {{.zkevm_rollup_fork_id}}
 IsValidiumMode = {{.is_cdk_validium}}
diff --git a/test/config/kurtosis-cdk-node-config.toml.template.pessimistic b/test/config/kurtosis-cdk-node-config.toml.template.pessimistic
new file mode 100644
index 000000000..a0c8e6db3
--- /dev/null
+++ b/test/config/kurtosis-cdk-node-config.toml.template.pessimistic
@@ -0,0 +1,62 @@
+PathRWData = "{{.zkevm_path_rw_data}}/"
+L1URL="{{.l1_rpc_url}}"
+L2URL="http://{{.l2_rpc_name}}{{.deployment_suffix}}:{{.zkevm_rpc_http_port}}"
+AggLayerURL="{{.agglayer_url}}"
+
+ForkId = {{.zkevm_rollup_fork_id}}
+IsValidiumMode = {{.is_cdk_validium}}
+
+{{if eq .zkevm_rollup_fork_id "12"}}
+ContractVersions = "banana"
+{{else if eq .zkevm_rollup_fork_id "13"}}
+# Doesn't look like this is needed at the moment, but soon perhaps?
+# ContractVersions = "durian"
+ContractVersions = "banana"
+{{else}}
+ContractVersions = "elderberry"
+{{end}}
+
+L2Coinbase =  "{{.zkevm_l2_sequencer_address}}"
+SequencerPrivateKeyPath = "{{or .zkevm_l2_sequencer_keystore_file "/etc/cdk/sequencer.keystore"}}"
+SequencerPrivateKeyPassword  = "{{.zkevm_l2_keystore_password}}"
+
+AggregatorPrivateKeyPath = "{{or .zkevm_l2_aggregator_keystore_file "/etc/cdk/aggregator.keystore"}}"
+AggregatorPrivateKeyPassword  = "{{.zkevm_l2_keystore_password}}"
+SenderProofToL1Addr = "{{.zkevm_l2_agglayer_address}}"   
+polygonBridgeAddr = "{{.zkevm_bridge_address}}" 
+
+
+RPCURL = "http://{{.l2_rpc_name}}{{.deployment_suffix}}:{{.zkevm_rpc_http_port}}"
+WitnessURL = "http://{{.l2_rpc_name}}{{.deployment_suffix}}:{{.zkevm_rpc_http_port}}"
+
+
+# This values can be override directly from genesis.json
+rollupCreationBlockNumber = "{{.zkevm_rollup_manager_block_number}}"
+rollupManagerCreationBlockNumber = "{{.zkevm_rollup_manager_block_number}}"
+genesisBlockNumber = "{{.zkevm_rollup_manager_block_number}}"
+[L1Config]
+	chainId = "{{.l1_chain_id}}"
+	polygonZkEVMGlobalExitRootAddress = "{{.zkevm_global_exit_root_address}}"
+	polygonRollupManagerAddress = "{{.zkevm_rollup_manager_address}}"
+	polTokenAddress = "{{.pol_token_address}}"
+	polygonZkEVMAddress = "{{.zkevm_rollup_address}}"
+	
+[L2Config]
+	GlobalExitRootAddr = "{{.zkevm_global_exit_root_address}}"
+
+[Log]
+Environment = "development" # "production" or "development"
+Level = "{{.global_log_level}}"
+Outputs = ["stderr"]
+
+[Aggregator]
+        Port = "{{.zkevm_aggregator_port}}"
+        RetryTime = "30s"
+        VerifyProofInterval = "10s"
+        GasOffset = 150000
+        SettlementBackend = "agglayer"
+       
+[AggSender]
+SaveCertificatesToFilesPath = "{{.zkevm_path_rw_data}}/"
+
+
diff --git a/test/run-e2e-multi_pp.sh b/test/run-e2e-multi_pp.sh
index f63013568..d4a3f0a02 100755
--- a/test/run-e2e-multi_pp.sh
+++ b/test/run-e2e-multi_pp.sh
@@ -1,5 +1,6 @@
 #!/bin/bash
 source $(dirname $0)/scripts/env.sh
+source $(dirname $0)/scripts/shared.sh
 
 function log_error() {
     echo -e "\033[0;31mError: $*" "\033[0m"
@@ -43,6 +44,8 @@ function resolve_template(){
     eval $_RESULT_VARNAME="$_TEMP_FILE"
 }
 
+
+
 ###############################################################################
 # MAIN
 ###############################################################################
@@ -62,6 +65,9 @@ build_docker_if_required
 resolve_template $PP1_ORIGIN_CONFIG_FILE PP1_RENDERED_CONFIG_FILE
 resolve_template $PP2_ORIGIN_CONFIG_FILE PP2_RENDERED_CONFIG_FILE
 
+override_cdk_node_config_file pessimistic
+ok_or_fatal "Failed to override cdk node config file"
+
 kurtosis clean --all
 kurtosis run --enclave $KURTOSIS_ENCLAVE --args-file "$PP1_RENDERED_CONFIG_FILE" --image-download always $KURTOSIS_FOLDER
 ok_or_fatal "Failed to run kurtosis pp1"
diff --git a/test/run-e2e.sh b/test/run-e2e.sh
index adbbcbcb1..0a30ba3b2 100755
--- a/test/run-e2e.sh
+++ b/test/run-e2e.sh
@@ -1,5 +1,6 @@
 #!/bin/bash
 source $(dirname $0)/scripts/env.sh
+source $(dirname $0)/scripts/shared.sh
 
 FORK=$1
 if [ -z $FORK ]; then
@@ -25,8 +26,8 @@ else
 fi
 
 kurtosis clean --all
-echo "Override cdk config file"
-cp $BASE_FOLDER/config/kurtosis-cdk-node-config.toml.template $KURTOSIS_FOLDER/templates/trusted-node/cdk-node-config.toml
+override_cdk_node_config_file $DATA_AVAILABILITY_MODE
+
 KURTOSIS_CONFIG_FILE="combinations/$FORK-$DATA_AVAILABILITY_MODE.yml"
 TEMP_CONFIG_FILE=$(mktemp --suffix ".yml")
 echo "rendering $KURTOSIS_CONFIG_FILE to temp file $TEMP_CONFIG_FILE"
diff --git a/test/scripts/agglayer_certificates_monitor.sh b/test/scripts/agglayer_certificates_monitor.sh
index c530548f8..7740c4747 100755
--- a/test/scripts/agglayer_certificates_monitor.sh
+++ b/test/scripts/agglayer_certificates_monitor.sh
@@ -1,11 +1,11 @@
 #!/usr/bin/env bash
 # This script monitors the agglayer certificates progress of pessimistic proof.
 
-function parse_params(){
+function parse_params() {
     # Check if the required arguments are provided.
     if [ "$#" -lt 3 ]; then
-    echo "Usage: $0 <settle_certificates_target> <timeout> <l2_network_id>"
-    exit 1
+        echo "Usage: $0 <settle_certificates_target> <timeout> <l2_network_id>"
+        exit 1
     fi
 
     # The number of batches to be verified.
@@ -18,7 +18,7 @@ function parse_params(){
     l2_rpc_network_id="$3"
 }
 
-function check_timeout(){
+function check_timeout() {
     local _end_time=$1
     current_time=$(date +%s)
     if ((current_time > _end_time)); then
@@ -27,13 +27,19 @@ function check_timeout(){
     fi
 }
 
-function check_num_certificates(){
-    readonly agglayer_rpc_url="$(kurtosis port print cdk agglayer agglayer)"
+function check_num_certificates() {
+    agglayer_rpc_url="$(kurtosis port print cdk agglayer aglr-readrpc)"
+    if [ $? -ne 0 ]; then
+        agglayer_rpc_url="$(kurtosis port print cdk agglayer agglayer)"
+        if [ $? -ne 0 ]; then
+            echo "[$(date '+%Y-%m-%d %H:%M:%S')] Error getting agglayer rpc url (not aglr-readrpc or agglayer)." >&3
+        fi
+    fi
 
     cast_output=$(cast rpc --rpc-url "$agglayer_rpc_url" "interop_getLatestKnownCertificateHeader" "$l2_rpc_network_id" 2>&1)
 
     if [ $? -ne 0 ]; then
-        echo "[$(date '+%Y-%m-%d %H:%M:%S')] Error executing command cast rpc: $cast_output"
+        echo "[$(date '+%Y-%m-%d %H:%M:%S')] Error executing command cast rpc $agglayer_rpc_url: $cast_output"
         return
     fi
 
@@ -51,17 +57,17 @@ function check_num_certificates(){
 
     echo "[$(date '+%Y-%m-%d %H:%M:%S')] Last known agglayer certificate height: $height, status: $status" >&3
 
-    if (( height > settle_certificates_target - 1 )); then
+    if ((height > settle_certificates_target - 1)); then
         echo "[$(date '+%Y-%m-%d %H:%M:%S')] ✅ Success! The number of settled certificates has reached the target." >&3
         exit 0
     fi
 
-    if (( height == settle_certificates_target - 1 )); then
+    if ((height == settle_certificates_target - 1)); then
         if [ "$status" == "Settled" ]; then
             echo "[$(date '+%Y-%m-%d %H:%M:%S')] ✅ Success! The number of settled certificates has reached the target." >&3
             exit 0
         fi
-        
+
         echo "[$(date '+%Y-%m-%d %H:%M:%S')] ⚠️ Warning! The number of settled certificates is one less than the target." >&3
     fi
 }
@@ -73,7 +79,7 @@ function extract_certificate_height() {
 
 function extract_certificate_status() {
     local cast_output="$1"
-     echo "$cast_output" | jq -r '.status'
+    echo "$cast_output" | jq -r '.status'
 }
 
 # MAIN
diff --git a/test/scripts/shared.sh b/test/scripts/shared.sh
new file mode 100644
index 000000000..778364f80
--- /dev/null
+++ b/test/scripts/shared.sh
@@ -0,0 +1,17 @@
+
+function override_cdk_node_config_file(){
+    local __DATA_AVAILABILITY_MODE=$1
+    if [ -z $__DATA_AVAILABILITY_MODE ]; then
+        echo "Missing DATA_AVAILABILITY_MODE:override_cdk_node_config_file  ['rollup', 'cdk-validium', 'pessimistic']"
+        return 1
+    fi
+    echo "Override cdk config file"
+    local _FILENAME=$BASE_FOLDER/config/kurtosis-cdk-node-config.toml.template.$__DATA_AVAILABILITY_MODE
+    cp $_FILENAME $KURTOSIS_FOLDER/templates/trusted-node/cdk-node-config.toml
+    if [ $? -ne 0 ]; then
+        echo "... copying generic config file"
+        _FILENAME=$BASE_FOLDER/config/kurtosis-cdk-node-config.toml.template
+        cp $_FILENAME $KURTOSIS_FOLDER/templates/trusted-node/cdk-node-config.toml
+    fi
+    echo "Override cdk config using: " $_FILENAME
+}


Reviews:
user: login: ToniRamirezM
state: APPROVED
author_association: CONTRIBUTOR
submitted_at: 2025-03-18T14:43:43Z
user: login: Stefan-Ethernal
body: LGTM, aside from nitpicks (I cannot approve it, since I have created the PR :melting_face:)
state: COMMENTED
author_association: COLLABORATOR
submitted_at: 2025-03-18T14:46:27Z
user: login: joanestebanr
body: @Stefan-Ethernal I can approve it! 
state: APPROVED
author_association: CONTRIBUTOR
submitted_at: 2025-03-18T14:51:51Z

Review comments:
diff_hunk: @@ -91,19 +90,19 @@ jobs:
 
     
     - name: Dump enclave logs
-      if: failure()
+      if: always()
path: .github/workflows/test-e2e.yml
user: login: Stefan-Ethernal
body: I have enabled this in order to be able to have the logs (because the e2e tests were timing out). If you think we don't need it in any case, but only for the failures, we can revert back to `failure` trigger. WDYT?
created_at: 2025-03-18T14:41:15Z
author_association: COLLABORATOR
diff_hunk: @@ -25,8 +26,8 @@ else
 fi
 
 kurtosis clean --all
-echo "Override cdk config file"
-cp $BASE_FOLDER/config/kurtosis-cdk-node-config.toml.template $KURTOSIS_FOLDER/templates/trusted-node/cdk-node-config.toml
+override_cdk_node_config_file  $DATA_AVAILABILITY_MODE
path: test/run-e2e.sh
user: login: Stefan-Ethernal
body: Extra space

```suggestion
override_cdk_node_config_file $DATA_AVAILABILITY_MODE
```
created_at: 2025-03-18T14:43:37Z
author_association: COLLABORATOR

PR comments:
user: login: sonarqubecloud[bot]
created_at: 2025-03-18T14:55:55Z
body: ## [![Quality Gate Passed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/qg-passed-20px.png 'Quality Gate Passed')](https://sonarcloud.io/dashboard?id=0xPolygon_cdk&pullRequest=310) **Quality Gate passed**  
Issues  
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0 New issues](https://sonarcloud.io/project/issues?id=0xPolygon_cdk&pullRequest=310&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/accepted-16px.png '') [0 Accepted issues](https://sonarcloud.io/project/issues?id=0xPolygon_cdk&pullRequest=310&issueStatuses=ACCEPTED)

Measures  
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=0xPolygon_cdk&pullRequest=310&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=0xPolygon_cdk&pullRequest=310&metric=new_coverage&view=list)  
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=0xPolygon_cdk&pullRequest=310&metric=new_duplicated_lines_density&view=list)  
  
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=0xPolygon_cdk&pullRequest=310)


author_association: NONE