chore: updated docs changelog and release notes for v1#4360
chore: updated docs changelog and release notes for v1#4360tiago18c wants to merge 3 commits intosolana-foundation:masterfrom
Conversation
|
@tiago18c is attempting to deploy a commit to the Solana Foundation Team on Vercel. A member of the Team first needs to authorize it. |
| the toolchain, and establish a stable foundation going forward. We cover the most | ||
| important changes below, but be sure to check out the full list of changes in | ||
| the | ||
| [CHANGELOG](https://github.com/solana-foundation/anchor/blob/v1.0.0/CHANGELOG.md#100---2026-xx-xx). |
There was a problem hiding this comment.
Just a note for posterity that this will need updating once we have a finalized date for the cut.
| Otherwise, bootstrap using `cargo install`: | ||
|
|
||
| ```sh | ||
| cargo install avm --git https://github.com/solana-foundation/anchor --tag v1.0.0 --locked |
There was a problem hiding this comment.
We have always recommended installing the latest avm because the latest should always work with all versions. avm also doesn't get published, so its versioning is not that useful.
| cargo install avm --git https://github.com/solana-foundation/anchor --tag v1.0.0 --locked | |
| cargo install avm --git https://github.com/solana-foundation/anchor --locked |
|
|
||
| ## Recommended Solana Version | ||
|
|
||
| The recommended Solana version is `3.1.10`. |
There was a problem hiding this comment.
Solana v4 is probably very close. If we release v1 with Solana v3, it will get outdated very quickly.
| ### `declare_program!` instruction parser | ||
|
|
||
| `declare_program!` now generates a typed instruction parser alongside the CPI | ||
| helpers. Use `my_program::parsers::Instruction::try_from_bytes` to decode any |
There was a problem hiding this comment.
Instruction::try_from_bytes was renamed to Instruction::parse along with similar methods in #4151.
| helpers. Use `my_program::parsers::Instruction::try_from_bytes` to decode any | |
| helpers. Use `my_program::parsers::Instruction::parse` to decode any |
I think all renames should get a mention.
|
|
||
| `declare_program!` now generates a typed instruction parser alongside the CPI | ||
| helpers. Use `my_program::parsers::Instruction::try_from_bytes` to decode any | ||
| instruction belonging to the program from its raw bytes. |
There was a problem hiding this comment.
This specific method actually expects solana_instruction::Instruction rather than raw bytes (unlike the other parse methods).
| // After (v1) | ||
| pub fn my_handler<'info>(ctx: Context<'info, MyAccounts<'info>>) -> Result<()> { ... } | ||
| // or simply (when the lifetime is inferred) | ||
| pub fn my_handler(ctx: Context<MyAccounts<'_>>) -> Result<()> { ... } |
There was a problem hiding this comment.
<'_> is useless:
| pub fn my_handler(ctx: Context<MyAccounts<'_>>) -> Result<()> { ... } | |
| pub fn my_handler(ctx: Context<MyAccounts>) -> Result<()> { ... } |
| ### Relaxed PDA seed syntax | ||
|
|
||
| The seed expressions accepted inside `seeds = [...]` constraints are now more | ||
| flexible and support a broader set of Rust expressions. |
There was a problem hiding this comment.
I think this should mention that using complex seeds will likely mean no account resolution.
| ### `common::close` accepts references | ||
|
|
||
| The `common::close` utility now accepts both owned and referenced account | ||
| infos, removing the need for manual `.to_account_info()` calls at call sites. | ||
|
|
There was a problem hiding this comment.
This is an internal function, which is why it wasn't mentioned in the CHANGELOG in #4178. It's fine to mention in the CHANGELOG, but I think it's best to keep the release notes as useful as possible.
| ### `common::close` accepts references | |
| The `common::close` utility now accepts both owned and referenced account | |
| infos, removing the need for manual `.to_account_info()` calls at call sites. |
| `anchor_lang::prelude::Owners` is now re-exported from the prelude, so you no | ||
| longer need a separate `use` statement for it. |
There was a problem hiding this comment.
Logic error:
| `anchor_lang::prelude::Owners` is now re-exported from the prelude, so you no | |
| longer need a separate `use` statement for it. | |
| `anchor_lang::Owners` is now re-exported from the prelude, so you no | |
| longer need a separate `use` statement for it. |
| ### All public API types exported | ||
|
|
||
| All types used in the public API surface of `anchor-client` are now | ||
| re-exported, so you no longer need to hunt for the correct sub-crate to import | ||
| them from. |
There was a problem hiding this comment.
This is actually a downgrade from the previous version in terms of discoverability and exports because the last version exported the entire solana-sdk. However, it's an improvement in terms of dependency management and being more lightweight. Something like this should be mentioned instead.
No description provided.