This commit is contained in:
Sundeep Charan Ramkumar 2024-04-18 16:03:04 +02:00 committed by GitHub
commit 5fad50bba7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
21 changed files with 78 additions and 93 deletions

View File

@ -16,6 +16,12 @@ The minor version will be incremented upon a breaking change and the patch versi
### Breaking
## [0.30.1] - 2024-04-17
### Fixes
- syn: Eliminate variable allocations that build up stack space for token extension code generation ([#2913](https://github.com/coral-xyz/anchor/pull/2913)).
## [0.30.0] - 2024-04-15
### Features

36
Cargo.lock generated
View File

@ -119,7 +119,7 @@ checksum = "6b2d54853319fd101b8dd81de382bcbf3e03410a64d8928bbee85a3e7dcde483"
[[package]]
name = "anchor-attribute-access-control"
version = "0.30.0"
version = "0.30.1"
dependencies = [
"anchor-syn",
"proc-macro2",
@ -129,7 +129,7 @@ dependencies = [
[[package]]
name = "anchor-attribute-account"
version = "0.30.0"
version = "0.30.1"
dependencies = [
"anchor-syn",
"bs58 0.5.0",
@ -140,7 +140,7 @@ dependencies = [
[[package]]
name = "anchor-attribute-constant"
version = "0.30.0"
version = "0.30.1"
dependencies = [
"anchor-syn",
"quote",
@ -149,7 +149,7 @@ dependencies = [
[[package]]
name = "anchor-attribute-error"
version = "0.30.0"
version = "0.30.1"
dependencies = [
"anchor-syn",
"quote",
@ -158,7 +158,7 @@ dependencies = [
[[package]]
name = "anchor-attribute-event"
version = "0.30.0"
version = "0.30.1"
dependencies = [
"anchor-syn",
"proc-macro2",
@ -168,7 +168,7 @@ dependencies = [
[[package]]
name = "anchor-attribute-program"
version = "0.30.0"
version = "0.30.1"
dependencies = [
"anchor-lang-idl",
"anchor-syn",
@ -183,7 +183,7 @@ dependencies = [
[[package]]
name = "anchor-cli"
version = "0.30.0"
version = "0.30.1"
dependencies = [
"anchor-client",
"anchor-lang",
@ -219,7 +219,7 @@ dependencies = [
[[package]]
name = "anchor-client"
version = "0.30.0"
version = "0.30.1"
dependencies = [
"anchor-lang",
"anyhow",
@ -236,7 +236,7 @@ dependencies = [
[[package]]
name = "anchor-derive-accounts"
version = "0.30.0"
version = "0.30.1"
dependencies = [
"anchor-syn",
"quote",
@ -245,10 +245,10 @@ dependencies = [
[[package]]
name = "anchor-derive-serde"
version = "0.30.0"
version = "0.30.1"
dependencies = [
"anchor-syn",
"borsh-derive-internal 0.10.3",
"borsh-derive-internal 0.9.3",
"proc-macro2",
"quote",
"syn 1.0.109",
@ -256,7 +256,7 @@ dependencies = [
[[package]]
name = "anchor-derive-space"
version = "0.30.0"
version = "0.30.1"
dependencies = [
"proc-macro2",
"quote",
@ -265,7 +265,7 @@ dependencies = [
[[package]]
name = "anchor-lang"
version = "0.30.0"
version = "0.30.1"
dependencies = [
"anchor-attribute-access-control",
"anchor-attribute-account",
@ -280,7 +280,7 @@ dependencies = [
"arrayref",
"base64 0.21.7",
"bincode",
"borsh 0.10.3",
"borsh 0.9.3",
"bytemuck",
"getrandom 0.2.10",
"solana-program",
@ -300,10 +300,10 @@ dependencies = [
[[package]]
name = "anchor-spl"
version = "0.30.0"
version = "0.30.1"
dependencies = [
"anchor-lang",
"borsh 0.10.3",
"borsh 0.9.3",
"mpl-token-metadata",
"serum_dex",
"spl-associated-token-account 3.0.2",
@ -317,7 +317,7 @@ dependencies = [
[[package]]
name = "anchor-syn"
version = "0.30.0"
version = "0.30.1"
dependencies = [
"anyhow",
"bs58 0.5.0",
@ -663,7 +663,7 @@ checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa"
[[package]]
name = "avm"
version = "0.30.0"
version = "0.30.1"
dependencies = [
"anyhow",
"cargo_toml",

View File

@ -1,6 +1,6 @@
[package]
name = "avm"
version = "0.30.0"
version = "0.30.1"
rust-version = "1.60"
edition = "2021"

View File

@ -1,6 +1,6 @@
[package]
name = "anchor-cli"
version = "0.30.0"
version = "0.30.1"
authors = ["Anchor Maintainers <accounts@200ms.io>"]
rust-version = "1.60"
edition = "2021"
@ -16,9 +16,9 @@ path = "src/bin/main.rs"
dev = []
[dependencies]
anchor-client = { path = "../client", version = "0.30.0" }
anchor-client = { path = "../client", version = "0.30.1" }
anchor-lang-idl = { path = "../idl", features = ["build"], version = "0.1.0" }
anchor-lang = { path = "../lang", version = "0.30.0" }
anchor-lang = { path = "../lang", version = "0.30.1" }
anyhow = "1.0.32"
base64 = "0.21"
bincode = "1.3.3"

View File

@ -1,6 +1,6 @@
[package]
name = "anchor-client"
version = "0.30.0"
version = "0.30.1"
authors = ["Anchor Maintainers <accounts@200ms.io>"]
rust-version = "1.60"
edition = "2021"
@ -16,7 +16,7 @@ async = []
debug = []
[dependencies]
anchor-lang = { path = "../lang", version = "0.30.0" }
anchor-lang = { path = "../lang", version = "0.30.1" }
anyhow = "1"
futures = "0.3"
regex = "1"

View File

@ -200,6 +200,6 @@ Override toolchain data in the workspace similar to [`rust-toolchain.toml`](http
```toml
[toolchain]
anchor_version = "0.30.0" # `anchor-cli` version to use(requires `avm`)
anchor_version = "0.30.1" # `anchor-cli` version to use(requires `avm`)
solana_version = "1.18.8" # Solana version to use(applies to all Solana tools)
```

View File

@ -35,7 +35,7 @@ An example `Anchor.toml` config looks as follows,
```toml
[toolchain]
anchor_version = "0.30.0"
anchor_version = "0.30.1"
solana_version = "1.18.8"
[workspace]

View File

@ -21,5 +21,5 @@ serde = { version = "1", features = ["derive"] }
serde_json = "1"
# `build` feature only
anchor-syn = { path = "../lang/syn", version = "0.30.0", optional = true }
anchor-syn = { path = "../lang/syn", version = "0.30.1", optional = true }
regex = { version = "1", optional = true }

View File

@ -1,6 +1,6 @@
[package]
name = "anchor-lang"
version = "0.30.0"
version = "0.30.1"
authors = ["Anchor Maintainers <accounts@200ms.io>"]
repository = "https://github.com/coral-xyz/anchor"
rust-version = "1.60"
@ -39,15 +39,15 @@ init-if-needed = ["anchor-derive-accounts/init-if-needed"]
interface-instructions = ["anchor-attribute-program/interface-instructions"]
[dependencies]
anchor-attribute-access-control = { path = "./attribute/access-control", version = "0.30.0" }
anchor-attribute-account = { path = "./attribute/account", version = "0.30.0" }
anchor-attribute-constant = { path = "./attribute/constant", version = "0.30.0" }
anchor-attribute-error = { path = "./attribute/error", version = "0.30.0" }
anchor-attribute-event = { path = "./attribute/event", version = "0.30.0" }
anchor-attribute-program = { path = "./attribute/program", version = "0.30.0" }
anchor-derive-accounts = { path = "./derive/accounts", version = "0.30.0" }
anchor-derive-serde = { path = "./derive/serde", version = "0.30.0" }
anchor-derive-space = { path = "./derive/space", version = "0.30.0" }
anchor-attribute-access-control = { path = "./attribute/access-control", version = "0.30.1" }
anchor-attribute-account = { path = "./attribute/account", version = "0.30.1" }
anchor-attribute-constant = { path = "./attribute/constant", version = "0.30.1" }
anchor-attribute-error = { path = "./attribute/error", version = "0.30.1" }
anchor-attribute-event = { path = "./attribute/event", version = "0.30.1" }
anchor-attribute-program = { path = "./attribute/program", version = "0.30.1" }
anchor-derive-accounts = { path = "./derive/accounts", version = "0.30.1" }
anchor-derive-serde = { path = "./derive/serde", version = "0.30.1" }
anchor-derive-space = { path = "./derive/space", version = "0.30.1" }
# `anchor-lang-idl` should only be included with `idl-build` feature
anchor-lang-idl = { path = "../idl", version = "0.1.0", optional = true }
@ -60,4 +60,4 @@ bytemuck = "1"
solana-program = "1.16"
thiserror = "1"
# TODO: Remove. This crate has been added to fix a build error with the 1.16.0 release.
getrandom = { version = "0.2", features = ["custom"] }
getrandom = { version = "0.2", features = ["custom"] }

View File

@ -1,6 +1,6 @@
[package]
name = "anchor-attribute-access-control"
version = "0.30.0"
version = "0.30.1"
authors = ["Anchor Maintainers <accounts@200ms.io>"]
repository = "https://github.com/coral-xyz/anchor"
license = "Apache-2.0"
@ -15,7 +15,7 @@ proc-macro = true
anchor-debug = ["anchor-syn/anchor-debug"]
[dependencies]
anchor-syn = { path = "../../syn", version = "0.30.0" }
anchor-syn = { path = "../../syn", version = "0.30.1" }
proc-macro2 = "1"
quote = "1"
syn = { version = "1", features = ["full"] }

View File

@ -1,6 +1,6 @@
[package]
name = "anchor-attribute-account"
version = "0.30.0"
version = "0.30.1"
authors = ["Anchor Maintainers <accounts@200ms.io>"]
repository = "https://github.com/coral-xyz/anchor"
license = "Apache-2.0"
@ -16,7 +16,7 @@ anchor-debug = ["anchor-syn/anchor-debug"]
idl-build = ["anchor-syn/idl-build"]
[dependencies]
anchor-syn = { path = "../../syn", version = "0.30.0", features = ["hash"] }
anchor-syn = { path = "../../syn", version = "0.30.1", features = ["hash"] }
bs58 = "0.5"
proc-macro2 = "1"
quote = "1"

View File

@ -1,6 +1,6 @@
[package]
name = "anchor-attribute-constant"
version = "0.30.0"
version = "0.30.1"
authors = ["Anchor Maintainers <accounts@200ms.io>"]
repository = "https://github.com/coral-xyz/anchor"
license = "Apache-2.0"
@ -16,6 +16,6 @@ anchor-debug = ["anchor-syn/anchor-debug"]
idl-build = ["anchor-syn/idl-build"]
[dependencies]
anchor-syn = { path = "../../syn", version = "0.30.0" }
anchor-syn = { path = "../../syn", version = "0.30.1" }
quote = "1"
syn = { version = "1", features = ["full"] }

View File

@ -1,6 +1,6 @@
[package]
name = "anchor-attribute-error"
version = "0.30.0"
version = "0.30.1"
authors = ["Anchor Maintainers <accounts@200ms.io>"]
repository = "https://github.com/coral-xyz/anchor"
license = "Apache-2.0"
@ -16,6 +16,6 @@ anchor-debug = ["anchor-syn/anchor-debug"]
idl-build = ["anchor-syn/idl-build"]
[dependencies]
anchor-syn = { path = "../../syn", version = "0.30.0" }
anchor-syn = { path = "../../syn", version = "0.30.1" }
quote = "1"
syn = { version = "1", features = ["full"] }

View File

@ -1,6 +1,6 @@
[package]
name = "anchor-attribute-event"
version = "0.30.0"
version = "0.30.1"
authors = ["Anchor Maintainers <accounts@200ms.io>"]
repository = "https://github.com/coral-xyz/anchor"
license = "Apache-2.0"
@ -17,7 +17,7 @@ event-cpi = ["anchor-syn/event-cpi"]
idl-build = ["anchor-syn/idl-build"]
[dependencies]
anchor-syn = { path = "../../syn", version = "0.30.0", features = ["hash"] }
anchor-syn = { path = "../../syn", version = "0.30.1", features = ["hash"] }
proc-macro2 = "1"
quote = "1"
syn = { version = "1", features = ["full"] }

View File

@ -1,6 +1,6 @@
[package]
name = "anchor-attribute-program"
version = "0.30.0"
version = "0.30.1"
authors = ["Anchor Maintainers <accounts@200ms.io>"]
repository = "https://github.com/coral-xyz/anchor"
license = "Apache-2.0"
@ -18,7 +18,7 @@ interface-instructions = ["anchor-syn/interface-instructions"]
[dependencies]
anchor-lang-idl = { path = "../../../idl", version = "0.1.0" }
anchor-syn = { path = "../../syn", version = "0.30.0" }
anchor-syn = { path = "../../syn", version = "0.30.1" }
anyhow = "1"
bs58 = "0.5"
heck = "0.3"

View File

@ -1,6 +1,6 @@
[package]
name = "anchor-derive-accounts"
version = "0.30.0"
version = "0.30.1"
authors = ["Anchor Maintainers <accounts@200ms.io>"]
repository = "https://github.com/coral-xyz/anchor"
license = "Apache-2.0"
@ -18,6 +18,6 @@ idl-build = ["anchor-syn/idl-build"]
init-if-needed = ["anchor-syn/init-if-needed"]
[dependencies]
anchor-syn = { path = "../../syn", version = "0.30.0" }
anchor-syn = { path = "../../syn", version = "0.30.1" }
quote = "1"
syn = { version = "1", features = ["full"] }

View File

@ -1,6 +1,6 @@
[package]
name = "anchor-derive-serde"
version = "0.30.0"
version = "0.30.1"
authors = ["Anchor Maintainers <accounts@200ms.io>"]
repository = "https://github.com/coral-xyz/anchor"
license = "Apache-2.0"
@ -15,7 +15,7 @@ proc-macro = true
idl-build = ["anchor-syn/idl-build"]
[dependencies]
anchor-syn = { path = "../../syn", version = "0.30.0" }
anchor-syn = { path = "../../syn", version = "0.30.1" }
borsh-derive-internal = ">=0.9, <0.11"
proc-macro2 = "1"
syn = { version = "1", features = ["full"] }

View File

@ -1,6 +1,6 @@
[package]
name = "anchor-derive-space"
version = "0.30.0"
version = "0.30.1"
authors = ["Anchor Maintainers <accounts@200ms.io>"]
repository = "https://github.com/coral-xyz/anchor"
license = "Apache-2.0"

View File

@ -1,6 +1,6 @@
[package]
name = "anchor-syn"
version = "0.30.0"
version = "0.30.1"
authors = ["Anchor Maintainers <accounts@200ms.io>"]
repository = "https://github.com/coral-xyz/anchor"
license = "Apache-2.0"

View File

@ -886,67 +886,46 @@ fn generate_constraint_init_group(
for e in extensions {
match e {
::anchor_spl::token_interface::spl_token_2022::extension::ExtensionType::GroupPointer => {
let cpi_program = #token_program.to_account_info();
let accounts = ::anchor_spl::token_interface::GroupPointerInitialize {
::anchor_spl::token_interface::group_pointer_initialize(anchor_lang::context::CpiContext::new(#token_program.to_account_info(), ::anchor_spl::token_interface::GroupPointerInitialize {
token_program_id: #token_program.to_account_info(),
mint: #field.to_account_info(),
};
let cpi_ctx = anchor_lang::context::CpiContext::new(cpi_program, accounts);
::anchor_spl::token_interface::group_pointer_initialize(cpi_ctx, #group_pointer_authority, #group_pointer_group_address)?;
}), #group_pointer_authority, #group_pointer_group_address)?;
},
::anchor_spl::token_interface::spl_token_2022::extension::ExtensionType::GroupMemberPointer => {
let cpi_program = #token_program.to_account_info();
let accounts = ::anchor_spl::token_interface::GroupMemberPointerInitialize {
::anchor_spl::token_interface::group_member_pointer_initialize(anchor_lang::context::CpiContext::new(#token_program.to_account_info(), ::anchor_spl::token_interface::GroupMemberPointerInitialize {
token_program_id: #token_program.to_account_info(),
mint: #field.to_account_info(),
};
let cpi_ctx = anchor_lang::context::CpiContext::new(cpi_program, accounts);
::anchor_spl::token_interface::group_member_pointer_initialize(cpi_ctx, #group_member_pointer_authority, #group_member_pointer_member_address)?;
}), #group_member_pointer_authority, #group_member_pointer_member_address)?;
},
::anchor_spl::token_interface::spl_token_2022::extension::ExtensionType::MetadataPointer => {
let cpi_program = #token_program.to_account_info();
let accounts = ::anchor_spl::token_interface::MetadataPointerInitialize {
::anchor_spl::token_interface::metadata_pointer_initialize(anchor_lang::context::CpiContext::new(#token_program.to_account_info(), ::anchor_spl::token_interface::MetadataPointerInitialize {
token_program_id: #token_program.to_account_info(),
mint: #field.to_account_info(),
};
let cpi_ctx = anchor_lang::context::CpiContext::new(cpi_program, accounts);
::anchor_spl::token_interface::metadata_pointer_initialize(cpi_ctx, #metadata_pointer_authority, #metadata_pointer_metadata_address)?;
}), #metadata_pointer_authority, #metadata_pointer_metadata_address)?;
},
::anchor_spl::token_interface::spl_token_2022::extension::ExtensionType::MintCloseAuthority => {
let cpi_program = #token_program.to_account_info();
let accounts = ::anchor_spl::token_interface::MintCloseAuthorityInitialize {
::anchor_spl::token_interface::mint_close_authority_initialize(anchor_lang::context::CpiContext::new(#token_program.to_account_info(), ::anchor_spl::token_interface::MintCloseAuthorityInitialize {
token_program_id: #token_program.to_account_info(),
mint: #field.to_account_info(),
};
let cpi_ctx = anchor_lang::context::CpiContext::new(cpi_program, accounts);
::anchor_spl::token_interface::mint_close_authority_initialize(cpi_ctx, #close_authority)?;
}), #close_authority)?;
},
::anchor_spl::token_interface::spl_token_2022::extension::ExtensionType::TransferHook => {
let cpi_program = #token_program.to_account_info();
let accounts = ::anchor_spl::token_interface::TransferHookInitialize {
::anchor_spl::token_interface::transfer_hook_initialize(anchor_lang::context::CpiContext::new(#token_program.to_account_info(), ::anchor_spl::token_interface::TransferHookInitialize {
token_program_id: #token_program.to_account_info(),
mint: #field.to_account_info(),
};
let cpi_ctx = anchor_lang::context::CpiContext::new(cpi_program, accounts);
::anchor_spl::token_interface::transfer_hook_initialize(cpi_ctx, #transfer_hook_authority, #transfer_hook_program_id)?;
}), #transfer_hook_authority, #transfer_hook_program_id)?;
},
::anchor_spl::token_interface::spl_token_2022::extension::ExtensionType::NonTransferable => {
let cpi_program = #token_program.to_account_info();
let accounts = ::anchor_spl::token_interface::NonTransferableMintInitialize {
::anchor_spl::token_interface::non_transferable_mint_initialize(anchor_lang::context::CpiContext::new(#token_program.to_account_info(), ::anchor_spl::token_interface::NonTransferableMintInitialize {
token_program_id: #token_program.to_account_info(),
mint: #field.to_account_info(),
};
let cpi_ctx = anchor_lang::context::CpiContext::new(cpi_program, accounts);
::anchor_spl::token_interface::non_transferable_mint_initialize(cpi_ctx)?;
}))?;
},
::anchor_spl::token_interface::spl_token_2022::extension::ExtensionType::PermanentDelegate => {
let cpi_program = #token_program.to_account_info();
let accounts = ::anchor_spl::token_interface::PermanentDelegateInitialize {
::anchor_spl::token_interface::permanent_delegate_initialize(anchor_lang::context::CpiContext::new(#token_program.to_account_info(), ::anchor_spl::token_interface::PermanentDelegateInitialize {
token_program_id: #token_program.to_account_info(),
mint: #field.to_account_info(),
};
let cpi_ctx = anchor_lang::context::CpiContext::new(cpi_program, accounts);
::anchor_spl::token_interface::permanent_delegate_initialize(cpi_ctx, #permanent_delegate.unwrap())?;
}), #permanent_delegate.unwrap())?;
},
_ => {} // do nothing
}

View File

@ -1,6 +1,6 @@
[package]
name = "anchor-spl"
version = "0.30.0"
version = "0.30.1"
authors = ["Anchor Maintainers <accounts@200ms.io>"]
rust-version = "1.60"
edition = "2021"
@ -27,7 +27,7 @@ token_2022 = ["spl-token-2022"]
token_2022_extensions = ["spl-token-2022", "spl-token-group-interface", "spl-token-metadata-interface", "spl-pod"]
[dependencies]
anchor-lang = { path = "../lang", version = "0.30.0", features = ["derive"] }
anchor-lang = { path = "../lang", version = "0.30.1", features = ["derive"] }
borsh = { version = ">=0.9, <0.11", optional = true }
mpl-token-metadata = { version = "4", optional = true }
serum_dex = { git = "https://github.com/openbook-dex/program/", rev = "1be91f2", version = "0.4.0", features = ["no-entrypoint"], optional = true }