What's Change
New Experimental Features
- Spec shaking for smaller contract binaries: The SDK now supports automatic removal of unused type and event definitions from the
contractspecv0section of compiled WASM files. By embedding markers that survive dead code elimination, only types and events actually used at contract boundaries (function parameters, return values, and events) are retained. This reduces contract binary size and enables imported contract types to be automatically re-exported when used. Requires Stellar CLI v25.2.0+. Behind a feature flagexperimental_spec_shaking_v2during the v25 release. (#1672)
Improvements
-
Compile-time validation for BigInt conversions:
BigInt::from<BytesN>now catches length mismatches at compile time instead of panicking at runtime, giving you earlier and clearer error messages. (#1725) -
Remove unnecessary clones in iterators: Iterator implementations no longer perform redundant clones, reducing overhead when iterating over SDK collection types. (#1734)
Bug Fixes
- Fix
BytesN::is_empty:BytesN::is_emptypreviously always returnedfalse. It now correctly returnstrueforBytesN<0>. (#1733)
Documentation
- Document the
allocfeature: Theallocmodule is now publicly documented in rustdoc, covering how the bump-pointer allocator works, thatdeallocis a no-op, and how to use a custom allocator instead. (#1726)
All Changes
- Remove unnecessary clone in iterators by @leighmcculloch in #1734
- Fix BytesN::is_empty to check const length by @leighmcculloch in #1733
- Use compile-time assert in BigInt::from by @leighmcculloch in #1725
- Add commentary to alloc module about use of static_mut_refs and light code reordering and vis changes by @leighmcculloch in #1722
- Document alloc feature by @leighmcculloch in #1726
- Bump deny action by @sisuresh in #1742
- Implement spec shaking using dead code elimination and data section of wasm by @leighmcculloch in #1672
- Bump version to 25.2.0 by @github-actions[bot] in #1749
Full Changelog: v25.1.1...v25.2.0