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
-
Update
anchor-cli
: -
Update Anchor crate(s) to
0.32.0
. -
Update TS package(s) to
0.32.0
.
Recommended Solana Version
The recommended Solana version is 2.3.0
.
You can install the newer tooling by running:
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:
and confirm your local version of Rust with:
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:
Lang
Improved error messaging when trying to create SystemAccount
When you tried to init
a SystemAccount
, you previously got a rather
unhelpful error:
Now the new error is a bit more helpful on pointing you in the right direction at compile time:
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
:
or when creating a new workspace:
Supported values: npm
, yarn
, pnpm
, bun
(default: yarn
)
See the full list of notable changes in the CHANGELOG.