github software-mansion/scarb v2.13.1

22 hours ago

Cairo release notes ➡️

Welcome to the release notes for Scarb v2.13.1!

Small change to our contacts: If you want to chat, but don't want to use our public Telegram channel (https://t.me/+1pMLtrNj5NthZWJk), you can chat with us privately on Telegram via @scarb_chat account.

  • Package audits verification - Since scarbs.xyz registry supports uploading package audits, you can request Scarb to only download packages that has been audited. The information is based on the registry and audits for packages can be seen on "Security" tab in package view. The flag require-audits can be added to [workspace] definition. See docs for context.
  • Documenting declarative macro definitions - Scarb doc can now generate documentation for declarative macro definitions. Macro definition can be annotated with /// doc comments, similar to other items.
  • Generating workspace documentation - Since this release, if you run Scarb doc with --workspace flag, it will generate a single mdbook documentation for your whole workspace. Before, it would generate docs for each of the packages separately. This can be helpful, if you need to publish docs for whole workspace at once.
  • Module level inline macros support - Scarb inline procedural macros can now be used at top-level of a Cairo module, including at top level of Cairo file. This might be helpful, if you want your macro to generate some code, like function definitions. No changes to existing macros are required.
  • Defining default params for targets - The new target-defaults key in Scarb manifest can be used to declare default values for user-defined or auto-detected compilation targets, by kind. This is especially useful, if you need to define some key (e.g. build-external-contracts) for multiple targets of the same kind (e.g. all test targets). See docs here for more information.
  • Compiling executable targets to Sierra - Executable targets can be compiled to Sierra json format, by adding sierra = true in [executable] target definition props.
  • Macro fingerprint callback interface - Scarb procedural macros can define a callback, that will be called when deciding if incremental cache should be used. This is required to support incremental compilation if your macro is non-deterministic in regards to input token stream. See docs here for context.
  • Version resolver network access optimization - This version introduces optimized version resolution algorithm, that should avoid making unnecessary network requests, in cotexts like re-runing Scarb with pre-downloaded cache and up-to-date lockfile. This can be especially helpful when working with Scarb on unstable network connection.

Oracles support

This Scarb release includes stable implementation of Cairo oracles!

An oracle is an external process (like a script, binary, or web service) that exposes custom logic or data to a Cairo program at runtime.
You use it to perform tasks the Cairo VM can't, such as accessing real-world data or executing complex, non-provable computations.

Oracles can be used with Scarb execute or Starknet Foundry Forge.

Learn more by reading Oracles docs.

Assets

Scarb manifest can now declare additional project files, that should be treated as runtime assets of the package.
All assets declared by the current package and all of its transitive dependencies are copied into the workspace target directory at build time.
Assets also declare files as included for publishing.
This can be usefull, if you need to distribute additional files used at runtime with your Scarb package.

Learn more by reading assets docs.

Cairo-profiler integration with Scarb execute

This release allows you to use cairo-profiler to analyze runtime performance of Cairo code executed with scarb execute.
To use this feature, you need to generate profiler trace, by using --save-profiler-trace-data flag when executing your program.
See Cairo profiler project readme to learn more.

Cairo-run removal

This release removes the builtin Scarb cairo-run extension, which has been deprecated since Scarb v2.10.0.
Please use scarb execute instead.

Cairo-test deprecation

This release marks the builtin Scarb cairo-test extension as deprecated and bound to be removed in future release.
Please use Starknet Foundry instead.

Cairo Version

This version of Scarb comes with Cairo v2.13.1.

What's Changed

New Contributors

Full Changelog: v2.11.2...v2.13.1

Don't miss a new scarb release

NewReleases is sending notifications on new releases.