Skip to content

Commit be7163b

Browse files
azteca1998gabrielbosio
authored andcommitted
Unify integer libfuncs. (#958)
* Remove useless argument. * Add some libfuncs. * Implement `?_try_from_felt252`. * More stuff. * More stuff. * More stuff. * Add testing for integer operations. * Add square root and testing. * Add test for integer conversions to felt252. * Add test for wide mul. * Change uint impls to unified. * Remove unused code and fix stuff. * Actually delete those files. * Add i?_diff implementation and test. * Fix stuff and replace sint libfuncs. * Remove unused sint code. * Add u128 libfuncs and tests. * Fix stuff. * Remove dead code. Don't clone old value on dict_entry_get (#962) * Document dict_entry * Document felt252_dict_entry_get side effect * Improve comments * Don't clone on get * Refactor to use scf instead of cf * Rename variables to clarify * Refactor to use scf instead of cf * Improve comment * Add comment exaplining UB * Make clippy happy * Update src/libfuncs/felt252_dict_entry.rs Co-authored-by: MrAzteca <azteca1998@users.noreply.github.com> * Update src/libfuncs/felt252_dict_entry.rs Co-authored-by: MrAzteca <azteca1998@users.noreply.github.com> * Update src/libfuncs/felt252_dict_entry.rs Co-authored-by: MrAzteca <azteca1998@users.noreply.github.com> * Update src/libfuncs/felt252_dict_entry.rs Co-authored-by: MrAzteca <azteca1998@users.noreply.github.com> * Fix comment --------- Co-authored-by: MrAzteca <azteca1998@users.noreply.github.com> Improve array documentation (and minor bug) (#965) * Improve legibility of array drop build * Improve array_new signature doc * Improve span_from_tuple build signature doc * Improve legibility of array span_from_tuple * Improve tuple_from_span signature doc * Improve legibility of tuple_from_span * Fix bug: freeing middle of array * Rename variable * Add note on possible null free * Remove panic Fix empty array slicing. (#966) * Fix empty array slicing. * Fix test. fix daily ci (#967) * fix daily * fix * path Update rust to 1.83.0 (#975) * rust 1.83.0 * clippy Make daily blocks run sequentially (#976) * make daily blocks to run sequentially by parts * compare only when the last part finished * fix compare * use max-parallel instead * use max-parallel 10 Avoid memory allocations per each entry in a dictionary. (#963) * Update the runtime. * Non-runtime changes and fixes. * Revert slab, not necessary. More progress. * Progress. * Fix stuff. * Minor fix. * Document `dup_fn` and `drop_fn` callbacks. * Fix suggestions. --------- Co-authored-by: Julian Gonzalez Calderon <gonzalezcalderonjulian@gmail.com> add workshop to docs (#974) Cairo 2.9.2 (#948) * update to 2.9.0 * ci * rust 1.83.0 * fix * 2.9.1 * update * update alexandria * scarb * version * fix * rc1 * fix * Update Makefile Co-authored-by: MrAzteca <azteca1998@users.noreply.github.com> * update replay * fix alexandria * looks like runtime is needed always due to build.rs * fix patch * typo --------- Co-authored-by: MrAzteca <azteca1998@users.noreply.github.com> Add more dict benches (#977) * Add more benches * Rename tests * Fix hyperfine benches * Add segment arena builtin * Add RangeCheck as first argument to `run_bench` * Increase bench size Fix `--no-default-features` library-only builds. (#984) Improve daily workflow (#982) * Increase max-parallel * Change long blocks Fix compare block matrix (#987) Add version check for cached AOT contracts. (#981) Co-authored-by: Edgar <git@edgarluque.com> Decrease paralelism and number of blocks (#1014) Co-authored-by: Edgar <git@edgarluque.com> Fix `array_snapshot_pop_front` CoW clones. (#1022) Unify daily run issues (#1004) * Decrease paralelism and number of blocks * Unify issue message update cairo to 2.10rc-0 (#986) * update cairo to 2.10rc-0 and the vm * cairo-vm 2.0.0rc3, implement redeposit_gas (not finished) * implement redeposit_gas libfunc and ignore alexandria temporarily * remove ignore alexandria * remove ignore alexandria * remove ignore alexandria * add tests * Fix `bounded_int_trim` libfunc implementation. * remove unwanted files * clippy * clippy * fix test * document new libfuncs * document new libfuncs * fix typo * Fix `bounded_int_trim` for signed types. * Remove unnecessary `if` expression. * prepare for release * handle positive signed values * document 'is_signed' method * typo * document better redeposit gas * better check in bounded int trim --------- Co-authored-by: Esteve Soler Arderiu <soler.arderiu@gmail.com> Fix daily run dependencies (#1023) * Checkout all repos * Improve cache * Update replay dependencies * Update sequencer deps version v0.2.6 (#1025) daily blocks workflow runs 1000 blocks (#1027) fix runtime version check (#1029) * fix runtime version check * format * try a better approach * forgot to add \0 at the end of target buffer * Revert "forgot to add \0 at the end of target buffer" This reverts commit 51d23e3. * add '\0' at the end --------- Co-authored-by: Edgar <git@edgarluque.com> fix possible segfault when checking runtime's version (#1032) update replay version blocks workflow ci (#1033) bump version (#1031) Co-authored-by: Julian Gonzalez Calderon <gonzalezcalderonjulian@gmail.com> Make dicts clone on write. (#964) * Update the runtime. * Non-runtime changes and fixes. * Revert slab, not necessary. More progress. * Progress. * Fix stuff. * Make it clone-on-write. * Finish the PR. * Try to fix `src/arch/x86_64.rs`. * Fix `x86_64.rs`. * Fix suggestions. * Add comment according to suggestions. --------- Co-authored-by: Edgar <git@edgarluque.com> Co-authored-by: Franco Giachetta <francogiachetta27@gmail.com> increase concurrency in blocks (#1034) update rust to 1.84.0 (#1039) replace blocks 1000000 and 1001000 (#1043) bump version to 0.2.8 (#1046) Dont remove submodule (#1044) as it no longer exists Update starknet-blocks workflow (#1042) * Update starknet-blocks workflow * Add RPC Cache * Rename to Starknet Blocks * Rename jobs * Use debug build * Update refs * Update ref * Remove matrix in compare job Fix cache (#1052) Cache RPC calls (#1048) Co-authored-by: Edgar <git@edgarluque.com> Pin cairo-lang to 2.10.0-rc0 (#1056) Upload daily comparison results as an artifact (#1049) * upload comparison results in daily workflow as an artifact * typo --------- Co-authored-by: Edgar <git@edgarluque.com> Update cairo to 2.10.0-rc1 (#1059) * Update cairo to 2.10.0-rc1 * update ci blocks * upd emu * fix alexandria * upd refs * deps * downgrade scarb * ci * fix test Fix `array_snapshot_pop_front`'s clone-on-write's clone implementation. (#1063) * Fix `array_snapshot_pop_front`'s clone-on-write's clone implementation. * Add testing. bump version to 0.2.9 for release (#1062) Update melior (#1061)
1 parent cf47c57 commit be7163b

File tree

119 files changed

+5539
-10776
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

119 files changed

+5539
-10776
lines changed
Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,15 @@
11
---
2-
title: "Daily Workflow Failure: Block Range {{ env.BLOCK_START }}-{{ env.BLOCK_END }}"
2+
title: "Daily Workflow Failure"
33
labels: bug
44
---
55

6-
Comparing VM execution against Native in the given block range produced diffs:
6+
Comparing VM execution against Native produced diffs:
77

88
- Commit: {{ env.COMMIT_SHA }}
9-
- Block Start: {{ env.BLOCK_START }}
10-
- Block End: {{ env.BLOCK_END }}
119
- Workflow URL: {{ env.WORKFLOW_URL }}
1210

1311
## Compare Output
1412

15-
The transaction were not compared in order. You should rerun the whole block to find the error root
13+
The transaction were not compared in order. You should rerun the whole failing block to find the error root
1614

17-
```
18-
{{ env.OUTPUT }}
19-
```
15+
- State Diffs Comparison: {{ env.COMPARISON_RESULT }}

.github/workflows/bench-hyperfine.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ jobs:
4343
sudo rm -rf /usr/share/dotnet/
4444
sudo rm -rf /usr/local/lib/android
4545
df -h
46-
- uses: dtolnay/rust-toolchain@1.82.0
46+
- uses: dtolnay/rust-toolchain@1.84.0
4747
with:
4848
components: clippy
4949
- uses: Swatinem/rust-cache@v2
@@ -131,7 +131,7 @@ jobs:
131131
df -h
132132
- name: Install Rust
133133
if: ${{ steps.cache-binary.outputs.cache-hit != 'true' || steps.cache-library.outputs.cache-hit != 'true' }}
134-
uses: dtolnay/rust-toolchain@1.82.0
134+
uses: dtolnay/rust-toolchain@1.84.0
135135
- name: add llvm deb repository
136136
if: ${{ steps.cache-binary.outputs.cache-hit != 'true' || steps.cache-library.outputs.cache-hit != 'true' }}
137137
uses: myci-actions/add-deb-repo@11

.github/workflows/ci.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
TABLEGEN_190_PREFIX: /usr/lib/llvm-19/
2222
steps:
2323
- uses: actions/checkout@v4
24-
- uses: dtolnay/rust-toolchain@1.82.0
24+
- uses: dtolnay/rust-toolchain@1.84.0
2525
with:
2626
components: clippy, rustfmt
2727
- uses: Swatinem/rust-cache@v2
@@ -41,7 +41,7 @@ jobs:
4141
runs-on: ubuntu-24.04
4242
steps:
4343
- uses: actions/checkout@v4
44-
- uses: dtolnay/rust-toolchain@1.82.0
44+
- uses: dtolnay/rust-toolchain@1.84.0
4545
with:
4646
components: rustfmt
4747
- run: cargo fmt --all -- --check
@@ -134,7 +134,7 @@ jobs:
134134
sudo rm -rf /usr/local/lib/android
135135
df -h
136136
- name: Setup rust env
137-
uses: dtolnay/rust-toolchain@1.82.0
137+
uses: dtolnay/rust-toolchain@1.84.0
138138
- name: Retreive cached dependecies
139139
uses: Swatinem/rust-cache@v2
140140
- name: add llvm deb repository
@@ -166,7 +166,7 @@ jobs:
166166
steps:
167167
- uses: actions/checkout@v4
168168
- name: Rustup toolchain install
169-
uses: dtolnay/rust-toolchain@1.82.0
169+
uses: dtolnay/rust-toolchain@1.84.0
170170
with:
171171
components: clippy
172172
- name: Rust `$PATH` workaround.
@@ -175,7 +175,7 @@ jobs:
175175
- name: Install scarb
176176
uses: software-mansion/setup-scarb@v1
177177
with:
178-
scarb-version: "2.8.4"
178+
scarb-version: "2.9.2"
179179
- name: Install deps
180180
run: make deps
181181
- name: Run tests
@@ -225,7 +225,7 @@ jobs:
225225
sudo rm -rf /usr/local/lib/android
226226
df -h
227227
- name: Setup rust env
228-
uses: dtolnay/rust-toolchain@1.82.0
228+
uses: dtolnay/rust-toolchain@1.84.0
229229
- name: Retreive cached dependecies
230230
uses: Swatinem/rust-cache@v2
231231
- name: add llvm deb repository
@@ -243,7 +243,7 @@ jobs:
243243
- name: Install scarb
244244
uses: software-mansion/setup-scarb@v1
245245
with:
246-
scarb-version: "2.8.4"
246+
scarb-version: "2.9.2"
247247
- name: Install deps
248248
run: make deps
249249
- name: Build runtime and alexandria
@@ -278,7 +278,7 @@ jobs:
278278
needs: [coverage]
279279
steps:
280280
- name: Setup rust env
281-
uses: dtolnay/rust-toolchain@1.80.0
281+
uses: dtolnay/rust-toolchain@1.84.0
282282
- name: Retreive cached dependencies
283283
uses: Swatinem/rust-cache@v2
284284
- name: Install testing tools

.github/workflows/daily.yml

Lines changed: 67 additions & 85 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ on:
77

88
env:
99
RANGE_SIZE: 25
10-
SEQUENCER_REV: 8d3e6b5515e7b62e7ab173026b2c81c750dbb853
1110

1211
jobs:
1312
run:
@@ -19,6 +18,7 @@ jobs:
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
@@ -41,16 +41,6 @@ jobs:
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
@@ -61,6 +51,16 @@ jobs:
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() }}

.github/workflows/publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
sudo rm -rf /usr/share/dotnet/
2727
sudo rm -rf /usr/local/lib/android
2828
- name: Setup rust env
29-
uses: dtolnay/rust-toolchain@1.82.0
29+
uses: dtolnay/rust-toolchain@1.84.0
3030
- name: Retreive cached dependecies
3131
uses: Swatinem/rust-cache@v2
3232
- name: add llvm deb repository

.github/workflows/release.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
sudo rm -rf /usr/share/dotnet/
2626
sudo rm -rf /usr/local/lib/android
2727
- name: Setup rust env
28-
uses: dtolnay/rust-toolchain@1.82.0
28+
uses: dtolnay/rust-toolchain@1.84.0
2929
- name: Retreive cached dependecies
3030
uses: Swatinem/rust-cache@v2
3131
- name: add llvm deb repository
@@ -36,6 +36,8 @@ jobs:
3636
keys-asc: https://apt.llvm.org/llvm-snapshot.gpg.key
3737
- name: Install LLVM
3838
run: sudo apt-get install llvm-19 llvm-19-dev llvm-19-runtime clang-19 clang-tools-19 lld-19 libpolly-19-dev libmlir-19-dev mlir-19-tools
39+
- name: Install deps
40+
run: make deps
3941
- name: build release
4042
run: make build
4143
- name: Compress into a tar file
@@ -58,11 +60,13 @@ jobs:
5860
steps:
5961
- uses: actions/checkout@v4
6062
- name: Rustup toolchain install
61-
uses: dtolnay/rust-toolchain@1.82.0
63+
uses: dtolnay/rust-toolchain@1.84.0
6264
with:
6365
components: clippy
6466
- name: Rust `$PATH` workaround.
6567
run: echo "$HOME/.cargo/bin" >> $GITHUB_PATH
68+
- name: Install deps
69+
run: make deps
6670
- name: Build release
6771
run: make build
6872
- name: Compress into a tar file

0 commit comments

Comments
 (0)