Skip to content

Commit

Permalink
Release ink! 3.0.0-rc7 (#1043)
Browse files Browse the repository at this point in the history
* Bump `3.0.0-rc6` ➔ `3.0.0-rc7`

* Update release notes

* Update release notes

* Remove outdated changelog note
  • Loading branch information
Michael Müller authored Nov 25, 2021
1 parent 71a2c38 commit 6cde90c
Show file tree
Hide file tree
Showing 32 changed files with 201 additions and 181 deletions.
52 changes: 36 additions & 16 deletions RELEASES.md
Original file line number Diff line number Diff line change
@@ -1,54 +1,74 @@
# Version 3.0-rc7 (UNRELEASED)
# Version 3.0-rc7

This is the 7th release candidate for ink! 3.0.

Since our last release candidate we implemented a number of contract size improvements.
With those improvements the size of our `erc20` example has reduced significantly:

| | | Release Build with `cargo-contract` |
|:---------|:------------|:------------------------------------|
| `erc20` | `3.0.0-rc6` | 29.3 K |
| `erc20` | `3.0.0-rc7` | 10.4 K |

The savings apply partly to our other examples; for `erc20` they are most
significant since it has been migrated to use a new [`Mapping`](https://paritytech.github.io/ink/ink_storage/lazy/struct.Mapping.html)
data structure, which we introduce with this release candidate.
The other examples will be migrated to this new data structure as a next step.

## Removed
- Removed the state rent API ‒ [#1036](https://github.com/paritytech/ink/pull/1036).

## Added
- The ink! codegen now heavily relies on static type information based on traits defined in `ink_lang`.
- Added support for wildcard selectors ‒ [#1020](https://github.com/paritytech/ink/pull/1020).
- This enables writing upgradable smart contracts using the proxy/forward pattern.
We added a new example to illustrate this ‒ the [proxy](https://github.com/paritytech/ink/tree/master/examples/proxy) example.
- Annotating a wildcard selector in traits is not supported.
- The ink! codegen now heavily relies on static type information based on traits defined in `ink_lang`[#665](https://github.com/paritytech/ink/pull/665).
- Some of those traits and their carried information can be used for static reflection of ink!
smart contracts. Those types and traits reside in the new `ink_lang::reflect` module and is
publicly usable by ink! smart contract authors.
- Added basic support for wildcard selectors ‒ [#1020](https://github.com/paritytech/ink/pull/1020).
- This enables writing upgradable smart contracts using the proxy pattern.
We added a new example illustrating this ‒ the [proxy](https://github.com/paritytech/ink/tree/master/examples/proxy) example.
- Annotating a wildcard selector in traits is not supported.

## Changed
- Upgraded to the `seal_call` v1 API ‒ [#960](https://github.com/paritytech/ink/pull/960).
- This API now enables control over the behavior of cross-contract calls, e.g. to forward/clone input,
enable tail calls and control reentrancy.
The crate documentation contains more details on the [`CallFlags`](https://paritytech.github.io/ink/ink_env/struct.CallFlags.html).
- **Note:** The default behavior of cross-contract calls now disallows reentering the calling contract.
- ink! contract definitions via `#[ink::contract]`:
- ink! smart contracts now generate two contract types. Given `MyContract`:
- ink! contract definitions via `#[ink::contract]`[#665](https://github.com/paritytech/ink/pull/665).<br/>
For ink! smart contracts we now generate two contract types. Given `MyContract`:
- `MyContract` will still be the storage struct.
However, it can now additionally be used as static dependency in other smart contracts.
Static dependencies can be envisioned as being directly embedded into a smart contract.
- `MyContractRef` is pretty much the same of what we had gotten with the old `ink-as-dependency`.
It is a typed thin-wrapper around an `AccountId` that is mirroring the ink! smart contract's API
and implemented traits.
- ink! trait definitions via `#[ink::trait_definition]`:
- ink! trait definitions via `#[ink::trait_definition]`[#665](https://github.com/paritytech/ink/pull/665).
- ink! trait definitions no longer can define trait constructors.
- ink! trait implementations now inherit `selector` and `payable` properties for trait messages.
- Now explicitly setting `selector` or `payable` property for an implemented ink! trait method
will only act as a guard that the set property is in fact the same as defined by the ink!
trait definition.
- Improved some ink! specific compile errors:
- For example, when using ink! messages and constructors that have inputs or
outputs that cannot be encoded or decoded using the SCALE codec.
- Simplified selector computation for ink! trait methods.
- Improved some ink! specific compile errors[#665](https://github.com/paritytech/ink/pull/665).
- For example, when using ink! messages and constructors which have inputs (or
outputs) that cannot be encoded (or decoded) using the SCALE codec.
- Simplified selector computation for ink! trait methods[#665](https://github.com/paritytech/ink/pull/665).
- Now selectors are encoded as `blake2b({namespace}::{trait_identifier}::{message_identifier})[0..4]`.
If no `namespace` is set for the ink! trait definition then the formula is
`blake2b({trait_identifier}::{message_identifier})[0..4]`.
Where `trait_identifier` and `message_identifier` both refer to the identifiers of the ink! trait
definition and ink! trait message respectively.
- We switched to Rust edition 2021 ‒ [#977](https://github.com/paritytech/ink/pull/977).
- Update chain extension example to show argument passing ‒ [#1029](https://github.com/paritytech/ink/pull/1029).

## Fixed
- Contracts that are compiled as root (the default) now properly revert the transaction if a message
returned `Result::Err`.
- This does not apply to ink! smart contracts that are used as dependencies. Therefore it is still possible to match against a result return type for a called dependency.
- Contracts now revert the transaction if an ink! message returns `Result::Err`[#975](https://github.com/paritytech/ink/pull/975), [#998](https://github.com/paritytech/ink/pull/998).
- It is still possible to match against a `Result` return type for a called dependency contract
‒ i.e. a sub-contract specified in the contract's `Cargo.toml`.
- We implemented a number of Wasm contract size improvements:
- Simple Mapping Storage Primitive ‒ [#946](https://github.com/paritytech/ink/pull/946).
- Remove `always` from `inline` to allow compiler decide that to do ‒ [#1012](https://github.com/paritytech/ink/pull/1012) (thanks [@xgreenx](https://github.com/xgreenx)).
- Add a way to allocate a storage facility using spread (and packed) layouts ‒ [#978](https://github.com/paritytech/ink/pull/978).
- Extract non-generic part of `push_topic` to reduce code size ‒ [#1026](https://github.com/paritytech/ink/pull/1026).

# Version 3.0-rc6

Expand Down
2 changes: 1 addition & 1 deletion crates/allocator/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "ink_allocator"
version = "3.0.0-rc6"
version = "3.0.0-rc7"
authors = ["Parity Technologies <[email protected]>", "Robin Freyler <[email protected]>"]
edition = "2021"

Expand Down
2 changes: 1 addition & 1 deletion crates/engine/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "ink_engine"
version = "3.0.0-rc6"
version = "3.0.0-rc7"
authors = ["Parity Technologies <[email protected]>", "Michael Müller <[email protected]>"]
edition = "2021"

Expand Down
12 changes: 6 additions & 6 deletions crates/env/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "ink_env"
version = "3.0.0-rc6"
version = "3.0.0-rc7"
authors = ["Parity Technologies <[email protected]>", "Robin Freyler <[email protected]>"]
edition = "2021"

Expand All @@ -15,10 +15,10 @@ categories = ["no-std", "embedded"]
include = ["Cargo.toml", "src/**/*.rs", "README.md", "LICENSE"]

[dependencies]
ink_metadata = { version = "3.0.0-rc6", path = "../metadata/", default-features = false, features = ["derive"], optional = true }
ink_allocator = { version = "3.0.0-rc6", path = "../allocator/", default-features = false }
ink_primitives = { version = "3.0.0-rc6", path = "../primitives/", default-features = false }
ink_prelude = { version = "3.0.0-rc6", path = "../prelude/", default-features = false }
ink_metadata = { version = "3.0.0-rc7", path = "../metadata/", default-features = false, features = ["derive"], optional = true }
ink_allocator = { version = "3.0.0-rc7", path = "../allocator/", default-features = false }
ink_primitives = { version = "3.0.0-rc7", path = "../primitives/", default-features = false }
ink_prelude = { version = "3.0.0-rc7", path = "../prelude/", default-features = false }

scale = { package = "parity-scale-codec", version = "2.3", default-features = false, features = ["derive", "full"] }
derive_more = { version = "0.99", default-features = false, features = ["from", "display"] }
Expand All @@ -32,7 +32,7 @@ static_assertions = "1.1"
libsecp256k1 = { version = "0.7.0", default-features = false }

[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
ink_engine = { version = "3.0.0-rc6", path = "../engine/", default-features = false, optional = true }
ink_engine = { version = "3.0.0-rc7", path = "../engine/", default-features = false, optional = true }

# Hashes for the off-chain environment.
sha2 = { version = "0.9", optional = true }
Expand Down
4 changes: 2 additions & 2 deletions crates/eth_compatibility/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "ink_eth_compatibility"
version = "3.0.0-rc6"
version = "3.0.0-rc7"
authors = ["Parity Technologies <[email protected]>"]
edition = "2021"

Expand All @@ -15,7 +15,7 @@ categories = ["no-std", "embedded"]
include = ["Cargo.toml", "src/**/*.rs", "/README.md", "/LICENSE"]

[dependencies]
ink_env = { version = "3.0.0-rc6", path = "../env", default-features = false }
ink_env = { version = "3.0.0-rc7", path = "../env", default-features = false }
libsecp256k1 = { version = "0.7.0", default-features = false }

[features]
Expand Down
20 changes: 10 additions & 10 deletions crates/lang/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "ink_lang"
version = "3.0.0-rc6"
version = "3.0.0-rc7"
authors = ["Parity Technologies <[email protected]>", "Robin Freyler <[email protected]>"]
edition = "2021"

Expand All @@ -15,20 +15,20 @@ categories = ["no-std", "embedded"]
include = ["Cargo.toml", "src/**/*.rs", "README.md", "LICENSE"]

[dependencies]
ink_env = { version = "3.0.0-rc6", path = "../env", default-features = false }
ink_storage = { version = "3.0.0-rc6", path = "../storage", default-features = false }
ink_primitives = { version = "3.0.0-rc6", path = "../primitives", default-features = false }
ink_metadata = { version = "3.0.0-rc6", path = "../metadata", default-features = false, optional = true }
ink_prelude = { version = "3.0.0-rc6", path = "../prelude", default-features = false }
ink_eth_compatibility = { version = "3.0.0-rc6", path = "../eth_compatibility", default-features = false }
ink_lang_macro = { version = "3.0.0-rc6", path = "macro", default-features = false }
ink_env = { version = "3.0.0-rc7", path = "../env", default-features = false }
ink_storage = { version = "3.0.0-rc7", path = "../storage", default-features = false }
ink_primitives = { version = "3.0.0-rc7", path = "../primitives", default-features = false }
ink_metadata = { version = "3.0.0-rc7", path = "../metadata", default-features = false, optional = true }
ink_prelude = { version = "3.0.0-rc7", path = "../prelude", default-features = false }
ink_eth_compatibility = { version = "3.0.0-rc7", path = "../eth_compatibility", default-features = false }
ink_lang_macro = { version = "3.0.0-rc7", path = "macro", default-features = false }

scale = { package = "parity-scale-codec", version = "2.3", default-features = false, features = ["derive", "full"] }
derive_more = { version = "0.99", default-features = false, features = ["from"] }

[dev-dependencies]
ink_lang_ir = { version = "3.0.0-rc6", path = "ir" }
ink_metadata = { version = "3.0.0-rc6", default-features = false, path = "../metadata" }
ink_lang_ir = { version = "3.0.0-rc7", path = "ir" }
ink_metadata = { version = "3.0.0-rc7", default-features = false, path = "../metadata" }

trybuild = { version = "1.0.52", features = ["diff"] }
# Required for the doctest of `env_access::EnvAccess::instantiate_contract`
Expand Down
4 changes: 2 additions & 2 deletions crates/lang/codegen/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "ink_lang_codegen"
version = "3.0.0-rc6"
version = "3.0.0-rc7"
authors = ["Parity Technologies <[email protected]>", "Robin Freyler <[email protected]>"]
edition = "2021"

Expand All @@ -18,7 +18,7 @@ include = ["Cargo.toml", "src/**/*.rs", "README.md", "LICENSE"]
name = "ink_lang_codegen"

[dependencies]
ir = { version = "3.0.0-rc6", package = "ink_lang_ir", path = "../ir", default-features = false }
ir = { version = "3.0.0-rc7", package = "ink_lang_ir", path = "../ir", default-features = false }
quote = "1"
syn = { version = "1.0", features = ["parsing", "full", "extra-traits"] }
proc-macro2 = "1.0"
Expand Down
2 changes: 1 addition & 1 deletion crates/lang/ir/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "ink_lang_ir"
version = "3.0.0-rc6"
version = "3.0.0-rc7"
authors = ["Parity Technologies <[email protected]>", "Robin Freyler <[email protected]>"]
edition = "2021"

Expand Down
16 changes: 8 additions & 8 deletions crates/lang/macro/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "ink_lang_macro"
version = "3.0.0-rc6"
version = "3.0.0-rc7"
authors = ["Parity Technologies <[email protected]>", "Robin Freyler <[email protected]>"]
edition = "2021"

Expand All @@ -15,19 +15,19 @@ categories = ["no-std", "embedded"]
include = ["Cargo.toml", "src/**/*.rs", "README.md", "LICENSE"]

[dependencies]
ink_lang_ir = { version = "3.0.0-rc6", path = "../ir", default-features = false }
ink_lang_codegen = { version = "3.0.0-rc6", path = "../codegen", default-features = false }
ink_primitives = { version = "3.0.0-rc6", path = "../../primitives/", default-features = false }
ink_lang_ir = { version = "3.0.0-rc7", path = "../ir", default-features = false }
ink_lang_codegen = { version = "3.0.0-rc7", path = "../codegen", default-features = false }
ink_primitives = { version = "3.0.0-rc7", path = "../../primitives/", default-features = false }

scale = { package = "parity-scale-codec", version = "2.3", default-features = false, features = ["derive"] }
syn = "1"
proc-macro2 = "1"

[dev-dependencies]
ink_metadata = { version = "3.0.0-rc6", path = "../../metadata/" }
ink_env = { version = "3.0.0-rc6", path = "../../env/" }
ink_storage = { version = "3.0.0-rc6", path = "../../storage/" }
ink_lang = { version = "3.0.0-rc6", path = ".." }
ink_metadata = { version = "3.0.0-rc7", path = "../../metadata/" }
ink_env = { version = "3.0.0-rc7", path = "../../env/" }
ink_storage = { version = "3.0.0-rc7", path = "../../storage/" }
ink_lang = { version = "3.0.0-rc7", path = ".." }
scale-info = { version = "1.0", default-features = false, features = ["derive"] }

[lib]
Expand Down
6 changes: 3 additions & 3 deletions crates/metadata/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "ink_metadata"
version = "3.0.0-rc6"
version = "3.0.0-rc7"
authors = ["Parity Technologies <[email protected]>", "Robin Freyler <[email protected]>"]
edition = "2021"

Expand All @@ -15,8 +15,8 @@ categories = ["no-std", "embedded"]
include = ["Cargo.toml", "src/**/*.rs", "README.md", "LICENSE"]

[dependencies]
ink_prelude = { version = "3.0.0-rc6", path = "../prelude/", default-features = false }
ink_primitives = { version = "3.0.0-rc6", path = "../primitives/", default-features = false }
ink_prelude = { version = "3.0.0-rc7", path = "../prelude/", default-features = false }
ink_primitives = { version = "3.0.0-rc7", path = "../primitives/", default-features = false }

serde = { version = "1.0", default-features = false, features = ["derive", "alloc"] }
impl-serde = "0.3.1"
Expand Down
2 changes: 1 addition & 1 deletion crates/prelude/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "ink_prelude"
version = "3.0.0-rc6"
version = "3.0.0-rc7"
authors = ["Parity Technologies <[email protected]>", "Robin Freyler <[email protected]>"]
edition = "2021"

Expand Down
4 changes: 2 additions & 2 deletions crates/primitives/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "ink_primitives"
version = "3.0.0-rc6"
version = "3.0.0-rc7"
authors = ["Parity Technologies <[email protected]>", "Robin Freyler <[email protected]>"]
edition = "2021"

Expand All @@ -15,7 +15,7 @@ categories = ["no-std", "embedded"]
include = ["/Cargo.toml", "src/**/*.rs", "/README.md", "/LICENSE"]

[dependencies]
ink_prelude = { version = "3.0.0-rc6", path = "../prelude/", default-features = false }
ink_prelude = { version = "3.0.0-rc7", path = "../prelude/", default-features = false }
scale = { package = "parity-scale-codec", version = "2.3", default-features = false, features = ["derive", "full"] }
scale-info = { version = "1.0", default-features = false, features = ["derive"], optional = true }
cfg-if = "1"
Expand Down
12 changes: 6 additions & 6 deletions crates/storage/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "ink_storage"
version = "3.0.0-rc6"
version = "3.0.0-rc7"
authors = ["Parity Technologies <[email protected]>", "Robin Freyler <[email protected]>"]
edition = "2021"

Expand All @@ -15,11 +15,11 @@ categories = ["no-std", "embedded"]
include = ["Cargo.toml", "src/**/*.rs", "README.md", "LICENSE"]

[dependencies]
ink_env = { version = "3.0.0-rc6", path = "../env/", default-features = false }
ink_metadata = { version = "3.0.0-rc6", path = "../metadata/", default-features = false, features = ["derive"], optional = true }
ink_primitives = { version = "3.0.0-rc6", path = "../primitives/", default-features = false }
ink_storage_derive = { version = "3.0.0-rc6", path = "derive", default-features = false }
ink_prelude = { version = "3.0.0-rc6", path = "../prelude/", default-features = false }
ink_env = { version = "3.0.0-rc7", path = "../env/", default-features = false }
ink_metadata = { version = "3.0.0-rc7", path = "../metadata/", default-features = false, features = ["derive"], optional = true }
ink_primitives = { version = "3.0.0-rc7", path = "../primitives/", default-features = false }
ink_storage_derive = { version = "3.0.0-rc7", path = "derive", default-features = false }
ink_prelude = { version = "3.0.0-rc7", path = "../prelude/", default-features = false }

scale = { package = "parity-scale-codec", version = "2.3", default-features = false, features = ["derive", "full"] }
derive_more = { version = "0.99", default-features = false, features = ["from", "display"] }
Expand Down
12 changes: 6 additions & 6 deletions crates/storage/derive/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "ink_storage_derive"
version = "3.0.0-rc6"
version = "3.0.0-rc7"
authors = ["Parity Technologies <[email protected]>", "Robin Freyler <[email protected]>"]
edition = "2021"

Expand All @@ -25,8 +25,8 @@ synstructure = "0.12.4"

[dev-dependencies]
scale = { package = "parity-scale-codec", version = "2.3", default-features = false, features = ["derive", "full"] }
ink_env = { version = "3.0.0-rc6", path = "../../env" }
ink_primitives = { version = "3.0.0-rc6", path = "../../primitives" }
ink_metadata = { version = "3.0.0-rc6", path = "../../metadata" }
ink_prelude = { version = "3.0.0-rc6", path = "../../prelude/" }
ink_storage = { version = "3.0.0-rc6", path = ".." }
ink_env = { version = "3.0.0-rc7", path = "../../env" }
ink_primitives = { version = "3.0.0-rc7", path = "../../primitives" }
ink_metadata = { version = "3.0.0-rc7", path = "../../metadata" }
ink_prelude = { version = "3.0.0-rc7", path = "../../prelude/" }
ink_storage = { version = "3.0.0-rc7", path = ".." }
12 changes: 6 additions & 6 deletions examples/contract-terminate/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
[package]
name = "contract_terminate"
version = "3.0.0-rc6"
version = "3.0.0-rc7"
authors = ["Parity Technologies <[email protected]>"]
edition = "2021"

[dependencies]
ink_primitives = { version = "3.0.0-rc6", path = "../../crates/primitives", default-features = false }
ink_metadata = { version = "3.0.0-rc6", path = "../../crates/metadata", default-features = false, features = ["derive"], optional = true }
ink_env = { version = "3.0.0-rc6", path = "../../crates/env", default-features = false }
ink_storage = { version = "3.0.0-rc6", path = "../../crates/storage", default-features = false }
ink_lang = { version = "3.0.0-rc6", path = "../../crates/lang", default-features = false }
ink_primitives = { version = "3.0.0-rc7", path = "../../crates/primitives", default-features = false }
ink_metadata = { version = "3.0.0-rc7", path = "../../crates/metadata", default-features = false, features = ["derive"], optional = true }
ink_env = { version = "3.0.0-rc7", path = "../../crates/env", default-features = false }
ink_storage = { version = "3.0.0-rc7", path = "../../crates/storage", default-features = false }
ink_lang = { version = "3.0.0-rc7", path = "../../crates/lang", default-features = false }

scale = { package = "parity-scale-codec", version = "2", default-features = false, features = ["derive"] }
scale-info = { version = "1", default-features = false, features = ["derive"], optional = true }
Expand Down
Loading

0 comments on commit 6cde90c

Please sign in to comment.