Skip to content

updated cairo-lang deps to version 2.18#1618

Closed
TomerStarkware wants to merge 1 commit into
mainfrom
tomer/update_sierra_2.18
Closed

updated cairo-lang deps to version 2.18#1618
TomerStarkware wants to merge 1 commit into
mainfrom
tomer/update_sierra_2.18

Conversation

@TomerStarkware
Copy link
Copy Markdown
Collaborator

@TomerStarkware TomerStarkware commented May 19, 2026

Upgrade cairo-lang to version 2.18.0

Closes #NA

Bumps the Sierra/cairo-lang dependency from 2.16.0 (last upgrade) to 2.18.0.
The change covers two commits:

  • Removed dup/drop bindings — Sierra 2.17 made dup/drop implicit, so all
    per-type override scaffolding is deleted: metadata/dup_overrides.rs,
    metadata/drop_overrides.rs, and the matching builders in array, box,
    enum, nullable, snapshot, struct, circuit, starknet, debug,
    and const libfuncs (~1.8k lines net removed).
  • 2.18 dep bumpcairo-lang-* workspace deps and the vendored
    vendor/cairo submodule moved to v2.18.0. New libfuncs and a new
    Sierra type introduced in 2.18 are wired up:
    • BoundedIntConcreteLibfunc::GuaranteeVerify — bumps RangeCheck
      by 2 to match CASM accounting (no runtime check; native trusts the
      Sierra type system).
    • BoundedIntConcreteLibfunc::U128ToU32Guarantees — splits a u128
      into four u32 guarantees from low to high limb.
    • BlakeConcreteLibfunc::Blake2sCompressGuarantees /
      Blake2sFinalizeGuarantees — share the existing Blake builder.
    • CoreTypeConcrete::BoundedIntGuarantee — reuses the MLIR
      representation of BoundedInt everywhere it appears
      (types.rs, values.rs, executor.rs); debug.rs keeps a
      distinct bounded_int_guarantee<lo,hi> label.
  • SCARB_VERSION / CAIRO_2_VERSION in Makefile updated to 2.18.0.
  • test_data/e2e_libfuncs_raw removed from .gitignore (no longer generated).

Introduces Breaking Changes?

Yes — Sierra version bumped (2.16 → 2.18). Programs compiled against
older Sierra versions will not be accepted, and downstream consumers
must update in lockstep.


This change is Reviewable

@TomerStarkware TomerStarkware requested a review from orizi May 19, 2026 11:01
@TomerStarkware TomerStarkware force-pushed the tomer/remove_dup_bindingins branch 2 times, most recently from 9641a97 to aa65112 Compare May 19, 2026 12:27
Copy link
Copy Markdown
Collaborator

@orizi orizi left a comment

Choose a reason for hiding this comment

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

@orizi reviewed 10 files and all commit messages, and made 1 comment.
Reviewable status: 10 of 31 files reviewed, 1 unresolved discussion (waiting on TomerStarkware).


-- commits line 1 at r1:
rebase

@TomerStarkware TomerStarkware force-pushed the tomer/update_sierra_2.18 branch 2 times, most recently from 783b0bc to 4f38683 Compare May 19, 2026 13:42
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 19, 2026

✅ Code is now correctly formatted.

@TomerStarkware TomerStarkware force-pushed the tomer/update_sierra_2.18 branch from 4f38683 to d1e213e Compare May 19, 2026 13:48
Copy link
Copy Markdown
Collaborator

@orizi orizi left a comment

Choose a reason for hiding this comment

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

@orizi reviewed 28 files and all commit messages, made 2 comments, and resolved 1 discussion.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on TomerStarkware).


debug_utils/sierra-emu/src/vm/bounded_int.rs line 300 at r3 (raw file):

pub fn eval_guarantee_verify(
    _registry: &ProgramRegistry<CoreType, CoreLibfunc>,

doc


debug_utils/sierra-emu/src/vm/bounded_int.rs line 310 at r3 (raw file):

}

pub fn eval_u128_to_u32_guarantees(

doc

Base automatically changed from tomer/remove_dup_bindingins to main May 19, 2026 14:01
@TomerStarkware TomerStarkware force-pushed the tomer/update_sierra_2.18 branch 2 times, most recently from c988f75 to b2f6974 Compare May 19, 2026 15:10
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 19, 2026

Benchmark results Main vs HEAD.

Base

Command Mean [s] Min [s] Max [s] Relative
base dict_insert.cairo (JIT) 1.934 ± 0.043 1.898 2.030 1.01 ± 0.03
base dict_insert.cairo (AOT) 1.911 ± 0.041 1.875 2.009 1.00

Head

Command Mean [s] Min [s] Max [s] Relative
head dict_insert.cairo (JIT) 1.931 ± 0.030 1.891 1.975 1.02 ± 0.02
head dict_insert.cairo (AOT) 1.897 ± 0.021 1.858 1.932 1.00

Base

Command Mean [s] Min [s] Max [s] Relative
base dict_snapshot.cairo (JIT) 1.730 ± 0.018 1.705 1.760 1.03 ± 0.01
base dict_snapshot.cairo (AOT) 1.681 ± 0.017 1.667 1.724 1.00

Head

Command Mean [s] Min [s] Max [s] Relative
head dict_snapshot.cairo (JIT) 1.751 ± 0.026 1.699 1.782 1.01 ± 0.02
head dict_snapshot.cairo (AOT) 1.726 ± 0.031 1.687 1.772 1.00

Base

Command Mean [s] Min [s] Max [s] Relative
base factorial_2M.cairo (JIT) 2.193 ± 0.024 2.155 2.228 1.01 ± 0.02
base factorial_2M.cairo (AOT) 2.172 ± 0.024 2.141 2.235 1.00

Head

Command Mean [s] Min [s] Max [s] Relative
head factorial_2M.cairo (JIT) 2.217 ± 0.031 2.169 2.263 1.01 ± 0.02
head factorial_2M.cairo (AOT) 2.195 ± 0.022 2.152 2.223 1.00

Base

Command Mean [s] Min [s] Max [s] Relative
base fib_2M.cairo (JIT) 1.693 ± 0.014 1.677 1.719 1.01 ± 0.02
base fib_2M.cairo (AOT) 1.678 ± 0.038 1.637 1.768 1.00

Head

Command Mean [s] Min [s] Max [s] Relative
head fib_2M.cairo (JIT) 1.752 ± 0.032 1.706 1.793 1.02 ± 0.03
head fib_2M.cairo (AOT) 1.717 ± 0.031 1.674 1.757 1.00

Base

Command Mean [s] Min [s] Max [s] Relative
base linear_search.cairo (JIT) 1.739 ± 0.027 1.692 1.788 1.04 ± 0.02
base linear_search.cairo (AOT) 1.674 ± 0.021 1.645 1.715 1.00

Head

Command Mean [s] Min [s] Max [s] Relative
head linear_search.cairo (JIT) 1.774 ± 0.022 1.745 1.804 1.01 ± 0.02
head linear_search.cairo (AOT) 1.750 ± 0.026 1.702 1.782 1.00

Base

Command Mean [s] Min [s] Max [s] Relative
base logistic_map.cairo (JIT) 1.971 ± 0.029 1.926 2.012 1.04 ± 0.02
base logistic_map.cairo (AOT) 1.887 ± 0.034 1.834 1.951 1.00

Head

Command Mean [s] Min [s] Max [s] Relative
head logistic_map.cairo (JIT) 2.025 ± 0.031 1.984 2.089 1.07 ± 0.02
head logistic_map.cairo (AOT) 1.889 ± 0.018 1.862 1.912 1.00

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 19, 2026

Benchmarking results

Benchmark for program dict_insert

Open benchmarks
Command Mean [s] Min [s] Max [s] Relative
Cairo-vm (Rust, Cairo 1) 11.038 ± 0.090 10.932 11.258 5.91 ± 0.07
cairo-native (embedded AOT) 1.866 ± 0.015 1.848 1.889 1.00
cairo-native (embedded JIT using LLVM's ORC Engine) 1.867 ± 0.024 1.819 1.898 1.00 ± 0.02

Benchmark for program dict_snapshot

Open benchmarks
Command Mean [ms] Min [ms] Max [ms] Relative
Cairo-vm (Rust, Cairo 1) 543.3 ± 6.1 537.6 558.2 1.00
cairo-native (embedded AOT) 1690.4 ± 15.9 1672.2 1719.2 3.11 ± 0.05
cairo-native (embedded JIT using LLVM's ORC Engine) 1696.3 ± 11.4 1671.2 1709.6 3.12 ± 0.04

Benchmark for program factorial_2M

Open benchmarks
Command Mean [s] Min [s] Max [s] Relative
Cairo-vm (Rust, Cairo 1) 4.854 ± 0.020 4.821 4.880 2.26 ± 0.02
cairo-native (embedded AOT) 2.149 ± 0.028 2.119 2.207 1.00 ± 0.02
cairo-native (embedded JIT using LLVM's ORC Engine) 2.147 ± 0.020 2.099 2.172 1.00

Benchmark for program fib_2M

Open benchmarks
Command Mean [s] Min [s] Max [s] Relative
Cairo-vm (Rust, Cairo 1) 4.752 ± 0.029 4.714 4.795 2.80 ± 0.04
cairo-native (embedded AOT) 1.694 ± 0.020 1.668 1.727 1.00
cairo-native (embedded JIT using LLVM's ORC Engine) 1.706 ± 0.016 1.684 1.734 1.01 ± 0.02

Benchmark for program linear_search

Open benchmarks
Command Mean [ms] Min [ms] Max [ms] Relative
Cairo-vm (Rust, Cairo 1) 591.2 ± 6.2 583.0 603.3 1.00
cairo-native (embedded AOT) 1700.6 ± 20.1 1677.5 1743.0 2.88 ± 0.05
cairo-native (embedded JIT using LLVM's ORC Engine) 1745.4 ± 18.7 1718.3 1774.0 2.95 ± 0.04

Benchmark for program logistic_map

Open benchmarks
Command Mean [ms] Min [ms] Max [ms] Relative
Cairo-vm (Rust, Cairo 1) 496.5 ± 5.1 490.1 505.4 1.00
cairo-native (embedded AOT) 1846.1 ± 13.0 1831.2 1874.3 3.72 ± 0.05
cairo-native (embedded JIT using LLVM's ORC Engine) 1959.1 ± 16.0 1939.9 1989.4 3.95 ± 0.05

@TomerStarkware TomerStarkware force-pushed the tomer/update_sierra_2.18 branch 2 times, most recently from f4ccda7 to 6c1013e Compare May 19, 2026 19:55
Copy link
Copy Markdown
Collaborator

@orizi orizi left a comment

Choose a reason for hiding this comment

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

@orizi partially reviewed 5 files and made 1 comment.
Reviewable status: 39 of 40 files reviewed, 3 unresolved discussions (waiting on TomerStarkware).


src/executor/contract.rs line 965 at r5 (raw file):

            .unwrap();
        assert_eq!(result.return_values, vec![Felt::from(3628800)]);
        assert_eq!(result.remaining_gas, 18446744073709547445);

what are these changes?

@TomerStarkware TomerStarkware force-pushed the tomer/update_sierra_2.18 branch from 6c1013e to 93fac59 Compare May 20, 2026 08:36
Copy link
Copy Markdown
Collaborator Author

@TomerStarkware TomerStarkware left a comment

Choose a reason for hiding this comment

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

@TomerStarkware made 3 comments.
Reviewable status: 39 of 40 files reviewed, 3 unresolved discussions (waiting on orizi).


debug_utils/sierra-emu/src/vm/bounded_int.rs line 300 at r3 (raw file):

Previously, orizi wrote…

doc

Done.


debug_utils/sierra-emu/src/vm/bounded_int.rs line 310 at r3 (raw file):

Previously, orizi wrote…

doc

Done.


src/executor/contract.rs line 965 at r5 (raw file):

Previously, orizi wrote…

what are these changes?

less gas usage due to compiler optimization

Copy link
Copy Markdown
Collaborator

@orizi orizi left a comment

Choose a reason for hiding this comment

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

:lgtm:

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

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