Skip to content

Commit 03474e5

Browse files
ascjonesHCastano
andauthored
Release v4.0.0-beta (use-ink#1508)
* Bump version * WIP update CHANGELOG.md * Fill out section regarding `LangError`s * Mention E2E testing * Add some compatiblity notes * Remove E2E tests from release Looks like we need to wait on a `smart-bench` release to be published before we can publish the E2E testing crate. Co-authored-by: Hernando Castano <hernando@hcastano.com>
1 parent 7618ec0 commit 03474e5

File tree

44 files changed

+137
-82
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+137
-82
lines changed

CHANGELOG.md

+59-6
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,66 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

7-
## [Unreleased]
8-
- Allows to use `Result<Self, Error>` as a return type in constructors - [#1446](https://github.com/paritytech/ink/pull/1446)
9-
- Checks if `#[ink_e2e::test(ws_url = "…")]` is reachable and throws meaningful error otherwise - [#1490](https://github.com/paritytech/ink/pull/1490)
10-
- Fix E2E dry-run for `Mapping::insert()` - [#1494](https://github.com/paritytech/ink/pull/1494)
7+
## Unreleased
8+
- Add E2E testing framework MVP ‒ [#1395](https://github.com/paritytech/ink/pull/1395)
9+
10+
## Version 4.0.0-beta
11+
12+
The focus of the first `beta` release is to establish the stable ABI for the final `4.0.0`
13+
release. It means that whilst subsequent `beta` releases may contain breaking contract
14+
*code* changes, the ABI will remain the same so that any contract compiled and deployed
15+
with `4.0.0-beta` continue to be compatible with all future `4.0.0` versions.
16+
17+
### Compatibility
18+
In order to build contracts which use ink! `v4.0.0-beta` you need to use
19+
`cargo-contract`
20+
[`v2.0.0-beta`](https://github.com/paritytech/cargo-contract/releases/tag/v2.0.0-beta).
21+
You can install it as follows:
22+
23+
`cargo install cargo-contract --version 2.0.0-beta`
24+
25+
You will also need to use a version of [`pallet-contracts`](https://github.com/paritytech/substrate/tree/master/frame/contracts)
26+
later than [265e3f1](https://github.com/paritytech/substrate/commit/265e3f12a2937fe4f71280b3652471627609d04f)
27+
(Nov 3, 2022) in your node.
28+
29+
The [`v0.22.1`](https://github.com/paritytech/substrate-contracts-node/releases/tag/v0.22.1)
30+
release of the [`substrate-contracts-node`](https://github.com/paritytech/substrate-contracts-node) is
31+
compatible with the ink! `4.0.0-beta` release.
1132

1233
### Breaking Changes
1334

35+
## Constructors and Messages now return `LangError`s
36+
37+
We have added a way to handle errors that are neither specific to a particular contract,
38+
nor from the underlying execution environment (e.g `pallet-contracts`). Instead these are
39+
errors that may come from the smart contracting language itself.
40+
41+
For example, take the case where a contract message is called using an invalid selector.
42+
This is not something a smart contract author should need to define as failure case, nor
43+
is it something that the Contracts pallet needs to be aware of.
44+
45+
Previously, the contract execution would trap if an invalid selector was used, leaving
46+
callers with no way to handle the error gracefully. This can now be handled with the help
47+
of the newly added `LangError`.
48+
49+
In short, this change means that all ink! messages and constructors now return a
50+
`Result<R, LangError>`, where `R` is the original return type. Contract callers can
51+
choose to handle the `LangError`.
52+
53+
In order to make this error compatible with other languages we have also added a
54+
`lang_error` field to the metadata format. This will be the central registry of all the
55+
different error variants which languages may want to emit in the future.
56+
57+
Related pull-requests:
58+
- https://github.com/paritytech/ink/pull/1450
59+
- https://github.com/paritytech/ink/pull/1504
60+
61+
Related discussions:
62+
- https://github.com/paritytech/ink/issues/1207
63+
- https://github.com/paritytech/substrate/issues/11018
64+
- https://github.com/paritytech/ink/issues/1002
65+
66+
## Random function removed
1467
We had to remove [`ink_env::random`](https://docs.rs/ink_env/3.3.1/ink_env/fn.random.html)
1568
with [#1442](https://github.com/paritytech/ink/pull/1442).
1669
This function allowed contract developers getting random entropy.
@@ -28,11 +81,11 @@ protocol for future versions of Polkadot.
2881

2982
### Added
3083
- Allow using `Result<Self, Error>` as a return type in constructors ‒ [#1446](https://github.com/paritytech/ink/pull/1446)
31-
- Introduce conditional compilation for messages, constructors and events ‒ [#1458](https://github.com/paritytech/ink/pull/1458)
3284
- Add `Mapping::take()` function allowing to get a value removing it from storage ‒ [#1461](https://github.com/paritytech/ink/pull/1461)
3385

34-
3586
### Changed
87+
- Add support for language level errors (`LangError`) ‒ [#1450](https://github.com/paritytech/ink/pull/1450)
88+
- Return `LangError`s from constructors ‒ [#1504](https://github.com/paritytech/ink/pull/1504)
3689
- Update `scale-info` requirement to `2.3`[#1467](https://github.com/paritytech/ink/pull/1467)
3790
- Merge `Mapping::insert(key, val)` and `Mapping::insert_return_size(key, val)` into one method - [#1463](https://github.com/paritytech/ink/pull/1463)
3891

crates/allocator/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "ink_allocator"
3-
version = "4.0.0-alpha.3"
3+
version = "4.0.0-beta"
44
authors = ["Parity Technologies <admin@parity.io>", "Robin Freyler <robin@parity.io>"]
55
edition = "2021"
66

crates/e2e/Cargo.toml

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
[package]
22
name = "ink_e2e"
3-
version = "4.0.0-alpha.3"
3+
version = "4.0.0-beta"
44
authors = ["Parity Technologies <admin@parity.io>"]
55
edition = "2021"
6+
publish = false
67

78
license = "Apache-2.0"
89
readme = "README.md"
@@ -15,8 +16,8 @@ categories = ["no-std", "embedded"]
1516
include = ["/Cargo.toml", "src/**/*.rs", "/README.md", "/LICENSE"]
1617

1718
[dependencies]
18-
ink_e2e_macro = { version = "4.0.0-alpha.3", path = "./macro" }
19-
ink_env = { version = "4.0.0-alpha.3", path = "../env" }
19+
ink_e2e_macro = { version = "4.0.0-beta", path = "./macro" }
20+
ink_env = { version = "4.0.0-beta", path = "../env" }
2021

2122
contract-metadata = { version = "2.0.0-alpha.4" }
2223
impl-serde = { version = "0.3.1", default-features = false }

crates/e2e/macro/Cargo.toml

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
[package]
22
name = "ink_e2e_macro"
3-
version = "4.0.0-alpha.3"
3+
version = "4.0.0-beta"
44
authors = ["Parity Technologies <admin@parity.io>"]
55
edition = "2021"
6+
publish = false
67

78
license = "Apache-2.0"
8-
readme = "README.md"
9+
readme = "../README.md"
910
repository = "https://github.com/paritytech/ink"
1011
documentation = "https://docs.rs/ink_macro/"
1112
homepage = "https://www.parity.io/"
@@ -19,7 +20,7 @@ name = "ink_e2e_macro"
1920
proc-macro = true
2021

2122
[dependencies]
22-
ink_ir = { version = "4.0.0-alpha.3", path = "../../ink/ir" }
23+
ink_ir = { version = "4.0.0-beta", path = "../../ink/ir" }
2324
derive_more = "0.99.17"
2425
env_logger = "0.9.1"
2526
log = "0.4.17"

crates/engine/Cargo.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "ink_engine"
3-
version = "4.0.0-alpha.3"
3+
version = "4.0.0-beta"
44
authors = ["Parity Technologies <admin@parity.io>", "Michael Müller <michi@parity.io>"]
55
edition = "2021"
66

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

1717
[dependencies]
18-
ink_primitives = { version = "4.0.0-alpha.3", path = "../../crates/primitives", default-features = false }
18+
ink_primitives = { version = "4.0.0-beta", path = "../../crates/primitives", default-features = false }
1919
scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive", "full"] }
2020
derive_more = { version = "0.99", default-features = false, features = ["from", "display"] }
2121

crates/env/Cargo.toml

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "ink_env"
3-
version = "4.0.0-alpha.3"
3+
version = "4.0.0-beta"
44
authors = ["Parity Technologies <admin@parity.io>", "Robin Freyler <robin@parity.io>"]
55
edition = "2021"
66

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

1717
[dependencies]
18-
ink_metadata = { version = "4.0.0-alpha.3", path = "../metadata", default-features = false, features = ["derive"], optional = true }
19-
ink_allocator = { version = "4.0.0-alpha.3", path = "../allocator", default-features = false }
20-
ink_storage_traits = { version = "4.0.0-alpha.3", path = "../storage/traits", default-features = false }
21-
ink_prelude = { version = "4.0.0-alpha.3", path = "../prelude", default-features = false }
22-
ink_primitives = { version = "4.0.0-alpha.3", path = "../primitives", default-features = false }
18+
ink_metadata = { version = "4.0.0-beta", path = "../metadata", default-features = false, features = ["derive"], optional = true }
19+
ink_allocator = { version = "4.0.0-beta", path = "../allocator", default-features = false }
20+
ink_storage_traits = { version = "4.0.0-beta", path = "../storage/traits", default-features = false }
21+
ink_prelude = { version = "4.0.0-beta", path = "../prelude", default-features = false }
22+
ink_primitives = { version = "4.0.0-beta", path = "../primitives", default-features = false }
2323

2424
scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive", "full"] }
2525
derive_more = { version = "0.99", default-features = false, features = ["from", "display"] }
@@ -33,7 +33,7 @@ static_assertions = "1.1"
3333
rlibc = "1"
3434

3535
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
36-
ink_engine = { version = "4.0.0-alpha.3", path = "../engine/", optional = true }
36+
ink_engine = { version = "4.0.0-beta", path = "../engine/", optional = true }
3737

3838
# Hashes for the off-chain environment.
3939
sha2 = { version = "0.10", optional = true }

crates/ink/Cargo.toml

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "ink"
3-
version = "4.0.0-alpha.3"
3+
version = "4.0.0-beta"
44
authors = ["Parity Technologies <admin@parity.io>", "Robin Freyler <robin@parity.io>"]
55
edition = "2021"
66

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

1717
[dependencies]
18-
ink_env = { version = "4.0.0-alpha.3", path = "../env", default-features = false }
19-
ink_storage = { version = "4.0.0-alpha.3", path = "../storage", default-features = false }
20-
ink_primitives = { version = "4.0.0-alpha.3", path = "../primitives", default-features = false }
21-
ink_metadata = { version = "4.0.0-alpha.3", path = "../metadata", default-features = false, optional = true }
22-
ink_prelude = { version = "4.0.0-alpha.3", path = "../prelude", default-features = false }
23-
ink_macro = { version = "4.0.0-alpha.3", path = "macro", default-features = false }
18+
ink_env = { version = "4.0.0-beta", path = "../env", default-features = false }
19+
ink_storage = { version = "4.0.0-beta", path = "../storage", default-features = false }
20+
ink_primitives = { version = "4.0.0-beta", path = "../primitives", default-features = false }
21+
ink_metadata = { version = "4.0.0-beta", path = "../metadata", default-features = false, optional = true }
22+
ink_prelude = { version = "4.0.0-beta", path = "../prelude", default-features = false }
23+
ink_macro = { version = "4.0.0-beta", path = "macro", default-features = false }
2424

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

crates/ink/codegen/Cargo.toml

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "ink_codegen"
3-
version = "4.0.0-alpha.3"
3+
version = "4.0.0-beta"
44
authors = ["Parity Technologies <admin@parity.io>", "Robin Freyler <robin@parity.io>"]
55
edition = "2021"
66

@@ -18,8 +18,8 @@ include = ["Cargo.toml", "src/**/*.rs", "README.md", "LICENSE"]
1818
name = "ink_codegen"
1919

2020
[dependencies]
21-
ink_primitives = { version = "4.0.0-alpha.3", path = "../../primitives" }
22-
ir = { version = "4.0.0-alpha.3", package = "ink_ir", path = "../ir", default-features = false }
21+
ink_primitives = { version = "4.0.0-beta", path = "../../primitives" }
22+
ir = { version = "4.0.0-beta", package = "ink_ir", path = "../ir", default-features = false }
2323
quote = "1"
2424
syn = { version = "1.0", features = ["parsing", "full", "extra-traits"] }
2525
proc-macro2 = "1.0"

crates/ink/ir/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "ink_ir"
3-
version = "4.0.0-alpha.3"
3+
version = "4.0.0-beta"
44
authors = ["Parity Technologies <admin@parity.io>", "Robin Freyler <robin@parity.io>"]
55
edition = "2021"
66

crates/ink/macro/Cargo.toml

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "ink_macro"
3-
version = "4.0.0-alpha.3"
3+
version = "4.0.0-beta"
44
authors = ["Parity Technologies <admin@parity.io>", "Robin Freyler <robin@parity.io>"]
55
edition = "2021"
66

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

1717
[dependencies]
18-
ink_ir = { version = "4.0.0-alpha.3", path = "../ir", default-features = false }
19-
ink_codegen = { version = "4.0.0-alpha.3", path = "../codegen", default-features = false }
20-
ink_primitives = { version = "4.0.0-alpha.3", path = "../../primitives/", default-features = false }
18+
ink_ir = { version = "4.0.0-beta", path = "../ir", default-features = false }
19+
ink_codegen = { version = "4.0.0-beta", path = "../codegen", default-features = false }
20+
ink_primitives = { version = "4.0.0-beta", path = "../../primitives/", default-features = false }
2121

2222
scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] }
2323
syn = "1"

crates/metadata/Cargo.toml

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "ink_metadata"
3-
version = "4.0.0-alpha.3"
3+
version = "4.0.0-beta"
44
authors = ["Parity Technologies <admin@parity.io>", "Robin Freyler <robin@parity.io>"]
55
edition = "2021"
66

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

1717
[dependencies]
18-
ink_prelude = { version = "4.0.0-alpha.3", path = "../prelude/", default-features = false }
19-
ink_primitives = { version = "4.0.0-alpha.3", path = "../primitives/", default-features = false }
18+
ink_prelude = { version = "4.0.0-beta", path = "../prelude/", default-features = false }
19+
ink_primitives = { version = "4.0.0-beta", path = "../primitives/", default-features = false }
2020

2121
serde = { version = "1.0", default-features = false, features = ["derive", "alloc"] }
2222
impl-serde = "0.4.0"

crates/prelude/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "ink_prelude"
3-
version = "4.0.0-alpha.3"
3+
version = "4.0.0-beta"
44
authors = ["Parity Technologies <admin@parity.io>", "Robin Freyler <robin@parity.io>"]
55
edition = "2021"
66

crates/primitives/Cargo.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "ink_primitives"
3-
version = "4.0.0-alpha.3"
3+
version = "4.0.0-beta"
44
authors = ["Parity Technologies <admin@parity.io>", "Robin Freyler <robin@parity.io>"]
55
edition = "2021"
66

@@ -16,7 +16,7 @@ include = ["/Cargo.toml", "src/**/*.rs", "/README.md", "/LICENSE"]
1616

1717
[dependencies]
1818
derive_more = { version = "0.99", default-features = false, features = ["from", "display"] }
19-
ink_prelude = { version = "4.0.0-alpha.3", path = "../prelude/", default-features = false }
19+
ink_prelude = { version = "4.0.0-beta", path = "../prelude/", default-features = false }
2020
scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive", "full"] }
2121
scale-info = { version = "2.3", default-features = false, features = ["derive"], optional = true }
2222
xxhash-rust = { version = "0.8", features = ["const_xxh32"] }

crates/storage/Cargo.toml

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "ink_storage"
3-
version = "4.0.0-alpha.3"
3+
version = "4.0.0-beta"
44
authors = ["Parity Technologies <admin@parity.io>", "Robin Freyler <robin@parity.io>"]
55
edition = "2021"
66

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

1717
[dependencies]
18-
ink_env = { version = "4.0.0-alpha.3", path = "../env/", default-features = false }
19-
ink_metadata = { version = "4.0.0-alpha.3", path = "../metadata/", default-features = false, features = ["derive"], optional = true }
20-
ink_primitives = { version = "4.0.0-alpha.3", path = "../primitives/", default-features = false }
21-
ink_storage_traits = { version = "4.0.0-alpha.3", path = "traits", default-features = false }
22-
ink_prelude = { version = "4.0.0-alpha.3", path = "../prelude/", default-features = false }
18+
ink_env = { version = "4.0.0-beta", path = "../env/", default-features = false }
19+
ink_metadata = { version = "4.0.0-beta", path = "../metadata/", default-features = false, features = ["derive"], optional = true }
20+
ink_primitives = { version = "4.0.0-beta", path = "../primitives/", default-features = false }
21+
ink_storage_traits = { version = "4.0.0-beta", path = "traits", default-features = false }
22+
ink_prelude = { version = "4.0.0-beta", path = "../prelude/", default-features = false }
2323

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

crates/storage/traits/Cargo.toml

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "ink_storage_traits"
3-
version = "4.0.0-alpha.3"
3+
version = "4.0.0-beta"
44
authors = ["Parity Technologies <admin@parity.io>"]
55
edition = "2021"
66

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

1717
[dependencies]
18-
ink_metadata = { version = "4.0.0-alpha.3", path = "../../metadata", default-features = false, features = ["derive"], optional = true }
19-
ink_primitives = { version = "4.0.0-alpha.3", path = "../../primitives", default-features = false }
20-
ink_prelude = { version = "4.0.0-alpha.3", path = "../../prelude", default-features = false }
18+
ink_metadata = { version = "4.0.0-beta", path = "../../metadata", default-features = false, features = ["derive"], optional = true }
19+
ink_primitives = { version = "4.0.0-beta", path = "../../primitives", default-features = false }
20+
ink_prelude = { version = "4.0.0-beta", path = "../../prelude", default-features = false }
2121
scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive", "full"] }
2222
scale-info = { version = "2.3", default-features = false, features = ["derive"], optional = true }
2323
syn = { version = "1", features = ["full"] }

examples/contract-terminate/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "contract_terminate"
3-
version = "4.0.0-alpha.3"
3+
version = "4.0.0-beta"
44
authors = ["Parity Technologies <admin@parity.io>"]
55
edition = "2021"
66
publish = false

examples/contract-transfer/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "contract_transfer"
3-
version = "4.0.0-alpha.3"
3+
version = "4.0.0-beta"
44
authors = ["Parity Technologies <admin@parity.io>"]
55
edition = "2021"
66
publish = false

examples/delegator/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "delegator"
3-
version = "4.0.0-alpha.3"
3+
version = "4.0.0-beta"
44
authors = ["Parity Technologies <admin@parity.io>"]
55
edition = "2021"
66
publish = false

examples/delegator/accumulator/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "accumulator"
3-
version = "4.0.0-alpha.3"
3+
version = "4.0.0-beta"
44
authors = ["Parity Technologies <admin@parity.io>"]
55
edition = "2021"
66

examples/delegator/adder/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "adder"
3-
version = "4.0.0-alpha.3"
3+
version = "4.0.0-beta"
44
authors = ["Parity Technologies <admin@parity.io>"]
55
edition = "2021"
66

0 commit comments

Comments
 (0)