|
1 | | -# Version 3.0-rc7 (UNRELEASED) |
| 1 | +# Version 3.0-rc7 |
2 | 2 |
|
3 | 3 | This is the 7th release candidate for ink! 3.0. |
4 | 4 |
|
| 5 | +Since our last release candidate we implemented a number of contract size improvements. |
| 6 | +With those improvements the size of our `erc20` example has reduced significantly: |
| 7 | + |
| 8 | +| | | Release Build with `cargo-contract` | |
| 9 | +|:---------|:------------|:------------------------------------| |
| 10 | +| `erc20` | `3.0.0-rc6` | 29.3 K | |
| 11 | +| `erc20` | `3.0.0-rc7` | 10.4 K | |
| 12 | + |
| 13 | +The savings apply partly to our other examples; for `erc20` they are most |
| 14 | +significant since it has been migrated to use a new [`Mapping`](https://paritytech.github.io/ink/ink_storage/lazy/struct.Mapping.html) |
| 15 | +data structure, which we introduce with this release candidate. |
| 16 | +The other examples will be migrated to this new data structure as a next step. |
| 17 | + |
5 | 18 | ## Removed |
6 | 19 | - Removed the state rent API ‒ [#1036](https://github.com/paritytech/ink/pull/1036). |
7 | 20 |
|
8 | 21 | ## Added |
9 | | -- The ink! codegen now heavily relies on static type information based on traits defined in `ink_lang`. |
| 22 | +- Added support for wildcard selectors ‒ [#1020](https://github.com/paritytech/ink/pull/1020). |
| 23 | + - This enables writing upgradable smart contracts using the proxy/forward pattern. |
| 24 | + We added a new example to illustrate this ‒ the [proxy](https://github.com/paritytech/ink/tree/master/examples/proxy) example. |
| 25 | + - Annotating a wildcard selector in traits is not supported. |
| 26 | +- 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). |
10 | 27 | - Some of those traits and their carried information can be used for static reflection of ink! |
11 | 28 | smart contracts. Those types and traits reside in the new `ink_lang::reflect` module and is |
12 | 29 | publicly usable by ink! smart contract authors. |
13 | | -- Added basic support for wildcard selectors ‒ [#1020](https://github.com/paritytech/ink/pull/1020). |
14 | | - - This enables writing upgradable smart contracts using the proxy pattern. |
15 | | - We added a new example illustrating this ‒ the [proxy](https://github.com/paritytech/ink/tree/master/examples/proxy) example. |
16 | | - - Annotating a wildcard selector in traits is not supported. |
17 | 30 |
|
18 | 31 | ## Changed |
19 | 32 | - Upgraded to the `seal_call` v1 API ‒ [#960](https://github.com/paritytech/ink/pull/960). |
20 | 33 | - This API now enables control over the behavior of cross-contract calls, e.g. to forward/clone input, |
21 | 34 | enable tail calls and control reentrancy. |
22 | 35 | The crate documentation contains more details on the [`CallFlags`](https://paritytech.github.io/ink/ink_env/struct.CallFlags.html). |
23 | 36 | - **Note:** The default behavior of cross-contract calls now disallows reentering the calling contract. |
24 | | -- ink! contract definitions via `#[ink::contract]`: |
25 | | - - ink! smart contracts now generate two contract types. Given `MyContract`: |
| 37 | +- ink! contract definitions via `#[ink::contract]` ‒ [#665](https://github.com/paritytech/ink/pull/665).<br/> |
| 38 | + For ink! smart contracts we now generate two contract types. Given `MyContract`: |
26 | 39 | - `MyContract` will still be the storage struct. |
27 | 40 | However, it can now additionally be used as static dependency in other smart contracts. |
28 | 41 | Static dependencies can be envisioned as being directly embedded into a smart contract. |
29 | 42 | - `MyContractRef` is pretty much the same of what we had gotten with the old `ink-as-dependency`. |
30 | 43 | It is a typed thin-wrapper around an `AccountId` that is mirroring the ink! smart contract's API |
31 | 44 | and implemented traits. |
32 | | -- ink! trait definitions via `#[ink::trait_definition]`: |
| 45 | +- ink! trait definitions via `#[ink::trait_definition]` ‒ [#665](https://github.com/paritytech/ink/pull/665). |
33 | 46 | - ink! trait definitions no longer can define trait constructors. |
34 | 47 | - ink! trait implementations now inherit `selector` and `payable` properties for trait messages. |
35 | 48 | - Now explicitly setting `selector` or `payable` property for an implemented ink! trait method |
36 | 49 | will only act as a guard that the set property is in fact the same as defined by the ink! |
37 | 50 | trait definition. |
38 | | -- Improved some ink! specific compile errors: |
39 | | - - For example, when using ink! messages and constructors that have inputs or |
40 | | - outputs that cannot be encoded or decoded using the SCALE codec. |
41 | | -- Simplified selector computation for ink! trait methods. |
| 51 | +- Improved some ink! specific compile errors ‒ [#665](https://github.com/paritytech/ink/pull/665). |
| 52 | + - For example, when using ink! messages and constructors which have inputs (or |
| 53 | + outputs) that cannot be encoded (or decoded) using the SCALE codec. |
| 54 | +- Simplified selector computation for ink! trait methods ‒ [#665](https://github.com/paritytech/ink/pull/665). |
42 | 55 | - Now selectors are encoded as `blake2b({namespace}::{trait_identifier}::{message_identifier})[0..4]`. |
43 | 56 | If no `namespace` is set for the ink! trait definition then the formula is |
44 | 57 | `blake2b({trait_identifier}::{message_identifier})[0..4]`. |
45 | 58 | Where `trait_identifier` and `message_identifier` both refer to the identifiers of the ink! trait |
46 | 59 | definition and ink! trait message respectively. |
| 60 | +- We switched to Rust edition 2021 ‒ [#977](https://github.com/paritytech/ink/pull/977). |
| 61 | +- Update chain extension example to show argument passing ‒ [#1029](https://github.com/paritytech/ink/pull/1029). |
47 | 62 |
|
48 | 63 | ## Fixed |
49 | | -- Contracts that are compiled as root (the default) now properly revert the transaction if a message |
50 | | - returned `Result::Err`. |
51 | | - - 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. |
| 64 | +- 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). |
| 65 | + - It is still possible to match against a `Result` return type for a called dependency contract |
| 66 | + ‒ i.e. a sub-contract specified in the contract's `Cargo.toml`. |
| 67 | +- We implemented a number of Wasm contract size improvements: |
| 68 | + - Simple Mapping Storage Primitive ‒ [#946](https://github.com/paritytech/ink/pull/946). |
| 69 | + - 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)). |
| 70 | + - Add a way to allocate a storage facility using spread (and packed) layouts ‒ [#978](https://github.com/paritytech/ink/pull/978). |
| 71 | + - Extract non-generic part of `push_topic` to reduce code size ‒ [#1026](https://github.com/paritytech/ink/pull/1026). |
52 | 72 |
|
53 | 73 | # Version 3.0-rc6 |
54 | 74 |
|
|
0 commit comments