LogoAnchor Docs
Anchor Project UpdatesRelease Notes

0.32.0

Anchor - Release Notes 0.32.0

0.32.0 is the current last planned upgrade before a number of breaking changes to stabilize Anchor 1.0. We cover the most important changes below, but be sure to check out the full list of changes in the CHANGELOG.


How to upgrade

  1. Update anchor-cli:

    avm install 0.32.0
  2. Update Anchor crate(s) to 0.32.0.

  3. Update TS package(s) to 0.32.0.

The recommended Solana version is 2.3.0.

You can install the newer tooling by running:

sh -c "$(curl -sSfL https://release.anza.xyz/v2.3.0/install)"

CLI

anchor verify now uses solana-verify to verify builds

Anchor versions before 0.32.0 used a docker image solanafoundation/anchor to create verifiable builds. This version replaces the verifiable builds with solana-verify under the hood.

In order to create verifiable builds with this you still use anchor verify. If someone tries to verify a build older than 0.32.0 with the newest CLI, the expectation is that the verification will fail given the change in how builds are verified.

IDL is automatically uploaded by default on deployment

In 0.32.0, the IDL is now uploaded whenever you use anchor deploy by default. If you still wish to deploy an anchor program without uploading the new IDL, use anchor deploy --no-idl.

Add MSRV to the Rust template

Rust 1.89.0 or higher is now required to build Anchor IDLs as previous versions of Rust do not have the stabilized Span::local_file.

You can update your local Rust compiler by running:

rustup update

and confirm your local version of Rust with:

rustc --version

Note: This is different that the forked rustc version that the solana toolsuite uses for compiling Solana programs.

IDL

IDL building is now stabilized.

WIth the stabilization of Span::local_file, we can now build IDLs using the current Rust compiler instead of nightly. This should avoid issues in the future such as the nightly build failing on 0.31.0 and lower with the following issue:

no method named source_file found for struct proc_macro2::Span in the current 
scope

Lang

Improved error messaging when trying to create SystemAccount

When you tried to init a SystemAccount, you previously got a rather unhelpful error:

error[E0425]: cannot find crate `try_from_unchecked` in the list of imported crates
error[E0425]: cannot find crate `try_from` in the list of imported crates

Now the new error is a bit more helpful on pointing you in the right direction at compile time:

"Cannot use `init` on a `SystemAccount`.
The `SystemAccount` type represents an already-existing account 
owned by the system program and cannot be initialized. 
If you need to create a new account, use a more specific account type 
or `UncheckedAccount` and perform manual initialization instead."

Use solana-invoke instead of solana_cpi::invoke for CPI

solana_cpi::invoke from solana-program is generally inefficient on consuming CUs. With the replacement of solana_cpi::invoke, we've found an average of 5% CUs saved across the board when using CPI in your Anchor program.

Solang is no longer supported

Developers wishing to use Solang templates with Anchor now have to build using Solang's older tooling.

Typescript

Remove event parsing panic issues

Events previously could be sent maliciously causing anyone using the event parser to panic. The regex has since been updated to avoid these panics and improve the stability of the parser.

Added support for bun as a package manager

bun is rising in popularity and has been added as an optional package in your Anchor.toml:

[toolchain]
package_manager = "bun"

or when creating a new workspace:

anchor init <NAME> --package-manager bun

Supported values: npm, yarn, pnpm, bun (default: yarn)


See the full list of notable changes in the CHANGELOG.