Skip to content
Closed
Show file tree
Hide file tree
Changes from 10 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions .github/workflows/docker-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,6 @@ jobs:
steps:
- uses: actions/checkout@v4
- uses: docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2 # v3.10.0
- uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0
with:
username: ${{ vars.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
Comment thread
obynonwane marked this conversation as resolved.

- name: Get short commit id
run: |
Expand All @@ -28,5 +24,4 @@ jobs:
- name: Build image
uses: docker/build-push-action@14487ce63c7a62a4a324b0bfb37086795e31c6c1 # v6.16.0
with:
tags: ${{ vars.DOCKER_USERNAME }}/e2e:${{ env.SHORT_COMMIT_ID }}
push: false
59 changes: 59 additions & 0 deletions scenarios/agglayer-upgrade-with-supplied-version/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# Agglayer Upgrade/Downgrade Automation

This repo contains e2e test scenario to automate **Agglayer image upgrade and downgrade** while running rollup testnets inside **Kurtosis**.

It is designed to:

- Bootstrap multiple rollup flavors ( e.g 1 Validium and 2 Rollup ) into the **same Kurtosis enclave**.
- Start Agglayer using a **FROM_TAG** version.
- Upgrade Agglayer to a **TO_TAG** version.
- Optionally downgrade back to the original **FROM_TAG** for validation.
- Cleanly tear down the setup using:
```bash
kurtosis enclave rm cdk --force
```

---
Comment thread
obynonwane marked this conversation as resolved.

## Scripts

- `run.sh`
Main orchestration script. Handles bootstrap, upgrade, and optional downgrade.
- **Create the .env file:**
```bash
cp env.example .env
```

- **Upgrade usage:**
```bash
./run.sh FROM_TAG TO_TAG
```

example

```bash
./run.sh 0.3.4 0.3.5
```

- **Downgrade usage:**
```bash
./run.sh FROM_TAG TO_TAG downgrade
```
example

```bash
./run.sh 0.3.5 0.3.4 downgrade
```
## Arguments & Descriptions

| Argument | Required | Description |
|------------------------|----------|-------------|
| `<FROM_TAG>` | Yes | Docker image tag to start with (e.g., `0.3.4`)|
| `<TO_TAG>` | Yes | Docker image tag to upgrade to (e.g., `0.3.5`)|
| `[ACTION]` | No | Optional: set to `downgrade` to downgrade back to `<FROM_TAG>` after upgrade |

---



````
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"type": "EOA",
"consensusContract": "PolygonPessimisticConsensus",
"consensusContractAddress": "0xAC77A07dD1683DeA96c08F286b67783fB1e4B583",
"polygonRollupManagerAddress": "0x2F50ef6b8e8Ee4E579B17619A92dE3E2ffbD8AD2",
"verifierAddress": "0xf22E2B040B639180557745F47aB97dFA95B1e22a",
"description": "Type: Pessimistic, Upgrade v0.2.x to v0.3.x",
"forkID": 12,
"timelockDelay": 0,
"timelockSalt": "",
"deployerPvtKey": "0x12d7de8621a77640c9241b2595ba78ce443d05e94090365ab3bb5e19df82c625",
"maxFeePerGas": "",
"maxPriorityFeePerGas": "",
"multiplierGas": "",
"genesisRoot": "0xd9c8633088ce212acd9280c5f64623add99871234145a808ab6fbdbac5659a87",
"programVKey": "0x00e60517ac96bf6255d81083269e72c14ad006e5f336f852f7ee3efb91b966be"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# This file has been generated automatically.
deployment_stages:
deploy_l1: false
deploy_agglayer: false
deploy_cdk_bridge_ui: false
deploy_l2_contracts: true
deploy_optimism_rollup: false
deploy_op_succinct: false
args:
deployment_suffix: "-003"
zkevm_rollup_chain_id: 30303
zkevm_rollup_id: 3
verbosity: debug
agglayer_contracts_image: europe-west2-docker.pkg.dev/prj-polygonlabs-devtools-dev/public/zkevm-contracts:v8.1.0-rc.2-fork.13
zkevm_prover_image: hermeznetwork/zkevm-prover:v9.0.0-RC3-fork.13
additional_services: []
consensus_contract_type: pessimistic
sp1_prover_key: ''
agglayer_prover_primary_prover: mock-prover
erigon_strict_mode: false
gas_token_enabled: false
zkevm_use_real_verifier: false
enable_normalcy: true
agglayer_prover_sp1_key: "0x50630eb71ab68ff812fcb9b9c58859f9e9f70a62b7e9e97c9c1cc09d86c760d8" # Replace with valid key
Comment thread
jhkimqd marked this conversation as resolved.
aggkit_components: aggsender,bridge
sequencer_type: erigon
cdk_erigon_node_image: hermeznetwork/cdk-erigon:v2.63.0-rc4


# sequencer
zkevm_l2_sequencer_address: "0x0d59BC8C02A089D48d9Cd465b74Cb6E23dEB950D"
zkevm_l2_sequencer_private_key: "0xf6385a27e7710349617340c6f9310e88f0aad10d01646a9bb204177431babcd8"

# aggregator
zkevm_l2_aggregator_address: "0x2D20D9081fb403E856355F2cddd1C4863D0109cb"
zkevm_l2_aggregator_private_key: "0x2cb77c2cca48d3fee64c14d73564fd6e90676a4f6da6545681e10c8b9b22fce2"

# claimtxmanager
zkevm_l2_claimtxmanager_address: "0x1359D1eAf25aADaA04304Ee7EFC5b94C43e0e1D5"
zkevm_l2_claimtxmanager_private_key: "0xb0244fcbf83d7aaa2d51dc78a55233058af31797a974d25f724de041f3484418"

# timelock
zkevm_l2_timelock_address: "0x7803E33388C695E7cbd85eD55f4abe6455E9ce2e"
zkevm_l2_timelock_private_key: "0xe12e739b58489a2c2f49c472169ba20eb89d039e71f04d5342ab645dc3fb6540"

# admin
# zkevm_l2_admin_address: "0x5666Cc6B46ad32b469D9Aec7C1eE6d02f7312759"
# zkevm_l2_admin_private_key: "0xd2ee309113fc97bed6030201fea0d1234d6b4acbc47b9a4fe12a8fa5270052aa"

# loadtest
zkevm_l2_loadtest_address: "0x5198d92d278Fd36e5745C308F728d256198A0e3d"
zkevm_l2_loadtest_private_key: "0xcc594c53eca19f9e56200cadf60c94757b0bdee1fc4bc73552ba879d51fd82b3"

# agglayer
zkevm_l2_agglayer_address: "0x9b5A1f2bC7bb48419d9f6407CFcA454F87884072"
zkevm_l2_agglayer_private_key: "0x7b1164f53f633e940089031a3c265c308d2bcf4756bc8dcf9046bf00e21ec3b1"

# dac
zkevm_l2_dac_address: "0xA9875E9B9FE3BD46da758ba69a5d4B9dFCA6F133"
zkevm_l2_dac_private_key: "0x5d1a923f60e2423932f782dab9510e1c2fd64b0f29b0893978864191ecdd6f4f"

# proofsigner
zkevm_l2_proofsigner_address: "0x3AA075513578d86dC63f9344cD9489b948d7686a"
zkevm_l2_proofsigner_private_key: "0xfd402dcc8c7fc7ce0df59fe12f33da7ac2ed760a619188ff16974fde16f9b00e"

# l1testing
zkevm_l2_l1testing_address: "0x943413d3b2E1B6aF09a758c35b6F5d23a4d6d262"
zkevm_l2_l1testing_private_key: "0x27d8ab2d65296d0da072b172ca9ca874583f9930adb6ac3222fd9494ae7c7f0d"

# claimsponsor
zkevm_l2_claimsponsor_address: "0xeA06890A8A547aDd71f98A6845542eb3B63C2862"
zkevm_l2_claimsponsor_private_key: "0xb97112e36cfcde131faa110430eed6593b75406e5d6991d8db3ed0f492a73b6f"
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# This file has been generated automatically.
deployment_stages:
deploy_l1: false
deploy_agglayer: false
deploy_cdk_bridge_ui: false
deploy_l2_contracts: true
deploy_optimism_rollup: false
deploy_op_succinct: false
args:
verbosity: debug
agglayer_contracts_image: europe-west2-docker.pkg.dev/prj-polygonlabs-devtools-dev/public/zkevm-contracts:v8.1.0-rc.2-fork.13
zkevm_prover_image: hermeznetwork/zkevm-prover:v9.0.0-RC3-fork.13
additional_services: []
consensus_contract_type: rollup
sequencer_type: erigon
agglayer_prover_sp1_key: "0x50630eb71ab68ff812fcb9b9c58859f9e9f70a62b7e9e97c9c1cc09d86c760d8" # Replace with valid key
deployment_suffix: "-003"
zkevm_rollup_chain_id: 20203
zkevm_rollup_id: 3





# polycli wallet inspect --mnemonic 'tennis coconut priority easy toward lava lake cigar address private visit purity' --addresses 11 | tee keys.txt | jq -r '.Addresses[] | [.ETHAddress, .HexPrivateKey] | @tsv' | awk 'BEGIN{split("sequencer,aggregator,claimtxmanager,timelock,admin,loadtest,agglayer,dac,proofsigner,l1testing,claimsponsor",roles,",")} {print "# " roles[NR] "\nzkevm_l2_" roles[NR] "_address: " $1 ""; print "zkevm_l2_" roles[NR] "_private_key: 0x" $2 "\n"}'

# sequencer
zkevm_l2_sequencer_address: "0x3bd49B59d0d61e83FA5C7856312b9bfEddbCbDA8"
zkevm_l2_sequencer_private_key: "0xf1b0412da5d68afa81e8301d93c56b125ee764e2fab4e919afb81ae14babc5e3"

# aggregator
zkevm_l2_aggregator_address: "0x3BAEE05bd44f4Ee84709C7Df6861A3528f4c8286"
zkevm_l2_aggregator_private_key: "0x8bcbeae7253c993102e8269f2b48639a832095e0a0235b609472b7b9286290b9"

# claimtxmanager
zkevm_l2_claimtxmanager_address: "0x1a1C53bA714643B53b39D82409915b513349a1ff"
zkevm_l2_claimtxmanager_private_key: "0xcc8de19498a724ec38c7c774d447a51e629ee947ec360f16913ab3000f5ad676"

# timelock
zkevm_l2_timelock_address: "0xb2BCBC707c88f1a41d3DBb982b9A8996cA83Df82"
zkevm_l2_timelock_private_key: "0xfbfd097f603d5ed2f1bf79a756d021e8c2a1771bb13ea42a36f534ac731739d3"

# # admin
# zkevm_l2_admin_address: "0x78770Cc5Bd03F93B8B401Ea91B77DF544Deb2265"
# zkevm_l2_admin_private_key: "0x6048871542899ff1d8ef8e2efc8037115676b083f1fcc680b995f3bb9470bcf6"

# loadtest
zkevm_l2_loadtest_address: "0x51406206342270c822b5d9dfb261279eEdF0Af20"
zkevm_l2_loadtest_private_key: "0x72e05c95e8c0b0380c1353dbfd50d1d8a762861ac008b8c270963f81abf4304c"

# agglayer
zkevm_l2_agglayer_address: "0xB8b680902bba8e04C78660D33a97a87E4CC4e797"
zkevm_l2_agglayer_private_key: "0x6fadecf5f47e84428042d36ecbfb1d05c587d658cb0d66e10151561e74340e81"

# dac
zkevm_l2_dac_address: "0x64a19B5D36664fa68dc8bAC6574A5B272F08ACc1"
zkevm_l2_dac_private_key: "0x29506f6abfd8ff62b29af422c4a0af1dbc989d7154220da916e565c8cc04ce47"

# proofsigner
zkevm_l2_proofsigner_address: "0xD3F0C080A75f537B361A3Eadf24EE5d6F72a15B3"
zkevm_l2_proofsigner_private_key: "0x89ac1075d2f7c27ba296fb4d625b0e10f272f8f7fa96320f7f0832a41b18e54b"

# l1testing
zkevm_l2_l1testing_address: "0xcd9Ac30C72a8757F446F814aFfbc32847c2CD17D"
zkevm_l2_l1testing_private_key: "0xbdbfded25015702c72558c5a3cea747713734d3535fe832b4cd4f1bb882977ea"

# claimsponsor
zkevm_l2_claimsponsor_address: "0xB2c5d585cc8c1f9FC51035941CFdA42DB83E9886"
zkevm_l2_claimsponsor_private_key: "0x4c545e05d1e85a36d316b92a4de4588c60fe3c5dbb2c235306d1ce4e439b751a"
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# This file has been generated automatically.
deployment_stages:
deploy_l1: false
deploy_agglayer: false
deploy_cdk_bridge_ui: false
deploy_l2_contracts: true
deploy_optimism_rollup: false
deploy_op_succinct: false
args:
verbosity: debug
agglayer_contracts_image: europe-west2-docker.pkg.dev/prj-polygonlabs-devtools-dev/public/zkevm-contracts:v8.1.0-rc.2-fork.13
zkevm_prover_image: hermeznetwork/zkevm-prover:v9.0.0-RC3-fork.13
additional_services: []
consensus_contract_type: rollup
sequencer_type: erigon
agglayer_prover_sp1_key: "0x50630eb71ab68ff812fcb9b9c58859f9e9f70a62b7e9e97c9c1cc09d86c760d8" # Replace with valid key
Comment thread
jhkimqd marked this conversation as resolved.
deployment_suffix: "-002"
zkevm_rollup_chain_id: 20202
zkevm_rollup_id: 2





# polycli wallet inspect --mnemonic 'tennis coconut priority easy toward lava lake cigar address private visit purity' --addresses 11 | tee keys.txt | jq -r '.Addresses[] | [.ETHAddress, .HexPrivateKey] | @tsv' | awk 'BEGIN{split("sequencer,aggregator,claimtxmanager,timelock,admin,loadtest,agglayer,dac,proofsigner,l1testing,claimsponsor",roles,",")} {print "# " roles[NR] "\nzkevm_l2_" roles[NR] "_address: " $1 ""; print "zkevm_l2_" roles[NR] "_private_key: 0x" $2 "\n"}'

# sequencer
zkevm_l2_sequencer_address: "0x3bd49B59d0d61e83FA5C7856312b9bfEddbCbDA8"
zkevm_l2_sequencer_private_key: "0xf1b0412da5d68afa81e8301d93c56b125ee764e2fab4e919afb81ae14babc5e3"

# aggregator
zkevm_l2_aggregator_address: "0x3BAEE05bd44f4Ee84709C7Df6861A3528f4c8286"
zkevm_l2_aggregator_private_key: "0x8bcbeae7253c993102e8269f2b48639a832095e0a0235b609472b7b9286290b9"

# claimtxmanager
zkevm_l2_claimtxmanager_address: "0x1a1C53bA714643B53b39D82409915b513349a1ff"
zkevm_l2_claimtxmanager_private_key: "0xcc8de19498a724ec38c7c774d447a51e629ee947ec360f16913ab3000f5ad676"

# timelock
zkevm_l2_timelock_address: "0xb2BCBC707c88f1a41d3DBb982b9A8996cA83Df82"
zkevm_l2_timelock_private_key: "0xfbfd097f603d5ed2f1bf79a756d021e8c2a1771bb13ea42a36f534ac731739d3"

# # admin
# zkevm_l2_admin_address: "0x78770Cc5Bd03F93B8B401Ea91B77DF544Deb2265"
# zkevm_l2_admin_private_key: "0x6048871542899ff1d8ef8e2efc8037115676b083f1fcc680b995f3bb9470bcf6"

# loadtest
zkevm_l2_loadtest_address: "0x51406206342270c822b5d9dfb261279eEdF0Af20"
zkevm_l2_loadtest_private_key: "0x72e05c95e8c0b0380c1353dbfd50d1d8a762861ac008b8c270963f81abf4304c"

# agglayer
zkevm_l2_agglayer_address: "0xB8b680902bba8e04C78660D33a97a87E4CC4e797"
zkevm_l2_agglayer_private_key: "0x6fadecf5f47e84428042d36ecbfb1d05c587d658cb0d66e10151561e74340e81"

# dac
zkevm_l2_dac_address: "0x64a19B5D36664fa68dc8bAC6574A5B272F08ACc1"
zkevm_l2_dac_private_key: "0x29506f6abfd8ff62b29af422c4a0af1dbc989d7154220da916e565c8cc04ce47"

# proofsigner
zkevm_l2_proofsigner_address: "0xD3F0C080A75f537B361A3Eadf24EE5d6F72a15B3"
zkevm_l2_proofsigner_private_key: "0x89ac1075d2f7c27ba296fb4d625b0e10f272f8f7fa96320f7f0832a41b18e54b"

# l1testing
zkevm_l2_l1testing_address: "0xcd9Ac30C72a8757F446F814aFfbc32847c2CD17D"
zkevm_l2_l1testing_private_key: "0xbdbfded25015702c72558c5a3cea747713734d3535fe832b4cd4f1bb882977ea"

# claimsponsor
zkevm_l2_claimsponsor_address: "0xB2c5d585cc8c1f9FC51035941CFdA42DB83E9886"
zkevm_l2_claimsponsor_private_key: "0x4c545e05d1e85a36d316b92a4de4588c60fe3c5dbb2c235306d1ce4e439b751a"
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
deployment_stages:
deploy_l2_contracts: true
deploy_optimism_rollup: false
deploy_op_succinct: false
args:
verbosity: debug
agglayer_contracts_image: europe-west2-docker.pkg.dev/prj-polygonlabs-devtools-dev/public/zkevm-contracts:v8.1.0-rc.2-fork.13
zkevm_prover_image: hermeznetwork/zkevm-prover:v9.0.0-RC3-fork.13
consensus_contract_type: cdk_validium
additional_services: []
sequencer_type: erigon
agglayer_prover_sp1_key: "0x50630eb71ab68ff812fcb9b9c58859f9e9f70a62b7e9e97c9c1cc09d86c760d8" # Replace with valid key




Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
#!/usr/bin/env bash
set -euo pipefail

# These get replaced by the host helper script
ROLLUP_MANAGER="__ROLLUP_MANAGER__" # from combined.json: polygonRollupManagerAddress


RPC_URL="${RPC_URL:-http://el-1-geth-lighthouse:8545}"
LOOKBACK="${LOOKBACK:-100}" # set the look back for event to be 100 blocks

EVENT="VerifyBatchesTrustedAggregator(uint32,uint64,bytes32,bytes32,address)"

CURRENT="$(cast block-number --rpc-url "$RPC_URL")" # gets the lates blocknumber captured by CURRENT variable
FROM=$(( CURRENT - LOOKBACK )) # set the start of scan window
if (( FROM < 0 )); then FROM=0; fi # if the scan range is less than 0 we set it to begin from 0

echo "Scanning blocks $FROM → $CURRENT on $RPC_URL"
echo " contract (rollup manager): $ROLLUP_MANAGER"
echo " event: $EVENT"
echo " lookback: $LOOKBACK blocks"

TMP_JSON="$(mktemp -t verify-logs.XXXXXX.json)"

# Stream logs as pretty JSON to terminal (if jq is installed) and save raw JSON to file
if command -v jq >/dev/null 2>&1; then
cast logs \
--address "$ROLLUP_MANAGER" "$EVENT" \
--from-block "$FROM" --to-block "$CURRENT" \
--rpc-url "$RPC_URL" \
--json \
| tee "$TMP_JSON" | jq -C .
else
echo "(jq not found — showing raw JSON)"
cast logs \
--address "$ROLLUP_MANAGER" "$EVENT" \
--from-block "$FROM" --to-block "$CURRENT" \
--rpc-url "$RPC_URL" \
--json | tee "$TMP_JSON"
fi

FOUND=0
if command -v jq >/dev/null 2>&1; then
FOUND="$(jq 'length' "$TMP_JSON")" # count how many item are in the json file
else
# crude fallback: count '[' then subtract brackets; if it's "[]", FOUND stays 0
# (safe enough for our purpose when jq isn't available)
if grep -q '"address"' "$TMP_JSON"; then # checks is tem_json contains substring address
FOUND="$(grep -c '"address"' "$TMP_JSON" || true)" # counts lines that contains the address substring
fi
fi

if (( FOUND > 0 )); then
Comment thread
obynonwane marked this conversation as resolved.
Outdated
echo "[SUCCESS---] Found ${FOUND} verification event(s) for $ROLLUP_MANAGER in the last $LOOKBACK blocks."
if command -v jq >/dev/null 2>&1; then
echo "--- summary ---"
# Show a compact, human-readable list
jq -r '.[] | "block=\(.blockNumber) tx=\(.transactionHash) logIndex=\(.logIndex) rollupIdTopic=\(.topics[1]) aggregatorTopic=\(.topics[2])"' "$TMP_JSON"
fi
exit 0
else
echo "[ERROR---] No verification events found for $ROLLUP_MANAGER in the last $LOOKBACK blocks."
exit 2
fi
6 changes: 6 additions & 0 deletions scenarios/agglayer-upgrade-with-supplied-version/env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
ENCLAVE_NAME=cdk
KURTOSIS_PACKAGE_HASH=be8cab2e9ed799ab91319fee0f488fab04a393ac # Latest commit
# KURTOSIS_PACKAGE_HASH=e05e8cdcfee52a106ec6850b8956b77171cdd948 # Kurtosis tag v0.3.4 + v9.0.0-rc.2-pp contracts + CDK-Erigon Validium by default
SP1_NETWORK_KEY=0x50630eb71ab68ff812fcb9b9c58859f9e9f70a62b7e9e97c9c1cc09d86c760d8 # Replace with valid key
Comment thread
jhkimqd marked this conversation as resolved.
FROM_TAG=0.3.5
TO_TAG=0.3.4
Loading