Skip to content

Commit

Permalink
Merge branch 'main' into jihwan/op-succinct-integration
Browse files Browse the repository at this point in the history
  • Loading branch information
jhkimqd committed Feb 19, 2025
2 parents 3c1e958 + 0e2aac9 commit edbe14d
Show file tree
Hide file tree
Showing 7 changed files with 189 additions and 1 deletion.
20 changes: 20 additions & 0 deletions .github/tests/antithesis/fork12-cdk-erigon-sovereign.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# This file is a copy/paste of .github/tests/combinations/fork12-cdk-erigon-sovereign.yml
# The only difference is that it does not deploy the cdk bridge ui.
deployment_stages:
deploy_cdk_bridge_ui: false
deploy_l2_contracts: true

args:
verbosity: debug
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
consensus_contract_type: pessimistic
sequencer_type: erigon
erigon_strict_mode: false
gas_token_enabled: false
zkevm_use_real_verifier: false
enable_normalcy: true
agglayer_prover_sp1_key: ""
agglayer_prover_primary_prover: mock-prover
additional_services:
- tx_spammer
14 changes: 14 additions & 0 deletions .github/tests/antithesis/fork12-cdk-erigon-validium.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# This file is a copy/paste of .github/tests/combinations/fork12-cdk-erigon-validium.yml
# The only difference is that it does not deploy the cdk bridge ui.
deployment_stages:
deploy_cdk_bridge_ui: false
deploy_l2_contracts: true

args:
verbosity: debug
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
consensus_contract_type: cdk-validium
sequencer_type: erigon
additional_services:
- tx_spammer
48 changes: 48 additions & 0 deletions .github/workflows/antithesis-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# Workflow for automatically building and pushing the config image to the Antithesis registry.
name: Antithesis Docker Image Builder

on:
pull_request:
workflow_dispatch:

env:
ANTITHESIS_REGISTRY: us-central1-docker.pkg.dev
ANTITHESIS_REPOSITORY: molten-verve-216720/polygon-repository

concurrency:
group: antithesis-build-and-push-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
build-and-push:
runs-on: ubuntu-latest
timeout-minutes: 30

steps:
- uses: actions/checkout@v4

- uses: docker/login-action@v3
with:
registry: ${{ env.ANTITHESIS_REGISTRY }}
username: _json_key
password: ${{ secrets.ANTITHESIS_JSON_LOGIN_KEY }}
# This step will only execute if the necessary secrets are available, preventing failures
# on pull requests from forked repositories.
if: ${{ env.ANTITHESIS_JSON_LOGIN_KEY }}
env:
ANTITHESIS_JSON_LOGIN_KEY: ${{ secrets.ANTITHESIS_JSON_LOGIN_KEY }}

- name: Build and push config image
uses: docker/build-push-action@v6
with:
context: docker
file: docker/antithesis.Dockerfile
push: true
tags: |
${{ env.ANTITHESIS_REGISTRY }}/${{ env.ANTITHESIS_REPOSITORY}}/config:antithesis-latest,
${{ env.ANTITHESIS_REGISTRY }}/${{ env.ANTITHESIS_REPOSITORY}}/config:${{ github.sha }}
# This step will only execute if the necessary secrets are available, preventing failures
# on pull requests from forked repositories.
if: ${{ env.ANTITHESIS_JSON_LOGIN_KEY }}
env:
ANTITHESIS_JSON_LOGIN_KEY: ${{ secrets.ANTITHESIS_JSON_LOGIN_KEY }}
2 changes: 1 addition & 1 deletion .github/workflows/docker-image-builder.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
zkevm-contracts:
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
steps:
- uses: actions/checkout@v4
- uses: docker/setup-buildx-action@v3
- uses: docker/login-action@v3
Expand Down
58 changes: 58 additions & 0 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ 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 }}
Expand All @@ -13,6 +19,15 @@ concurrency:
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
Expand Down Expand Up @@ -330,6 +345,49 @@ jobs:
name: dump_cardona_sepolia_testnet_pless_zkevm_node_${{ github.run_id }}
path: ./dump

# Trigger Antithesis tests.
# Note that the configuration docker image must have been pushed into the Antithesis registry.
antithesis:
runs-on: ubuntu-latest

permissions:
contents: read
packages: write

steps:
- uses: actions/checkout@v4

- name: Set the parameter file to be used in Antithesis tests
run: echo "PARAM_FILE=${{ github.event_name == 'workflow_dispatch' && inputs.param_file || env.DEFAULT_ANTITHESIS_PARAM_FILE }}" >> $GITHUB_ENV

- name: Trigger Antithesis tests
uses: antithesishq/antithesis-trigger-action@main
with:
username: ${{ secrets.ANTITHESIS_USERNAME }}
password: ${{ secrets.ANTITHESIS_PASSWORD }}
github_token: ${{ secrets.ANTITHESIS_PAT }}

tenant: ${{ env.ANTITHESIS_TENANT }}
notebook_name: ${{ env.ANTITHESIS_NOTEBOOK }}
test_name: cdk

config_image: ${{ env.ANTITHESIS_REGISTRY }}/${{ env.ANTITHESIS_REPOSITORY}}/config:antithesis-latest
description: Kurtosis CDK tests
email_recipients: ${{ secrets.ANTITHESIS_EMAIL_RECIPIENTS }} # this is a ";" delimited list (e.g. "u1@site.com;u2@site.com").
# Note: duration must be specified in number of hours (min 0.5 hours).
additional_parameters: |-
custom.configuration=${{ env.PARAM_FILE }}
custom.duration=1.0
# This step will only execute if the necessary secrets are available, preventing failures
# on pull requests from forked repositories.
if: ${{ env.ANTITHESIS_USERNAME && env.ANTITHESIS_PASSWORD && env.ANTITHESIS_PAT && env.ANTITHESIS_EMAIL_RECIPIENTS }}
env:
ANTITHESIS_USERNAME: ${{ secrets.ANTITHESIS_USERNAME }}
ANTITHESIS_PASSWORD: ${{ secrets.ANTITHESIS_PASSWORD }}
ANTITHESIS_PAT: ${{ secrets.ANTITHESIS_PAT }}
ANTITHESIS_EMAIL_RECIPIENTS: ${{ secrets.ANTITHESIS_EMAIL_RECIPIENTS }}

# Deploy the CDK environment against a local l1 chain with pre-deployed zkevm contracts.
# TODO: Fix this job.
# pre-deployed-contracts:
Expand Down
6 changes: 6 additions & 0 deletions docker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,3 +135,9 @@ $ docker images --filter "reference=local/toolbox"
REPOSITORY TAG IMAGE ID CREATED SIZE
local/toolbox local 3f85f026aaf9 2 seconds ago 448MB
```

### Antithesis

```bash
docker build --tag kurtosis-cdk-antithesis --file antithesis.Dockerfile .
```
42 changes: 42 additions & 0 deletions docker/antithesis.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
FROM debian:stable-slim as builder

# WARNING (DL3008): Pin versions in apt get install.
# hadolint ignore=DL3008
RUN apt-get update \
&& apt-get --yes upgrade \
&& apt-get install --yes --no-install-recommends libssl-dev ca-certificates jq git curl make \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* \
# Pull kurtosis-cdk package.
# Temporary hack for now.
# && git clone --branch v0.2.29 https://github.com/0xPolygon/kurtosis-cdk \
&& git clone --branch feat/antithesis-integration https://github.com/leovct/kurtosis-cdk \
# Pull kurtosis-cdk dependencies.
# The package has other dependencies (blockscout, prometheus and grafana) but they shouldn't be used when testing the package with Antithesis.
&& git clone --branch 4.4.0 https://github.com/ethpandaops/ethereum-package \
&& git clone --branch 1.2.0 https://github.com/ethpandaops/optimism-package \
# Make the kurtosis-cdk package reference locally pulled dependencies.
&& sed -i '$ a\\nreplace:\n github.com/ethpandaops/ethereum-package: ../ethereum-package\n github.com/ethpandaops/optimism-package: ../optimism-package\n github.com/kurtosis-tech/redis-package: ../redis-package\n github.com/kurtosis-tech/postgres-package: ../postgres-package\n github.com/bharath-123/db-adminer-package: ../db-adminer-package\n github.com/kurtosis-tech/prometheus-package: ../prometheus-package' /kurtosis-cdk/kurtosis.yml \
# Pull ethereum package dependencies.
&& git clone --branch main https://github.com/kurtosis-tech/prometheus-package \
&& git clone --branch main https://github.com/kurtosis-tech/postgres-package \
&& git clone --branch main https://github.com/bharath-123/db-adminer-package \
&& git clone --branch main https://github.com/kurtosis-tech/redis-package \
# Make the ethereum package reference locally pulled dependencies.
&& sed -i '$ a\\nreplace:\n github.com/kurtosis-tech/prometheus-package: ../prometheus-package\n github.com/kurtosis-tech/postgres-package: ../postgres-package\n github.com/bharath-123/db-adminer-package: ../db-adminer-package\n github.com/kurtosis-tech/redis-package: ../redis-package' /ethereum-package/kurtosis.yml \
# Pull optimism package dependencies.
# It relies on the ethereum package which is already pulled.
&& sed -i '$ a\\nreplace:\n github.com/ethpandaops/ethereum-package: ../ethereum-package' /optimism-package/kurtosis.yml


FROM scratch
LABEL author="devtools@polygon.technology"
LABEL description="Antithesis config image for kurtosis-cdk"

COPY --from=builder /kurtosis-cdk /kurtosis-cdk
COPY --from=builder /ethereum-package /ethereum-package
COPY --from=builder /prometheus-package /prometheus-package
COPY --from=builder /postgres-package /postgres-package
COPY --from=builder /db-adminer-package /db-adminer-package
COPY --from=builder /redis-package /redis-package
COPY --from=builder /optimism-package /optimism-package

0 comments on commit edbe14d

Please sign in to comment.