Repository navigation
workspace: upgrade cairo compiler to v2.19.5 - #15143
Conversation
PR SummaryMedium Risk Overview Sierra 1.9.4 is reflected in OS hint-coverage snapshots now include Reviewed by Cursor Bugbot for commit 4b82be5. Bugbot is set up for automated code reviews on this repo. Configure here. |
|
Artifacts upload workflows: |
einat-starkware
left a comment
There was a problem hiding this comment.
@einat-starkware reviewed 43 files and made 1 comment.
Reviewable status: all files reviewed (commit messages unreviewed), 1 unresolved discussion (waiting on avi-starkware, matanl-starkware, and Yoni-Starkware).
-- commits line 4 at r2:
Currently two commits, need to squash them
Bumps the Rust cairo-lang-* crates and the Sierra compiler binary version from 2.19.4 to 2.19.5. The bump moves the Sierra version from 1.9.3 to 1.9.4, cascading into Cairo1 class hashes and their downstream fixtures: starknet_os_flow_tests fuzz-deployment addresses and hint-coverage fixtures, the proof-flow genesis global root and STRK fee-token address, and the cende blob regression (operator and fee-token addresses, chain_info/preconfirmed_block). The 2.19.5 class-hash changes alter the cende blobs, so the regression now compares against a freshly uploaded generation 62 in the apollo-central-systest-blobs bucket. The hint-coverage fixtures gain StatelessHint(EnterScopeNewNode): the changed class hashes reshape the Patricia tree, so the traversal now enters a new node where it previously did not. The experimental-libfuncs poseidon counts drop (66 -> 64, 57 -> 55) from compiler output changes in 2.19.5. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Co-authored-by: Cursor <cursoragent@cursor.com>
da8db6f to
4b82be5
Compare
Yoni-Starkware
left a comment
There was a problem hiding this comment.
@Yoni-Starkware made 1 comment.
Reviewable status: all files reviewed (commit messages unreviewed), 1 unresolved discussion (waiting on avi-starkware, einat-starkware, and matanl-starkware).
Previously, einat-starkware wrote…
Currently two commits, need to squash them
Done.
einat-starkware
left a comment
There was a problem hiding this comment.
@einat-starkware reviewed all commit messages, made 1 comment, and resolved 1 discussion.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on avi-starkware and matanl-starkware).
avi-starkware
left a comment
There was a problem hiding this comment.
@avi-starkware+AGNT made 2 comments.
Reviewable status: all files reviewed, 1 unresolved discussion.
Cargo.toml line 261 at r3 (raw file):
cairo-lang-casm = "2.19.5" cairo-lang-runner = "2.19.5" cairo-lang-sierra = "2.19.5"
cairo-lang-sierra 2.19.5 narrows which enum types may be a felt252_dict value type. I can't tell from here whether that's reachable for a class already declared on chain.
The validity check in src/extensions/modules/felt252_dict.rs changed:
- && generic_args.len() <= 3
+ && generic_args.len() == 3
+ && info.long_id.generic_id == StructType::id()The old guard read !generic_args.is_empty() && generic_args.len() <= 3, so it admitted lengths 1, 2 and 3. 2.19.5 admits only 3, and on top of that requires every contained variant type to be a zero-sized unit-style StructType. Two arity classes dropped, plus a new shape constraint.
There's no version gate to fall back on. VersionId::supports compares major and minor only, so a class tagged sierra 1.9.x is indistinguishable from one compiled under 2.19.4, and nothing routes it to the old behavior.
Can the cairo compiler owners confirm the old predicate was strictly unreachable-wider, meaning no shape a released frontend emits falls in the gap? If something does fall in it, the recompilation path needs a story before this lands.
Nonblocking from me. For what it's worth, the rest of the bump checks out: SierraVersion::LATEST = 1.9.4 matches what cairo-lang-starknet-classes 2.19.5 declares in compiler_version.rs, and within src/ that constant is the only thing that changed in the crate. This predicate is the one thing I couldn't settle from source.
crates/apollo_infra_utils/src/cairo_compiler_version.txt line 1 at r3 (raw file):
2.19.5
This file is the Cairo1 compiler pin, and no workflow watches it.
blockifier_compiled_cairo.yml still names the old location in its paths: filter:
- "crates/apollo_compile_to_casm/src/constants.rs" # Contains the Cairo1 compiler version.The comment is stale. The version moved out of constants.rs into this .txt, and nothing in .github/ mentions it:
$ git grep -n 'cairo_compiler_version' -- .github/
(no output)
So neither this file nor Cargo.toml appears in any path filter. Your PR does trigger the recompilation check, but only because it happens to touch crates/blockifier_test_utils/**. A cairo bump whose non-lockfile changes all land elsewhere would skip it and nobody would notice.
Tracking the real pin would be:
- "crates/apollo_infra_utils/src/cairo_compiler_version.txt" # Contains the Cairo1 compiler version.Pre-existing, and the workflow file isn't in this diff, so nothing to do here. Filing it as informing so it resolves on send. Worth a separate PR if you agree.
Bumps the Rust
cairo-lang-*crates and the Sierra compiler binary from 2.19.4 to 2.19.5.The bump moves the Sierra version from 1.9.3 to 1.9.4 (confirmed against the published
cairo-lang-starknet-classessources), which changes Cairo1 class hashes and cascades into their downstream fixtures.Version pins
Cargo.toml: sixcairo-lang-*crates -> 2.19.5 (Cargo.lockregenerated)crates/apollo_infra_utils/src/cairo_compiler_version.txt-> 2.19.5 (drives thestarknet-sierra-compilebinary install; cross-checked againstCargo.tomlbytest_current_compiler_version)SierraVersion::LATEST-> 1.9.4Regenerated fixtures
starknet_os_flow_tests: fuzz-deployment addresses, hint-coverage JSONsproof.bin,proof_facts.jsonchain_info.json,preconfirmed_block.json, and blobs re-uploaded toapollo-central-systest-blobsat generation 62Notable value changes
StatelessHint(EnterScopeNewNode): the changed class hashes reshape the Patricia tree, so traversal now enters a new node where it previously did not.🤖 Generated with Claude Code