Releases: starkware-libs/cairo
Releases · starkware-libs/cairo
v2.5.2
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
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 }
- Usage example:
- 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
- @keienWang made their first contribution in #4919
Full Changelog: v2.5.0...v2.5.1
v2.5.0
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
andfeature
attributes and warnings on usage ofunstable
features.- Warning be ignored using
feature("feature_name")
on an expression wrapping the usage. unstable
specifically added forSafeDispatcher
s usage.
- Warning be ignored using
- 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
- Update linear-types.adoc by @Akare123 in #4508
- fix: several links pointing to legacy repository uri by @krauspt in #4568
- Update match-expressions.adoc by @AdventureSeeker987 in #4607
- fix: minor typos by @tudorpintea999 in #4500
New Contributors
- @clint419 made their first contribution in #4378
- @akhercha made their first contribution in #4251
- @dedushky made their first contribution in #4388
- @Akare123 made their first contribution in #4508
- @krauspt made their first contribution in #4568
- @AdventureSeeker987 made their first contribution in #4607
- @tudorpintea999 made their first contribution in #4500
Full Changelog: v2.4.3...v2.5.0
v2.4.4
v2.5.0-dev.1
Internal release for internal development purposes only.
v2.4.3
What's Changed
- Update cairo-vm version to be "0.8.4-rc.0" specifically .#4731
Full Changelog: v2.4.2...v2.4.3
v2.4.2
What's Changed
- LS Memory usage improvements - reloading the entire backend in the background periodically to reduce the memory footprint.
Full Changelog: v2.4.1...v2.4.2
v2.5.0-dev.0
Internal release for internal development purposes only.
v2.4.1
Bug Fix
- Made generated storage variable modules have a non-friendly name, preventing colisions on module names. #4632
Full Changelog: v2.4.0...v2.4.1
v2.4.0
This is the Cairo version associated with Starknet 0.13.0. Contracts written with 2.4.0 are not declarable on Starknet until the upgrade.
Major Updates
- Added basic byte array formatting:
- Added
core::fmt::Formatter
for creating aByteArray
constructively. - Added
core::fmt::Display
andcore::fmt::Debug
as traits describing how to write a value based on a format string. - Added
derive
forDebug
for easy implementation ofcore::fmt::Debug
. - Inline macros
write!
andwriteln!
- adds to a formatter:write!(f, "format_string({})", value)
. - Inline macro
format!
- creates a byte array:format!("format_string({})", value)
. - Inline macros
print!
andprintln!
- prints a format string to stdout for debug:print!("format_string({})", value)
. - Inline macro
panic!
- panics with a formatted byte array:panic!("format_string({})", value)
. - Inline macro
assert!
- asserts condition:- Panic with the format string if the condition is false:
assert!(cond, "format_string({})", value)
. - Panic with the condition as a bytearray if the condition is false:
assert!(cond)
.
- Panic with the format string if the condition is false:
- In test plugin only Inline macro
assert_eq!
- asserts equality condition:assert_eq!(a, b, "Extra description {}, param");
- Added
- Contracts with sierra versions 1.4.0 and up calculate gas usage in a more efficient way.
- Removed need for
available_gas
in tests not testing specific gas usage - Now using a default large value. (#4172)- If testing not using dynamic gas - add
#[available_gas(static)]
instead.
- If testing not using dynamic gas - add
- Added Cairo Editions, allowing introducing opt-in for features that make break existing code.
- Currently 2 editions exist:
2023_01
(default) and2023_10
.
- Currently 2 editions exist:
- Added prelude (control for which code is in the context for all cairo code).
- Previously - all the corelib base module was in the context of all cairo code.
- Now - it is according to edition configured per crate:
2023_01
- The prelude includes all the top level of the corelib as of the state of the corelib at release2.3.1
.2023_10
- A much smaller subset.
- Users are encouraged to update their packages to the newest edition.
- Updated ExecutionInfo to be an extended version.
Bug Fixes
- Added support for bool and non copy nullable. #4340
- Raise diagnostic on impl inference cycle. #4367
- Made ap-changes be calculated without LP. #4250
- Fixes various inconsistent annotations code.
- Uses an algorithm similar to the new gas usage calculation - available only for 1.4.0 sierra declared classes.
- Handlng zero sized locals. #4414
- Added indirect impl support for inference. #4420
- Remove redundant gas assertions. #4464
Optimizations
- Removing extra store temps happening before store locals. #4173
- Added cast for signed integers. #3623
- Changed bytes31 casts to use libfunc upcast. #4098
- Accessing a member of a struct does not cause all the struct to be stored. #4263
- Avoid storing zero sized objects on the stack. #4290
- Adding
Zero-Sized
handling in the Sierra-to-casm compiler for better stack merging capabilities, and more efficient casm. - Using efficient invmod implementation where possible. #4402
New Features
- Added libfunc for efficient u256 inv_mod_n. #3603
- Added Nullable
deref_or
method by @enitrat in #4037 - Added Option
unwrap_or
andunwrap_default
by @Eikix in #4203 - Added
append_array
to Array. #4260 - Added
match_nullable_snapshot
. #4253 - Testing
#[should_panic(expected: 'error')]
supported - no need for wrapping(
)
in the case of a single var. - Testing
#[should_panic(expected: "error")]
supported - for testing panicking with byte array. - Add verify_signature function for secp curves. #4120
- Zero and One traits by @enitrat in #4254
- Support match on felt252 continuous from 0 and on values. #4284
- Skip attributes with no related item, getting better diagnostics for later code. #4296
- Added plugin suites. #4349
- Better compiler performance by avoiding data copies. #4244
- Caching compiler parser actions. #4247
- Allocate arguments before return values, generating more easily read Sierra code. #4258
- Move literal values validation to parser. #4295
- Made inline macro plugins point to the inner syntax, Improving diagnostics. #4345
- Improved Trait Mismatch diagnostic message. #4374
Others
- docs: fix typo by @shuoer86 in #4235
- fix typos by @vuittont60 in #4264
- Remove redundent diagnostics for inline macros. #4346
New Contributors
- @shuoer86 made their first contribution in #4235
- @Eikix made their first contribution in #4203
- @vuittont60 made their first contribution in #4264
Full Changelog: v2.3.1...v2.4.0