Skip to content

Commit 348e424

Browse files
Merge branch 'main' into circuit-outputs-ref-counting
2 parents 7ba95ec + 2e606ce commit 348e424

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/[email protected]
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/[email protected]
49+
50+
- name: Restore RPC Calls
51+
id: restore-rpc-calls
52+
uses: actions/cache/[email protected]
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/[email protected]
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."
@@ -27,77 +116,73 @@ with-mem-tracing = []
27116
with-libfunc-profiling = []
28117
with-segfault-catcher = []
29118
with-trace-dump = ["dep:sierra-emu"]
30-
31-
# the aquamarine dep is only used in docs and cannot be detected as used by cargo udeps
32-
[package.metadata.cargo-udeps.ignore]
33-
normal = ["aquamarine"]
119+
testing = ["dep:cairo-lang-compiler"]
34120

35121
[dependencies]
36-
aquamarine = "0.6.0"
37-
bumpalo = "3.16.0"
38-
cairo-lang-compiler.workspace = true
39-
cairo-lang-filesystem.workspace = true
122+
aquamarine.workspace = true
123+
bumpalo.workspace = true
124+
cairo-lang-compiler = { workspace = true, optional = true }
40125
cairo-lang-runner.workspace = true
41126
cairo-lang-sierra.workspace = true
42-
cairo-lang-sierra-to-casm.workspace = true
43-
educe = "0.5.11" # can't update until https://github.com/magiclen/educe/issues/27
127+
cairo-lang-utils.workspace = true
128+
educe.workspace = true
44129
itertools.workspace = true
45-
lazy_static = "1.5"
46-
libc = "0.2"
47-
llvm-sys = "191.0.0"
130+
lazy_static.workspace = true
131+
libc.workspace = true
132+
libloading.workspace = true
133+
llvm-sys.workspace = true
48134
melior = { workspace = true, features = ["ods-dialects", "helpers"] }
49-
mlir-sys = { version = "0.4.1" }
135+
mlir-sys.workspace = true
50136
num-bigint.workspace = true
137+
num-integer.workspace = true
51138
num-traits.workspace = true
52-
starknet-types-core = { workspace = true, features = [
53-
"std",
54-
"serde",
55-
"num-traits",
56-
] }
57-
tempfile.workspace = true
58-
thiserror = "2.0.9"
59-
tracing = "0.1"
60-
utf8_iter = "1.0.4"
139+
serde = { workspace = true, features = ["derive"] }
140+
serde_json.workspace = true
61141
sierra-emu = { workspace = true, optional = true }
142+
starknet-types-core = { workspace = true, features = [ "std", "serde", "num-traits" ] }
143+
tempfile.workspace = true
144+
thiserror.workspace = true
145+
tracing.workspace = true
146+
utf8_iter.workspace = true
62147

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

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

84-
# Runtime functions
85-
rand = "0.9.0"
165+
# Runtime library dependencies.
166+
rand.workspace = true
86167
starknet-curve.workspace = true
87168

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

102187
[profile.optimized-dev]
103188
inherits = "dev"
@@ -123,67 +208,26 @@ opt-level = 1
123208
[[bench]]
124209
name = "benches"
125210
harness = false
211+
required-features = [ "testing" ]
126212

127213
[[bench]]
128214
name = "compile_time"
129215
harness = false
216+
required-features = [ "testing" ]
130217

131218
[[bench]]
132219
name = "libfuncs"
133220
harness = false
221+
required-features = [ "testing" ]
134222

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

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