From 9403b1c381f4f62e900904b4df88976ed499b72b Mon Sep 17 00:00:00 2001 From: joanestebanr <129153821+joanestebanr@users.noreply.github.com> Date: Wed, 13 Nov 2024 09:49:41 +0100 Subject: [PATCH 01/14] feat: kurtosis-cdk use branch for aggsender integration --- .github/workflows/test-e2e.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-e2e.yml b/.github/workflows/test-e2e.yml index 8994d8e6..4b5b355f 100644 --- a/.github/workflows/test-e2e.yml +++ b/.github/workflows/test-e2e.yml @@ -70,7 +70,7 @@ jobs: with: repository: 0xPolygon/kurtosis-cdk path: "kurtosis-cdk" - ref: "v0.2.19" + ref: "jesteban/bump_aggsender" - name: Setup Bats and bats libs uses: bats-core/bats-action@2.0.0 From 82265e8e66df6e88d8583fd7134cdf633491b51d Mon Sep 17 00:00:00 2001 From: joanestebanr <129153821+joanestebanr@users.noreply.github.com> Date: Wed, 13 Nov 2024 12:00:30 +0100 Subject: [PATCH 02/14] feat: split bats tests for fep and pessimistic --- .github/workflows/test-e2e.yml | 1 + test/Makefile | 5 ++ test/{ => bats/fep}/access-list-e2e.bats | 0 test/{ => bats/fep}/basic-e2e.bats | 0 test/{ => bats/fep}/bridge-e2e.bats | 0 test/{ => bats/fep}/e2e.bats | 0 test/bats/pessimistic/bridge-e2e.bats | 82 ++++++++++++++++++++++++ test/combinations/fork12-pessimistic.yml | 14 ++++ 8 files changed, 102 insertions(+) rename test/{ => bats/fep}/access-list-e2e.bats (100%) rename test/{ => bats/fep}/basic-e2e.bats (100%) rename test/{ => bats/fep}/bridge-e2e.bats (100%) rename test/{ => bats/fep}/e2e.bats (100%) create mode 100644 test/bats/pessimistic/bridge-e2e.bats create mode 100644 test/combinations/fork12-pessimistic.yml diff --git a/.github/workflows/test-e2e.yml b/.github/workflows/test-e2e.yml index 4b5b355f..76fe4fdd 100644 --- a/.github/workflows/test-e2e.yml +++ b/.github/workflows/test-e2e.yml @@ -18,6 +18,7 @@ jobs: - "fork11-rollup" - "fork12-validium" - "fork12-rollup" + - "fork12-pessimistic" runs-on: ubuntu-latest steps: - name: Checkout code diff --git a/test/Makefile b/test/Makefile index 12f406fd..31ee60b3 100644 --- a/test/Makefile +++ b/test/Makefile @@ -96,6 +96,11 @@ test-e2e-fork12-rollup: stop ./run-e2e.sh fork12 rollup bats . +.PHONY: test-e2e-fork12-pessimistic +test-e2e-fork12-pessimistic: stop + ./run-e2e.sh fork12 pessimistic + bats . + .PHONY: stop stop: kurtosis clean --all diff --git a/test/access-list-e2e.bats b/test/bats/fep/access-list-e2e.bats similarity index 100% rename from test/access-list-e2e.bats rename to test/bats/fep/access-list-e2e.bats diff --git a/test/basic-e2e.bats b/test/bats/fep/basic-e2e.bats similarity index 100% rename from test/basic-e2e.bats rename to test/bats/fep/basic-e2e.bats diff --git a/test/bridge-e2e.bats b/test/bats/fep/bridge-e2e.bats similarity index 100% rename from test/bridge-e2e.bats rename to test/bats/fep/bridge-e2e.bats diff --git a/test/e2e.bats b/test/bats/fep/e2e.bats similarity index 100% rename from test/e2e.bats rename to test/bats/fep/e2e.bats diff --git a/test/bats/pessimistic/bridge-e2e.bats b/test/bats/pessimistic/bridge-e2e.bats new file mode 100644 index 00000000..a374e077 --- /dev/null +++ b/test/bats/pessimistic/bridge-e2e.bats @@ -0,0 +1,82 @@ +setup() { + load 'helpers/common-setup' + _common_setup + load 'helpers/common' + load 'helpers/lxly-bridge-test' + + if [ -z "$BRIDGE_ADDRESS" ]; then + local combined_json_file="/opt/zkevm/combined.json" + echo "BRIDGE_ADDRESS env variable is not provided, resolving the bridge address from the Kurtosis CDK '$combined_json_file'" >&3 + + # Fetching the combined JSON output and filtering to get polygonZkEVMBridgeAddress + combined_json_output=$($contracts_service_wrapper "cat $combined_json_file" | tail -n +2) + bridge_default_address=$(echo "$combined_json_output" | jq -r .polygonZkEVMBridgeAddress) + BRIDGE_ADDRESS=$bridge_default_address + fi + echo "Bridge address=$BRIDGE_ADDRESS" >&3 + + readonly sender_private_key=${SENDER_PRIVATE_KEY:-"12d7de8621a77640c9241b2595ba78ce443d05e94090365ab3bb5e19df82c625"} + readonly sender_addr="$(cast wallet address --private-key $sender_private_key)" + destination_net=${DESTINATION_NET:-"1"} + destination_addr=${DESTINATION_ADDRESS:-"0x0bb7AA0b4FdC2D2862c088424260e99ed6299148"} + ether_value=${ETHER_VALUE:-"0.0200000054"} + amount=$(cast to-wei $ether_value ether) + readonly native_token_addr=${NATIVE_TOKEN_ADDRESS:-"0x0000000000000000000000000000000000000000"} + if [[ -n "$GAS_TOKEN_ADDR" ]]; then + echo "Using provided GAS_TOKEN_ADDR: $GAS_TOKEN_ADDR" >&3 + gas_token_addr="$GAS_TOKEN_ADDR" + else + echo "GAS_TOKEN_ADDR not provided, retrieving from rollup parameters file." >&3 + readonly rollup_params_file=/opt/zkevm/create_rollup_parameters.json + run bash -c "$contracts_service_wrapper 'cat $rollup_params_file' | tail -n +2 | jq -r '.gasTokenAddress'" + assert_success + assert_output --regexp "0x[a-fA-F0-9]{40}" + gas_token_addr=$output + fi + readonly is_forced=${IS_FORCED:-"true"} + readonly bridge_addr=$BRIDGE_ADDRESS + readonly meta_bytes=${META_BYTES:-"0x"} + + readonly l1_rpc_url=${L1_ETH_RPC_URL:-"$(kurtosis port print $enclave el-1-geth-lighthouse rpc)"} + readonly bridge_api_url=${BRIDGE_API_URL:-"$(kurtosis port print $enclave zkevm-bridge-service-001 rpc)"} + + readonly dry_run=${DRY_RUN:-"false"} + readonly l1_rpc_network_id=$(cast call --rpc-url $l1_rpc_url $bridge_addr 'networkID() (uint32)') + readonly l2_rpc_network_id=$(cast call --rpc-url $l2_rpc_url $bridge_addr 'networkID() (uint32)') + gas_price=$(cast gas-price --rpc-url "$l2_rpc_url") + readonly weth_token_addr=$(cast call --rpc-url $l2_rpc_url $bridge_addr 'WETHToken()' | cast parse-bytes32-address) +} + +@test "Native gas token deposit to WETH" { + destination_addr=$sender_addr + local initial_receiver_balance=$(cast call --rpc-url "$l2_rpc_url" "$weth_token_addr" "$balance_of_fn_sig" "$destination_addr" | awk '{print $1}') + echo "Initial receiver balance of native token on L2 $initial_receiver_balance" >&3 + + echo "=== Running LxLy deposit on L1 to network: $l2_rpc_network_id native_token: $native_token_addr" >&3 + + destination_net=$l2_rpc_network_id + run bridgeAsset "$native_token_addr" "$l1_rpc_url" + assert_success + + echo "=== Running LxLy claim on L2" >&3 + timeout="120" + claim_frequency="10" + run wait_for_claim "$timeout" "$claim_frequency" "$l2_rpc_url" + assert_success + + run verify_balance "$l2_rpc_url" "$weth_token_addr" "$destination_addr" "$initial_receiver_balance" "$ether_value" + assert_success + + echo "=== bridgeAsset L2 WETH: $weth_token_addr to L1 ETH" >&3 + destination_addr=$sender_addr + destination_net=0 + run bridgeAsset "$weth_token_addr" "$l2_rpc_url" + assert_success + + echo "=== Claim in L1 ETH" >&3 + timeout="400" + claim_frequency="60" + run wait_for_claim "$timeout" "$claim_frequency" "$l1_rpc_url" + assert_success +} + diff --git a/test/combinations/fork12-pessimistic.yml b/test/combinations/fork12-pessimistic.yml new file mode 100644 index 00000000..27a8b5a7 --- /dev/null +++ b/test/combinations/fork12-pessimistic.yml @@ -0,0 +1,14 @@ +args: + agglayer_image: ghcr.io/agglayer/agglayer:0.2.0-rc.10 + cdk_erigon_node_image: hermeznetwork/cdk-erigon:v2.60.0-beta8 + 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_contracts_image: nulyjkdhthz/zkevm-contracts:v9.0.0-rc.3-pp-fork.12 + additional_services: [] + consensus_contract_type: pessimistic + sequencer_type: erigon + erigon_strict_mode: false + zkevm_use_gas_token_contract: true + agglayer_prover_sp1_key: + enable_normalcy: true \ No newline at end of file From bfd7bb2522ad54aa953f9dd2ee620695268006c6 Mon Sep 17 00:00:00 2001 From: joanestebanr <129153821+joanestebanr@users.noreply.github.com> Date: Wed, 13 Nov 2024 12:15:07 +0100 Subject: [PATCH 03/14] feat: split bats tests for fep and pessimistic --- test/Makefile | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/test/Makefile b/test/Makefile index 31ee60b3..3fb9b5a9 100644 --- a/test/Makefile +++ b/test/Makefile @@ -79,27 +79,27 @@ generate-mocks-bridgesync: ## Generates mocks for bridgesync, using mockery tool .PHONY: test-e2e-fork9-validium test-e2e-fork9-validium: stop ./run-e2e.sh fork9 cdk-validium - bats . + bats bats/fep/ .PHONY: test-e2e-fork11-rollup test-e2e-fork11-rollup: stop ./run-e2e.sh fork11 rollup - bats . + bats bats/fep/ .PHONY: test-e2e-fork12-validium test-e2e-fork12-validium: stop ./run-e2e.sh fork12 cdk-validium - bats . + bats bats/fep/ .PHONY: test-e2e-fork12-rollup test-e2e-fork12-rollup: stop ./run-e2e.sh fork12 rollup - bats . + bats bats/fep/ .PHONY: test-e2e-fork12-pessimistic test-e2e-fork12-pessimistic: stop ./run-e2e.sh fork12 pessimistic - bats . + bats bats/pessimistic/ .PHONY: stop stop: From 82ee145bd7fb0ee7a0ced4ccfd3f20170f185944 Mon Sep 17 00:00:00 2001 From: joanestebanr <129153821+joanestebanr@users.noreply.github.com> Date: Wed, 13 Nov 2024 13:25:26 +0100 Subject: [PATCH 04/14] fix: paths e2e, add sqlite3 to docker, fix default.go, add log cert as info --- Dockerfile | 2 +- test/bats/fep/access-list-e2e.bats | 4 ++-- test/bats/fep/basic-e2e.bats | 4 ++-- test/bats/fep/bridge-e2e.bats | 6 +++--- test/bats/fep/e2e.bats | 2 +- test/bats/pessimistic/bridge-e2e.bats | 6 +++--- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/Dockerfile b/Dockerfile index ac5e759b..22e36595 100644 --- a/Dockerfile +++ b/Dockerfile @@ -42,7 +42,7 @@ RUN cargo build --release --bin cdk # CONTAINER FOR RUNNING BINARY FROM --platform=${BUILDPLATFORM} debian:bookworm-slim -RUN apt-get update && apt-get install -y ca-certificates postgresql-client libssl-dev && rm -rf /var/lib/apt/lists/* +RUN apt-get update && apt-get install -y ca-certificates sqlite3 procps libssl-dev && rm -rf /var/lib/apt/lists/* COPY --from=builder /app/target/release/cdk /usr/local/bin/ COPY --from=build /go/src/github.com/0xPolygon/cdk/target/cdk-node /usr/local/bin/ diff --git a/test/bats/fep/access-list-e2e.bats b/test/bats/fep/access-list-e2e.bats index 83947c03..b1e07f78 100644 --- a/test/bats/fep/access-list-e2e.bats +++ b/test/bats/fep/access-list-e2e.bats @@ -1,6 +1,6 @@ setup() { - load 'helpers/common-setup' - load 'helpers/common' + load '../../helpers/common-setup' + load '../../helpers/common' _common_setup readonly erigon_sequencer_node=${KURTOSIS_ERIGON_SEQUENCER:-cdk-erigon-sequencer-001} diff --git a/test/bats/fep/basic-e2e.bats b/test/bats/fep/basic-e2e.bats index 1024ac4a..088ee239 100644 --- a/test/bats/fep/basic-e2e.bats +++ b/test/bats/fep/basic-e2e.bats @@ -1,6 +1,6 @@ setup() { - load 'helpers/common-setup' - load 'helpers/common' + load '../../helpers/common-setup' + load '../../helpers/common' _common_setup readonly sender_private_key=${SENDER_PRIVATE_KEY:-"12d7de8621a77640c9241b2595ba78ce443d05e94090365ab3bb5e19df82c625"} diff --git a/test/bats/fep/bridge-e2e.bats b/test/bats/fep/bridge-e2e.bats index e754ef70..2514ee5f 100644 --- a/test/bats/fep/bridge-e2e.bats +++ b/test/bats/fep/bridge-e2e.bats @@ -1,8 +1,8 @@ setup() { - load 'helpers/common-setup' + load '../../helpers/common-setup' _common_setup - load 'helpers/common' - load 'helpers/lxly-bridge-test' + load '../../helpers/common' + load '../../helpers/lxly-bridge-test' if [ -z "$BRIDGE_ADDRESS" ]; then local combined_json_file="/opt/zkevm/combined.json" diff --git a/test/bats/fep/e2e.bats b/test/bats/fep/e2e.bats index c85e33ce..09efbc47 100644 --- a/test/bats/fep/e2e.bats +++ b/test/bats/fep/e2e.bats @@ -1,5 +1,5 @@ setup() { - load 'helpers/common-setup' + load '../../helpers/common-setup' _common_setup } diff --git a/test/bats/pessimistic/bridge-e2e.bats b/test/bats/pessimistic/bridge-e2e.bats index a374e077..c165d1c7 100644 --- a/test/bats/pessimistic/bridge-e2e.bats +++ b/test/bats/pessimistic/bridge-e2e.bats @@ -1,8 +1,8 @@ setup() { - load 'helpers/common-setup' + load '../../helpers/common-setup' _common_setup - load 'helpers/common' - load 'helpers/lxly-bridge-test' + load '../../helpers/common' + load '../../helpers/lxly-bridge-test' if [ -z "$BRIDGE_ADDRESS" ]; then local combined_json_file="/opt/zkevm/combined.json" From b780e94a1d8550a14de2a634c572fc0e6b41ae3f Mon Sep 17 00:00:00 2001 From: joanestebanr <129153821+joanestebanr@users.noreply.github.com> Date: Wed, 13 Nov 2024 15:10:30 +0100 Subject: [PATCH 05/14] feat: check num certs on e2e --- test/bats/pessimistic/e2e-pp.bats | 10 +++ test/scripts/agglayer_certificates_monitor.sh | 74 +++++++++++++++++++ 2 files changed, 84 insertions(+) create mode 100644 test/bats/pessimistic/e2e-pp.bats create mode 100755 test/scripts/agglayer_certificates_monitor.sh diff --git a/test/bats/pessimistic/e2e-pp.bats b/test/bats/pessimistic/e2e-pp.bats new file mode 100644 index 00000000..7e0c4902 --- /dev/null +++ b/test/bats/pessimistic/e2e-pp.bats @@ -0,0 +1,10 @@ +setup() { + load '../../helpers/common-setup' + _common_setup +} + +@test "Verify batches" { + echo "Waiting 10 minutes to get some settle certificate...." + run $PROJECT_ROOT/test/scripts/batch_verification_monitor.sh 1 600 + assert_success +} diff --git a/test/scripts/agglayer_certificates_monitor.sh b/test/scripts/agglayer_certificates_monitor.sh new file mode 100755 index 00000000..9441e270 --- /dev/null +++ b/test/scripts/agglayer_certificates_monitor.sh @@ -0,0 +1,74 @@ +#!/usr/bin/env bash + +# This script monitors the agglayer certificates progress of pessimistic proof. +############################################################################### + + +############################################################################### +function parse_params(){ + # Check if the required arguments are provided. + if [ "$#" -lt 2 ]; then + echo "Usage: $0 " + exit 1 + fi + + # The number of batches to be verified. + settle_certificates_target="$1" + + # The script timeout (in seconds). + timeout="$2" +} +############################################################################### +function check_timeout(){ + local _end_time=$1 + current_time=$(date +%s) + if ((current_time > _end_time)); then + echo "[$(date '+%Y-%m-%d %H:%M:%S')] ❌ Exiting... Timeout reached!" + exit 1 + fi +} + +############################################################################### +function check_num_certificates(){ + local _cmd="echo 'select status, count(*) from certificate_info group by status;' | sqlite3 /tmp/aggsender.sqlite" + local _outcmd=mktemp + kurtosis service exec cdk cdk-node-001 "$_cmd" > $_outcmd + if [ $? -ne 0 ]; then + echo "[$(date '+%Y-%m-%d %H:%M:%S')] Error executing command kurtosis service: $_cmd" + return + fi + local num_certs=$(cat $_outcmd | tail -n +2 | cut -f 2 -d '|' | xargs |tr ' ' '+' | bc) + # Get the number of settled certificates "4|0" + local _num_settle_certs=$(cat $_outcmd | tail -n +2 | grep ^${aggsender_status_settled} | cut -d'|' -f2) + [ -z "$_num_settle_certs" ] && _num_settle_certs=0 + echo "[$(date '+%Y-%m-%d %H:%M:%S')] Num certificates on aggsender: $num_certs. Settled certificates : $_num_settle_certs" + if [ $num_certs -ge $settle_certificates_target ]; then + echo "[$(date '+%Y-%m-%d %H:%M:%S')] ✅ Exiting... $num_certs certificates were settled! (total certs $num_certs)" + exit 0 + fi +} + +############################################################################### +# MAIN +############################################################################### + +declare -A aggsender_status_map=( + [0]="Pending" + [1]="Proven" + [2]="Candidate" + [3]="InError" + [4]="Settled" +) + +readonly aggsender_status_settled=4 + + +parse_params $* +start_time=$(date +%s) +end_time=$((start_time + timeout)) +echo "[$(date '+%Y-%m-%d %H:%M:%S')] Start monitoring agglayer certificates progress..." +while true; do + check_num_certificates + check_timeout $end_time + sleep 10 +done \ No newline at end of file From 44178fea522aebbe69f4133897aafb0b98250d44 Mon Sep 17 00:00:00 2001 From: joanestebanr <129153821+joanestebanr@users.noreply.github.com> Date: Wed, 13 Nov 2024 15:45:38 +0100 Subject: [PATCH 06/14] feat: fix e2e --- test/bats/pessimistic/bridge-e2e.bats | 6 ------ test/scripts/agglayer_certificates_monitor.sh | 2 +- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/test/bats/pessimistic/bridge-e2e.bats b/test/bats/pessimistic/bridge-e2e.bats index c165d1c7..953082a9 100644 --- a/test/bats/pessimistic/bridge-e2e.bats +++ b/test/bats/pessimistic/bridge-e2e.bats @@ -72,11 +72,5 @@ setup() { destination_net=0 run bridgeAsset "$weth_token_addr" "$l2_rpc_url" assert_success - - echo "=== Claim in L1 ETH" >&3 - timeout="400" - claim_frequency="60" - run wait_for_claim "$timeout" "$claim_frequency" "$l1_rpc_url" - assert_success } diff --git a/test/scripts/agglayer_certificates_monitor.sh b/test/scripts/agglayer_certificates_monitor.sh index 9441e270..a7761a2d 100755 --- a/test/scripts/agglayer_certificates_monitor.sh +++ b/test/scripts/agglayer_certificates_monitor.sh @@ -23,7 +23,7 @@ function check_timeout(){ local _end_time=$1 current_time=$(date +%s) if ((current_time > _end_time)); then - echo "[$(date '+%Y-%m-%d %H:%M:%S')] ❌ Exiting... Timeout reached!" + echo "[$(date '+%Y-%m-%d %H:%M:%S')] ❌ Exiting... Timeout reached not found the expected numbers of settled certs!" exit 1 fi } From fb285999b2824a9753c17fe1c649ee4f451eb950 Mon Sep 17 00:00:00 2001 From: joanestebanr <129153821+joanestebanr@users.noreply.github.com> Date: Wed, 13 Nov 2024 16:03:00 +0100 Subject: [PATCH 07/14] feat: wip --- test/bats/fep/e2e.bats | 2 +- test/bats/pessimistic/e2e-pp.bats | 2 +- test/combinations/fork12-pessimistic.yml | 3 +-- test/scripts/agglayer_certificates_monitor.sh | 6 +++++- 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/test/bats/fep/e2e.bats b/test/bats/fep/e2e.bats index 09efbc47..3728d09f 100644 --- a/test/bats/fep/e2e.bats +++ b/test/bats/fep/e2e.bats @@ -5,6 +5,6 @@ setup() { @test "Verify batches" { echo "Waiting 10 minutes to get some verified batch...." - run $PROJECT_ROOT/test/scripts/batch_verification_monitor.sh 0 600 + run $PROJECT_ROOT/../test/scripts/batch_verification_monitor.sh 0 600 assert_success } diff --git a/test/bats/pessimistic/e2e-pp.bats b/test/bats/pessimistic/e2e-pp.bats index 7e0c4902..70dfbe81 100644 --- a/test/bats/pessimistic/e2e-pp.bats +++ b/test/bats/pessimistic/e2e-pp.bats @@ -5,6 +5,6 @@ setup() { @test "Verify batches" { echo "Waiting 10 minutes to get some settle certificate...." - run $PROJECT_ROOT/test/scripts/batch_verification_monitor.sh 1 600 + run $PROJECT_ROOT/../test/scripts/agglayer_certificates_monitor.sh 1 600 assert_success } diff --git a/test/combinations/fork12-pessimistic.yml b/test/combinations/fork12-pessimistic.yml index 27a8b5a7..3103ed3c 100644 --- a/test/combinations/fork12-pessimistic.yml +++ b/test/combinations/fork12-pessimistic.yml @@ -1,5 +1,5 @@ args: - agglayer_image: ghcr.io/agglayer/agglayer:0.2.0-rc.10 + agglayer_image: ghcr.io/agglayer/agglayer:0.2.0-rc.11 cdk_erigon_node_image: hermeznetwork/cdk-erigon:v2.60.0-beta8 zkevm_bridge_proxy_image: haproxy:3.0-bookworm zkevm_bridge_service_image: hermeznetwork/zkevm-bridge-service:v0.6.0-RC1 @@ -10,5 +10,4 @@ args: sequencer_type: erigon erigon_strict_mode: false zkevm_use_gas_token_contract: true - agglayer_prover_sp1_key: enable_normalcy: true \ No newline at end of file diff --git a/test/scripts/agglayer_certificates_monitor.sh b/test/scripts/agglayer_certificates_monitor.sh index a7761a2d..b422f3da 100755 --- a/test/scripts/agglayer_certificates_monitor.sh +++ b/test/scripts/agglayer_certificates_monitor.sh @@ -31,16 +31,20 @@ function check_timeout(){ ############################################################################### function check_num_certificates(){ local _cmd="echo 'select status, count(*) from certificate_info group by status;' | sqlite3 /tmp/aggsender.sqlite" - local _outcmd=mktemp + local _outcmd=$(mktemp) kurtosis service exec cdk cdk-node-001 "$_cmd" > $_outcmd if [ $? -ne 0 ]; then echo "[$(date '+%Y-%m-%d %H:%M:%S')] Error executing command kurtosis service: $_cmd" + # clean temp file + rm $_outcmd return fi local num_certs=$(cat $_outcmd | tail -n +2 | cut -f 2 -d '|' | xargs |tr ' ' '+' | bc) # Get the number of settled certificates "4|0" local _num_settle_certs=$(cat $_outcmd | tail -n +2 | grep ^${aggsender_status_settled} | cut -d'|' -f2) [ -z "$_num_settle_certs" ] && _num_settle_certs=0 + # clean temp file + rm $_outcmd echo "[$(date '+%Y-%m-%d %H:%M:%S')] Num certificates on aggsender: $num_certs. Settled certificates : $_num_settle_certs" if [ $num_certs -ge $settle_certificates_target ]; then echo "[$(date '+%Y-%m-%d %H:%M:%S')] ✅ Exiting... $num_certs certificates were settled! (total certs $num_certs)" From 9100073585b7629c692738474205e55e34f5bdc3 Mon Sep 17 00:00:00 2001 From: joanestebanr <129153821+joanestebanr@users.noreply.github.com> Date: Wed, 13 Nov 2024 16:20:39 +0100 Subject: [PATCH 08/14] feat: wip --- test/bats/fep/e2e.bats | 2 +- test/bats/pessimistic/e2e-pp.bats | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/test/bats/fep/e2e.bats b/test/bats/fep/e2e.bats index 3728d09f..2b3206ba 100644 --- a/test/bats/fep/e2e.bats +++ b/test/bats/fep/e2e.bats @@ -5,6 +5,6 @@ setup() { @test "Verify batches" { echo "Waiting 10 minutes to get some verified batch...." - run $PROJECT_ROOT/../test/scripts/batch_verification_monitor.sh 0 600 + run $PROJECT_ROOT/../scripts/batch_verification_monitor.sh 0 600 assert_success } diff --git a/test/bats/pessimistic/e2e-pp.bats b/test/bats/pessimistic/e2e-pp.bats index 70dfbe81..77d7910d 100644 --- a/test/bats/pessimistic/e2e-pp.bats +++ b/test/bats/pessimistic/e2e-pp.bats @@ -5,6 +5,6 @@ setup() { @test "Verify batches" { echo "Waiting 10 minutes to get some settle certificate...." - run $PROJECT_ROOT/../test/scripts/agglayer_certificates_monitor.sh 1 600 + run $PROJECT_ROOT/../scripts/agglayer_certificates_monitor.sh 1 600 assert_success } From dc75fe34fc534322f15f646a49438172101ba6d0 Mon Sep 17 00:00:00 2001 From: joanestebanr <129153821+joanestebanr@users.noreply.github.com> Date: Wed, 13 Nov 2024 17:09:24 +0100 Subject: [PATCH 09/14] feat: wip --- test/combinations/fork12-pessimistic.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/test/combinations/fork12-pessimistic.yml b/test/combinations/fork12-pessimistic.yml index 3103ed3c..088822c5 100644 --- a/test/combinations/fork12-pessimistic.yml +++ b/test/combinations/fork12-pessimistic.yml @@ -1,6 +1,7 @@ args: agglayer_image: ghcr.io/agglayer/agglayer:0.2.0-rc.11 cdk_erigon_node_image: hermeznetwork/cdk-erigon:v2.60.0-beta8 + cdk_node_image: 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 From 6479bcc014e6ce200b3f6abfbf5f39c8eb113a73 Mon Sep 17 00:00:00 2001 From: joanestebanr <129153821+joanestebanr@users.noreply.github.com> Date: Thu, 14 Nov 2024 14:57:10 +0100 Subject: [PATCH 10/14] fix: remove unused interface BridgeL2Syncer in aggsender --- aggsender/types/epoch_notifier.go | 3 --- 1 file changed, 3 deletions(-) diff --git a/aggsender/types/epoch_notifier.go b/aggsender/types/epoch_notifier.go index 045ba7ff..426ad362 100644 --- a/aggsender/types/epoch_notifier.go +++ b/aggsender/types/epoch_notifier.go @@ -23,6 +23,3 @@ type EpochNotifier interface { Start(ctx context.Context) String() string } - -type BridgeL2Syncer interface { -} From 7f38beff22864cf260a9311dfaf0045e635a63c8 Mon Sep 17 00:00:00 2001 From: joanestebanr <129153821+joanestebanr@users.noreply.github.com> Date: Fri, 15 Nov 2024 15:23:13 +0100 Subject: [PATCH 11/14] fix: PR comments --- .github/workflows/test-e2e.yml | 2 +- test/Makefile | 2 +- test/bats/{pessimistic => pp}/bridge-e2e.bats | 0 test/bats/{pessimistic => pp}/e2e-pp.bats | 0 test/scripts/agglayer_certificates_monitor.sh | 12 ++---------- 5 files changed, 4 insertions(+), 12 deletions(-) rename test/bats/{pessimistic => pp}/bridge-e2e.bats (100%) rename test/bats/{pessimistic => pp}/e2e-pp.bats (100%) diff --git a/.github/workflows/test-e2e.yml b/.github/workflows/test-e2e.yml index 76fe4fdd..8b1c6045 100644 --- a/.github/workflows/test-e2e.yml +++ b/.github/workflows/test-e2e.yml @@ -71,7 +71,7 @@ jobs: with: repository: 0xPolygon/kurtosis-cdk path: "kurtosis-cdk" - ref: "jesteban/bump_aggsender" + ref: "v0.2.20" - name: Setup Bats and bats libs uses: bats-core/bats-action@2.0.0 diff --git a/test/Makefile b/test/Makefile index 3fb9b5a9..d53f52df 100644 --- a/test/Makefile +++ b/test/Makefile @@ -99,7 +99,7 @@ test-e2e-fork12-rollup: stop .PHONY: test-e2e-fork12-pessimistic test-e2e-fork12-pessimistic: stop ./run-e2e.sh fork12 pessimistic - bats bats/pessimistic/ + bats bats/pp/ .PHONY: stop stop: diff --git a/test/bats/pessimistic/bridge-e2e.bats b/test/bats/pp/bridge-e2e.bats similarity index 100% rename from test/bats/pessimistic/bridge-e2e.bats rename to test/bats/pp/bridge-e2e.bats diff --git a/test/bats/pessimistic/e2e-pp.bats b/test/bats/pp/e2e-pp.bats similarity index 100% rename from test/bats/pessimistic/e2e-pp.bats rename to test/bats/pp/e2e-pp.bats diff --git a/test/scripts/agglayer_certificates_monitor.sh b/test/scripts/agglayer_certificates_monitor.sh index b422f3da..47c116b6 100755 --- a/test/scripts/agglayer_certificates_monitor.sh +++ b/test/scripts/agglayer_certificates_monitor.sh @@ -1,10 +1,6 @@ #!/usr/bin/env bash - # This script monitors the agglayer certificates progress of pessimistic proof. -############################################################################### - -############################################################################### function parse_params(){ # Check if the required arguments are provided. if [ "$#" -lt 2 ]; then @@ -18,7 +14,7 @@ function parse_params(){ # The script timeout (in seconds). timeout="$2" } -############################################################################### + function check_timeout(){ local _end_time=$1 current_time=$(date +%s) @@ -28,7 +24,6 @@ function check_timeout(){ fi } -############################################################################### function check_num_certificates(){ local _cmd="echo 'select status, count(*) from certificate_info group by status;' | sqlite3 /tmp/aggsender.sqlite" local _outcmd=$(mktemp) @@ -52,10 +47,7 @@ function check_num_certificates(){ fi } -############################################################################### # MAIN -############################################################################### - declare -A aggsender_status_map=( [0]="Pending" [1]="Proven" @@ -75,4 +67,4 @@ while true; do check_num_certificates check_timeout $end_time sleep 10 -done \ No newline at end of file +done From 82e6b7dd321e35e7ce3f1bd7039b96e8f868301f Mon Sep 17 00:00:00 2001 From: joanestebanr <129153821+joanestebanr@users.noreply.github.com> Date: Tue, 19 Nov 2024 11:54:07 +0100 Subject: [PATCH 12/14] fix: agglayer version 0.2.0-rc.5 as kurtosis-cdk version --- test/combinations/fork12-pessimistic.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/combinations/fork12-pessimistic.yml b/test/combinations/fork12-pessimistic.yml index 088822c5..a5c6faea 100644 --- a/test/combinations/fork12-pessimistic.yml +++ b/test/combinations/fork12-pessimistic.yml @@ -1,5 +1,5 @@ args: - agglayer_image: ghcr.io/agglayer/agglayer:0.2.0-rc.11 + agglayer_image: ghcr.io/agglayer/agglayer:0.2.0-rc.5 cdk_erigon_node_image: hermeznetwork/cdk-erigon:v2.60.0-beta8 cdk_node_image: cdk zkevm_bridge_proxy_image: haproxy:3.0-bookworm From b43faedf5a8954d1608476546b1834662f3d40e4 Mon Sep 17 00:00:00 2001 From: joanestebanr <129153821+joanestebanr@users.noreply.github.com> Date: Tue, 19 Nov 2024 12:49:12 +0100 Subject: [PATCH 13/14] fix: upgrade agglayer --- .github/workflows/test-e2e.yml | 2 +- test/combinations/fork12-pessimistic.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-e2e.yml b/.github/workflows/test-e2e.yml index 8b1c6045..8cf8950b 100644 --- a/.github/workflows/test-e2e.yml +++ b/.github/workflows/test-e2e.yml @@ -71,7 +71,7 @@ jobs: with: repository: 0xPolygon/kurtosis-cdk path: "kurtosis-cdk" - ref: "v0.2.20" + ref: "main" - name: Setup Bats and bats libs uses: bats-core/bats-action@2.0.0 diff --git a/test/combinations/fork12-pessimistic.yml b/test/combinations/fork12-pessimistic.yml index a5c6faea..088822c5 100644 --- a/test/combinations/fork12-pessimistic.yml +++ b/test/combinations/fork12-pessimistic.yml @@ -1,5 +1,5 @@ args: - agglayer_image: ghcr.io/agglayer/agglayer:0.2.0-rc.5 + agglayer_image: ghcr.io/agglayer/agglayer:0.2.0-rc.11 cdk_erigon_node_image: hermeznetwork/cdk-erigon:v2.60.0-beta8 cdk_node_image: cdk zkevm_bridge_proxy_image: haproxy:3.0-bookworm From b128b1452b6c4f49fe0ca6f8de5601d1db0e70a0 Mon Sep 17 00:00:00 2001 From: joanestebanr <129153821+joanestebanr@users.noreply.github.com> Date: Tue, 19 Nov 2024 14:12:59 +0100 Subject: [PATCH 14/14] fix: kurtosis version --- .github/workflows/test-e2e.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-e2e.yml b/.github/workflows/test-e2e.yml index 8cf8950b..abde0c6b 100644 --- a/.github/workflows/test-e2e.yml +++ b/.github/workflows/test-e2e.yml @@ -71,7 +71,7 @@ jobs: with: repository: 0xPolygon/kurtosis-cdk path: "kurtosis-cdk" - ref: "main" + ref: "v0.2.21" - name: Setup Bats and bats libs uses: bats-core/bats-action@2.0.0