Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release ink! 3.1.0 #1240

Merged
merged 10 commits into from
May 18, 2022
57 changes: 57 additions & 0 deletions RELEASES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,62 @@
# [Unreleased]

# Version 3.1.0

## Compatibility
We recommend using a version of the [`pallet-contracts`](https://github.com/paritytech/substrate/tree/master/frame/contracts)
later than [7d233c2446b5a60662400a0a4bcfb78bb3b79ff7](https://github.com/paritytech/substrate/tree/7d233c2446b5a60662400a0a4bcfb78bb3b79ff7)
(May 13, 2022) in your node.

This is the case in the latest release of the [`substrate-contracts-node`](https://github.com/paritytech/substrate-contracts-node)
[v0.15.0](https://github.com/paritytech/substrate-contracts-node/releases/tag/v0.15.0) and
the latest Polkadot release [v0.9.22](michi-will-add-the-link-once-published).

## Breaking Changes
There are two breaking changes in this release:

* As part of [#1235](https://github.com/paritytech/ink/pull/1235) the message selectors of
your contract may change. A change of selectors would affect your client, frontend, Dapp, etc..
* As part of [#1233](https://github.com/paritytech/ink/pull/1235) we removed the `eth_compatibility`
crate.<br><br>
Its recovery functionality has been moved to `ink_env` now: [`ink_env::ecdsa_to_eth_address`]().
The reason for this change is that we moved the gas-expensive crypto operations into `pallet-contracts`.<br><br>
The crates `to_default_account_id` function has been removed; the reason for this change is that ink!
doesn't have knowledge about the specific Substrate types on the underlying chain.
If you want to retain the function in your contract and are just using standard Substrate types
you should add the prior functionality to your contract ‒ it was a simple
`<Blake2x256 as CryptoHash>::hash(&ecdsa_pubkey[u8; 33])`.

## New API functions
We added two new `Mapping` API functions:
[`Mapping::contains`](https://paritytech.github.io/ink/ink_storage/struct.Mapping.html#method.contains) and
[`Mapping::insert_return_size`](https://paritytech.github.io/ink/ink_storage/struct.Mapping.html#method.insert_return_size) ‒ [#1224](https://github.com/paritytech/ink/pull/1224)
These are more gas-efficient than whatever you were using previously.

Additionaly there are a couple new `ink_env` functions now:
* [`ink_env::set_code_hash`](https://paritytech.github.io/ink/ink_env/fn.set_code_hash.html)
* [`ink_env::own_code_hash`](https://paritytech.github.io/ink/ink_env/fn.own_code_hash.html)
* [`ink_env::code_hash`](https://paritytech.github.io/ink/ink_env/fn.code_hash.html)
* [`ink_env::ecdsa_to_eth_address`](https://paritytech.github.io/ink/ink_env/fn.ecdsa_to_eth_address.html)

## New Upgradeable Contract Example

We've added a new example: [`upgradeable-contracts/set-code-hash`](https://github.com/paritytech/ink/tree/master/examples/upgradeable-contracts#set-code-hash).

It illustrates how the newly added [`ink_env::set_code_hash`](https://paritytech.github.io/ink/ink_env/fn.set_code_hash.html)
can be used to implement an upgradeable contract that replaces its own code.

## Added
- Implement `seal_code_hash` and `seal_own_code_hash` ‒ [#1205](https://github.com/paritytech/ink/pull/1205)
- Add `set_code_hash` function and example ‒ [#1203](https://github.com/paritytech/ink/pull/1203)
- Implement [`ink_env::ecdsa_to_eth_address`](https://paritytech.github.io/ink/ink_env/fn.ecdsa_to_eth_address.html) ‒ [#1233](https://github.com/paritytech/ink/pull/1233)
- Add [`Mapping::contains(key)`]() and [`Mapping::insert_return_size(key, val)`]() ‒ [#1224](https://github.com/paritytech/ink/pull/1224)

## Fixed
- Fix ordering of message ids if the trait is implemented before the inherent section ‒ [#1235](https://github.com/paritytech/ink/pull/1235)

## Removed
- Removed `eth_compatibility` crate and moved its functionality partly into `ink_env` ‒ [#1233](https://github.com/paritytech/ink/pull/1233)

# Version 3.0.1

## Changed
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.1"
version = "3.1.0"
authors = ["Parity Technologies <admin@parity.io>", "Robin Freyler <robin@parity.io>"]
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.1"
version = "3.1.0"
authors = ["Parity Technologies <admin@parity.io>", "Michael Müller <michi@parity.io>"]
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.1"
version = "3.1.0"
authors = ["Parity Technologies <admin@parity.io>", "Robin Freyler <robin@parity.io>"]
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.1", path = "../metadata/", default-features = false, features = ["derive"], optional = true }
ink_allocator = { version = "3.0.1", path = "../allocator/", default-features = false }
ink_primitives = { version = "3.0.1", path = "../primitives/", default-features = false }
ink_prelude = { version = "3.0.1", path = "../prelude/", default-features = false }
ink_metadata = { version = "3.1.0", path = "../metadata/", default-features = false, features = ["derive"], optional = true }
ink_allocator = { version = "3.1.0", path = "../allocator/", default-features = false }
ink_primitives = { version = "3.1.0", path = "../primitives/", default-features = false }
ink_prelude = { version = "3.1.0", path = "../prelude/", default-features = false }

scale = { package = "parity-scale-codec", version = "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"
rlibc = "1"

[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
ink_engine = { version = "3.0.1", path = "../engine/", optional = true }
ink_engine = { version = "3.1.0", path = "../engine/", optional = true }

# Hashes for the off-chain environment.
sha2 = { version = "0.10", optional = true }
Expand Down
30 changes: 30 additions & 0 deletions crates/eth_compatibility/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
[package]
name = "ink_eth_compatibility"
version = "3.1.0"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2021"
cmichi marked this conversation as resolved.
Show resolved Hide resolved

license = "Apache-2.0"
readme = "README.md"
repository = "https://github.com/paritytech/ink"
documentation = "https://docs.rs/ink_eth_compatibility/"
homepage = "https://www.parity.io/"
description = "[ink!] Ethereum related stuff."
keywords = ["wasm", "parity", "webassembly", "blockchain", "ethereum"]
categories = ["no-std", "embedded"]
include = ["Cargo.toml", "src/**/*.rs", "/README.md", "/LICENSE"]

[dependencies]
ink_env = { version = "3.1.0", path = "../env", default-features = false }

[target.'cfg(not(target_os = "windows"))'.dependencies]
# We do not include `libsecp256k1` on Windows, since it's incompatible.
# We have https://github.com/paritytech/ink/issues/1068 for removing
# this dependency altogether.
libsecp256k1 = { version = "0.7.0", default-features = false }

[features]
default = ["std"]
std = [
"ink_env/std",
]
18 changes: 9 additions & 9 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.1"
version = "3.1.0"
authors = ["Parity Technologies <admin@parity.io>", "Robin Freyler <robin@parity.io>"]
edition = "2021"

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

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

scale = { package = "parity-scale-codec", version = "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.1", path = "ir" }
ink_metadata = { version = "3.0.1", default-features = false, path = "../metadata" }
ink_lang_ir = { version = "3.1.0", path = "ir" }
ink_metadata = { version = "3.1.0", default-features = false, path = "../metadata" }

trybuild = { version = "1.0.60", 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.1"
version = "3.1.0"
authors = ["Parity Technologies <admin@parity.io>", "Robin Freyler <robin@parity.io>"]
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.1", package = "ink_lang_ir", path = "../ir", default-features = false }
ir = { version = "3.1.0", 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.1"
version = "3.1.0"
authors = ["Parity Technologies <admin@parity.io>", "Robin Freyler <robin@parity.io>"]
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.1"
version = "3.1.0"
authors = ["Parity Technologies <admin@parity.io>", "Robin Freyler <robin@parity.io>"]
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.1", path = "../ir", default-features = false }
ink_lang_codegen = { version = "3.0.1", path = "../codegen", default-features = false }
ink_primitives = { version = "3.0.1", path = "../../primitives/", default-features = false }
ink_lang_ir = { version = "3.1.0", path = "../ir", default-features = false }
ink_lang_codegen = { version = "3.1.0", path = "../codegen", default-features = false }
ink_primitives = { version = "3.1.0", path = "../../primitives/", default-features = false }

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

[dev-dependencies]
ink_metadata = { version = "3.0.1", path = "../../metadata/" }
ink_env = { version = "3.0.1", path = "../../env/" }
ink_storage = { version = "3.0.1", path = "../../storage/" }
ink_lang = { version = "3.0.1", path = ".." }
ink_metadata = { version = "3.1.0", path = "../../metadata/" }
ink_env = { version = "3.1.0", path = "../../env/" }
ink_storage = { version = "3.1.0", path = "../../storage/" }
ink_lang = { version = "3.1.0", path = ".." }
scale-info = { version = "2", 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.1"
version = "3.1.0"
authors = ["Parity Technologies <admin@parity.io>", "Robin Freyler <robin@parity.io>"]
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.1", path = "../prelude/", default-features = false }
ink_primitives = { version = "3.0.1", path = "../primitives/", default-features = false }
ink_prelude = { version = "3.1.0", path = "../prelude/", default-features = false }
ink_primitives = { version = "3.1.0", 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.1"
version = "3.1.0"
authors = ["Parity Technologies <admin@parity.io>", "Robin Freyler <robin@parity.io>"]
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.1"
version = "3.1.0"
authors = ["Parity Technologies <admin@parity.io>", "Robin Freyler <robin@parity.io>"]
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.1", path = "../prelude/", default-features = false }
ink_prelude = { version = "3.1.0", path = "../prelude/", default-features = false }
scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive", "full"] }
scale-info = { version = "2", default-features = false, features = ["derive"], optional = true }
cfg-if = "1"
Expand Down
14 changes: 7 additions & 7 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.1"
version = "3.1.0"
authors = ["Parity Technologies <admin@parity.io>", "Robin Freyler <robin@parity.io>"]
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.1", path = "../env/", default-features = false }
ink_metadata = { version = "3.0.1", path = "../metadata/", default-features = false, features = ["derive"], optional = true }
ink_primitives = { version = "3.0.1", path = "../primitives/", default-features = false }
ink_storage_derive = { version = "3.0.1", path = "derive", default-features = false }
ink_prelude = { version = "3.0.1", path = "../prelude/", default-features = false }
ink_env = { version = "3.1.0", path = "../env/", default-features = false }
ink_metadata = { version = "3.1.0", path = "../metadata/", default-features = false, features = ["derive"], optional = true }
ink_primitives = { version = "3.1.0", path = "../primitives/", default-features = false }
ink_storage_derive = { version = "3.1.0", path = "derive", default-features = false }
ink_prelude = { version = "3.1.0", path = "../prelude/", default-features = false }

scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive", "full"] }
derive_more = { version = "0.99", default-features = false, features = ["from", "display"] }
Expand All @@ -33,7 +33,7 @@ quickcheck_macros = "1.0"
itertools = "0.10"
paste = "1.0"

ink_lang = { version = "3.0.1", path = "../lang/", default-features = false }
ink_lang = { version = "3.1.0", path = "../lang/", default-features = false }

[features]
default = ["std"]
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.1"
version = "3.1.0"
authors = ["Parity Technologies <admin@parity.io>", "Robin Freyler <robin@parity.io>"]
edition = "2021"

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

[dev-dependencies]
scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive", "full"] }
ink_env = { version = "3.0.1", path = "../../env" }
ink_primitives = { version = "3.0.1", path = "../../primitives" }
ink_metadata = { version = "3.0.1", path = "../../metadata" }
ink_prelude = { version = "3.0.1", path = "../../prelude/" }
ink_storage = { version = "3.0.1", path = ".." }
ink_env = { version = "3.1.0", path = "../../env" }
ink_primitives = { version = "3.1.0", path = "../../primitives" }
ink_metadata = { version = "3.1.0", path = "../../metadata" }
ink_prelude = { version = "3.1.0", path = "../../prelude/" }
ink_storage = { version = "3.1.0", path = ".." }
2 changes: 1 addition & 1 deletion examples/contract-terminate/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "contract_terminate"
version = "3.0.1"
version = "3.1.0"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2021"
publish = false
Expand Down
2 changes: 1 addition & 1 deletion examples/contract-transfer/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "contract_transfer"
version = "3.0.1"
version = "3.1.0"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2021"
publish = false
Expand Down
4 changes: 2 additions & 2 deletions examples/delegator/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "delegator"
version = "3.0.1"
version = "3.1.0"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2021"
publish = false
Expand All @@ -13,11 +13,11 @@ ink_storage = { path = "../../crates/storage", default-features = false }
ink_lang = { path = "../../crates/lang", default-features = false }

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

adder = { path = "adder", default-features = false, features = ["ink-as-dependency"] }
subber = { path = "subber", default-features = false, features = ["ink-as-dependency"] }
accumulator = { path = "accumulator", default-features = false, features = ["ink-as-dependency"] }
scale-info = { version = "2", default-features = false, features = ["derive"], optional = true }

[lib]
name = "delegator"
Expand Down
2 changes: 1 addition & 1 deletion examples/delegator/accumulator/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "accumulator"
version = "3.0.1"
version = "3.1.0"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2021"

Expand Down
2 changes: 1 addition & 1 deletion examples/delegator/adder/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "adder"
version = "3.0.1"
version = "3.1.0"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2021"

Expand Down
2 changes: 1 addition & 1 deletion examples/delegator/subber/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "subber"
version = "3.0.1"
version = "3.1.0"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2021"

Expand Down