Skip to content

Releases: starkware-libs/cairo

v2.6.0

04 Mar 13:16
5aa90bc
Compare
Choose a tag to compare

This is the Cairo version associated with Starknet 0.13.1. Contracts written with 2.6.0 are not declarable on Starknet until the upgrade.

Major Updates

  • Added support for gas coupons.
    • Gas coupons are a way to pay for calling a function, in a different place then the actual function call.
    • Allows support for recursive destructs (as we can hold such a coupon for the recursive destruct call in the recursive object).
    • Only available with experimental flags.
  • Support for complex consts (Non-Zero, struct, enum).
  • More aggressive function inlining heuristics.

New Feautres

  • Better manual gas handling - if gas is handled manually - gas withdrawal is not automatically added. #4880
  • Added if-let expression support.
  • Added support for underscore pattern in match on tuples. #4996
  • Add cmp::minmax function by @delaaxe in #4981
  • Added while let support.
  • Add remaining assert_xx! comparison test macros by @iamvukasin in #4936
  • Add TryInto<u512, u256> by @delaaxe in #5031
  • feat: add num::traits::ops::OverflowingAdd trait by @enitrat in #4988
  • feat: OverflowingSub trait by @enitrat in #5164
  • feat: OverflowingMul trait by @enitrat in #5172
  • feat: wrapping traits by @enitrat in #5175
  • Fixed array support [1, 4, 5] of type [felt252; 3].
    • No support for conversion into a span for Index access yet, basically equivalent to (felt252, felt252, felt252) for the time being.

Optimizations

  • Improved performance for ecdsa. #4985
  • Add split_structs optimization - preventing carry of full structs merges due to partial changes. #5034
  • Add scrub units optimization.

Bug Fixes

  • if let inside loops properly works. #5016
  • Fix bug in local variables aliasing. #5028
  • Fixed struct formatting. Closing issue #5032. #5062
  • Fix enable ap tracking detection bug. #5073
  • fix: enum store derive by @enitrat in #5191

Other updates

New Contributors

Full Changelog: v2.5.4...v2.6.0

v2.6.0-rc.1

14 Feb 14:27
6200713
Compare
Choose a tag to compare

New Features

  • Support for non-zero consts at the Sierra level.
  • const_as_immediate in Sierra as an addition to the existing const_as_box.
  • Added while let support.
  • Add remaining assert_xx! comparison test macros by @iamvukasin in #4936
  • Add TryInto<u512, u256> by @delaaxe in #5031

Optimizations

  • Add split_structs optimization - preventing carry of full structs merges due to partial changes. #5034

Bug Fixes

  • if let inside loops properly works. #5016
  • Fix bug in local variables aliasing. #5028

New Contributors

Full Changelog: v2.6.0-rc.0...v2.6.0-rc.1

v2.5.4

14 Feb 11:13
f42bf29
Compare
Choose a tag to compare

Bug fixes

  • Fixed struct pattern formatting. Fixes issue #5032. #5062
  • Added pub for storage member modules. #5065
  • Prevented pub construct cancellation in cases of differing user types. #4938

Full Changelog: v2.5.3...v2.5.4

v2.6.0-rc.0

06 Feb 16:38
7c70efd
Compare
Choose a tag to compare

This is the Cairo version associated with Starknet 0.13.1. Contracts written with 2.6.0 are not declarable on Starknet until the upgrade.

Major Updates

  • Added support for gas coupons.
    • Gas coupons are a way to pay for calling a function, in a different place then the actual function call.
    • Allows support for recursive destructs (as we can hold such a coupon for the recursive destruct call in the recursive object).
    • Only available with experimental flags.
  • Support for const simple value, as well as wrapping structs and enums of these in Sierra.

New Feautres

  • Better manual gas handling - if gas is handled manually - gas withdrawal is not automatically added. #4880
  • Added if-let expression support.
  • Added support for underscore pattern in match on tuples. #4996
  • Add cmp::minmax function by @delaaxe in #4981

Optimizations

  • Improved performance for ecdsa. #4985

New Contributors

Full Changelog: v2.5.3...v2.6.0-rc.0

v2.5.3

01 Feb 09:12
2789b60
Compare
Choose a tag to compare

Bug Fixes

  • Allow renaming a variable twice as it might happen in some cases. #4967

Full Changelog: v2.5.2...v2.5.3

v2.5.2

31 Jan 12:17
5d96b8b
Compare
Choose a tag to compare

Bug Fixes

  • Fixed execution order of struct-construct to stated member ordering. #4947
  • Fixed while formatting. #4958
  • Fixed bug in optimizing out code. #4961

Full Changelog: v2.5.1...v2.5.2

v2.5.1

29 Jan 05:16
afdf61a
Compare
Choose a tag to compare

New features

  • Allow use starknet::get_block_number by @milancermak in #4914
  • Added base struct for struct constructions. #4923
    • Usage example: A { a: 5, b: 7, ..base_struct_of_type_A }
  • Display for snapshots by @piotmag769 in #4745
  • Support feature at module and fn level. #4941

Bug fixes

  • Fix try_into for integers to not panic. #4874
  • Made integer overflowing ops pub. #4942
  • Prevented starknet plugin from code generation on items not on config. #4909

New Contributors

Full Changelog: v2.5.0...v2.5.1

v2.5.0

22 Jan 09:52
1a4ccb0
Compare
Choose a tag to compare

Read more on post.

Major updates

  • Breaking change: starknet::Call::calldata is now a Span. Direct usages relying on it may break.
    • The change is required to vastly reduce the costs of using account contracts.
  • New edition 2023_11 - introducing pub for struct members and module items.
    • Kudos to @Jinwei1987 for writing the original visibility addition code.
  • Use cairofmt::skip in the formatter. #4387
  • Added warnings - can be ignored in crate - and won't be affected by dependencies
    • Added warning for unhandled error types. #4454
    • Added warnings for unused variables. #4457
    • Depraction warning for external(v0) on impls. #4470
    • Added starknet ABI failures as warnings. #4493
    • Added abi failure + warning for account contract functions. #4575
    • Added warnings for bad embeddable impls. #4796
    • Added unstable and feature attributes and warnings on usage of unstable features.
      • Warning be ignored using feature("feature_name") on an expression wrapping the usage.
      • unstable specifically added for SafeDispatchers usage.
  • Experimental feature for negative impls.
  • Fixed get_dep_component inline macro. #4742

New Features

  • Added Bits<T> in num module by @akhercha in #4251
  • Added more data for missing method diagnostic. #4405
  • Added assert_ne! test macro by @clint419 in #4424
  • Adding snapshot forwarding. #4430
  • Adding must_use annotation for types and functions.
  • support for match out of order for enums. #4536
  • Added Debug derive for various corelib types.
  • support for otherwise pattern in match for enums. #4557
  • support for match on true/false in parser and semantic. #4559
  • Added Store impl for ByteArray. #4596
  • Added while loops.
  • Add bool::then_some function by @LucasLvy in #4529
  • Add support for match on none felt252 numeric values. #4764
  • Added Serde, Store, PartialEq, Debug and Display for NonZero. #4795
  • Added PartialOrd for ContractAddress. #4863

Bug fixes

  • Fix attribute parsing with only an identifier after. #4407
  • Made auto-available traits be prelude based. #4410
  • Made contract address calculation deterministic by @enitrat in #4391
  • Fixed deploy syscall address registry by @enitrat in #4489
  • Avoid Not a trait. diagnostic if a diagnostic was already reported. #4477
  • Added error for nopanic cycles. #4643
  • Added breaking of stack if no longer holding a var as temp. #4777

Optimizations

  • Improve Span deserialization. #4595
  • Better performance of is_empty. #4715
  • Add return optimizations - if a value is ready for function return early - it is returned early - reducing many extra writes.
  • Pass Call::calldata as a Span. #4620

Others

New Contributors

Full Changelog: v2.4.3...v2.5.0

v2.4.4

17 Jan 12:18
Compare
Choose a tag to compare

What's Changed

  • Refactoring for better errors.

Full Changelog: v2.4.3...v2.4.4

v2.5.0-dev.1

04 Jan 13:04
dbb8ea6
Compare
Choose a tag to compare

Internal release for internal development purposes only.