This commit is contained in:
Armani Ferrante 2021-04-19 08:42:01 +08:00 committed by GitHub
parent ab509b6580
commit 0de345f1a6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
17 changed files with 69 additions and 51 deletions

View File

@ -11,11 +11,14 @@ incremented for features.
## [Unreleased] ## [Unreleased]
## [0.4.4] - 2021-04-18
## Features ## Features
* lang: Allows one to specify multiple `with` targets when creating associated acconts ([#197](https://github.com/project-serum/anchor/pull/197)). * lang: Allows one to specify multiple `with` targets when creating associated acconts ([#197](https://github.com/project-serum/anchor/pull/197)).
* lang, ts: Add array support ([#202](https://github.com/project-serum/anchor/pull/202)). * lang, ts: Add array support ([#202](https://github.com/project-serum/anchor/pull/202)).
* lang: Zero copy deserialization for accounts ([#202](https://github.com/project-serum/anchor/pull/202)). * lang: Zero copy deserialization for accounts ([#202](https://github.com/project-serum/anchor/pull/202), [#206](https://github.com/project-serum/anchor/pull/206)).
* lang, spl, cli, client: Upgrade solana toolchain to 1.6.6 ([#210](https://github.com/project-serum/anchor/pull/210)).
## [0.4.3] - 2021-04-13 ## [0.4.3] - 2021-04-13

26
Cargo.lock generated
View File

@ -44,7 +44,7 @@ dependencies = [
[[package]] [[package]]
name = "anchor-attribute-access-control" name = "anchor-attribute-access-control"
version = "0.4.3" version = "0.4.4"
dependencies = [ dependencies = [
"anchor-syn", "anchor-syn",
"anyhow", "anyhow",
@ -56,7 +56,7 @@ dependencies = [
[[package]] [[package]]
name = "anchor-attribute-account" name = "anchor-attribute-account"
version = "0.4.3" version = "0.4.4"
dependencies = [ dependencies = [
"anchor-syn", "anchor-syn",
"anyhow", "anyhow",
@ -67,7 +67,7 @@ dependencies = [
[[package]] [[package]]
name = "anchor-attribute-error" name = "anchor-attribute-error"
version = "0.4.3" version = "0.4.4"
dependencies = [ dependencies = [
"anchor-syn", "anchor-syn",
"proc-macro2 1.0.24", "proc-macro2 1.0.24",
@ -77,7 +77,7 @@ dependencies = [
[[package]] [[package]]
name = "anchor-attribute-event" name = "anchor-attribute-event"
version = "0.4.3" version = "0.4.4"
dependencies = [ dependencies = [
"anchor-syn", "anchor-syn",
"anyhow", "anyhow",
@ -88,7 +88,7 @@ dependencies = [
[[package]] [[package]]
name = "anchor-attribute-interface" name = "anchor-attribute-interface"
version = "0.4.3" version = "0.4.4"
dependencies = [ dependencies = [
"anchor-syn", "anchor-syn",
"anyhow", "anyhow",
@ -100,7 +100,7 @@ dependencies = [
[[package]] [[package]]
name = "anchor-attribute-program" name = "anchor-attribute-program"
version = "0.4.3" version = "0.4.4"
dependencies = [ dependencies = [
"anchor-syn", "anchor-syn",
"anyhow", "anyhow",
@ -111,7 +111,7 @@ dependencies = [
[[package]] [[package]]
name = "anchor-attribute-state" name = "anchor-attribute-state"
version = "0.4.3" version = "0.4.4"
dependencies = [ dependencies = [
"anchor-syn", "anchor-syn",
"anyhow", "anyhow",
@ -122,7 +122,7 @@ dependencies = [
[[package]] [[package]]
name = "anchor-cli" name = "anchor-cli"
version = "0.4.3" version = "0.4.4"
dependencies = [ dependencies = [
"anchor-lang", "anchor-lang",
"anchor-syn", "anchor-syn",
@ -146,7 +146,7 @@ dependencies = [
[[package]] [[package]]
name = "anchor-client" name = "anchor-client"
version = "0.4.3" version = "0.4.4"
dependencies = [ dependencies = [
"anchor-lang", "anchor-lang",
"anyhow", "anyhow",
@ -158,7 +158,7 @@ dependencies = [
[[package]] [[package]]
name = "anchor-derive-accounts" name = "anchor-derive-accounts"
version = "0.4.3" version = "0.4.4"
dependencies = [ dependencies = [
"anchor-syn", "anchor-syn",
"anyhow", "anyhow",
@ -169,7 +169,7 @@ dependencies = [
[[package]] [[package]]
name = "anchor-lang" name = "anchor-lang"
version = "0.4.3" version = "0.4.4"
dependencies = [ dependencies = [
"anchor-attribute-access-control", "anchor-attribute-access-control",
"anchor-attribute-account", "anchor-attribute-account",
@ -188,7 +188,7 @@ dependencies = [
[[package]] [[package]]
name = "anchor-spl" name = "anchor-spl"
version = "0.4.3" version = "0.4.4"
dependencies = [ dependencies = [
"anchor-lang", "anchor-lang",
"solana-program", "solana-program",
@ -197,7 +197,7 @@ dependencies = [
[[package]] [[package]]
name = "anchor-syn" name = "anchor-syn"
version = "0.4.3" version = "0.4.4"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"bs58", "bs58",

View File

@ -1,6 +1,6 @@
[package] [package]
name = "anchor-cli" name = "anchor-cli"
version = "0.4.3" version = "0.4.4"
authors = ["armaniferrante <armaniferrante@gmail.com>"] authors = ["armaniferrante <armaniferrante@gmail.com>"]
edition = "2018" edition = "2018"

View File

@ -1,13 +1,13 @@
[package] [package]
name = "anchor-client" name = "anchor-client"
version = "0.4.3" version = "0.4.4"
authors = ["Serum Foundation <foundation@projectserum.com>"] authors = ["Serum Foundation <foundation@projectserum.com>"]
edition = "2018" edition = "2018"
license = "Apache-2.0" license = "Apache-2.0"
description = "Rust client for Anchor programs" description = "Rust client for Anchor programs"
[dependencies] [dependencies]
anchor-lang = { path = "../lang", version = "0.4.3" } anchor-lang = { path = "../lang", version = "0.4.4" }
anyhow = "1.0.32" anyhow = "1.0.32"
regex = "1.4.5" regex = "1.4.5"
solana-client = "1.6.6" solana-client = "1.6.6"

View File

@ -1,6 +1,6 @@
[package] [package]
name = "anchor-lang" name = "anchor-lang"
version = "0.4.3" version = "0.4.4"
authors = ["Serum Foundation <foundation@projectserum.com>"] authors = ["Serum Foundation <foundation@projectserum.com>"]
repository = "https://github.com/project-serum/anchor" repository = "https://github.com/project-serum/anchor"
edition = "2018" edition = "2018"
@ -12,14 +12,14 @@ derive = []
default = [] default = []
[dependencies] [dependencies]
anchor-attribute-access-control = { path = "./attribute/access-control", version = "0.4.3" } anchor-attribute-access-control = { path = "./attribute/access-control", version = "0.4.4" }
anchor-attribute-account = { path = "./attribute/account", version = "0.4.3" } anchor-attribute-account = { path = "./attribute/account", version = "0.4.4" }
anchor-attribute-error = { path = "./attribute/error", version = "0.4.3" } anchor-attribute-error = { path = "./attribute/error", version = "0.4.4" }
anchor-attribute-program = { path = "./attribute/program", version = "0.4.3" } anchor-attribute-program = { path = "./attribute/program", version = "0.4.4" }
anchor-attribute-state = { path = "./attribute/state", version = "0.4.3" } anchor-attribute-state = { path = "./attribute/state", version = "0.4.4" }
anchor-attribute-interface = { path = "./attribute/interface", version = "0.4.3" } anchor-attribute-interface = { path = "./attribute/interface", version = "0.4.4" }
anchor-attribute-event = { path = "./attribute/event", version = "0.4.3" } anchor-attribute-event = { path = "./attribute/event", version = "0.4.4" }
anchor-derive-accounts = { path = "./derive/accounts", version = "0.4.3" } anchor-derive-accounts = { path = "./derive/accounts", version = "0.4.4" }
base64 = "0.13.0" base64 = "0.13.0"
borsh = "0.8.2" borsh = "0.8.2"
bytemuck = "1.4.0" bytemuck = "1.4.0"

View File

@ -1,6 +1,6 @@
[package] [package]
name = "anchor-attribute-access-control" name = "anchor-attribute-access-control"
version = "0.4.3" version = "0.4.4"
authors = ["Serum Foundation <foundation@projectserum.com>"] authors = ["Serum Foundation <foundation@projectserum.com>"]
repository = "https://github.com/project-serum/anchor" repository = "https://github.com/project-serum/anchor"
license = "Apache-2.0" license = "Apache-2.0"
@ -15,5 +15,5 @@ proc-macro2 = "1.0"
quote = "1.0" quote = "1.0"
syn = { version = "1.0.60", features = ["full"] } syn = { version = "1.0.60", features = ["full"] }
anyhow = "1.0.32" anyhow = "1.0.32"
anchor-syn = { path = "../../syn", version = "0.4.3" } anchor-syn = { path = "../../syn", version = "0.4.4" }
regex = "1.0" regex = "1.0"

View File

@ -1,6 +1,6 @@
[package] [package]
name = "anchor-attribute-account" name = "anchor-attribute-account"
version = "0.4.3" version = "0.4.4"
authors = ["Serum Foundation <foundation@projectserum.com>"] authors = ["Serum Foundation <foundation@projectserum.com>"]
repository = "https://github.com/project-serum/anchor" repository = "https://github.com/project-serum/anchor"
license = "Apache-2.0" license = "Apache-2.0"
@ -15,4 +15,4 @@ proc-macro2 = "1.0"
quote = "1.0" quote = "1.0"
syn = { version = "1.0.60", features = ["full"] } syn = { version = "1.0.60", features = ["full"] }
anyhow = "1.0.32" anyhow = "1.0.32"
anchor-syn = { path = "../../syn", version = "0.4.3", features = ["hash"] } anchor-syn = { path = "../../syn", version = "0.4.4", features = ["hash"] }

View File

@ -20,6 +20,13 @@ use syn::parse_macro_input;
/// ///
/// # Zero Copy Deserialization /// # Zero Copy Deserialization
/// ///
/// **WARNING**: Zero copy deserialization is an experimental feature. It's
/// recommended to use it only when necessary, i.e., when you have extremely
/// large accounts that cannot be Borsh deserialized without hitting stack or
/// heap limits.
///
/// ## Usage
///
/// To enable zero-copy-deserialization, one can pass in the `zero_copy` /// To enable zero-copy-deserialization, one can pass in the `zero_copy`
/// argument to the macro as follows: /// argument to the macro as follows:
/// ///
@ -29,14 +36,22 @@ use syn::parse_macro_input;
/// ///
/// This can be used to conveniently implement /// This can be used to conveniently implement
/// [`ZeroCopy`](./trait.ZeroCopy.html) so that the account can be used /// [`ZeroCopy`](./trait.ZeroCopy.html) so that the account can be used
/// with [`AccountLoader`](./struct.AccountLoader.html). /// with [`Loader`](./struct.Loader.html).
/// ///
/// Other than being more efficient, the most salient benefit this provides is /// Other than being more efficient, the most salient benefit this provides is
/// the ability to define account types larger than the max stack or heap size. /// the ability to define account types larger than the max stack or heap size.
/// This is used in special cases, for example, the Serum DEX event queue. When /// When using borsh, the account has to be copied and deserialized into a new
/// using borsh, one is limited, since the account has to be copied and /// data structure and thus is constrained by stack and heap limits imposed by
/// deserialized into a new data structure. With zero copy deserialization, /// the BPF VM. With zero copy deserialization, all bytes from the account's
/// everything is, effectively, lazy loaded on field access. /// backing `RefCell<&mut [u8]>` are simply re-interpreted as a reference to
/// the data structure. No allocations or copies necessary. Hence the ability
/// to get around stack and heap limitations.
///
/// To facilitate this, all fields in an account must be constrained to be
/// "plain old data", i.e., they must implement
/// [`Pod`](../bytemuck/trait.Pod.html). Please review the
/// [`safety`](file:///home/armaniferrante/Documents/code/src/github.com/project-serum/anchor/target/doc/bytemuck/trait.Pod.html#safety)
/// section before using.
#[proc_macro_attribute] #[proc_macro_attribute]
pub fn account( pub fn account(
args: proc_macro::TokenStream, args: proc_macro::TokenStream,

View File

@ -1,6 +1,6 @@
[package] [package]
name = "anchor-attribute-error" name = "anchor-attribute-error"
version = "0.4.3" version = "0.4.4"
authors = ["Serum Foundation <foundation@projectserum.com>"] authors = ["Serum Foundation <foundation@projectserum.com>"]
repository = "https://github.com/project-serum/anchor" repository = "https://github.com/project-serum/anchor"
license = "Apache-2.0" license = "Apache-2.0"
@ -14,4 +14,4 @@ proc-macro = true
proc-macro2 = "1.0" proc-macro2 = "1.0"
quote = "1.0" quote = "1.0"
syn = { version = "1.0.60", features = ["full"] } syn = { version = "1.0.60", features = ["full"] }
anchor-syn = { path = "../../syn", version = "0.4.3" } anchor-syn = { path = "../../syn", version = "0.4.4" }

View File

@ -1,6 +1,6 @@
[package] [package]
name = "anchor-attribute-event" name = "anchor-attribute-event"
version = "0.4.3" version = "0.4.4"
authors = ["Serum Foundation <foundation@projectserum.com>"] authors = ["Serum Foundation <foundation@projectserum.com>"]
repository = "https://github.com/project-serum/anchor" repository = "https://github.com/project-serum/anchor"
license = "Apache-2.0" license = "Apache-2.0"
@ -15,4 +15,4 @@ proc-macro2 = "1.0"
quote = "1.0" quote = "1.0"
syn = { version = "1.0.60", features = ["full"] } syn = { version = "1.0.60", features = ["full"] }
anyhow = "1.0.32" anyhow = "1.0.32"
anchor-syn = { path = "../../syn", version = "0.4.3", features = ["hash"] } anchor-syn = { path = "../../syn", version = "0.4.4", features = ["hash"] }

View File

@ -1,6 +1,6 @@
[package] [package]
name = "anchor-attribute-interface" name = "anchor-attribute-interface"
version = "0.4.3" version = "0.4.4"
authors = ["Serum Foundation <foundation@projectserum.com>"] authors = ["Serum Foundation <foundation@projectserum.com>"]
repository = "https://github.com/project-serum/anchor" repository = "https://github.com/project-serum/anchor"
license = "Apache-2.0" license = "Apache-2.0"
@ -15,5 +15,5 @@ proc-macro2 = "1.0"
quote = "1.0" quote = "1.0"
syn = { version = "1.0.60", features = ["full"] } syn = { version = "1.0.60", features = ["full"] }
anyhow = "1.0.32" anyhow = "1.0.32"
anchor-syn = { path = "../../syn", version = "0.4.3" } anchor-syn = { path = "../../syn", version = "0.4.4" }
heck = "0.3.2" heck = "0.3.2"

View File

@ -1,6 +1,6 @@
[package] [package]
name = "anchor-attribute-program" name = "anchor-attribute-program"
version = "0.4.3" version = "0.4.4"
authors = ["Serum Foundation <foundation@projectserum.com>"] authors = ["Serum Foundation <foundation@projectserum.com>"]
repository = "https://github.com/project-serum/anchor" repository = "https://github.com/project-serum/anchor"
license = "Apache-2.0" license = "Apache-2.0"
@ -15,4 +15,4 @@ proc-macro2 = "1.0"
quote = "1.0" quote = "1.0"
syn = { version = "1.0.60", features = ["full"] } syn = { version = "1.0.60", features = ["full"] }
anyhow = "1.0.32" anyhow = "1.0.32"
anchor-syn = { path = "../../syn", version = "0.4.3" } anchor-syn = { path = "../../syn", version = "0.4.4" }

View File

@ -1,6 +1,6 @@
[package] [package]
name = "anchor-attribute-state" name = "anchor-attribute-state"
version = "0.4.3" version = "0.4.4"
authors = ["Serum Foundation <foundation@projectserum.com>"] authors = ["Serum Foundation <foundation@projectserum.com>"]
repository = "https://github.com/project-serum/anchor" repository = "https://github.com/project-serum/anchor"
license = "Apache-2.0" license = "Apache-2.0"
@ -15,4 +15,4 @@ proc-macro2 = "1.0"
quote = "1.0" quote = "1.0"
syn = { version = "1.0.60", features = ["full"] } syn = { version = "1.0.60", features = ["full"] }
anyhow = "1.0.32" anyhow = "1.0.32"
anchor-syn = { path = "../../syn", version = "0.4.3" } anchor-syn = { path = "../../syn", version = "0.4.4" }

View File

@ -1,6 +1,6 @@
[package] [package]
name = "anchor-derive-accounts" name = "anchor-derive-accounts"
version = "0.4.3" version = "0.4.4"
authors = ["Serum Foundation <foundation@projectserum.com>"] authors = ["Serum Foundation <foundation@projectserum.com>"]
repository = "https://github.com/project-serum/anchor" repository = "https://github.com/project-serum/anchor"
license = "Apache-2.0" license = "Apache-2.0"
@ -15,4 +15,4 @@ proc-macro2 = "1.0"
quote = "1.0" quote = "1.0"
syn = { version = "1.0.60", features = ["full"] } syn = { version = "1.0.60", features = ["full"] }
anyhow = "1.0.32" anyhow = "1.0.32"
anchor-syn = { path = "../../syn", version = "0.4.3" } anchor-syn = { path = "../../syn", version = "0.4.4" }

View File

@ -1,6 +1,6 @@
[package] [package]
name = "anchor-syn" name = "anchor-syn"
version = "0.4.3" version = "0.4.4"
authors = ["Serum Foundation <foundation@projectserum.com>"] authors = ["Serum Foundation <foundation@projectserum.com>"]
repository = "https://github.com/project-serum/anchor" repository = "https://github.com/project-serum/anchor"
license = "Apache-2.0" license = "Apache-2.0"

View File

@ -1,12 +1,12 @@
[package] [package]
name = "anchor-spl" name = "anchor-spl"
version = "0.4.3" version = "0.4.4"
authors = ["Serum Foundation <foundation@projectserum.com>"] authors = ["Serum Foundation <foundation@projectserum.com>"]
edition = "2018" edition = "2018"
license = "Apache-2.0" license = "Apache-2.0"
description = "CPI clients for SPL programs" description = "CPI clients for SPL programs"
[dependencies] [dependencies]
anchor-lang = { path = "../lang", version = "0.4.3", features = ["derive"] } anchor-lang = { path = "../lang", version = "0.4.4", features = ["derive"] }
spl-token = { version = "3.0.1", features = ["no-entrypoint"] } spl-token = { version = "3.0.1", features = ["no-entrypoint"] }
solana-program = "1.6.6" solana-program = "1.6.6"

View File

@ -1,6 +1,6 @@
{ {
"name": "@project-serum/anchor", "name": "@project-serum/anchor",
"version": "0.4.3", "version": "0.4.4",
"description": "Anchor client", "description": "Anchor client",
"main": "dist/cjs/index.js", "main": "dist/cjs/index.js",
"module": "dist/esm/index.js", "module": "dist/esm/index.js",