77
88env :
99 RANGE_SIZE : 25
10- SEQUENCER_REV : 8d3e6b5515e7b62e7ab173026b2c81c750dbb853
1110
1211jobs :
1312 run :
1918 RPC_ENDPOINT_TESTNET : ${{ secrets.RPC_ENDPOINT_TESTNET }}
2019 RPC_ENDPOINT_MAINNET : ${{ secrets.RPC_ENDPOINT_MAINNET }}
2120 strategy :
21+ max-parallel : 30
2222 matrix :
2323 block :
2424 - 740000
4141 - 800350
4242 - 800400
4343 - 800450
44- - 800500
45- - 800550
46- - 800600
47- - 800650
48- - 800700
49- - 800750
50- - 800800
51- - 800850
52- - 800900
53- - 800950
5444 - 900000
5545 - 900100
5646 - 900200
6151 - 900700
6252 - 900800
6353 - 900900
54+ - 1000400
55+ - 1000500
56+ - 1002000
57+ - 1003000
58+ - 1004000
59+ - 1005000
60+ - 1006000
61+ - 1007000
62+ - 1008000
63+ - 1009000
6464 runner :
6565 - native
6666 - vm
@@ -71,44 +71,73 @@ jobs:
7171 working-directory : ./starknet-replay
7272
7373 steps :
74- # We checkout replay first, as it's the main repository for this workflow
74+ # We checkout replay as it's the main repository for this workflow
7575 - name : Checkout Replay
7676 uses : actions/checkout@v4
7777 with :
7878 repository : lambdaclass/starknet-replay
7979 path : starknet-replay
80- # We need native for building the runtime
80+ # We need native if we want to run with cairo native main
8181 - name : Checkout Native
8282 uses : actions/checkout@v4
8383 with :
8484 path : cairo_native
85+ # We need sequencer if we want to run with cairo native main
86+ - name : Checkout Native
87+ uses : actions/checkout@v4
88+ with :
89+ repository : lambdaclass/sequencer
90+ path : sequencer
91+ ref : replay
92+
93+ - name : Cache RPC Calls
94+ uses : actions/cache@v4
95+ with :
96+ path : starknet-replay/rpc_cache
97+ key : cache-${{matrix.block}}
8598
8699 # Install dependencies
87100 - uses : ./cairo_native/.github/actions/install-linux-deps
88101 - name : Setup rust env
89- uses : dtolnay/rust-toolchain@1.82 .0
102+ uses : dtolnay/rust-toolchain@1.84 .0
90103 - name : Retreive cached dependecies
91104 uses : Swatinem/rust-cache@v2
105+ with :
106+ workspaces : |
107+ starknet-replay
108+ cairo_native
109+
92110 - name : Build Cairo Native Runtime Library
93111 shell : bash
94112 run : |
95113 cd ../cairo_native
96114 make runtime
97115 echo "CAIRO_NATIVE_RUNTIME_LIBRARY=$(pwd)/libcairo_native_runtime.a" > $GITHUB_ENV
98116
99- - name : Patch dependencies
117+ - name : Patch replay dependencies
100118 run : |
101- # Patches native dependency to local path, to use current cairo native version
102- DEPENDENCY="cairo-native"
103- NEW_PATH="../cairo_native"
104- sed -Ei "s#^($DEPENDENCY *=).*#\1 { path = '$NEW_PATH' }#" Cargo.toml
105- grep $DEPENDENCY Cargo.toml
106-
107- # Patches sequencer dependency to specified rev
108- GIT="https://github.com/lambdaclass/sequencer"
109- NEW_REV="$SEQUENCER_REV"
110- sed -Ei "s#(\"$GIT\" *, *rev *= *\").?*(\".*)#\1$NEW_REV\2#" Cargo.toml
111- grep $GIT Cargo.toml
119+ # Updates sequencer dependency to local path
120+ name='[[:alnum:]_-]+'
121+ sequencer_url='"https:\/\/github.com\/lambdaclass\/sequencer\.git"'
122+ rev='"[[:alnum:]]+"'
123+ new_path='"..\/sequencer\/crates\/\1"'
124+ sed -i'' -r "s/^($name) = \{ git = $sequencer_url, rev = $rev/\1 = { path = $new_path/" Cargo.toml
125+
126+ # Updates native dependency to local path
127+ new_path='"..\/cairo_native"'
128+ sed -i'' -r "s/^cairo-native = .*/cairo-native.path = $new_path/" Cargo.toml
129+
130+ git diff
131+
132+ - name : Patch sequencer dependencies
133+ run : |
134+ cd ../sequencer
135+
136+ # Updates native dependency to local path
137+ new_path='"..\/cairo_native"'
138+ sed -i'' -r "s/^cairo-native = .*/cairo-native.path = $new_path/" Cargo.toml
139+
140+ git diff
112141
113142 - name : Run with Native
114143 if : ${{ matrix.runner == 'native' }}
@@ -137,50 +166,6 @@ jobs:
137166 # We always run the compare job, to ensure that a single run job failing
138167 # would not cancel the whole comparison.
139168 if : ${{ always() }}
140- strategy :
141- matrix :
142- block :
143- - 740000
144- - 741000
145- - 742000
146- - 743000
147- - 744000
148- - 745000
149- - 746000
150- - 747000
151- - 748000
152- - 749000
153- - 800000
154- - 800050
155- - 800100
156- - 800150
157- - 800200
158- - 800250
159- - 800300
160- - 800350
161- - 800400
162- - 800450
163- - 800500
164- - 800550
165- - 800600
166- - 800650
167- - 800700
168- - 800750
169- - 800800
170- - 800850
171- - 800900
172- - 800950
173- - 900000
174- - 900100
175- - 900200
176- - 900300
177- - 900400
178- - 900500
179- - 900600
180- - 900700
181- - 900800
182- - 900900
183- fail-fast : false
184169 defaults :
185170 run :
186171 shell : bash
@@ -190,39 +175,36 @@ jobs:
190175 - name : Fetch Native dumps
191176 uses : actions/download-artifact@v4
192177 with :
193- name : dump-${{matrix.block}} -native
178+ pattern : dump-* -native
194179 path : state_dumps/native
180+ merge-multiple : true
195181 continue-on-error : true
196182 - name : Fetch VM dumps
197183 uses : actions/download-artifact@v4
198184 with :
199- name : dump-${{matrix.block}} -vm
185+ pattern : dump-* -vm
200186 path : state_dumps/vm
187+ merge-multiple : true
201188 continue-on-error : true
202189
203190 - name : Compare states
204191 run : |
205192 ./scripts/cmp_state_dumps.sh | tee output
206193
194+ - name : Upload Compare Results
195+ uses : actions/upload-artifact@v4
196+ if : ${{ always() }}
197+ with :
198+ name : output-result
199+ path : output
200+
207201 - name : Prepare env vars
208202 if : ${{ always() }}
209203 run : |
210- # Save blocks to env var
211- BLOCK_START=${{ matrix.block }}
212- BLOCK_END=$(($BLOCK_START + $RANGE_SIZE - 1))
213- echo "BLOCK_END=$BLOCK_END" | tee -a $GITHUB_ENV
214- echo "BLOCK_START=$BLOCK_START" | tee -a $GITHUB_ENV
215-
216204 # Save workflow url
217205 REPO_URL="${{ github.server_url }}/${{ github.repository }}"
218206 echo "WORKFLOW_URL=$REPO_URL/actions/runs/${{ github.run_id }}" | tee -a $GITHUB_ENV
219-
220- # Save output
221- {
222- echo 'OUTPUT<<EOF'
223- cat output
224- echo EOF
225- } >> "$GITHUB_ENV"
207+ echo "COMPARISON_RESULT=$REPO_URL/actions/runs/${{ github.run_id }}/artifacts/${{ steps.upload_compare_results.outputs.artifact-id }}" | tee -a $GITHUB_ENV
226208
227209 - name : Create Issue
228210 if : ${{ failure() }}
0 commit comments