WELCOME TO 0.23.0!
As always, thanks to the tireless contributors who made this release as good as it is!
avm install latest
avm use latest
Let's dive in:
We just published a new chapter: Intro to Solana.
We want this chapter to include everything you need to know about Solana to get started with anchor. So if you think there's something missing in this chapter, let us know!
Today, a new initiative led by
@0xDeep
.
🔥🔥🔥🚀 Anchor By Example.
A new resource for devs to learn
@solana
led by the community. We're just getting started, so please give feedback and contribute!
The Solana explorer now has a label for anchor-verified programs!
Thanks to
@losman0s
for adding this feature!
Here's an example:
What does it mean to be verified and why is it important?
1/x
We are going to do a stream this friday where we are going to explain how anchor works under the hood and how to contribute to it but also just hang out!
Will share stream details soon. See you there!
0.24.2!
Thanks to everyone who contributed to this release!
0.24.0 had some client bugs so we released two patches. Please upgrade directly to 0.24.2!
Let's dive in:
thats how you call this function now. no pda calculation to be seen. and remember the payer and the system_program? anchor takes care of those for you too. all signers not provided will default to the provider and common programs dont have to be specified
And the grand finale: The new ts builder API. We'll let it speak for itself. Have a look at this giant seeds constraint. Now think about the function you have to write in the client to calculate that PDA.
but..what if you didnt have to?
We now have a reference for the Anchor.toml file in the book!
did we miss anything or is something unclear? let us know here
you'll also find some issues there we'd welcome help with!
We are going to do a stream this friday where we are going to explain how anchor works under the hood and how to contribute to it but also just hang out!
Will share stream details soon. See you there!
We are going to do a stream this friday where we are going to explain how anchor works under the hood and how to contribute to it but also just hang out!
Will share stream details soon. See you there!
Detailed documentation for the account types (e.g. Account<‘info, T>), constraints (e.g. init, seeds), and the context types (e.g. CpiContext) has been added. Check out the “anchor-lang” page to learn more!
The Anchor Book has been updated to v0.23.0!
We've also had a subchapter about program directory structure since v0.22.0 that we forgot to tweet about 😅
There's more: We have improved the API around creating bumps. Previously, the init PDA api looked like you could provide any kind of bump. But this was never true. It always had to be the canonical one. So now you can just access the canonical bump with ctx.bumps.get
These are only some of the features in this release. To learn about all new features check out
If you want to get started with Anchor check out the anchor book at and
This release completes much of the error redesign that has been started in 0.22.0. Whenever possible, anchor errors log expected and actual values now. We've also added more require macros (eq,neq,gt,gte).
Anchor now has support for multiple test suites. Each test suite is defined by a Test.toml file and runs independently using its local validator and config. It's possible to create base files with config that test suites can share!
Thanks everyone for coming to the stream and asking questions!
We took 90 minutes to talk about the different macros and data structures anchor uses internally.
You can find the recording here:
New relase.
Now you can view any IDL by typing the program address in the search bar, even if the program is not in the registry.
For comparison, here are two screenshots:
Left (complete program) vs. right (IDL viewer only)
Accounts Data coming next
“fn programdata_address(&self) -> Option<Pubkey>” on the Program type. For upgradeable programs this function returns the address of their program data account.
For example, you can use this to allow the upgrade authority of your program to set admin settings.
New grant opportunity!
The Solana Foundation is supporting
@Solana
projects implementing
@anchorlang
IDLs.
We'll grant $5k USDC to any eligible program that shows proof of IDL integration after July 18, 2022. Find out more here, including how to submit:
These are only some of the new features in 0.24.0.
If you want the avm changes, you have to re-install it as updating anchor through the avm does not update the avm (yet).
has also been updated to 0.24.0
An important disclaimer: “verified” does not mean secure or not malicious. It’s still possible for a verified program to contain insecure or malicious code.
The ts client has also received an upgrade. It does its best to give you as much information as possible when an AnchorError occurs (see changelog for the limitations). E.g. the program error stack, the compared values, and the origin of the error.
Even for non-AnchorErrors, the ts client will provide the program stack as long as the underlying solana library returns the tx logs.
Thats it for the error features in this release. But there's a couple more things.
We now have wrapper functions for system program cpi calls
thats how you call this function now. no pda calculation to be seen. and remember the payer and the system_program? anchor takes care of those for you too. all signers not provided will default to the provider and common programs dont have to be specified
and a side note: "avm use latest" only updates anchor currently. if you want new avm features, you have to reinstall avm completely.
These are only some of the changes made in this release. To learn about all of them visit the changelog:
Return values are not only useful for CPIs. They can also be used to calculate something onchain to avoid rewriting the calculation code on the client. The new `view` function makes this easy.
comparisons for pubkeys have their own macros and result in slightly different logs (doing it this way is much cheaper computationally). Require macros can be used with or without custom errors.
Anchor now has support for return values from handler functions. These use the `get_return_data` and `set_return_data` syscalls under the hood. After a CPI, return data can be pulled lazily using `get` to avoid unnecessary syscalls if the caller doesn't need the return data.
Without verification, you’re putting all your trust in the program author.
With the anchor verified label, you can check a program’s verification status in the explorer. A program will be labeled as "verified" if its published source code matches that of the deployed program.
First release of the week.
Lots of UI related changes. Improved mobile UI, program page, and navigation.
In addition:
- Search experience improved
- "latest" tag will show if you're currently looking at the last version of the program.
@gansersol
@espiKnwldgBmbs
@AckeeBlockchain
You can easily use solana program test with the rust client. Run `cargo doc` inside your program to see all the generated helpers for constructing instruction data Vec<u8> and instruction account lists Vec<Account<Meta>>
Check out the tests/multiple-suites directory in our repo for more examples! Support for test suites is non-breaking. If a 'test' script is found in Anchor.toml, a test suite with the Anchor.toml file as the config file is run.