-
Notifications
You must be signed in to change notification settings - Fork 209
108 lines (92 loc) · 3.58 KB
/
Copy pathmain_prover.yaml
File metadata and controls
108 lines (92 loc) · 3.58 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
# TODO: uncomment "if: ${{ always() && github.event_name == 'merge_group' }}" lines when reenabling this workflow in the merge queue
name: L2 (SP1 Backend)
on:
push:
branches: ["main"]
pull_request:
paths:
- ".github/workflows/main_prover.yaml"
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
env:
DOCKER_ETHREX_WORKDIR: /usr/local/bin
PROVER: sp1
jobs:
test:
name: Integration Test Prover SP1
runs-on: gpu
steps:
- name: Checkout sources
uses: actions/checkout@v4
- name: Setup Rust Environment
uses: ./.github/actions/setup-rust
- name: Check solc
run: solc --version
- name: RISC-V SP1 toolchain install
# if: ${{ always() && github.event_name == 'merge_group' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
. "$HOME/.cargo/env"
curl -L https://sp1.succinct.xyz | bash
~/.sp1/bin/sp1up --version 5.0.8
- name: Set up Docker Buildx
# if: ${{ always() && github.event_name == 'merge_group' }}
uses: docker/setup-buildx-action@v3
# This step is needed because of an state bug in the GPU runner.
# Issue to fix this: https://github.com/lambdaclass/ethrex/pull/2741.
- name: Clean .env
# if: ${{ always() && github.event_name == 'merge_group' }}
run: rm -rf cmd/.env
- name: Build prover
# if: ${{ always() && github.event_name == 'merge_group' }}
run: |
cd crates/l2
PROVER=sp1 G=true make build-prover
- name: Build test
# if: ${{ always() && github.event_name == 'merge_group' }}
run: |
cargo test l2 --features l2 --no-run --release
- name: Start L1 & Deploy contracts
# if: ${{ always() && github.event_name == 'merge_group' }}
run: |
touch cmd/.env
cd crates/l2
DOCKER_ETHREX_WORKDIR=/usr/local/bin \
ETHREX_DEPLOYER_DEPLOY_RICH=true \
ETHREX_DEPLOYER_SP1_DEPLOY_VERIFIER=true \
docker compose up --build contract_deployer
- name: Ensure admin permissions in _work
run: sudo chown admin:admin -R /home/admin/actions-runner/_work/
- name: Start Sequencer
# if: ${{ always() && github.event_name == 'merge_group' }}
run: |
cd crates/l2
DOCKER_ETHREX_WORKDIR=/usr/local/bin \
ETHREX_PROPOSER_BLOCK_TIME=12000 \
ETHREX_COMMITTER_COMMIT_TIME=30000 \
ETHREX_WATCHER_WATCH_INTERVAL=1000 \
ETHREX_BLOCK_PRODUCER_FEE_VAULT_ADDRESS=0x000c0d6b7c4516a5b274c51ea331a9410fe69127 \
docker compose up --build --detach --no-deps ethrex_l2
- name: Copy env to host
run: |
docker cp contract_deployer:/env/.env cmd/.env
cat cmd/.env
- name: Run test
# if: ${{ always() && github.event_name == 'merge_group' }}
run: |
cd crates/l2
RUST_LOG=info,ethrex_prover_lib=debug PROVER=sp1 G=true make init-prover &
docker logs --follow ethrex_l2 & DOCKER_LOGS_PID=$!
PROPOSER_COINBASE_ADDRESS=0x0007a881CD95B1484fca47615B64803dad620C8d cargo test l2 --release -- --nocapture --test-threads=1
killall ethrex -s SIGINT
kill $DOCKER_LOGS_PID || true
- name: Destroy Docker containers
if: always()
run: |
cd crates/l2
docker compose down
- name: Ensure admin permissions in _work
if: always()
run: sudo chown admin:admin -R /home/admin/actions-runner/_work/