Skip to content

Commit 91188f9

Browse files
Merge branch 'main' into circuit-outputs-ref-counting
2 parents aa46b9a + 2e606ce commit 91188f9

File tree

16 files changed

+244
-179
lines changed

16 files changed

+244
-179
lines changed

.github/workflows/daily.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ jobs:
168168
uses: actions/cache/save@v4.2.0
169169
if: ${{ always() && matrix.runner == 'vm' }}
170170
with:
171-
path: starknet-replay/rpc_cache
171+
path: starknet-replay/cache
172172
key: ${{ steps.restore-rpc-calls.outputs.cache-primary-key }}
173173

174174
compare:

.github/workflows/starknet-blocks.yml

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,15 @@ jobs:
4646
path: sequencer
4747
# https://github.com/lambdaclass/sequencer/pull/79
4848
ref: 096d0c4baf87eb41dc4a6facad75a17170c3a967
49-
- name: Cache RPC Calls
50-
uses: actions/cache@v4.2.0
49+
50+
- name: Restore RPC Calls
51+
id: restore-rpc-calls
52+
uses: actions/cache/restore@v4.2.0
5153
with:
5254
path: starknet-replay/cache
53-
key: cache-${{matrix.block}}-${{matrix.runner}}
55+
key: cache-${{matrix.block}}-${{ github.run_id }}
56+
restore-keys: |
57+
cache-${{matrix.block}}
5458
5559
# Install dependencies
5660
- uses: ./cairo_native/.github/actions/install-linux-deps
@@ -103,7 +107,14 @@ jobs:
103107
with:
104108
name: dump-${{matrix.block}}-${{matrix.runner}}
105109
path: starknet-replay/state_dumps/${{matrix.runner}}
106-
110+
111+
- name: Save RPC Calls
112+
uses: actions/cache/save@v4.2.0
113+
if: ${{ always() && matrix.runner == 'vm' }}
114+
with:
115+
path: starknet-replay/cache
116+
key: ${{ steps.restore-rpc-calls.outputs.cache-primary-key }}
117+
107118
compare-dumps:
108119
name: Compare Dumps
109120
needs: [run-blocks]

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 150 additions & 106 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,98 @@
1+
[workspace]
2+
members = [
3+
"debug_utils",
4+
"debug_utils/sierra-emu",
5+
"debug_utils/casm-data-flow",
6+
"debug_utils/cairo-native-stress",
7+
"binaries/cairo-native-compile",
8+
"binaries/cairo-native-dump",
9+
"binaries/cairo-native-run",
10+
"binaries/cairo-native-test",
11+
"binaries/scarb-native-dump",
12+
"binaries/scarb-native-test",
13+
"binaries/starknet-native-compile",
14+
"binaries/cairo-native-bin-utils",
15+
]
16+
117
[workspace.package]
218
version = "0.6.1"
319
edition = "2021"
420
license = "Apache-2.0"
521
repository = "https://github.com/lambdaclass/cairo_native"
622

23+
[workspace.dependencies]
24+
anyhow = "1.0"
25+
aquamarine = "0.6.0"
26+
ark-ec = "0.5.0"
27+
ark-ff = "0.5.0"
28+
ark-secp256k1 = "0.5.0"
29+
ark-secp256r1 = "0.5.0"
30+
bincode = "2.0.1"
31+
bumpalo = "3.16.0"
32+
cairo-lang-casm = "~2.12.3"
33+
cairo-lang-compiler = "~2.12.3"
34+
cairo-lang-defs = "~2.12.3"
35+
cairo-lang-filesystem = "~2.12.3"
36+
cairo-lang-runner = "~2.12.3"
37+
cairo-lang-semantic = "~2.12.3"
38+
cairo-lang-sierra = "~2.12.3"
39+
cairo-lang-sierra-ap-change = "~2.12.3"
40+
cairo-lang-sierra-gas = "~2.12.3"
41+
cairo-lang-sierra-generator = "~2.12.3"
42+
cairo-lang-sierra-to-casm = "~2.12.3"
43+
cairo-lang-starknet = "~2.12.3"
44+
cairo-lang-starknet-classes = "~2.12.3"
45+
cairo-lang-test-plugin = "~2.12.3"
46+
cairo-lang-utils = "~2.12.3"
47+
cairo-native-bin-utils.path = "binaries/cairo-native-bin-utils"
48+
cairo-native.path = "."
49+
clap = "4.5.23"
50+
colored = "2.1.0"
51+
criterion = "0.5.1"
52+
itertools = "0.14.0"
53+
k256 = "0.13.4"
54+
keccak = "0.1.5"
55+
lambdaworks-math = "0.11.0"
56+
lazy_static = "1.5"
57+
libc = "0.2"
58+
libloading = "0.8.6"
59+
llvm-sys = "191.0.0"
60+
melior = "0.21.0"
61+
mlir-sys = "0.4.1"
62+
num-bigint = "0.4.6"
63+
num-integer = "0.1.46"
64+
num-traits = "0.2"
65+
p256 = "0.13.2"
66+
pretty_assertions_sorted = "1.2.3"
67+
proptest = "1.5.0"
68+
rand = "0.9.0"
69+
rayon = "1.10.0"
70+
rstest = "0.24.0"
71+
scarb-metadata = "1.12.0"
72+
scarb-ui = "0.1.5"
73+
sec1 = "0.7.3"
74+
serde = "1.0.0"
75+
serde_json = "1.0.128"
76+
sha2 = "0.10.8"
77+
sierra-emu = { path = "debug_utils/sierra-emu", version = "0.6.1" }
78+
smallvec = "1.13.2"
79+
starknet-crypto = "0.8.1"
80+
starknet-curve = "0.6.0"
81+
starknet-types-core = "0.2.0"
82+
stats_alloc = "0.1.10"
83+
tempfile = "3.15.0"
84+
test-case = "3.3"
85+
thiserror = "2.0.9"
86+
tracing = "0.1"
87+
tracing-subscriber = "0.3.19"
88+
utf8_iter = "1.0.4"
89+
walkdir = "2.5.0"
90+
91+
# Can't update until https://github.com/magiclen/educe/issues/27.
92+
educe = "0.5.11"
93+
# Can't use crates.io dep because of a cycle in the dependency chain.
94+
cairo-vm = { git = "https://github.com/lambdaclass/cairo-vm", rev = "742e9ae3de8b55f4a5dc44831f06068712f2f0c5" }
95+
796
[package]
897
name = "cairo-native"
998
description = "A compiler to convert Cairo's IR Sierra code to MLIR and execute it."
@@ -26,77 +115,73 @@ with-mem-tracing = []
26115
with-libfunc-profiling = []
27116
with-segfault-catcher = []
28117
with-trace-dump = ["dep:sierra-emu"]
29-
30-
# the aquamarine dep is only used in docs and cannot be detected as used by cargo udeps
31-
[package.metadata.cargo-udeps.ignore]
32-
normal = ["aquamarine"]
118+
testing = ["dep:cairo-lang-compiler"]
33119

34120
[dependencies]
35-
aquamarine = "0.6.0"
36-
bumpalo = "3.16.0"
37-
cairo-lang-compiler.workspace = true
38-
cairo-lang-filesystem.workspace = true
121+
aquamarine.workspace = true
122+
bumpalo.workspace = true
123+
cairo-lang-compiler = { workspace = true, optional = true }
39124
cairo-lang-runner.workspace = true
40125
cairo-lang-sierra.workspace = true
41-
cairo-lang-sierra-to-casm.workspace = true
42-
educe = "0.5.11" # can't update until https://github.com/magiclen/educe/issues/27
126+
cairo-lang-utils.workspace = true
127+
educe.workspace = true
43128
itertools.workspace = true
44-
lazy_static = "1.5"
45-
libc = "0.2"
46-
llvm-sys = "191.0.0"
129+
lazy_static.workspace = true
130+
libc.workspace = true
131+
libloading.workspace = true
132+
llvm-sys.workspace = true
47133
melior = { workspace = true, features = ["ods-dialects", "helpers"] }
48-
mlir-sys = { version = "0.4.1" }
134+
mlir-sys.workspace = true
49135
num-bigint.workspace = true
136+
num-integer.workspace = true
50137
num-traits.workspace = true
51-
starknet-types-core = { workspace = true, features = [
52-
"std",
53-
"serde",
54-
"num-traits",
55-
] }
56-
tempfile.workspace = true
57-
thiserror = "2.0.9"
58-
tracing = "0.1"
59-
utf8_iter = "1.0.4"
138+
serde = { workspace = true, features = ["derive"] }
139+
serde_json.workspace = true
60140
sierra-emu = { workspace = true, optional = true }
141+
starknet-types-core = { workspace = true, features = [ "std", "serde", "num-traits" ] }
142+
tempfile.workspace = true
143+
thiserror.workspace = true
144+
tracing.workspace = true
145+
utf8_iter.workspace = true
61146

62-
63-
# CLI dependencies
147+
# Gas cost computation dependencies. Removing these implies either duplicating
148+
# code or moving shared code to another crate.
149+
cairo-lang-sierra-to-casm.workspace = true
64150
cairo-lang-sierra-ap-change.workspace = true
65151
cairo-lang-sierra-gas.workspace = true
66-
cairo-lang-starknet.workspace = true
67-
cairo-lang-utils.workspace = true
152+
153+
# Contract compilation dependencies.
68154
cairo-lang-starknet-classes.workspace = true
69-
libloading.workspace = true
70-
serde = { workspace = true, features = ["derive"] }
71-
# needed to interface with cairo-lang-*
72-
keccak = "0.1.5"
73-
sha2 = "0.10.8" # needed for the syscall handler stub
74-
serde_json.workspace = true
75155

76-
# for the syscallhandler stub to match blockifier
77-
ark-secp256k1 = "0.5.0"
78-
ark-secp256r1 = "0.5.0"
79-
ark-ec = "0.5.0"
80-
ark-ff = "0.5.0"
81-
num-integer.workspace = true
156+
# Syscall handler implementation dependencies.
157+
ark-ec.workspace = true
158+
ark-ff.workspace = true
159+
ark-secp256k1.workspace = true
160+
ark-secp256r1.workspace = true
161+
keccak.workspace = true
162+
sha2.workspace = true
82163

83-
# Runtime functions
84-
rand = "0.9.0"
164+
# Runtime library dependencies.
165+
rand.workspace = true
85166
starknet-curve.workspace = true
86167

87168
[dev-dependencies]
88-
cairo-vm = { git = "https://github.com/lambdaclass/cairo-vm", rev = "742e9ae3de8b55f4a5dc44831f06068712f2f0c5", features = ["cairo-1-hints"] }
89-
criterion = { version = "0.5.1", features = ["html_reports"] }
90-
lambdaworks-math = "0.11.0"
91-
pretty_assertions_sorted = "1.2.3"
92-
proptest = "1.5.0"
93-
rstest = "0.24.0"
94-
test-case = "3.3"
95-
walkdir = "2.5.0"
96-
serde_json = { version = "1.0.128" }
97-
rayon = "1.10.0"
98-
tracing-subscriber = { version = "0.3.19", features = ["env-filter", "json", "registry"] }
169+
cairo-lang-compiler.workspace = true
170+
cairo-lang-filesystem.workspace = true
171+
cairo-lang-runner.workspace = true
99172
cairo-lang-sierra-generator.workspace = true
173+
cairo-lang-starknet.workspace = true
174+
criterion = { workspace = true, features = ["html_reports"] }
175+
lambdaworks-math.workspace = true
176+
pretty_assertions_sorted.workspace = true
177+
proptest.workspace = true
178+
rayon.workspace = true
179+
rstest.workspace = true
180+
serde_json.workspace = true
181+
test-case.workspace = true
182+
tracing-subscriber = { workspace = true, features = ["env-filter", "json", "registry"] }
183+
walkdir.workspace = true
184+
cairo-vm = { workspace = true, features = ["cairo-1-hints"] }
100185

101186
[profile.optimized-dev]
102187
inherits = "dev"
@@ -122,67 +207,26 @@ opt-level = 1
122207
[[bench]]
123208
name = "benches"
124209
harness = false
210+
required-features = [ "testing" ]
125211

126212
[[bench]]
127213
name = "compile_time"
128214
harness = false
215+
required-features = [ "testing" ]
129216

130217
[[bench]]
131218
name = "libfuncs"
132219
harness = false
220+
required-features = [ "testing" ]
133221

134-
[workspace]
135-
members = [
136-
"debug_utils",
137-
"debug_utils/sierra-emu",
138-
"debug_utils/casm-data-flow",
139-
"debug_utils/cairo-native-stress",
140-
"binaries/cairo-native-compile",
141-
"binaries/cairo-native-dump",
142-
"binaries/cairo-native-run",
143-
"binaries/cairo-native-test",
144-
"binaries/scarb-native-dump",
145-
"binaries/scarb-native-test",
146-
"binaries/starknet-native-compile",
147-
"binaries/cairo-native-bin-utils",
148-
]
222+
[[test]]
223+
name = "entry"
224+
required-features = [ "testing" ]
149225

150-
[workspace.dependencies]
151-
anyhow = "1.0"
152-
cairo-lang-casm = "~2.12.3"
153-
cairo-lang-compiler = "~2.12.3"
154-
cairo-lang-defs = "~2.12.3"
155-
cairo-lang-filesystem = "~2.12.3"
156-
cairo-lang-runner = "~2.12.3"
157-
cairo-lang-semantic = "~2.12.3"
158-
cairo-lang-sierra = "~2.12.3"
159-
cairo-lang-sierra-ap-change = "~2.12.3"
160-
cairo-lang-sierra-gas = "~2.12.3"
161-
cairo-lang-sierra-generator = "~2.12.3"
162-
cairo-lang-sierra-to-casm = "~2.12.3"
163-
cairo-lang-starknet = "~2.12.3"
164-
cairo-lang-starknet-classes = "~2.12.3"
165-
cairo-lang-test-plugin = "~2.12.3"
166-
cairo-lang-utils = "~2.12.3"
167-
cairo-native-bin-utils.path = "binaries/cairo-native-bin-utils"
168-
cairo-native.path = "."
169-
clap = "4.5.23"
170-
colored = "2.1.0"
171-
itertools = "0.14.0"
172-
libloading = "0.8.6"
173-
melior = "0.21.0"
174-
num-bigint = "0.4.6"
175-
num-integer = "0.1.46"
176-
num-traits = "0.2"
177-
scarb-metadata = "1.12.0"
178-
scarb-ui = "0.1.5"
179-
serde = "1.0.0"
180-
serde_json = "1.0.128"
181-
sierra-emu = { path = "debug_utils/sierra-emu", version = "0.6.1" }
182-
starknet-crypto = "0.8.1"
183-
starknet-curve = "0.6.0"
184-
starknet-types-core = "0.2.0"
185-
stats_alloc = "0.1.10"
186-
tempfile = "3.15.0"
187-
tracing = "0.1"
188-
tracing-subscriber = "0.3.19"
226+
[[example]]
227+
name = "invoke"
228+
required-features = [ "testing" ]
229+
230+
[[example]]
231+
name = "easy_api"
232+
required-features = [ "testing" ]

Makefile

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -62,28 +62,28 @@ check: check-llvm
6262

6363
.PHONY: test
6464
test: check-llvm needs-cairo2 build-alexandria
65-
cargo test --profile ci --features=with-cheatcode,with-debug-utils
65+
cargo test --profile ci --features=with-cheatcode,with-debug-utils,testing
6666

6767
.PHONY: test-cairo
6868
test-cairo: check-llvm needs-cairo2
6969
cargo r --profile ci --package cairo-native-test -- --compare-with-cairo-vm corelib
7070

7171
.PHONY: proptest
7272
proptest: check-llvm needs-cairo2
73-
cargo test --profile ci --features=with-cheatcode,with-debug-utils proptest
73+
cargo test --profile ci --features=with-cheatcode,with-debug-utils,testing proptest
7474

7575
.PHONY: test-cli
7676
test-ci: check-llvm needs-cairo2 build-alexandria
77-
cargo test --profile ci --features=with-cheatcode,with-debug-utils
77+
cargo test --profile ci --features=with-cheatcode,with-debug-utils,testing
7878

7979
.PHONY: proptest-cli
8080
proptest-ci: check-llvm needs-cairo2
81-
cargo test --profile ci --features=with-cheatcode,with-debug-utils proptest
81+
cargo test --profile ci --features=with-cheatcode,with-debug-utils,testing proptest
8282

8383
.PHONY: coverage
8484
coverage: check-llvm needs-cairo2 build-alexandria
85-
cargo llvm-cov --verbose --profile ci --features=with-cheatcode,with-debug-utils --workspace --lcov --output-path lcov.info
86-
cargo llvm-cov --verbose --profile ci --features=with-cheatcode,with-debug-utils --lcov --output-path lcov-test.info run --package cairo-native-test -- corelib
85+
cargo llvm-cov --verbose --profile ci --features=with-cheatcode,with-debug-utils,testing --workspace --lcov --output-path lcov.info
86+
cargo llvm-cov --verbose --profile ci --features=with-cheatcode,with-debug-utils,testing --lcov --output-path lcov-test.info run --package cairo-native-test -- corelib
8787

8888
.PHONY: doc
8989
doc: check-llvm

0 commit comments

Comments
 (0)