Anchor Project UpdatesRelease Notes

1.2.1

Anchor - Release Notes 1.2.1

1.2.1 introduces opt-in Solana v4 dependencies. This includes newer SPL interfaces and fixes #5138 when solana-v4 is enabled: initializing a token account for a Token-2022 mint with the PermissionedBurn extension no longer fails with InvalidAccountData because of the older pinned interface.

See the full CHANGELOG.

How to upgrade

avm install 1.2.1
avm use 1.2.1

Without AVM

cargo install --git https://github.com/otter-sec/anchor --tag v1.2.1 anchor-cli --locked

Then update Anchor crate(s) and TS package(s) to 1.2.1.

Solana v4 dependencies

To use Solana v4 dependencies, set default-features = false and add solana-v4 to the features of each Anchor dependency that selects a Solana version, including anchor-lang, anchor-spl, and anchor-client when used. Solana v3 remains the default; the solana-v3 and solana-v4 features are mutually exclusive.

For example, in your program's Cargo.toml:

[dependencies]
anchor-lang = { version = "1.2.1", default-features = false, features = ["solana-v4"] }
anchor-spl = { version = "1.2.1", default-features = false, features = ["solana-v4", "associated_token", "mint", "token", "token_2022", "token_2022_extensions"] }

Disabling default features also disables the default SPL modules. The example explicitly restores them; keep the features your program needs, along with any other Anchor features you already use, such as init-if-needed or event-cpi. Ensure other dependencies do not re-enable solana-v3 through Cargo feature unification.

With solana-v4, anchor-spl uses spl-token-2022-interface v3, which recognizes PermissionedBurn. The default solana-v3 feature continues to use interface v2 and does not fix the issue for that extension.

On this page

GitHubEdit on GitHub