Skip to content

updated cairo-lang deps to version 2.19#1620

Merged
TomerStarkware merged 2 commits into
mainfrom
tomer/update_sierra_2.19
May 25, 2026
Merged

updated cairo-lang deps to version 2.19#1620
TomerStarkware merged 2 commits into
mainfrom
tomer/update_sierra_2.19

Conversation

@TomerStarkware

@TomerStarkware TomerStarkware commented May 24, 2026

Copy link
Copy Markdown
Collaborator

Update cairo-lang dependencies to version 2.19

Closes #NA

Bumps cairo-lang dependencies from ~2.17.0-rc.4 to ~2.19.0-rc.0, along with Scarb / Cairo toolchain versions in the Makefile and the vendored cairo submodule (now tracking v2.19.0-rc.0).

The bump pulls in new Sierra constructs that required matching support on the native side:

  • BoundedIntGuarantee type — added alongside BoundedInt everywhere the latter is handled (types.rs, values.rs, executor.rs, debug.rs, metadata/trace_dump.rs, sierra-emu). Same MLIR representation as
    BoundedInt, no separate codegen path.
  • bounded_int_guarantee_verify libfunc — consumes the guarantee and returns the RangeCheck builtin incremented by 2 (one slot per bound check).
  • u128_to_u32_guarantees libfunc — splits a u128 into four little-endian u32 limbs.
  • Blake guarantee variants — Blake2sCompressGuarantees / Blake2sFinalizeGuarantees are wired into the existing build_blake_operation path.
  • SHA-512 syscall family — new sha512_process_block syscall, Sha512StateHandle type, and Sha512StateHandleInit / Sha512StateHandleDigest libfuncs. The state buffer is arena-allocated on each call to
    preserve the Copy semantics of Sha512StateHandle in corelib (same approach we use for SHA-256). Stub handler uses sha2::compress512; gas cost is 4733 * STEP + 65 * RANGE_CHECK + 3320 * BITWISE.
  • add_type_names: false added to all SierraGeneratorConfig call sites required by the new lang version.
  • get_unspent_gas test expected value updated from 6200 to 3600 to reflect the new cost model.
  • EcConcreteLibfunc::NegNz is now implemented in sierra-emu (was todo!()).

All StarknetSyscallHandler impls across examples and tests gained an unimplemented!() (or Ok(()) in syscalls test) stub for sha512_process_block.

Introduces Breaking Changes?

Yes — StarknetSyscallHandler gains a required sha512_process_block method. Any downstream impl must add it.

  • Created PR in sequencer
  • Created PR in starknet-replay
  • Updated the starknet-blocks.yml workflow to use these PRs.

These PRs should be merged after this one right away, in that order.

Checklist

  • Linked to Github Issue.
  • Unit tests added.
  • Integration tests added.
  • This change requires new documentation.
    • Documentation has been added/updated.

This change is Reviewable

@github-actions

github-actions Bot commented May 24, 2026

Copy link
Copy Markdown

Benchmarking results

Benchmark for program dict_insert

Open benchmarks
Command Mean [s] Min [s] Max [s] Relative
Cairo-vm (Rust, Cairo 1) 10.511 ± 0.196 10.360 10.965 5.66 ± 0.11
cairo-native (embedded AOT) 1.856 ± 0.011 1.846 1.884 1.00
cairo-native (embedded JIT using LLVM's ORC Engine) 1.873 ± 0.007 1.862 1.882 1.01 ± 0.01

Benchmark for program dict_snapshot

Open benchmarks
Command Mean [ms] Min [ms] Max [ms] Relative
Cairo-vm (Rust, Cairo 1) 558.0 ± 9.6 548.8 579.4 1.00
cairo-native (embedded AOT) 1671.5 ± 5.8 1659.1 1677.6 3.00 ± 0.05
cairo-native (embedded JIT using LLVM's ORC Engine) 1692.0 ± 7.0 1673.1 1697.3 3.03 ± 0.05

Benchmark for program factorial_2M

Open benchmarks
Command Mean [s] Min [s] Max [s] Relative
Cairo-vm (Rust, Cairo 1) 4.777 ± 0.026 4.738 4.812 2.21 ± 0.01
cairo-native (embedded AOT) 2.159 ± 0.005 2.149 2.165 1.00
cairo-native (embedded JIT using LLVM's ORC Engine) 2.209 ± 0.090 2.166 2.463 1.02 ± 0.04

Benchmark for program fib_2M

Open benchmarks
Command Mean [s] Min [s] Max [s] Relative
Cairo-vm (Rust, Cairo 1) 4.732 ± 0.099 4.669 4.983 2.83 ± 0.06
cairo-native (embedded AOT) 1.674 ± 0.010 1.657 1.692 1.00
cairo-native (embedded JIT using LLVM's ORC Engine) 1.691 ± 0.007 1.675 1.697 1.01 ± 0.01

Benchmark for program linear_search

Open benchmarks
Command Mean [ms] Min [ms] Max [ms] Relative
Cairo-vm (Rust, Cairo 1) 593.2 ± 7.2 585.0 605.6 1.00
cairo-native (embedded AOT) 1694.1 ± 12.4 1682.1 1722.9 2.86 ± 0.04
cairo-native (embedded JIT using LLVM's ORC Engine) 1722.6 ± 10.5 1709.8 1738.6 2.90 ± 0.04

Benchmark for program logistic_map

Open benchmarks
Command Mean [ms] Min [ms] Max [ms] Relative
Cairo-vm (Rust, Cairo 1) 505.9 ± 4.4 500.4 512.7 1.00
cairo-native (embedded AOT) 1839.2 ± 4.9 1829.8 1846.1 3.64 ± 0.03
cairo-native (embedded JIT using LLVM's ORC Engine) 1962.6 ± 7.5 1951.6 1976.7 3.88 ± 0.04

@github-actions

github-actions Bot commented May 24, 2026

Copy link
Copy Markdown

Benchmark results Main vs HEAD.

Base

Command Mean [s] Min [s] Max [s] Relative
base dict_insert.cairo (JIT) 1.871 ± 0.016 1.839 1.892 1.01 ± 0.01
base dict_insert.cairo (AOT) 1.849 ± 0.012 1.826 1.866 1.00

Head

Command Mean [s] Min [s] Max [s] Relative
head dict_insert.cairo (JIT) 1.277 ± 0.037 1.239 1.357 1.00
head dict_insert.cairo (AOT) 1.322 ± 0.023 1.294 1.357 1.03 ± 0.03

Base

Command Mean [s] Min [s] Max [s] Relative
base dict_snapshot.cairo (JIT) 1.682 ± 0.018 1.662 1.716 1.01 ± 0.01
base dict_snapshot.cairo (AOT) 1.660 ± 0.015 1.634 1.682 1.00

Head

Command Mean [s] Min [s] Max [s] Relative
head dict_snapshot.cairo (JIT) 1.245 ± 0.015 1.229 1.278 1.04 ± 0.04
head dict_snapshot.cairo (AOT) 1.194 ± 0.041 1.129 1.239 1.00

Base

Command Mean [s] Min [s] Max [s] Relative
base factorial_2M.cairo (JIT) 2.173 ± 0.014 2.151 2.194 1.01 ± 0.01
base factorial_2M.cairo (AOT) 2.152 ± 0.010 2.133 2.162 1.00

Head

Command Mean [s] Min [s] Max [s] Relative
head factorial_2M.cairo (JIT) 1.439 ± 0.021 1.400 1.477 1.00
head factorial_2M.cairo (AOT) 1.443 ± 0.026 1.405 1.494 1.00 ± 0.02

Base

Command Mean [s] Min [s] Max [s] Relative
base fib_2M.cairo (JIT) 1.692 ± 0.009 1.675 1.705 1.02 ± 0.01
base fib_2M.cairo (AOT) 1.659 ± 0.011 1.644 1.677 1.00

Head

Command Mean [s] Min [s] Max [s] Relative
head fib_2M.cairo (JIT) 1.188 ± 0.041 1.129 1.244 1.03 ± 0.04
head fib_2M.cairo (AOT) 1.152 ± 0.031 1.119 1.227 1.00

Base

Command Mean [s] Min [s] Max [s] Relative
base linear_search.cairo (JIT) 1.715 ± 0.011 1.700 1.730 1.02 ± 0.01
base linear_search.cairo (AOT) 1.682 ± 0.011 1.664 1.695 1.00

Head

Command Mean [s] Min [s] Max [s] Relative
head linear_search.cairo (JIT) 1.183 ± 0.018 1.159 1.211 1.03 ± 0.03
head linear_search.cairo (AOT) 1.145 ± 0.023 1.126 1.191 1.00

Base

Command Mean [s] Min [s] Max [s] Relative
base logistic_map.cairo (JIT) 1.947 ± 0.015 1.920 1.968 1.06 ± 0.01
base logistic_map.cairo (AOT) 1.829 ± 0.014 1.809 1.851 1.00

Head

Command Mean [s] Min [s] Max [s] Relative
head logistic_map.cairo (JIT) 1.355 ± 0.036 1.318 1.428 1.08 ± 0.03
head logistic_map.cairo (AOT) 1.258 ± 0.019 1.238 1.294 1.00

@TomerStarkware
TomerStarkware force-pushed the tomer/update_sierra_2.19 branch from bf31c89 to cef4cb3 Compare May 24, 2026 11:54

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

:lgtm:

@orizi reviewed 36 files and all commit messages, and made 1 comment.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on dorimedini-starkware).

@TomerStarkware
TomerStarkware force-pushed the tomer/update_sierra_2.19 branch 4 times, most recently from 384021b to af4008a Compare May 25, 2026 08:09
@TomerStarkware
TomerStarkware force-pushed the tomer/update_sierra_2.19 branch from af4008a to 8d59c20 Compare May 25, 2026 10:25
@TomerStarkware
TomerStarkware enabled auto-merge May 25, 2026 12:46
@TomerStarkware
TomerStarkware disabled auto-merge May 25, 2026 12:47
@TomerStarkware
TomerStarkware merged commit cd645da into main May 25, 2026
15 checks passed
@TomerStarkware
TomerStarkware deleted the tomer/update_sierra_2.19 branch May 25, 2026 12:47
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.

2 participants