|
@@ -1,15 +1,13 @@
|
|
|
---
|
|
|
-title: Release Notes
|
|
|
-description: Anchor - Release Notes
|
|
|
+title: Release Notes 0.29.0
|
|
|
+description: Anchor - Release Notes 0.29.0
|
|
|
---
|
|
|
|
|
|
Anchor keeps a [CHANGELOG](https://github.com/coral-xyz/anchor/blob/master/CHANGELOG.md) but it's not easy to make sense what has changed, what effect does the change have and how to migrate. This is where release notes comes in, an easy to digest and actionable view for each release.
|
|
|
|
|
|
---
|
|
|
|
|
|
-## [0.29.0]
|
|
|
-
|
|
|
-### How to update
|
|
|
+## How to update
|
|
|
|
|
|
1. Update `avm`:
|
|
|
|
|
@@ -27,7 +25,7 @@ Anchor keeps a [CHANGELOG](https://github.com/coral-xyz/anchor/blob/master/CHANG
|
|
|
|
|
|
4. Update TS package(s) to `0.29.0`.
|
|
|
|
|
|
-### Solana `1.14` is no longer supported
|
|
|
+## Solana `1.14` is no longer supported
|
|
|
|
|
|
Minimum supported Solana version is now `1.16.0` because
|
|
|
|
|
@@ -40,7 +38,7 @@ If you are still on Solana `1.14`, update by running:
|
|
|
solana-install init 1.17.0
|
|
|
```
|
|
|
|
|
|
-### Override toolchain for the workspace
|
|
|
+## Override toolchain for the workspace
|
|
|
|
|
|
`Anchor.toml` has a new section called `[toolchain]` that allows overriding the current toolchain versions inside the workspace.
|
|
|
|
|
@@ -50,13 +48,13 @@ anchor_version = "0.29.0" # `anchor-cli` version to use
|
|
|
solana_version = "1.17.0" # Solana version to use
|
|
|
```
|
|
|
|
|
|
-#### Notes
|
|
|
+### Notes
|
|
|
|
|
|
- Fields are optional.
|
|
|
- `anchor_version` requires [`avm`](https://github.com/coral-xyz/anchor/tree/master/avm) to be installed.
|
|
|
- Before this release, `anchor_version` and `solana_version` keys in `Anchor.toml` were being used for Docker verifiable builds only. Now, all commands work via the `[toolchain]` section.
|
|
|
|
|
|
-### Install CLI from commit with `avm`
|
|
|
+## Install CLI from commit with `avm`
|
|
|
|
|
|
It is possible to install CLI from commit by running:
|
|
|
|
|
@@ -94,7 +92,7 @@ Specify `toolchain.anchor_version` as `<VERSION>-<COMMIT>`:
|
|
|
anchor_version = "0.28.0-6cf200493a307c01487c7b492b4893e0d6f6cb23"
|
|
|
```
|
|
|
|
|
|
-### Multiple files template
|
|
|
+## Multiple files template
|
|
|
|
|
|
Programs created with `anchor init` or `anchor new` have a single `lib.rs` file but not everyone prefers a single file approach for programs.
|
|
|
|
|
@@ -123,7 +121,7 @@ or if you have an existing workspace:
|
|
|
anchor new <NAME> --template multiple
|
|
|
```
|
|
|
|
|
|
-### Upgradeable programs in tests
|
|
|
+## Upgradeable programs in tests
|
|
|
|
|
|
You can now configure upgradability of the programs in `anchor test`.
|
|
|
|
|
@@ -143,7 +141,7 @@ program = "swap.so"
|
|
|
upgradeable = true
|
|
|
```
|
|
|
|
|
|
-### Lamport utilities
|
|
|
+## Lamport utilities
|
|
|
|
|
|
Transferring lamports from a PDA is quite complicated due to the types that are being used.
|
|
|
|
|
@@ -175,7 +173,7 @@ let lamports = ctx.accounts.my_account.get_lamports();
|
|
|
|
|
|
**Note:** The new methods are not only more ergonomic but they are also more performant than the previous examples. This is because `to_account_info` method clones the data internally but the new methods use a reference to the underlying data.
|
|
|
|
|
|
-### Type safe context bumps
|
|
|
+## Type safe context bumps
|
|
|
|
|
|
Before this release, `ctx.bumps` used to be a `BTreeMap<String, u8>` which doesn't provide type safety for the keys(account names).
|
|
|
|
|
@@ -191,7 +189,7 @@ let bump = ctx.bumps.my_account;
|
|
|
|
|
|
**Note**: The new way is not only more intuitive but also is more performant. This is mainly because `BTreeMap` is heap-allocated and it has to resize and grow occasionally.
|
|
|
|
|
|
-### `idl-build` feature
|
|
|
+## `idl-build` feature
|
|
|
|
|
|
There is a new way to generate IDLs via compilation.
|
|
|
|
|
@@ -208,7 +206,7 @@ The IDL will be built automatically when you run `anchor build` but if you'd lik
|
|
|
anchor idl build
|
|
|
```
|
|
|
|
|
|
-#### Notes
|
|
|
+### Notes
|
|
|
|
|
|
- All crates that are being used for the IDL generation needs to be added to the `idl-build` feature list.
|
|
|
|
|
@@ -227,7 +225,7 @@ idl-build = [
|
|
|
- Generation time is a lot slower compared to the default method(parsing) due to Rust compile times.
|
|
|
- Even though most of it works great, some parts are still rough around the edges and you may encounter parts that are not fully ironed out. Please [create an issue](https://github.com/coral-xyz/anchor/issues) if you run into a problem.
|
|
|
|
|
|
-### Type aliases
|
|
|
+## Type aliases
|
|
|
|
|
|
Anchor IDL now supports type aliases.
|
|
|
|
|
@@ -284,7 +282,7 @@ Generates the following IDL:
|
|
|
|
|
|
**Note:** This example only works with the default IDL generation method(parsing) for now because type aliases for default Rust types don't work properly with `idl-build`([#2640](https://github.com/coral-xyz/anchor/issues/2640)).
|
|
|
|
|
|
-### Export `mpl-token-metadata`
|
|
|
+## Export `mpl-token-metadata`
|
|
|
|
|
|
`anchor-spl` with `metadata` feature enabled now exports the `mpl-token-metadata` crate.
|
|
|
|
|
@@ -302,7 +300,7 @@ and use the exported crate from `anchor-spl`:
|
|
|
use anchor_spl::metadata::mpl_token_metadata;
|
|
|
```
|
|
|
|
|
|
-### TypeScript SDK improvements
|
|
|
+## TypeScript SDK improvements
|
|
|
|
|
|
1. `Program.addEventListener` method is now strongly typed -- correct types for the event names and the event returned from the callback instead of `any`.
|
|
|
|
|
@@ -317,7 +315,7 @@ use anchor_spl::metadata::mpl_token_metadata;
|
|
|
|
|
|
4. Removed `assert` and `base64-js` dependency.
|
|
|
|
|
|
-### New docker image
|
|
|
+## New docker image
|
|
|
|
|
|
The previous image([projectserum/build](https://hub.docker.com/r/projectserum/build)) is now deprecated, new image is [backpackapp/build](https://hub.docker.com/r/backpackapp/build).
|
|
|
|
|
@@ -329,7 +327,7 @@ docker pull backpackapp/build:v0.29.0
|
|
|
|
|
|
**Note:** `anchor build --verifiable` now works with the latest image.
|
|
|
|
|
|
-### Enhanced performance
|
|
|
+## Enhanced performance
|
|
|
|
|
|
`0.29.0` performance is noticeably improved in all areas, the biggest one being [binary size](https://github.com/coral-xyz/anchor/blob/master/bench/BINARY_SIZE.md#0290) which is reduced ~36% compared to `0.28.0`!
|
|
|
|