Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
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
1 change: 1 addition & 0 deletions .github/workflows/test-e2e-multi_pp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ on:
workflow_dispatch: {}

jobs:

test-e2e-multi_pp:
strategy:
fail-fast: false
Expand Down
106 changes: 106 additions & 0 deletions .github/workflows/test-e2e-pp.yml
Original file line number Diff line number Diff line change
@@ -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
3 changes: 1 addition & 2 deletions .github/workflows/test-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ jobs:
- "fork11-rollup"
- "fork12-validium"
- "fork12-rollup"
- "fork12-pessimistic"
steps:
- name: Checkout Code
uses: actions/checkout@v4
Expand All @@ -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
Expand Down
8 changes: 3 additions & 5 deletions test/combinations/fork11-rollup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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}}
7 changes: 2 additions & 5 deletions test/combinations/fork12-cdk-validium.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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}}
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -37,4 +36,3 @@ args:
zkevm_use_real_verifier: false
enable_normalcy: true
verifier_program_vkey: 0x00766aa16a6efe4ac05c0fe21d4b50f9631dbd1a2663a982da861427085ea2ea

12 changes: 5 additions & 7 deletions test/combinations/fork12-pessimistic-multi.yml
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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}}
16 changes: 8 additions & 8 deletions test/combinations/fork12-pessimistic.yml
Original file line number Diff line number Diff line change
@@ -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

4 changes: 1 addition & 3 deletions test/combinations/fork12-rollup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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}}
9 changes: 3 additions & 6 deletions test/combinations/fork9-cdk-validium.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,14 @@ 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
gas_token_enabled: true
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}}
2 changes: 1 addition & 1 deletion test/config/kurtosis-cdk-node-config.toml.template
Original file line number Diff line number Diff line change
@@ -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}}
Expand Down
62 changes: 62 additions & 0 deletions test/config/kurtosis-cdk-node-config.toml.template.pessimistic
Original file line number Diff line number Diff line change
@@ -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}}/"


6 changes: 6 additions & 0 deletions test/run-e2e-multi_pp.sh
Original file line number Diff line number Diff line change
@@ -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"
Expand Down Expand Up @@ -43,6 +44,8 @@ function resolve_template(){
eval $_RESULT_VARNAME="$_TEMP_FILE"
}



###############################################################################
# MAIN
###############################################################################
Expand All @@ -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"
Expand Down
5 changes: 3 additions & 2 deletions test/run-e2e.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/bin/bash
source $(dirname $0)/scripts/env.sh
source $(dirname $0)/scripts/shared.sh

FORK=$1
if [ -z $FORK ]; then
Expand All @@ -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"
Expand Down
Loading
Loading