Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: create e2e smoke test flow + use cluster for SP1 proofs #405

Merged
merged 42 commits into from
Mar 19, 2025
Merged
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
c0e045b
test: create e2e smoke test flow + use cluster for SP1 proofs
gjermundgaraba Mar 13, 2025
fbf87d5
lint
gjermundgaraba Mar 13, 2025
6301d74
Merge branch 'main' into gjermund/e2e-test-improvements
gjermundgaraba Mar 13, 2025
fb38ef2
initial setup 3 e2e workflows
gjermundgaraba Mar 14, 2025
7726fd9
pull out e2e setup
gjermundgaraba Mar 14, 2025
f095c40
test matrix
gjermundgaraba Mar 14, 2025
242c96d
cleanup
gjermundgaraba Mar 14, 2025
d43edb9
ci cleanup
gjermundgaraba Mar 14, 2025
8cf10aa
fix newlines
gjermundgaraba Mar 14, 2025
f21248a
rename to yaml
gjermundgaraba Mar 14, 2025
8544375
Merge remote-tracking branch 'origin/main' into gjermund/e2e-test-imp…
gjermundgaraba Mar 14, 2025
f5a0214
fix checkout
gjermundgaraba Mar 14, 2025
c4fe1fa
single-line matrix output
gjermundgaraba Mar 14, 2025
dc39a2d
pass github pat to e2e setup
gjermundgaraba Mar 14, 2025
b0f88d8
fix matrix script
gjermundgaraba Mar 14, 2025
b4020b1
trying a different approach to the config
gjermundgaraba Mar 15, 2025
bffc470
lint
gjermundgaraba Mar 15, 2025
88b59e2
add missing checkout
gjermundgaraba Mar 15, 2025
3b76a82
fix skip tests
gjermundgaraba Mar 15, 2025
1019cde
more cleanup
gjermundgaraba Mar 16, 2025
44efbe3
fix broken test + stack trace support in relayer
gjermundgaraba Mar 16, 2025
62a896a
Merge remote-tracking branch 'origin/main' into gjermund/e2e-test-imp…
gjermundgaraba Mar 16, 2025
b3d1550
some more cleanups
gjermundgaraba Mar 16, 2025
b098839
remove unused type
gjermundgaraba Mar 16, 2025
29d7d90
cleanup after self-review
gjermundgaraba Mar 16, 2025
e26d03a
ups
gjermundgaraba Mar 16, 2025
571b89c
removed unecessary quotes
gjermundgaraba Mar 17, 2025
883a9a2
code review fixes
gjermundgaraba Mar 17, 2025
a887d2c
Merge remote-tracking branch 'origin/main' into gjermund/e2e-test-imp…
gjermundgaraba Mar 17, 2025
1cdd6b4
push to main run minimal
gjermundgaraba Mar 18, 2025
110a6b1
Merge remote-tracking branch 'origin/main' into gjermund/e2e-test-imp…
gjermundgaraba Mar 18, 2025
dc3c72d
test different tm_client settings
gjermundgaraba Mar 18, 2025
dccb743
Merge remote-tracking branch 'origin/main' into gjermund/e2e-test-imp…
gjermundgaraba Mar 18, 2025
0a7260a
Revert "test different tm_client settings"
gjermundgaraba Mar 18, 2025
f8e1c4e
type safety in sp1 config
gjermundgaraba Mar 18, 2025
cbd441b
consistent use of quotes in ci files
gjermundgaraba Mar 19, 2025
db4329f
fixed paths
gjermundgaraba Mar 19, 2025
bb24820
fixed a bunch of issues
gjermundgaraba Mar 19, 2025
7ef1698
fix 2
gjermundgaraba Mar 19, 2025
d3e75b7
code review fixes
gjermundgaraba Mar 19, 2025
3638e65
Apply suggestions from code review
gjermundgaraba Mar 19, 2025
139da65
Merge branch 'main' into gjermund/e2e-test-improvements
gjermundgaraba Mar 19, 2025
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
2 changes: 1 addition & 1 deletion .env.example
Original file line number Diff line number Diff line change
@@ -3,7 +3,7 @@ ETH_TESTNET_TYPE="pow"

# SP1_PROVER={network|local|mock}
SP1_PROVER=mock
# Private key with the permission to use the sp1 network prover (optional if you use SP1_PROVER=mock)
# Private key with the permission to use the sp1 network prover (not used if you use SP1_PROVER=mock)
NETWORK_PRIVATE_KEY="PRIVATE_KEY"
# Private key which the operator uses to sign the transactions in Eth Sepolia testnet
PRIVATE_KEY="PRIVATE-KEY"
21 changes: 21 additions & 0 deletions .github/actions/e2e-matrix/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: e2e-matrix
description: Dynamically discovers and generates a test matrix for e2e tests

inputs:
skip-tests:
description: Comma-separated list of tests to skip
required: false
default: ''

outputs:
matrix:
description: JSON string containing the test matrix
value: ${{ steps.generate-matrix.outputs.matrix }}

runs:
using: composite
steps:
- name: Generate Test Matrix
id: generate-matrix
shell: bash
run: echo "matrix=$(${{ github.workspace }}/scripts/generate-e2e-test-matrix.sh '${{ inputs.skip-tests }}')" >> $GITHUB_OUTPUT
61 changes: 61 additions & 0 deletions .github/actions/e2e-setup/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: e2e-setup

inputs:
github_token:
description: A Github PAT
required: true

runs:
using: composite
steps:
- name: Set up foundry tooling
uses: ./.github/actions/foundry-setup

- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: 1.23
check-latest: true
cache-dependency-path: e2e/interchaintestv8/go.sum

- name: Cache Relayer and Operator
id: cache-relayer
uses: actions/cache@v4
with:
path: |
~/.cargo/bin/relayer
~/.cargo/bin/operator
key: ${{ runner.os }}-relayer-${{ hashFiles('Cargo.lock', 'packages/**', 'programs/**', 'abi/**') }}

- name: Install SP1 toolchain
if: (steps.cache-relayer.outputs.cache-hit != 'true')
shell: bash
run: |
curl -L https://sp1.succinct.xyz | bash
~/.sp1/bin/sp1up --token ${{ inputs.github_token }}
~/.sp1/bin/cargo-prove prove --version

- name: Install operator
if: steps.cache-relayer.outputs.cache-hit != 'true'
uses: actions-rs/cargo@v1
with:
command: install
args: --bin operator --path programs/operator --locked

- name: Install relayer
if: steps.cache-relayer.outputs.cache-hit != 'true'
uses: actions-rs/cargo@v1
with:
command: install
args: --bin relayer --path programs/relayer --locked

- name: Setup Kurtosis
if: env.ETH_TESTNET_TYPE == 'pos'
shell: bash
run: |
echo "deb [trusted=yes] https://apt.fury.io/kurtosis-tech/ /" | sudo tee /etc/apt/sources.list.d/kurtosis.list
sudo apt update
sudo apt install kurtosis-cli=1.5.0 # Must match the kurtosis library version we use in the e2e tests
kurtosis engine start
kurtosis analytics disable
echo "$(dirname $(which kurtosis))" >> $GITHUB_PATH
Original file line number Diff line number Diff line change
@@ -1,21 +1,19 @@
name: setup
name: foundry-setup

runs:
using: composite
steps:
- name: "Check out the repo"
uses: "actions/checkout@v4"
- name: Install stable toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
components: rustfmt, clippy
- name: "Install Foundry"
uses: "foundry-rs/foundry-toolchain@v1"
- name: "Install Bun"
uses: "oven-sh/setup-bun@v2"
- name: "Install the Node.js dependencies"
- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
- name: Install Bun
uses: oven-sh/setup-bun@v2
- name: Install the Node.js dependencies
shell: bash
run: bun install
- name: Setup Protoc
44 changes: 19 additions & 25 deletions .github/workflows/abigen.yaml
Original file line number Diff line number Diff line change
@@ -4,38 +4,36 @@ on:
workflow_dispatch:
pull_request:
paths:
- "abi/**"
- "abigen/**"
- "**.sol"
- "bun.lockb"
- 'abi/**'
- 'abigen/**'
- '**.sol'
- 'bun.lockb'
push:
branches:
- "main"
- main
paths:
- "abi/**"
- "abigen/**"
- 'abi/**'
- 'abigen/**'

jobs:
gen-check:
name: "Check for abigen changes"
name: Check for abigen changes
runs-on: depot-ubuntu-22.04-4
steps:
- name: Checkout sources
uses: actions/checkout@v4

- name: "Set up environment"
uses: ./.github/setup
- uses: actions/checkout@v4
- name: Set up environment
uses: ./.github/actions/foundry-setup

- uses: actions/setup-go@v4
with:
go-version: "1.23"
go-version: 1.23

- uses: extractions/setup-just@v2

- name: "Install abigen"
- name: Install abigen
run: go install github.com/ethereum/go-ethereum/cmd/abigen@latest

- name: "Check that generating files from go does not create any changes"
- name: Check that generating files from go does not create any changes
uses: nickcharlton/diff-check@main
with:
command: just generate-abi
@@ -44,12 +42,10 @@ jobs:
name: lint
runs-on: depot-ubuntu-22.04-4
steps:
- name: Checkout sources
uses: actions/checkout@v4

- uses: actions/checkout@v4
- uses: actions/setup-go@v4
with:
go-version: "1.23"
go-version: 1.23
cache-dependency-path: abigen/go.sum

- name: golangci-lint
@@ -61,13 +57,11 @@ jobs:
test:
runs-on: depot-ubuntu-22.04-4
steps:
- name: Checkout sources
uses: actions/checkout@v4

- uses: actions/checkout@v4
- uses: actions/setup-go@v4
with:
go-version: "1.23"
go-version: 1.23
cache-dependency-path: abigen/go.sum

- name: "Unit test abigen"
- name: Unit test abigen
run: cd abigen && go test -v ./...
22 changes: 10 additions & 12 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@ on:
pull_request:
push:
branches:
- "main"
- main

jobs:
test-deploy:
@@ -13,10 +13,10 @@ jobs:
FOUNDRY_ETH_RPC_URL: http://localhost:8545
DEPLOYMENT_ENV: local
steps:
- name: Check out the repo
uses: actions/checkout@v4
- name: "Set up environment"
uses: ./.github/setup
- uses: actions/checkout@v4
- name: Set up environment
uses: ./.github/actions/foundry-setup

- name: Deploy Anvil
run: |
anvil &
@@ -35,8 +35,7 @@ jobs:
outputs:
matrix: ${{ steps.matrix.outputs.matrix }}
steps:
- name: Check out the repo
uses: actions/checkout@v4
- uses: actions/checkout@v4
- name: Set deployment matrix
id: matrix
run: |
@@ -48,12 +47,11 @@ jobs:
strategy:
matrix: ${{ fromJSON(needs.gather-deploys.outputs.matrix) }}
env:
DEPLOYMENT_ENV: "${{ matrix.env }}"
DEPLOYMENT_ENV: ${{ matrix.env }}
steps:
- name: Check out the repo
uses: actions/checkout@v4
- name: "Set up environment"
uses: ./.github/setup
- uses: actions/checkout@v4
- name: Set up environment
uses: ./.github/actions/foundry-setup
- name: Export the RPC URL
run: |
cat deployments/${{ matrix.env }}/${{ matrix.file }} | jq -r ". | \"FOUNDRY_ETH_RPC_URL=\(.rpc_url)\"" >> $GITHUB_ENV
7 changes: 3 additions & 4 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@ on:
branches:
- main
tags:
- 'relayer-v[0-9]+.[0-9]+.[0-9]+'
- relayer-v[0-9]+.[0-9]+.[0-9]+
workflow_dispatch: # this will kick off a dev deployment
pull_request:
paths:
@@ -29,9 +29,8 @@ jobs:
env:
registry_url: ghcr.io/cosmos/eureka-relayer
steps:
- name: Check out the repo
- uses: actions/checkout@v4
if: github.event_name != 'pull_request'
uses: actions/checkout@v4
- name: Check out the PR commit head
uses: actions/checkout@v4
if: github.event_name == 'pull_request'
@@ -61,7 +60,7 @@ jobs:
uses: docker/build-push-action@v6
with:
context: .
file: './programs/relayer/Dockerfile'
file: ./programs/relayer/Dockerfile
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
push: true
51 changes: 51 additions & 0 deletions .github/workflows/e2e-full.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: e2e-full
on:
workflow_dispatch:
schedule:
- cron: '0 0 */3 * *' # Run every 3 days at midnight UTC

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

env:
FOUNDRY_PROFILE: ci
ETH_TESTNET_TYPE: pos
SP1_PROVER: network
ETHEREUM_POS_NETWORK_PRESET: mainnet
permissions:
contents: read

jobs:
generate-matrix:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.get-matrix.outputs.matrix }}
steps:
- uses: actions/checkout@v4
- name: Generate Test Matrix
id: get-matrix
uses: ./.github/actions/e2e-matrix
with:
skip-tests: TestWithRelayerTestSuite/Test_2_ConcurrentRecvPacketToEth_Groth16,TestWithRelayerTestSuite/TestMultiPeriodClientUpdateToCosmos

e2e:
needs: generate-matrix
strategy:
fail-fast: false
matrix: ${{ fromJson(needs.generate-matrix.outputs.matrix) }}
name: ${{ matrix.test }}
runs-on: depot-ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Set up E2E environment
uses: ./.github/actions/e2e-setup
with:
github_token: ${{ secrets.GITHUB_TOKEN }}

- name: Run Tests
env:
NETWORK_PRIVATE_KEY: ${{ secrets.SP1_PRIVATE_KEY }}
run: |
cd e2e/interchaintestv8
go test -v -mod=readonly . -run "^${{ matrix.test }}$" -timeout 120m
54 changes: 54 additions & 0 deletions .github/workflows/e2e-minimal.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: e2e-minimal
on:
workflow_dispatch:
push:
branches:
- main
schedule:
- cron: '0 3 * * *' # Run daily at 3 AM UTC (outside EU and US work hours)

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

env:
FOUNDRY_PROFILE: ci
ETH_TESTNET_TYPE: pos
SP1_PROVER: network
ETHEREUM_POS_NETWORK_PRESET: minimal
permissions:
contents: read

jobs:
generate-matrix:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.get-matrix.outputs.matrix }}
steps:
- uses: actions/checkout@v4
- name: Generate Test Matrix
id: get-matrix
uses: ./.github/actions/e2e-matrix
with:
skip-tests: TestWithRelayerTestSuite/Test_2_ConcurrentRecvPacketToEth_Groth16

e2e:
needs: generate-matrix
strategy:
fail-fast: false
matrix: ${{ fromJson(needs.generate-matrix.outputs.matrix) }}
name: ${{ matrix.test }}
runs-on: depot-ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Set up E2E environment
uses: ./.github/actions/e2e-setup
with:
github_token: ${{ secrets.GITHUB_TOKEN }}

- name: Run Tests
env:
NETWORK_PRIVATE_KEY: ${{ secrets.SP1_PRIVATE_KEY }}
run: |
cd e2e/interchaintestv8
go test -v -mod=readonly . -run "^${{ matrix.test }}$" -timeout 60m
Loading