diff --git a/CHANGELOG.md b/CHANGELOG.md index 587340459..5270084e3 100644 --- a/CHANGELOG.md +++ b/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 diff --git a/Cargo.lock b/Cargo.lock index 619f99cb7..efbaa1c4b 100644 --- a/Cargo.lock +++ b/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", diff --git a/cli/Cargo.toml b/cli/Cargo.toml index 66705a8fe..707020720 100644 --- a/cli/Cargo.toml +++ b/cli/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "anchor-cli" -version = "0.4.3" +version = "0.4.4" authors = ["armaniferrante "] edition = "2018" diff --git a/client/Cargo.toml b/client/Cargo.toml index 568af7c75..3db35f1b9 100644 --- a/client/Cargo.toml +++ b/client/Cargo.toml @@ -1,13 +1,13 @@ [package] name = "anchor-client" -version = "0.4.3" +version = "0.4.4" authors = ["Serum Foundation "] 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" diff --git a/lang/Cargo.toml b/lang/Cargo.toml index d346631ea..3adf7150a 100644 --- a/lang/Cargo.toml +++ b/lang/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "anchor-lang" -version = "0.4.3" +version = "0.4.4" authors = ["Serum Foundation "] 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" diff --git a/lang/attribute/access-control/Cargo.toml b/lang/attribute/access-control/Cargo.toml index 1c57715bc..aba66fdc2 100644 --- a/lang/attribute/access-control/Cargo.toml +++ b/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 "] 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" diff --git a/lang/attribute/account/Cargo.toml b/lang/attribute/account/Cargo.toml index f02706520..b394ba860 100644 --- a/lang/attribute/account/Cargo.toml +++ b/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 "] 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"] } diff --git a/lang/attribute/account/src/lib.rs b/lang/attribute/account/src/lib.rs index dca0b92a9..3e81199e8 100644 --- a/lang/attribute/account/src/lib.rs +++ b/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, diff --git a/lang/attribute/error/Cargo.toml b/lang/attribute/error/Cargo.toml index 1bccdb6cf..b382e2281 100644 --- a/lang/attribute/error/Cargo.toml +++ b/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 "] 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" } \ No newline at end of file +anchor-syn = { path = "../../syn", version = "0.4.4" } \ No newline at end of file diff --git a/lang/attribute/event/Cargo.toml b/lang/attribute/event/Cargo.toml index 17215a398..6e9da8564 100644 --- a/lang/attribute/event/Cargo.toml +++ b/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 "] 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"] } diff --git a/lang/attribute/interface/Cargo.toml b/lang/attribute/interface/Cargo.toml index 3aa139327..0b604c4f0 100644 --- a/lang/attribute/interface/Cargo.toml +++ b/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 "] 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" diff --git a/lang/attribute/program/Cargo.toml b/lang/attribute/program/Cargo.toml index 20231f78e..08c326e46 100644 --- a/lang/attribute/program/Cargo.toml +++ b/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 "] 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" } diff --git a/lang/attribute/state/Cargo.toml b/lang/attribute/state/Cargo.toml index 2c0842643..60411a379 100644 --- a/lang/attribute/state/Cargo.toml +++ b/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 "] 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" } diff --git a/lang/derive/accounts/Cargo.toml b/lang/derive/accounts/Cargo.toml index 621010da2..3f3893448 100644 --- a/lang/derive/accounts/Cargo.toml +++ b/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 "] 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" } diff --git a/lang/syn/Cargo.toml b/lang/syn/Cargo.toml index bf2514608..ae4045842 100644 --- a/lang/syn/Cargo.toml +++ b/lang/syn/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "anchor-syn" -version = "0.4.3" +version = "0.4.4" authors = ["Serum Foundation "] repository = "https://github.com/project-serum/anchor" license = "Apache-2.0" diff --git a/spl/Cargo.toml b/spl/Cargo.toml index 520c54677..dbce6db3a 100644 --- a/spl/Cargo.toml +++ b/spl/Cargo.toml @@ -1,12 +1,12 @@ [package] name = "anchor-spl" -version = "0.4.3" +version = "0.4.4" authors = ["Serum Foundation "] 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" diff --git a/ts/package.json b/ts/package.json index 38d6f111e..b0c1e7f37 100644 --- a/ts/package.json +++ b/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",