Skip to content

Releases: software-mansion/scarb

v2.14.0

25 Nov 20:03
682b29e

Choose a tag to compare

Cairo release notes ➡️

Welcome to the release notes for Scarb v2.14.0!

This release:

  • Promotes Scarb 2.14.0-rc.0 to stable release.
  • Changes the default project template created with scarb new. Note, that this change may breake compatibility with snforge new in older Starknet Foundry versions. In such cases, please upgrade Starknet Foundry to latest version, or create new projects with scarb new, choosing Starknet Foundry test runner.
  • Introduces better handling of visbility of reexported items in Scarb doc.

Cairo Version

This version of Scarb comes with Cairo v2.14.0.

What's Changed

Full Changelog: v2.14.0-rc.0...v2.14.0

v2.14.0-rc.0

20 Nov 22:57
255f382

Choose a tag to compare

v2.14.0-rc.0 Pre-release
Pre-release

Cairo release notes ➡️

Welcome to the release notes for Scarb v2.14.0-rc.0!
This release includes several features and bugfixes.

  • Unit artifacts fingerprints - We now fingerprint artifacts produces by Scarb. This means, that if you run Scarb a second time, without changing anything in your code or in the target directory, Scarb will skip the compilation saving your time!
  • The new quote_format! macro in procedural macro API - Some Cairo syntax may not play nicely with quote! macro. In such cases, you can use quote_format!, which accepts any Cairo syntax. It works similar to formatdoc! macro you may already know.
  • Option to skip all compiler optimizations - If you need to output raw Sierra, without any optimizations applied by the compiler, you may use the new skip-optimizations option in the [cairo] section. Use with cauation! This makes sense only for some dev tooling you may need.

Cairo Version

This version of Scarb comes with Cairo v2.14.0-rc.0.

What's Changed

Full Changelog: v2.13.1...v2.14.0-rc.0

v2.13.1

30 Oct 16:09
a76aed7

Choose a tag to compare

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 (https://t.me/scarb_chat).

  • 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

Read more

v2.12.2

15 Sep 13:57
v2.12.2
dc0dbfd

Choose a tag to compare

Cairo release notes ➡️

Welcome to the release notes for Scarb v2.12.2!

The release introduces couple of fixes, improved cache handling, adds file embeddings support to scarb doc .

cache handling

Enhanced cache file handling by delaying creation until the cache is ready, securing file access with locks during reads, appending component names to cache traces, and ensuring cache fingerprint files are written after the cache itself.

scarb doc

Support mdbook file embedding syntax, updated mdbook features related documentation.

fixes

  • inline macro diagnostics
  • table formatting in scarb doc generated summary page.

Cairo Version

This version of Scarb comes with Cairo v2.12.2.

What's Changed

Full Changelog: v2.12.1...v2.12.2

v2.12.1

28 Aug 14:07
40d114d

Choose a tag to compare

Cairo release notes ➡️

Welcome to the release notes for Scarb v2.12.1!

This release brings several performance improvements and bugfixes.

Compiler plugins execution order change

Up to this release, all procedural macros has been expanded after all builtin compiler plugins.
From this release, procedural macros are expanded before all builtin compiler plugins, except for the cfg config plugin, which is run as the first.

Cairo Version

This version of Scarb comes with Cairo v2.12.1.

What's Changed

Full Changelog: v2.12.0...v2.12.1

v2.12.1-rc.0

14 Aug 19:22
fdf4204

Choose a tag to compare

v2.12.1-rc.0 Pre-release
Pre-release

Cairo release notes ➡️

Welcome to the release notes for Scarb v2.12.1-rc.0!

Cairo Version

This version of Scarb comes with Cairo v2.12.0.

What's Changed

Full Changelog: v2.12.0...v2.12.1-rc.0

v2.12.0

04 Aug 15:26
639d0a6

Choose a tag to compare

Cairo release notes ➡️

Welcome to the release notes for Scarb v2.12.0!

This release promotes 2.12.0-rc.4 to a stable version.

Cairo Version

This version of Scarb comes with Cairo v2.12.0.

Full Changelog: v2.12.0-rc.4...v2.12.0

v2.12.0-rc.4

30 Jul 20:01
b2428f0

Choose a tag to compare

v2.12.0-rc.4 Pre-release
Pre-release

Cairo release notes ➡️

Welcome to the release notes for Scarb v2.12.0-rc.4!

This release brings several bugfixes to Scarb.

Default inlining strategy in dev profile

This release reverts the changes made in 2.12.0-rc.2 regarding the default inlining strategy for the dev profile.
Since this release, both the dev and release profile will use the release (default) strategy.
For more information, please see our docs.

Cairo Version

This version of Scarb comes with Cairo v2.12.0-rc.3.

What's Changed

Full Changelog: v2.12.0-rc.3...v2.12.0-rc.4

v2.12.0-rc.3

29 Jul 19:38
d75018e

Choose a tag to compare

v2.12.0-rc.3 Pre-release
Pre-release

Cairo release notes ➡️

Welcome to the release notes for Scarb v2.12.0-rc.3!

This release brings several bugfixes on Cairo and Scarb level.

Cairo Version

This version of Scarb comes with Cairo v2.12.0-rc.3.

What's Changed

  • upgrade vitepress, vue and prettier by @mkaput in #2423
  • add oracle docs by @mkaput in #2421
  • fix markdown in creating-executable-package.md by @mkaput in #2433
  • Change error message and add a warning for executable target by @maciektr in #2436
  • Snforge-scarb-plugin fingerprint hack by @maciektr in #2441
  • Save fingerprint digests on the first calculation by @maciektr in #2442
  • Fix ScarbCommand error message on Scarb exiting with error by @maciektr in #2453
  • Prepare scarb-metadata release v1.15.1 by @maciektr in #2454
  • Set release as alias for default in inlining-strategy deserializer by @maciektr in #2457
  • Bump deno_task_shell from 0.25.2 to 0.25.3 by @maciektr in #2460
  • Rewrite token stream spans to start at zero, for optimized get_text method by @maciektr in #2448
  • Update docs for by inlining-strategy @maciektr in #2462

Full Changelog: v2.12.0-rc.2...v2.12.0-rc.3

v2.12.0-rc.2

23 Jul 07:37
476bd42

Choose a tag to compare

v2.12.0-rc.2 Pre-release
Pre-release

Cairo release notes ➡️

Welcome to the release notes for Scarb v2.12.0-rc.2!

Default inlining strategy in dev profile

This release changes the default inlining strategy settings for the dev profile to avoid.
The strategy used by release profile is not changed.
This means you should especially make sure to use release when compiling your contracts for deployment.
For more information, please see our docs.

Incremental compilation

This release of Scarb brings incremental compilation support to the Cairo ecosystem.

Incremental compilation means, that Scarb can now cache some steps of your compilation process and reuse this cache in subsequent builds. Hence after initial build, following builds should complete faster. If you build your Scarb project now, you can notice two new directories in the target directory - incremental and .fingerprint - which contain the caches. This means, that to use the cache, you need to preserve the target directory between the runs. The cache is saved on a package level and it will only be used, if a whole package did not change.

Oracles (experimental)

An oracle is an external process (like a script, binary, or web service) that exposes custom logic or data to a Cairo program. You use it to perform tasks the Cairo VM can't, such as accessing real-world data or executing complex, non-provable computations. This Scarb release brings initial support for oracles in scarb execute with a new --experimental-oracles flag.

To use oracles, you need to add a dependency on the oracle package:

[dependencies]
oracle = "0.1.0-dev.4"

Then, in your Cairo program, write a module that wraps the oracle in an idiomatic API:

mod my_oracle {
    pub fn funny_hash(x: u64) -> oracle::Result<u64> {
        oracle::invoke("stdio:cargo -q run --manifest-path my_oracle/Cargo.toml", 'funny_hash', (x,))
    }
}

#[executable]
fn main() {
    let x = my_oracle::funny_hash(42);
    println!("Funny hash of 42 is: {:?}", x);
}

We also build a Rust crate that eases implementing oracles in this language. We plan to build similar SDKs for other languages depending on community demands.

use cairo_oracle_server::Oracle;
use std::process::ExitCode;

fn main() -> ExitCode {
    Oracle::new()
        .provide("funny_hash", |value: u64| {
            Ok((value.rotate_left(13) ^ 0x517cc1b727220a95).rotate_right(7) + value)
        })
        .run()
}

To run this executable, you must now explicitly enable oracle support. We plan to remove this flag once oracles will become stabilised.

scarb execute --experimental-oracles

You can read more about oracles in the oracle package documentation and in Scarb docs. We will be happy to hear feedback on this feature and see what ideas this enables!

Cairo Version

This version of Scarb comes with Cairo v2.12.0-rc.2.

What's Changed

Full Changelog: v2.12.0-rc.1...v2.12.0-rc.2