Skip to content

Commit e981ff2

Browse files
test: create e2e smoke test flow + use cluster for SP1 proofs (#405)
Co-authored-by: srdtrk <[email protected]>
1 parent de19ea5 commit e981ff2

36 files changed

+749
-613
lines changed

.env.example

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ ETH_TESTNET_TYPE="pow"
33

44
# SP1_PROVER={network|local|mock}
55
SP1_PROVER=mock
6-
# Private key with the permission to use the sp1 network prover (optional if you use SP1_PROVER=mock)
6+
# Private key with the permission to use the sp1 network prover (not used if you use SP1_PROVER=mock)
77
NETWORK_PRIVATE_KEY="PRIVATE_KEY"
88
# Private key which the operator uses to sign the transactions in Eth Sepolia testnet
99
PRIVATE_KEY="PRIVATE-KEY"

.github/actions/e2e-matrix/action.yml

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: e2e-matrix
2+
description: Dynamically discovers and generates a test matrix for e2e tests
3+
4+
inputs:
5+
skip-tests:
6+
description: Comma-separated list of tests to skip
7+
required: false
8+
default: ''
9+
10+
outputs:
11+
matrix:
12+
description: JSON string containing the test matrix
13+
value: ${{ steps.generate-matrix.outputs.matrix }}
14+
15+
runs:
16+
using: composite
17+
steps:
18+
- name: Generate Test Matrix
19+
id: generate-matrix
20+
shell: bash
21+
run: echo "matrix=$(${{ github.workspace }}/scripts/generate-e2e-test-matrix.sh '${{ inputs.skip-tests }}')" >> $GITHUB_OUTPUT

.github/actions/e2e-setup/action.yml

+61
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
name: e2e-setup
2+
3+
inputs:
4+
github_token:
5+
description: A Github PAT
6+
required: true
7+
8+
runs:
9+
using: composite
10+
steps:
11+
- name: Set up foundry tooling
12+
uses: ./.github/actions/foundry-setup
13+
14+
- name: Setup Go
15+
uses: actions/setup-go@v4
16+
with:
17+
go-version: 1.23
18+
check-latest: true
19+
cache-dependency-path: e2e/interchaintestv8/go.sum
20+
21+
- name: Cache Relayer and Operator
22+
id: cache-relayer
23+
uses: actions/cache@v4
24+
with:
25+
path: |
26+
~/.cargo/bin/relayer
27+
~/.cargo/bin/operator
28+
key: ${{ runner.os }}-relayer-${{ hashFiles('Cargo.lock', 'packages/**', 'programs/**', 'abi/**') }}
29+
30+
- name: Install SP1 toolchain
31+
if: (steps.cache-relayer.outputs.cache-hit != 'true')
32+
shell: bash
33+
run: |
34+
curl -L https://sp1.succinct.xyz | bash
35+
~/.sp1/bin/sp1up --token ${{ inputs.github_token }}
36+
~/.sp1/bin/cargo-prove prove --version
37+
38+
- name: Install operator
39+
if: steps.cache-relayer.outputs.cache-hit != 'true'
40+
uses: actions-rs/cargo@v1
41+
with:
42+
command: install
43+
args: --bin operator --path programs/operator --locked
44+
45+
- name: Install relayer
46+
if: steps.cache-relayer.outputs.cache-hit != 'true'
47+
uses: actions-rs/cargo@v1
48+
with:
49+
command: install
50+
args: --bin relayer --path programs/relayer --locked
51+
52+
- name: Setup Kurtosis
53+
if: env.ETH_TESTNET_TYPE == 'pos'
54+
shell: bash
55+
run: |
56+
echo "deb [trusted=yes] https://apt.fury.io/kurtosis-tech/ /" | sudo tee /etc/apt/sources.list.d/kurtosis.list
57+
sudo apt update
58+
sudo apt install kurtosis-cli=1.5.0 # Must match the kurtosis library version we use in the e2e tests
59+
kurtosis engine start
60+
kurtosis analytics disable
61+
echo "$(dirname $(which kurtosis))" >> $GITHUB_PATH

.github/setup/action.yml .github/actions/foundry-setup/action.yml

+6-8
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,19 @@
1-
name: setup
1+
name: foundry-setup
22

33
runs:
44
using: composite
55
steps:
6-
- name: "Check out the repo"
7-
uses: "actions/checkout@v4"
86
- name: Install stable toolchain
97
uses: actions-rs/toolchain@v1
108
with:
119
profile: minimal
1210
toolchain: stable
1311
components: rustfmt, clippy
14-
- name: "Install Foundry"
15-
uses: "foundry-rs/foundry-toolchain@v1"
16-
- name: "Install Bun"
17-
uses: "oven-sh/setup-bun@v2"
18-
- name: "Install the Node.js dependencies"
12+
- name: Install Foundry
13+
uses: foundry-rs/foundry-toolchain@v1
14+
- name: Install Bun
15+
uses: oven-sh/setup-bun@v2
16+
- name: Install the Node.js dependencies
1917
shell: bash
2018
run: bun install
2119
- name: Setup Protoc

.github/workflows/abigen.yaml

+19-25
Original file line numberDiff line numberDiff line change
@@ -4,38 +4,36 @@ on:
44
workflow_dispatch:
55
pull_request:
66
paths:
7-
- "abi/**"
8-
- "abigen/**"
9-
- "**.sol"
10-
- "bun.lockb"
7+
- 'abi/**'
8+
- 'abigen/**'
9+
- '**.sol'
10+
- 'bun.lockb'
1111
push:
1212
branches:
13-
- "main"
13+
- main
1414
paths:
15-
- "abi/**"
16-
- "abigen/**"
15+
- 'abi/**'
16+
- 'abigen/**'
1717

1818
jobs:
1919
gen-check:
20-
name: "Check for abigen changes"
20+
name: Check for abigen changes
2121
runs-on: depot-ubuntu-22.04-4
2222
steps:
23-
- name: Checkout sources
24-
uses: actions/checkout@v4
25-
26-
- name: "Set up environment"
27-
uses: ./.github/setup
23+
- uses: actions/checkout@v4
24+
- name: Set up environment
25+
uses: ./.github/actions/foundry-setup
2826

2927
- uses: actions/setup-go@v4
3028
with:
31-
go-version: "1.23"
29+
go-version: 1.23
3230

3331
- uses: extractions/setup-just@v2
3432

35-
- name: "Install abigen"
33+
- name: Install abigen
3634
run: go install github.com/ethereum/go-ethereum/cmd/abigen@latest
3735

38-
- name: "Check that generating files from go does not create any changes"
36+
- name: Check that generating files from go does not create any changes
3937
uses: nickcharlton/diff-check@main
4038
with:
4139
command: just generate-abi
@@ -44,12 +42,10 @@ jobs:
4442
name: lint
4543
runs-on: depot-ubuntu-22.04-4
4644
steps:
47-
- name: Checkout sources
48-
uses: actions/checkout@v4
49-
45+
- uses: actions/checkout@v4
5046
- uses: actions/setup-go@v4
5147
with:
52-
go-version: "1.23"
48+
go-version: 1.23
5349
cache-dependency-path: abigen/go.sum
5450

5551
- name: golangci-lint
@@ -61,13 +57,11 @@ jobs:
6157
test:
6258
runs-on: depot-ubuntu-22.04-4
6359
steps:
64-
- name: Checkout sources
65-
uses: actions/checkout@v4
66-
60+
- uses: actions/checkout@v4
6761
- uses: actions/setup-go@v4
6862
with:
69-
go-version: "1.23"
63+
go-version: 1.23
7064
cache-dependency-path: abigen/go.sum
7165

72-
- name: "Unit test abigen"
66+
- name: Unit test abigen
7367
run: cd abigen && go test -v ./...

.github/workflows/deploy.yml

+10-12
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ on:
44
pull_request:
55
push:
66
branches:
7-
- "main"
7+
- main
88

99
jobs:
1010
test-deploy:
@@ -13,10 +13,10 @@ jobs:
1313
FOUNDRY_ETH_RPC_URL: http://localhost:8545
1414
DEPLOYMENT_ENV: local
1515
steps:
16-
- name: Check out the repo
17-
uses: actions/checkout@v4
18-
- name: "Set up environment"
19-
uses: ./.github/setup
16+
- uses: actions/checkout@v4
17+
- name: Set up environment
18+
uses: ./.github/actions/foundry-setup
19+
2020
- name: Deploy Anvil
2121
run: |
2222
anvil &
@@ -35,8 +35,7 @@ jobs:
3535
outputs:
3636
matrix: ${{ steps.matrix.outputs.matrix }}
3737
steps:
38-
- name: Check out the repo
39-
uses: actions/checkout@v4
38+
- uses: actions/checkout@v4
4039
- name: Set deployment matrix
4140
id: matrix
4241
run: |
@@ -48,12 +47,11 @@ jobs:
4847
strategy:
4948
matrix: ${{ fromJSON(needs.gather-deploys.outputs.matrix) }}
5049
env:
51-
DEPLOYMENT_ENV: "${{ matrix.env }}"
50+
DEPLOYMENT_ENV: ${{ matrix.env }}
5251
steps:
53-
- name: Check out the repo
54-
uses: actions/checkout@v4
55-
- name: "Set up environment"
56-
uses: ./.github/setup
52+
- uses: actions/checkout@v4
53+
- name: Set up environment
54+
uses: ./.github/actions/foundry-setup
5755
- name: Export the RPC URL
5856
run: |
5957
cat deployments/${{ matrix.env }}/${{ matrix.file }} | jq -r ". | \"FOUNDRY_ETH_RPC_URL=\(.rpc_url)\"" >> $GITHUB_ENV

.github/workflows/docker.yml

+3-4
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ on:
44
branches:
55
- main
66
tags:
7-
- 'relayer-v[0-9]+.[0-9]+.[0-9]+'
7+
- relayer-v[0-9]+.[0-9]+.[0-9]+
88
workflow_dispatch: # this will kick off a dev deployment
99
pull_request:
1010
paths:
@@ -29,9 +29,8 @@ jobs:
2929
env:
3030
registry_url: ghcr.io/cosmos/eureka-relayer
3131
steps:
32-
- name: Check out the repo
32+
- uses: actions/checkout@v4
3333
if: github.event_name != 'pull_request'
34-
uses: actions/checkout@v4
3534
- name: Check out the PR commit head
3635
uses: actions/checkout@v4
3736
if: github.event_name == 'pull_request'
@@ -61,7 +60,7 @@ jobs:
6160
uses: docker/build-push-action@v6
6261
with:
6362
context: .
64-
file: './programs/relayer/Dockerfile'
63+
file: ./programs/relayer/Dockerfile
6564
tags: ${{ steps.meta.outputs.tags }}
6665
labels: ${{ steps.meta.outputs.labels }}
6766
push: true

.github/workflows/e2e-full.yml

+51
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: e2e-full
2+
on:
3+
workflow_dispatch:
4+
schedule:
5+
- cron: '0 0 */3 * *' # Run every 3 days at midnight UTC
6+
7+
concurrency:
8+
group: ${{ github.workflow }}-${{ github.ref }}
9+
cancel-in-progress: true
10+
11+
env:
12+
FOUNDRY_PROFILE: ci
13+
ETH_TESTNET_TYPE: pos
14+
SP1_PROVER: network
15+
ETHEREUM_POS_NETWORK_PRESET: mainnet
16+
permissions:
17+
contents: read
18+
19+
jobs:
20+
generate-matrix:
21+
runs-on: ubuntu-latest
22+
outputs:
23+
matrix: ${{ steps.get-matrix.outputs.matrix }}
24+
steps:
25+
- uses: actions/checkout@v4
26+
- name: Generate Test Matrix
27+
id: get-matrix
28+
uses: ./.github/actions/e2e-matrix
29+
with:
30+
skip-tests: TestWithRelayerTestSuite/Test_2_ConcurrentRecvPacketToEth_Groth16,TestWithRelayerTestSuite/TestMultiPeriodClientUpdateToCosmos
31+
32+
e2e:
33+
needs: generate-matrix
34+
strategy:
35+
fail-fast: false
36+
matrix: ${{ fromJson(needs.generate-matrix.outputs.matrix) }}
37+
name: ${{ matrix.test }}
38+
runs-on: depot-ubuntu-22.04
39+
steps:
40+
- uses: actions/checkout@v4
41+
- name: Set up E2E environment
42+
uses: ./.github/actions/e2e-setup
43+
with:
44+
github_token: ${{ secrets.GITHUB_TOKEN }}
45+
46+
- name: Run Tests
47+
env:
48+
NETWORK_PRIVATE_KEY: ${{ secrets.SP1_PRIVATE_KEY }}
49+
run: |
50+
cd e2e/interchaintestv8
51+
go test -v -mod=readonly . -run "^${{ matrix.test }}$" -timeout 120m

.github/workflows/e2e-minimal.yml

+54
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: e2e-minimal
2+
on:
3+
workflow_dispatch:
4+
push:
5+
branches:
6+
- main
7+
schedule:
8+
- cron: '0 3 * * *' # Run daily at 3 AM UTC (outside EU and US work hours)
9+
10+
concurrency:
11+
group: ${{ github.workflow }}-${{ github.ref }}
12+
cancel-in-progress: true
13+
14+
env:
15+
FOUNDRY_PROFILE: ci
16+
ETH_TESTNET_TYPE: pos
17+
SP1_PROVER: network
18+
ETHEREUM_POS_NETWORK_PRESET: minimal
19+
permissions:
20+
contents: read
21+
22+
jobs:
23+
generate-matrix:
24+
runs-on: ubuntu-latest
25+
outputs:
26+
matrix: ${{ steps.get-matrix.outputs.matrix }}
27+
steps:
28+
- uses: actions/checkout@v4
29+
- name: Generate Test Matrix
30+
id: get-matrix
31+
uses: ./.github/actions/e2e-matrix
32+
with:
33+
skip-tests: TestWithRelayerTestSuite/Test_2_ConcurrentRecvPacketToEth_Groth16
34+
35+
e2e:
36+
needs: generate-matrix
37+
strategy:
38+
fail-fast: false
39+
matrix: ${{ fromJson(needs.generate-matrix.outputs.matrix) }}
40+
name: ${{ matrix.test }}
41+
runs-on: depot-ubuntu-22.04
42+
steps:
43+
- uses: actions/checkout@v4
44+
- name: Set up E2E environment
45+
uses: ./.github/actions/e2e-setup
46+
with:
47+
github_token: ${{ secrets.GITHUB_TOKEN }}
48+
49+
- name: Run Tests
50+
env:
51+
NETWORK_PRIVATE_KEY: ${{ secrets.SP1_PRIVATE_KEY }}
52+
run: |
53+
cd e2e/interchaintestv8
54+
go test -v -mod=readonly . -run "^${{ matrix.test }}$" -timeout 60m

0 commit comments

Comments
 (0)