Armani Ferrante 4 年 前
コミット
0de345f1a6

+ 4 - 1
CHANGELOG.md

@@ -11,11 +11,14 @@ incremented for features.
 
 ## [Unreleased]
 
+## [0.4.4] - 2021-04-18
+
 ## Features
 
 * 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: 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
 

+ 13 - 13
Cargo.lock

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

+ 1 - 1
cli/Cargo.toml

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

+ 2 - 2
client/Cargo.toml

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

+ 9 - 9
lang/Cargo.toml

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

+ 2 - 2
lang/attribute/access-control/Cargo.toml

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

+ 2 - 2
lang/attribute/account/Cargo.toml

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

+ 20 - 5
lang/attribute/account/src/lib.rs

@@ -20,6 +20,13 @@ use syn::parse_macro_input;
 ///
 /// # 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`
 /// argument to the macro as follows:
 ///
@@ -29,14 +36,22 @@ use syn::parse_macro_input;
 ///
 /// This can be used to conveniently implement
 /// [`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
 /// 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
-/// using borsh, one is limited, since the account has to be copied and
-/// deserialized into a new data structure. With zero copy deserialization,
-/// everything is, effectively, lazy loaded on field access.
+/// When using borsh, the account has to be copied and deserialized into a new
+/// data structure and thus is constrained by stack and heap limits imposed by
+/// the BPF VM. With zero copy deserialization, all bytes from the account's
+/// 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]
 pub fn account(
     args: proc_macro::TokenStream,

+ 2 - 2
lang/attribute/error/Cargo.toml

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

+ 2 - 2
lang/attribute/event/Cargo.toml

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

+ 2 - 2
lang/attribute/interface/Cargo.toml

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

+ 2 - 2
lang/attribute/program/Cargo.toml

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

+ 2 - 2
lang/attribute/state/Cargo.toml

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

+ 2 - 2
lang/derive/accounts/Cargo.toml

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

+ 1 - 1
lang/syn/Cargo.toml

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

+ 2 - 2
spl/Cargo.toml

@@ -1,12 +1,12 @@
 [package]
 name = "anchor-spl"
-version = "0.4.3"
+version = "0.4.4"
 authors = ["Serum Foundation <foundation@projectserum.com>"]
 edition = "2018"
 license = "Apache-2.0"
 description = "CPI clients for SPL programs"
 
 [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"] }
 solana-program = "1.6.6"

+ 1 - 1
ts/package.json

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