Cairo v2.22.0

Release 6 reads

Version
v2.22.0
Repository
starkware-libs/cairo

Release notes

What's Changed

Highlights

• Sierra 1.10.0. Enum matches are now compiled to the new enum_match_v2 libfunc, a single libfunc that matches an enum, a snapshot of an enum, or a box of either, by a search over the variant indicator. Contract classes are emitted with Sierra version 1.10.0. See Sierra below for the libfuncs that are no longer part of the allowed list from this version.

• Faster trait solving. The extension of impl lookup contexts by a candidate's scope is now memoized, and impl candidates are ordered by build-independent key names instead of pairwise comparators. This recovers the compile-time cost of the build-independent ordering introduced in v2.21.0, and then some: nalgebra_transform3 compiles in 8.3s, compared with 13.0s on v2.20.0. #10447 #10448

• Locals consistently shadow functions. A call whose name binds to a local variable now always resolves to that local, regardless of whether a closure appeared earlier in the function. Calling a non-callable local is an error (Call expression requires a function, found T), replacing the former Function is shadowed by a local variable warning. by @Ravan002 in #10473 #10477

Features

• Added the enum_match_v2 libfunc and generate it for all enum matches.

• Allowed libfuncs lists support a deprecation version per libfunc - the first Sierra version in which it is no longer allowed - and the patch part of versions is now optional. #10463 #10464

Bug Fixes

• Calling a function shadowed by a local variable is now an error rather than a warning, and no longer depends on closures being in context; a parameter named like an imported enum variant likewise shadows it when called. by @Ravan002 in #10473 #10477

• Report an error when an inline macro plugin yields no code and only warnings, instead of failing with Compilation failed without any diagnostics under --allow-warnings. #10479

• Honour #[must_use] on impl methods, not only on the trait declaration. by @HusseinAdeiza in #10458

• Reject signed MIN % -1 in const evaluation. by @Snan0M in #10470

• Report a diagnostic for circuits whose input indices are not contiguous from 0, instead of panicking in Sierra specialization. by @zakazaka95 in #10366

• Parser: clearer diagnostic for consecutive comparison operators, with guidance on chained comparisons and a possibly missing :: in generic paths. by @AaronAjose in #9725

• Runner: return a hint error for an invalid WriteRunParam index instead of panicking. by @kenny-ish in #10456

• cairo-run prints the remaining gas only when --available-gas is given. by @Snan0M in #10472

• Updated salsa to 0.28.6 and pinned it exactly, fixing builds that resolve dependencies without the lockfile.

Sierra

• Bumped the Sierra version to 1.10.0.

• The following libfuncs are deprecated from Sierra 1.10 and are no longer allowed in classes of that version: enum_match, enum_snapshot_match and enum_boxed_match (replaced by enum_match_v2), u96_limbs_less_than_guarantee_verify and u96_single_limb_less_than_guarantee_verify (replaced by u96_limbs_less_than_guarantee_verify_v2), and the legacy felt252_const, bytes31_const and {u,i}{8,16,32,64,128}_const libfuncs. #10465 #10486

Starknet

• #[derive(starknet::Event)] names the generated per-variant impls {Enum}_{Variant}_IntoEvent, so two enums in the same module can no longer produce colliding impl names. by @Ravan002 in #10475

Corelib

• Implemented ToSpanTrait for Span<T> (returning the span itself), for generic code over ToSpanTrait. by @bengineer42 in #9050

Formatter

• Don't double the space before a comment that follows =. by @Ravan002 in #10474

Optimizations

• Memoize the extension of lookup contexts by a candidate's scope. #10448

• Order impl candidates and SCC representatives by their key names instead of comparators. #10447

• Const folding propagates known values through the success path of array_snapshot_pop_front / array_snapshot_pop_back. by @jcastil0 in #9783

Documentation

• Mention span-to-span conversion in the slice…

Full release on GitHub ↗

Release Scaffold-ETH 2

Scaffold-ETH 2 v3.0.0-beta.0

Major Changes • ad12187: create-eth now lives in the scaffold-eth-2 repository. The npx create-eth@latest command and the generated projects work the same way.

Release Agave (Solana validator)

Agave (Solana validator) Release v4.4.2

This is stable release recommended for general adoption. What's Changed • v4.4: ci: request an agent with host kernel for xdp tests (backport of #16290) by @mergify[bot] in #16787 •...