Skip to content

Commit

Permalink
v0.29.0 (#2672)
Browse files Browse the repository at this point in the history
  • Loading branch information
acheroncrypto authored Oct 16, 2023
1 parent 88a75af commit fc9fd6d
Show file tree
Hide file tree
Showing 95 changed files with 4,142 additions and 812 deletions.
49 changes: 25 additions & 24 deletions .github/workflows/reusable-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -336,33 +336,34 @@ jobs:
# - run: cd tests/misc && chmod +x ci.sh && ./ci.sh
# - run: cd tests/misc && anchor test --skip-lint

test-anchor-init:
needs: setup-anchor-cli
name: Test Anchor Init
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/setup/
- uses: ./.github/actions/setup-ts/
- uses: ./.github/actions/setup-solana/
# TODO: Re-enable after releasing `0.29.0`.
# test-anchor-init:
# needs: setup-anchor-cli
# name: Test Anchor Init
# runs-on: ubuntu-latest
# timeout-minutes: 30
# steps:
# - uses: actions/checkout@v3
# - uses: ./.github/actions/setup/
# - uses: ./.github/actions/setup-ts/
# - uses: ./.github/actions/setup-solana/

- uses: actions/cache@v3
if: ${{ env.CACHE != 'false' }}
name: Cache Cargo registry + index
id: cache-anchor
with:
path: ${{ env.CARGO_CACHE_PATH }}
key: cargo-${{ runner.os }}-${{ env.CARGO_PROFILE }}-anchor-${{ hashFiles('**/Cargo.lock') }}
# - uses: actions/cache@v3
# if: ${{ env.CACHE != 'false' }}
# name: Cache Cargo registry + index
# id: cache-anchor
# with:
# path: ${{ env.CARGO_CACHE_PATH }}
# key: cargo-${{ runner.os }}-${{ env.CARGO_PROFILE }}-anchor-${{ hashFiles('**/Cargo.lock') }}

- uses: actions/download-artifact@v3
with:
name: ${{ env.ANCHOR_BINARY_NAME }}
path: ~/.cargo/bin/
- run: chmod +x ~/.cargo/bin/anchor
# - uses: actions/download-artifact@v3
# with:
# name: ${{ env.ANCHOR_BINARY_NAME }}
# path: ~/.cargo/bin/
# - run: chmod +x ~/.cargo/bin/anchor

- run: cd "$(mktemp -d)" && anchor init hello-anchor && cd hello-anchor && yarn link @coral-xyz/anchor && yarn && anchor test && yarn lint:fix
- uses: ./.github/actions/git-diff/
# - run: cd "$(mktemp -d)" && anchor init hello-anchor && cd hello-anchor && yarn link @coral-xyz/anchor && yarn && anchor test && yarn lint:fix
# - uses: ./.github/actions/git-diff/

test-programs:
needs: setup-anchor-cli
Expand Down
11 changes: 10 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,14 @@ The minor version will be incremented upon a breaking change and the patch versi

### Features

### Fixes

### Breaking

## [0.29.0] - 2023-10-16

### Features

- lang: Change all accounts to have a reference to `AccountInfo` ([#2656](https://github.com/coral-xyz/anchor/pull/2656)).
- lang: Add `get_lamports`, `add_lamports` and `sub_lamports` methods for all account types ([#2552](https://github.com/coral-xyz/anchor/pull/2552)).
- client: Add a helper struct `DynSigner` to simplify use of `Client<C> where <C: Clone + Deref<Target = impl Signer>>` with Solana clap CLI utils that loads `Signer` as `Box<dyn Signer>` ([#2550](https://github.com/coral-xyz/anchor/pull/2550)).
Expand All @@ -30,7 +38,7 @@ The minor version will be incremented upon a breaking change and the patch versi
- syn: Add `IdlBuild` trait to implement IDL support for custom types ([#2629](https://github.com/coral-xyz/anchor/pull/2629)).
- spl: Add `idl-build` feature. IDL build method will not work without enabling this feature when using `anchor-spl` ([#2629](https://github.com/coral-xyz/anchor/pull/2629)).
- lang: Add support for type aliases in IDLs ([#2637](https://github.com/coral-xyz/anchor/pull/2637)).
- cli: Add `test.upgradeable`, `test.genesis.upgradeable` setting in anchor.toml to support testing upgradeable programs ([#2641](https://github.com/coral-xyz/anchor/pull/2642)).
- cli: Add `test.upgradeable`, `test.genesis.upgradeable` setting in `Anchor.toml` to support testing upgradeable programs ([#2642](https://github.com/coral-xyz/anchor/pull/2642)).
- cli, client, lang, spl: Update Solana toolchain and dependencies to `1.17.0`, `1.16` remains supported ([#2645](https://github.com/coral-xyz/anchor/pull/2645)).
- spl: Add support for memo program ([#2661](https://github.com/coral-xyz/anchor/pull/2661)).
- avm: Add `anchor-cli` installation from commit ([#2659](https://github.com/coral-xyz/anchor/pull/2659)).
Expand All @@ -47,6 +55,7 @@ The minor version will be incremented upon a breaking change and the patch versi
- lang: Fix `associated_token::token_program` constraint ([#2603](https://github.com/coral-xyz/anchor/pull/2603)).
- cli: Fix `anchor account` command panicking outside of workspace ([#2620](https://github.com/coral-xyz/anchor/pull/2620)).
- lang: IDL named enum variant fields are now camelCase as opposed to snake_case, consistent with the other IDL types ([#2633](https://github.com/coral-xyz/anchor/pull/2633)).
- avm: Remove excessive panics and handle the errors gracefully ([#2671](https://github.com/coral-xyz/anchor/pull/2671)).

### Breaking

Expand Down
30 changes: 15 additions & 15 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.28.0
0.29.0
2 changes: 1 addition & 1 deletion avm/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "avm"
version = "0.28.0"
version = "0.29.0"
rust-version = "1.60"
edition = "2021"

Expand Down
15 changes: 14 additions & 1 deletion bench/BINARY_SIZE.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,27 @@ The programs and their tests are located in [/tests/bench](https://github.com/co

Solana version: 1.17.0

| Program | Binary Size | - |
| ------- | ----------- | --- |
| bench | 735,800 | - |

### Notable changes

---

## [0.29.0]

Solana version: 1.17.0

| Program | Binary Size | +/- |
| ------- | ----------- | ------------------------ |
| bench | 735,800 | 🟢 **-417,936 (36.22%)** |

### Notable changes

- Change all accounts to have a reference to `AccountInfo` ([#2656](https://github.com/coral-xyz/anchor/pull/2656)).
- `Box` the `anchor_lang::Result` error variants ([#2600](https://github.com/coral-xyz/anchor/pull/2600)).
- Change all accounts to have a reference to `AccountInfo` instead of cloning ([#2656](https://github.com/coral-xyz/anchor/pull/2656)).
- Reduce unnecessary cloning ([#2663](https://github.com/coral-xyz/anchor/pull/2663)).

---

Expand Down
100 changes: 100 additions & 0 deletions bench/COMPUTE_UNITS.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,104 @@ The programs and their tests are located in [/tests/bench](https://github.com/co

Solana version: 1.17.0

| Instruction | Compute Units | - |
| --------------------------- | ------------- | --- |
| accountInfo1 | 584 | - |
| accountInfo2 | 824 | - |
| accountInfo4 | 1,319 | - |
| accountInfo8 | 2,531 | - |
| accountEmptyInit1 | 4,899 | - |
| accountEmpty1 | 708 | - |
| accountEmptyInit2 | 9,325 | - |
| accountEmpty2 | 1,064 | - |
| accountEmptyInit4 | 17,821 | - |
| accountEmpty4 | 1,766 | - |
| accountEmptyInit8 | 34,855 | - |
| accountEmpty8 | 3,179 | - |
| accountSizedInit1 | 4,988 | - |
| accountSized1 | 732 | - |
| accountSizedInit2 | 9,499 | - |
| accountSized2 | 1,106 | - |
| accountSizedInit4 | 18,219 | - |
| accountSized4 | 1,863 | - |
| accountSizedInit8 | 35,574 | - |
| accountSized8 | 3,374 | - |
| accountUnsizedInit1 | 5,075 | - |
| accountUnsized1 | 759 | - |
| accountUnsizedInit2 | 9,736 | - |
| accountUnsized2 | 1,168 | - |
| accountUnsizedInit4 | 18,622 | - |
| accountUnsized4 | 2,000 | - |
| accountUnsizedInit8 | 36,119 | - |
| accountUnsized8 | 3,667 | - |
| boxedAccountEmptyInit1 | 4,952 | - |
| boxedAccountEmpty1 | 745 | - |
| boxedAccountEmptyInit2 | 9,426 | - |
| boxedAccountEmpty2 | 1,136 | - |
| boxedAccountEmptyInit4 | 18,020 | - |
| boxedAccountEmpty4 | 1,913 | - |
| boxedAccountEmptyInit8 | 35,248 | - |
| boxedAccountEmpty8 | 3,500 | - |
| boxedAccountSizedInit1 | 5,027 | - |
| boxedAccountSized1 | 767 | - |
| boxedAccountSizedInit2 | 9,582 | - |
| boxedAccountSized2 | 1,183 | - |
| boxedAccountSizedInit4 | 18,332 | - |
| boxedAccountSized4 | 2,002 | - |
| boxedAccountSizedInit8 | 35,868 | - |
| boxedAccountSized8 | 3,682 | - |
| boxedAccountUnsizedInit1 | 5,109 | - |
| boxedAccountUnsized1 | 797 | - |
| boxedAccountUnsizedInit2 | 9,746 | - |
| boxedAccountUnsized2 | 1,246 | - |
| boxedAccountUnsizedInit4 | 18,658 | - |
| boxedAccountUnsized4 | 2,135 | - |
| boxedAccountUnsizedInit8 | 36,525 | - |
| boxedAccountUnsized8 | 3,948 | - |
| boxedInterfaceAccountMint1 | 2,085 | - |
| boxedInterfaceAccountMint2 | 3,726 | - |
| boxedInterfaceAccountMint4 | 6,991 | - |
| boxedInterfaceAccountMint8 | 13,562 | - |
| boxedInterfaceAccountToken1 | 2,015 | - |
| boxedInterfaceAccountToken2 | 3,585 | - |
| boxedInterfaceAccountToken4 | 6,712 | - |
| boxedInterfaceAccountToken8 | 13,003 | - |
| interfaceAccountMint1 | 2,174 | - |
| interfaceAccountMint2 | 4,057 | - |
| interfaceAccountMint4 | 7,823 | - |
| interfaceAccountMint8 | 15,357 | - |
| interfaceAccountToken1 | 2,101 | - |
| interfaceAccountToken2 | 3,909 | - |
| interfaceAccountToken4 | 7,522 | - |
| interface1 | 630 | - |
| interface2 | 813 | - |
| interface4 | 1,174 | - |
| interface8 | 1,905 | - |
| program1 | 630 | - |
| program2 | 813 | - |
| program4 | 1,176 | - |
| program8 | 1,905 | - |
| signer1 | 564 | - |
| signer2 | 776 | - |
| signer4 | 1,195 | - |
| signer8 | 2,035 | - |
| systemAccount1 | 618 | - |
| systemAccount2 | 882 | - |
| systemAccount4 | 1,406 | - |
| systemAccount8 | 2,460 | - |
| uncheckedAccount1 | 546 | - |
| uncheckedAccount2 | 738 | - |
| uncheckedAccount4 | 1,115 | - |
| uncheckedAccount8 | 1,877 | - |

### Notable changes

---

## [0.29.0]

Solana version: 1.17.0

| Instruction | Compute Units | +/- |
| --------------------------- | ------------- | ---------------------- |
| accountInfo1 | 584 | 🟢 **-431 (42.46%)** |
Expand Down Expand Up @@ -109,6 +207,8 @@ Solana version: 1.17.0
### Notable changes

- `Box` the `anchor_lang::Result` error variants ([#2600](https://github.com/coral-xyz/anchor/pull/2600)).
- Change all accounts to have a reference to `AccountInfo` instead of cloning ([#2656](https://github.com/coral-xyz/anchor/pull/2656)).
- Reduce unnecessary cloning ([#2663](https://github.com/coral-xyz/anchor/pull/2663)).

---

Expand Down
Loading

1 comment on commit fc9fd6d

@vercel
Copy link

@vercel vercel bot commented on fc9fd6d Oct 16, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

anchor-docs – ./

anchor-docs-git-master-200ms.vercel.app
www.anchor-lang.com
anchor-lang.com
anchor-docs-200ms.vercel.app

Please sign in to comment.