Skip to content

workspace: upgrade cairo compiler to v2.19.5 - #15143

Merged
Yoni-Starkware merged 1 commit into
main-v0.14.4from
yoni/cairo-2.19.5
Sep 22, 2026
Merged

Yoni-Starkware merged 1 commit into
main-v0.14.4from
yoni/cairo-2.19.5

Conversation

@Yoni-Starkware

@Yoni-Starkware Yoni-Starkware commented Sep 17, 2026 •

Copy link
Copy Markdown
Collaborator

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-classes sources), which changes Cairo1 class hashes and cascades into their downstream fixtures.

Version pins

  • Cargo.toml: six cairo-lang-* crates -> 2.19.5 (Cargo.lock regenerated)
  • crates/apollo_infra_utils/src/cairo_compiler_version.txt -> 2.19.5 (drives the starknet-sierra-compile binary install; cross-checked against Cargo.toml by test_current_compiler_version)
  • SierraVersion::LATEST -> 1.9.4

Regenerated fixtures

  • starknet_os_flow_tests: fuzz-deployment addresses, hint-coverage JSONs
  • proof flow: genesis global root, STRK fee-token address, proof.bin, proof_facts.json
  • cende blob regression: operator and fee-token addresses, chain_info.json, preconfirmed_block.json, and blobs re-uploaded to apollo-central-systest-blobs at generation 62

Notable value changes

  • Hint coverage gains StatelessHint(EnterScopeNewNode): the changed class hashes reshape the Patricia tree, so traversal now enters a new node where it previously did not.
  • Experimental-libfuncs poseidon counts drop 66 -> 64 and 57 -> 55, from compiler output changes in 2.19.5.

🤖 Generated with Claude Code

@cursor

cursor Bot commented Sep 17, 2026 •

Copy link
Copy Markdown

PR Summary

Medium Risk
Touches Sierra compilation and class hashing used across execution, OS hints, and proof fixtures; wrong pins or stale fixtures would break CI and proof-flow consistency rather than production logic directly.

Overview
Upgrades the workspace Cairo / Sierra toolchain from 2.19.4 to 2.19.5, including the six pinned cairo-lang-* crates in Cargo.toml, regenerated Cargo.lock, and cairo_compiler_version.txt (used for the external starknet-sierra-compile binary).

Sierra 1.9.4 is reflected in SierraVersion::LATEST (was 1.9.3). That changes Cairo1 class hashes and compiled output, so integration fixtures were refreshed: proof-flow genesis global root, STRK fee token address, proof_facts.json, cende blob regression (chain_info.json, preconfirmed_block.json, GCS generation 62), and fuzz deployment address expectations.

OS hint-coverage snapshots now include StatelessHint(EnterScopeNewNode) after Patricia-tree traversal shifts from new class hashes. Poseidon builtin expectations in experimental-libfuncs tests drop slightly (66→64 / 57→55). Cargo.lock also picks up transitive bumps (e.g. hashbrown 0.17.1 for proving-related git deps, socket2 0.6.4).

Reviewed by Cursor Bugbot for commit 4b82be5. Bugbot is set up for automated code reviews on this repo. Configure here.

@reviewable-StarkWare

Copy link
Copy Markdown

This change is Reviewable

@github-actions

github-actions Bot commented Sep 17, 2026 •

Copy link
Copy Markdown

@einat-starkware einat-starkware left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@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>

@Yoni-Starkware Yoni-Starkware left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@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).


-- commits line 4 at r2:

Previously, einat-starkware wrote…

Currently two commits, need to squash them

Done.

@einat-starkware einat-starkware left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm:

@einat-starkware reviewed all commit messages, made 1 comment, and resolved 1 discussion.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on avi-starkware and matanl-starkware).

@Yoni-Starkware
Yoni-Starkware added this pull request to the merge queue Sep 22, 2026
Merged via the queue into main-v0.14.4 with commit 9cf4dd8 Sep 22, 2026
39 checks passed

@avi-starkware avi-starkware left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants