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.
- No support for conversion into a span for
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
- Pluralize "test" when needed in tests info output by @kwkr in #5080
- docs: update reserved keywords by @enitrat in #5125
- fixed typo by @zhaichuankai in #5153
New Contributors
- @delaaxe made their first contribution in #4981
- @iamvukasin made their first contribution in #4936
- @thor314 made their first contribution in #5030
- @kwkr made their first contribution in #5080
- @zhaichuankai made their first contribution in #5153
Full Changelog: v2.5.4...v2.6.0