Skip to content

Commit bdfa029

Browse files
authored
fix(ci): update tests & use ethrex binary (#187)
**Motivation** Our integration tests are using an old ethrex commit, and daily reports indicate that Rex is out of sync. **Description** - Updates both the daily reports and integration tests to download and use the ethrex binary. - Updates the codebase to ensure all tests pass successfully. Some hotfixes will be removed once we have #185. Closes None
1 parent e3cb969 commit bdfa029

File tree

7 files changed

+207
-286
lines changed

7 files changed

+207
-286
lines changed

.github/workflows/daily_reports.yml

Lines changed: 45 additions & 83 deletions
Original file line numberDiff line numberDiff line change
@@ -18,60 +18,42 @@ jobs:
1818
with:
1919
tool-cache: false
2020
large-packages: false
21+
2122
- name: Checkout sources
2223
uses: actions/checkout@v4
2324
- name: Setup Rust Environment
2425
uses: ./.github/actions/setup-rust
25-
- name: Install solc
26-
uses: pontem-network/get-solc@master
27-
with:
28-
version: v0.8.29
29-
token: ${{ secrets.GITHUB_TOKEN || '' }}
26+
3027
- name: Install ethrex
3128
run: |
32-
cd ..
33-
git clone https://github.com/lambdaclass/ethrex.git
29+
curl -L https://github.com/lambdaclass/ethrex/releases/latest/download/ethrex-linux_x86_64 -o /usr/local/bin/ethrex
30+
chmod +x /usr/local/bin/ethrex
31+
ethrex --version
3432
echo "ethrex installed successfully"
35-
# also creates empty verification keys (as workflow runs with exec backend)
36-
- name: Build prover
33+
- name: Run ethrex l2 --dev
3734
run: |
38-
cd ../ethrex/crates/l2
39-
make build-prover
40-
mkdir -p prover/zkvm/interface/sp1/out && touch prover/zkvm/interface/sp1/out/riscv32im-succinct-zkvm-vk
41-
- name: Build L1 docker image
42-
uses: docker/build-push-action@v6
43-
with:
44-
context: ../ethrex/
45-
file: ../ethrex/crates/blockchain/dev/Dockerfile
46-
tags: ethrex_dev:latest
47-
push: false
48-
- name: Start L1 & Deploy contracts
35+
ethrex l2 --dev &
36+
37+
- name: Wait for ethrex l2
4938
run: |
50-
cd ../ethrex/crates/l2
51-
touch .env
52-
CI_ETHREX_WORKDIR=/usr/local/bin \
53-
ETHREX_DEPLOYER_DEPLOY_RICH=true \
54-
ETHREX_DEPLOYER_PICO_CONTRACT_ADDRESS=0x00000000000000000000000000000000000000aa \
55-
ETHREX_DEPLOYER_SP1_CONTRACT_ADDRESS=0x00000000000000000000000000000000000000aa \
56-
ETHREX_DEPLOYER_RISC0_CONTRACT_ADDRESS=0x00000000000000000000000000000000000000aa \
57-
ETHREX_L2_VALIDIUM=false \
58-
docker compose -f docker-compose-l2.yaml up contract_deployer
59-
- name: Start Sequencer
39+
for i in {1..20}; do
40+
if nc -z localhost 3900; then
41+
echo "ProofCoordinator ready!"
42+
exit 0
43+
fi
44+
sleep 5
45+
done
46+
echo "ProofCoordinator not ready in time"
47+
exit 1
48+
49+
- name: Start Prover
6050
run: |
61-
cd ../ethrex/crates/l2
62-
CI_ETHREX_WORKDIR=/usr/local/bin \
63-
ETHREX_L2_VALIDIUM=false \
64-
ETHREX_WATCHER_BLOCK_DELAY=0 \
65-
docker compose -f docker-compose-l2.yaml up --detach ethrex_l2
66-
- name: Run test
51+
ethrex l2 prover --proof-coordinator http://localhost:3900 &
52+
53+
- name: Run tests
6754
run: |
68-
sudo chmod -R a+rw ../ethrex/crates/l2
69-
cd ../ethrex/crates/l2
70-
RUST_LOG=info,ethrex_prover_lib=debug make init-prover &
71-
docker logs --follow ethrex_l2 &
7255
cd /home/runner/work/rex/rex/sdk
7356
PROPOSER_COINBASE_ADDRESS=0x0007a881CD95B1484fca47615B64803dad620C8d cargo test --package rex-sdk --test tests -- --nocapture --test-threads=1
74-
killall ethrex_prover -s SIGINT
7557
7658
cli-integration-test:
7759
name: Integration Test - CLI
@@ -83,65 +65,45 @@ jobs:
8365
with:
8466
tool-cache: false
8567
large-packages: false
68+
8669
- name: Checkout sources
8770
uses: actions/checkout@v4
8871
- name: Setup Rust Environment
8972
uses: ./.github/actions/setup-rust
9073

91-
- name: Install solc
92-
uses: pontem-network/get-solc@master
93-
with:
94-
version: v0.8.29
95-
token: ${{ secrets.GITHUB_TOKEN || '' }}
96-
9774
- name: Install ethrex
9875
run: |
99-
cd ..
100-
git clone https://github.com/lambdaclass/ethrex.git
76+
curl -L https://github.com/lambdaclass/ethrex/releases/latest/download/ethrex-linux_x86_64 -o /usr/local/bin/ethrex
77+
chmod +x /usr/local/bin/ethrex
78+
ethrex --version
10179
echo "ethrex installed successfully"
102-
# also creates empty verification keys (as workflow runs with exec backend)
103-
- name: Build prover
80+
81+
- name: Run ethrex l2 --dev
10482
run: |
105-
cd ../ethrex/crates/l2
106-
make build-prover
107-
mkdir -p prover/zkvm/interface/sp1/out && touch prover/zkvm/interface/sp1/out/riscv32im-succinct-zkvm-vk
108-
- name: Build L1 docker image
109-
uses: docker/build-push-action@v6
110-
with:
111-
context: ../ethrex/
112-
file: ../ethrex/crates/blockchain/dev/Dockerfile
113-
tags: ethrex_dev:latest
114-
push: false
83+
ethrex l2 --dev &
11584
116-
- name: Start L1 & Deploy contracts
85+
- name: Wait for ethrex l2
11786
run: |
118-
cd ../ethrex/crates/l2
119-
touch .env
120-
CI_ETHREX_WORKDIR=/usr/local/bin \
121-
ETHREX_DEPLOYER_DEPLOY_RICH=true \
122-
ETHREX_DEPLOYER_PICO_CONTRACT_ADDRESS=0x00000000000000000000000000000000000000aa \
123-
ETHREX_DEPLOYER_SP1_CONTRACT_ADDRESS=0x00000000000000000000000000000000000000aa \
124-
ETHREX_DEPLOYER_RISC0_CONTRACT_ADDRESS=0x00000000000000000000000000000000000000aa \
125-
ETHREX_L2_VALIDIUM=false \
126-
docker compose -f docker-compose-l2.yaml up contract_deployer
127-
- name: Start Sequencer
87+
for i in {1..20}; do
88+
if nc -z localhost 3900; then
89+
echo "ProofCoordinator ready!"
90+
exit 0
91+
fi
92+
sleep 5
93+
done
94+
echo "ProofCoordinator not ready in time"
95+
exit 1
96+
97+
- name: Start Prover
12898
run: |
129-
cd ../ethrex/crates/l2
130-
CI_ETHREX_WORKDIR=/usr/local/bin \
131-
ETHREX_L2_VALIDIUM=false \
132-
ETHREX_WATCHER_BLOCK_DELAY=0 \
133-
docker compose -f docker-compose-l2.yaml up --detach ethrex_l2
134-
- name: Run test
99+
ethrex l2 prover --proof-coordinator http://localhost:3900 &
100+
101+
- name: Run tests
135102
run: |
136-
sudo chmod -R a+rw ../ethrex/crates/l2
137-
cd ../ethrex/crates/l2
138-
RUST_LOG=info,ethrex_prover_lib=debug make init-prover &
139-
docker logs --follow ethrex_l2 &
140103
cd /home/runner/work/rex/rex
141104
make cli
142105
cd cli
143106
PROPOSER_COINBASE_ADDRESS=0x0007a881CD95B1484fca47615B64803dad620C8d cargo test --package rex --test tests -- --nocapture --test-threads=1
144-
killall ethrex_prover -s SIGINT
145107
146108
post-daily-report:
147109
name: Post report to slack

.github/workflows/pr_main.yml

Lines changed: 41 additions & 95 deletions
Original file line numberDiff line numberDiff line change
@@ -23,75 +23,48 @@ jobs:
2323
with:
2424
tool-cache: false
2525
large-packages: false
26+
2627
- name: Checkout sources
2728
uses: actions/checkout@v4
29+
2830
- name: Setup Rust Environment
2931
uses: ./.github/actions/setup-rust
3032

31-
- name: Install solc
32-
uses: pontem-network/get-solc@master
33-
with:
34-
version: v0.8.29
35-
token: ${{ secrets.GITHUB_TOKEN || '' }}
36-
3733
- name: Install ethrex
3834
run: |
39-
cd ..
40-
git clone https://github.com/lambdaclass/ethrex.git
41-
cd ethrex
42-
git checkout 187e8c27f9b9a22948cd82b0b3f79866c16ac489
35+
curl -L https://github.com/lambdaclass/ethrex/releases/download/v0.0.4-alpha/ethrex-linux_x86_64 -o /usr/local/bin/ethrex
36+
chmod +x /usr/local/bin/ethrex
37+
ethrex --version
4338
echo "ethrex installed successfully"
4439
45-
# also creates empty verification keys (as workflow runs with exec backend)
46-
- name: Build prover
40+
- name: Run ethrex l2 --dev
4741
run: |
48-
cd ../ethrex/crates/l2
49-
make build-prover
50-
mkdir -p prover/zkvm/interface/sp1/out && touch prover/zkvm/interface/sp1/out/riscv32im-succinct-zkvm-vk
51-
52-
- name: Build L1 docker image
53-
uses: docker/build-push-action@v6
54-
with:
55-
context: ../ethrex/
56-
file: ../ethrex/crates/blockchain/dev/Dockerfile
57-
tags: ethrex_dev:latest
58-
push: false
42+
ethrex l2 --dev &
5943
60-
- name: Start L1 & Deploy contracts
44+
- name: Wait for ethrex l2
6145
run: |
62-
cd ../ethrex/crates/l2
63-
touch .env
64-
CI_ETHREX_WORKDIR=/usr/local/bin \
65-
ETHREX_DEPLOYER_DEPLOY_RICH=true \
66-
ETHREX_DEPLOYER_PICO_CONTRACT_ADDRESS=0x00000000000000000000000000000000000000aa \
67-
ETHREX_DEPLOYER_SP1_CONTRACT_ADDRESS=0x00000000000000000000000000000000000000aa \
68-
ETHREX_DEPLOYER_RISC0_CONTRACT_ADDRESS=0x00000000000000000000000000000000000000aa \
69-
ETHREX_L2_VALIDIUM=false \
70-
docker compose -f docker-compose-l2.yaml up contract_deployer
71-
72-
- name: Start Sequencer
46+
for i in {1..20}; do
47+
if nc -z localhost 3900; then
48+
echo "ProofCoordinator ready!"
49+
exit 0
50+
fi
51+
sleep 5
52+
done
53+
echo "ProofCoordinator not ready in time"
54+
exit 1
55+
56+
- name: Start Prover
7357
run: |
74-
cd ../ethrex/crates/l2
75-
CI_ETHREX_WORKDIR=/usr/local/bin \
76-
ETHREX_L2_VALIDIUM=false \
77-
ETHREX_WATCHER_BLOCK_DELAY=0 \
78-
docker compose -f docker-compose-l2.yaml up --detach ethrex_l2
58+
ethrex l2 prover --proof-coordinator http://localhost:3900 &
7959
80-
- name: Run test
60+
- name: Run tests
8161
run: |
82-
sudo chmod -R a+rw ../ethrex/crates/l2
83-
cd ../ethrex/crates/l2
84-
RUST_LOG=info,ethrex_prover_lib=debug make init-prover &
85-
docker logs --follow ethrex_l2 &
8662
cd /home/runner/work/rex/rex/sdk
8763
PROPOSER_COINBASE_ADDRESS=0x0007a881CD95B1484fca47615B64803dad620C8d cargo test --package rex-sdk --test tests -- --nocapture --test-threads=1
88-
killall ethrex_prover -s SIGINT
89-
9064
9165
cli-integration-test:
9266
name: Integration Test - CLI
9367
runs-on: ubuntu-latest
94-
9568
steps:
9669
- name: Free Disk Space (Ubuntu)
9770
uses: jlumbroso/[email protected]
@@ -103,68 +76,41 @@ jobs:
10376
- name: Setup Rust Environment
10477
uses: ./.github/actions/setup-rust
10578

106-
- name: Install solc
107-
uses: pontem-network/get-solc@master
108-
with:
109-
version: v0.8.29
110-
token: ${{ secrets.GITHUB_TOKEN || '' }}
111-
11279
- name: Install ethrex
11380
run: |
114-
cd ..
115-
git clone https://github.com/lambdaclass/ethrex.git
116-
cd ethrex
117-
git checkout 187e8c27f9b9a22948cd82b0b3f79866c16ac489
81+
curl -L https://github.com/lambdaclass/ethrex/releases/download/v0.0.4-alpha/ethrex-linux_x86_64 -o /usr/local/bin/ethrex
82+
chmod +x /usr/local/bin/ethrex
83+
ethrex --version
11884
echo "ethrex installed successfully"
11985
120-
# also creates empty verification keys (as workflow runs with exec backend)
121-
- name: Build prover
86+
- name: Run ethrex l2 --dev
12287
run: |
123-
cd ../ethrex/crates/l2
124-
make build-prover
125-
mkdir -p prover/zkvm/interface/sp1/out && touch prover/zkvm/interface/sp1/out/riscv32im-succinct-zkvm-vk
126-
127-
- name: Build L1 docker image
128-
uses: docker/build-push-action@v6
129-
with:
130-
context: ../ethrex/
131-
file: ../ethrex/crates/blockchain/dev/Dockerfile
132-
tags: ethrex_dev:latest
133-
push: false
88+
ethrex l2 --dev &
13489
135-
- name: Start L1 & Deploy contracts
90+
- name: Wait for ethrex l2
13691
run: |
137-
cd ../ethrex/crates/l2
138-
touch .env
139-
CI_ETHREX_WORKDIR=/usr/local/bin \
140-
ETHREX_DEPLOYER_DEPLOY_RICH=true \
141-
ETHREX_DEPLOYER_PICO_CONTRACT_ADDRESS=0x00000000000000000000000000000000000000aa \
142-
ETHREX_DEPLOYER_SP1_CONTRACT_ADDRESS=0x00000000000000000000000000000000000000aa \
143-
ETHREX_DEPLOYER_RISC0_CONTRACT_ADDRESS=0x00000000000000000000000000000000000000aa \
144-
ETHREX_L2_VALIDIUM=false \
145-
docker compose -f docker-compose-l2.yaml up contract_deployer
146-
147-
- name: Start Sequencer
92+
for i in {1..20}; do
93+
if nc -z localhost 3900; then
94+
echo "Service ready!"
95+
exit 0
96+
fi
97+
sleep 5
98+
done
99+
echo "Service not ready in time"
100+
exit 1
101+
102+
- name: Start Prover
148103
run: |
149-
cd ../ethrex/crates/l2
150-
CI_ETHREX_WORKDIR=/usr/local/bin \
151-
ETHREX_L2_VALIDIUM=false \
152-
ETHREX_WATCHER_BLOCK_DELAY=0 \
153-
docker compose -f docker-compose-l2.yaml up --detach ethrex_l2
104+
ethrex l2 prover --proof-coordinator http://localhost:3900 &
154105
155-
- name: Run test
106+
- name: Run tests
156107
run: |
157-
sudo chmod -R a+rw ../ethrex/crates/l2
158-
cd ../ethrex/crates/l2
159-
RUST_LOG=info,ethrex_prover_lib=debug make init-prover &
160-
docker logs --follow ethrex_l2 &
161108
cd /home/runner/work/rex/rex
162109
make cli
163110
cd cli
164111
PROPOSER_COINBASE_ADDRESS=0x0007a881CD95B1484fca47615B64803dad620C8d cargo test --package rex --test tests -- --nocapture --test-threads=1
165-
killall ethrex_prover -s SIGINT
166112
167-
# The purpose of this job is to add it as a required check in GitHub so that we don't have to add every individual job as a required check
113+
# The purpose of this job is to add it as a required check in GitHub so that we don't have to add every individual job as a required check
168114
all-tests:
169115
# "Integration Test" is a required check, don't change the name
170116
name: Integration Test

cli/src/commands/l2.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,7 @@ impl Command {
323323
deposit_through_contract_call(
324324
amount,
325325
to,
326-
21000 * 10,
326+
21000 * 100,
327327
&private_key,
328328
bridge_address,
329329
&eth_client,

0 commit comments

Comments
 (0)