Releases: use-ink/ink
v5.0.0-rc
This is a release candidate for ink! 5.0. Notable changes include:
- Support for multiple chain extensions - #1958. This is a breaking change. Developers need to update their code utilising new API.
- Lazy
StorageVec
structure that allows access vector data efficiently - #1995 - E2E framework introduced a new builder API to simplify the call building - #1917
Added
- Allow mutable parameters in messages - #2004
- [E2E] Allow testing with live-chain state - #1949
- [E2E] Call builders and extra gas margin option - #1917
- Linter:
storage_never_freed
lint - #1932 - Linter:
strict_balance_equality
lint - #1914 - Linter:
no_main
lint - #2001 - Clean E2E configuration parsing - #1922
- Make
set_code_hash
generic - #1906 - Provide a
StorageVec
datastructure built on top ofLazy
- #1995
Changed
- Messages return
TypeSpec
directly - #1999 - Fail when decoding from storage and not all bytes consumed - #1897
- [E2E] resolve DispatchError error details for dry-runs - #1944
- [E2E] update to new
drink
API - #2005 - Support multiple chain extensions - #1958
- New example of how to use multiple chain extensions in one contract.
- Affects the usage of the
#[ink::chain_extension]
macro and the definition of the chain extension.
v5.0.0-alpha
The preview release of the ink! 5.0.0 release.
This release addresses the majority of issues raised in the OpenZeppelin audit
in particular, we addressed the proxy selector clashing attack.
As of this release, ink! only allows exactly one other message with a well-known reserved selector to be defined.
You can read more about the change in the PR
There are also other notable changes:
- Rework of event definitions - #1827.
- Updated upgradeable contract example illustrating
delegate_call
- Removal of unchecked arithmetic.
cargo-contract
will fail compiling the contract with raw arithmetic operations. - Introduction of an alternative off-chain E2E testing backend, drink!
Big thanks to @pmikolajczyk41 for this massive contribution!
You can see a more detailed log of changes below:
Added
- [Drink backend]: allow for arbitrary runtime - #1892
- [Drink backend]: support runtime call - #1891
- Reexport
scale
dependencies, introduce#[ink::scale_derive]
- #1890 - Upgradeable contracts example - #1889
- Persist static buffer size in metadata - #1880
- Modify static buffer size via environmental variables - #1869
- [Drink backend]: Make tests generic
E2EBackend
trait - #1867 - [Drink backend]: Backend choice β #1864
- [Drink backend]: Backend traits - #1857
- [Drink backend]: Abstract error and result structs - #1844
- Added
sr25519_verify
function toink_env
#1840 - Warn when primitive number is annotated as event topic - #1837
- Events
2.0
- #1827 - Add
set_block_number
to off-chain test apiEngine
- #1806 - Stabilize
call_runtime
β #1749 - Schema generation - #1765
- Restrict wildcard selectors to have exactly one other message - #1708
Changed
- Reexport
scale
dependencies, introduce#[ink::scale_derive]
β #1890 [ink_e2e]
build contracts at runtime instead of during codegen - #1881- Use of workspace dependencies and properties - #1835
- Remove of unchecked arithmetic - #1831
- E2E crate refactoring - #1830
- Use `decode_all`` for decoding cross contract call result - #1810
- E2E: improve call API, remove
build_message
+ callback - #1782
v4.3.0
Version 4.3.0
This release is to fix compatibility of ink_e2e
with newer (> 1.69) versions of Rust,
which produce signext
instructions, and older versions of pallet_contracts
which do
not yet support these instructions.
- Backport use of
contract-build
to3.2.0
to includesignext
lowering, and update
subxt
to remove incompatiblewasmi-instrument
transient dependency β #1884
v4.2.1
Version 4.2.1
This release contains a low-severity security related fix. Users of the 4.x
series of releases are advised to update.
Note that this release contains a breaking change since the API of ink_env::invoke_contract_delegate
and CallBuilder::try_invoke
now return an extra ink_primitives::MessageResult
which must be handled.
We decided to release this breaking change as a PATCH
release to ensure that affected users are upgrading to the fixed API.
See the published advisory for more info.
Fixed
- Handle
LangError
fromDelegateCall
v4.2.0
v4.1.0
v4.0.1
v4.0.0
Version 4.0.0
The latest stable release of ink! is here π₯³
This version brings a lot of usability improvements, making the language better suited for the needs of production parachains.
A couple of highlights include:
- Changes to how contract storage works, which significantly reduced the sizes of
contract binaries - A new end-to-end testing framework, letting you easily write integration tests
- Changes to the metadata format, which (in part) makes error handling more expressive
There's a lot more to dig through, so take some time to poke around the CHANGELOG
(including the 4.0.0-alpha
and 4.0.0-beta
releases).
You may notice there have been a few breaking changes. No need to be scared though, we wrote up a migration guide covering all of the breaking changes and how to update your ink! 3.x contract accordingly.
Thanks to everyone that helped make this release possible β€οΈ
Compatibility
In order to build contracts which use ink! v4.0.0
you need to use cargo-contract
v2.0.0
. You can install it as follows:
cargo install cargo-contract --forced --locked
You will also need to use a version of pallet-contracts
later than polkadot-v0.9.37 in your node.
The v0.24.0
release of the substrate-contracts-node
is compatible with the ink! 4.0.0
release.
For full compatibility requirements see the migration guide.
Added
- Add
Mapping::contains(key)
andMapping::insert_return_size(key, val)
β #1224 - Add
payment-channel
example β #1248 (thanks @kanishkatn!) - Add
version
field to ink! metadata β #1313 - The
rand-extension
example has been adapted to an updated version of theChainExtension
API β #1356 - Add
ink_env::pay_with_call!
helper macro for off-chain emulation of sending payments with contract message calls β #1379 - Allow using
Result<Self, Error>
as a return type in constructors β #1446 - Add
Mapping::take()
function allowing to get a value removing it from storage β #1461 - Add E2E testing framework MVP β #1395
- Add E2E tests for
Mapping
functions - #1492 - E2E: expose call dry-run method β #1624
- Make cross-contract callee non-optional β #1636
- Support custom environment in E2E tests - #1645 (thanks @pmikolajczyk41!)
Changed
- Contract size optimization in case contract doesn't accept payment β #1267 (thanks @xgreenx!)
- Move ink! linter into
ink
repository β #1361 - Introduce
ink
entrance crate β #1223 - Use
XXH32
instead ofsha256
for calculating storage keys β #1393 - Storage Refactoring β #1331
- Add support for language level errors (
LangError
) β #1450 - Return
LangError
s from constructors β #1504 - Update
scale-info
requirement to2.3
β #1467 - Merge
Mapping::insert(key, val)
andMapping::insert_return_size(key, val)
into one method - #1463 - FFI: no more
__unstable__
wasm import module β #1522 - Clean up CallBuilder
return()
type β #1525 - Fix trait message return type metadata β #1531
- Bump Dylint dependencies β #1551
- Stabilize
take_storage
β #1568 - Chain Extension: Evaluation of method return type at compile time β #1569
- Make more functions be const β #1574 (thanks @yjhmelody!)
- Unify fallible and non fallible
instantiate
methods β #1591 - Make
CallBuilder
andCreateBuilder
error handling optional β #1602 - Rename
CallBuilder::fire()
method toinvoke()
β #1604 - chore: add minimum rust version to the ink crate β #1609 (thanks @Kurtsley!)
- Rename
_checked
codegen call methods withtry_
β #1621 - Bump Substrate and
subxt
dependencies β #1549 - E2E: spawn a separate contracts node instance per test β #1642
Fixed
- Trim single whitespace prefix in the metadata
docs
field β #1385 - Allow pay_with_call to take multiple arguments β #1401
- Add Determinism enum from pallet-contracts β #1547
- Added missed
WhereClosure
for the generics intostorage_item
β #1536 (thanks @xgreenx!)
Removed
v4.0.0-rc
The first release candidate is here! This is the first release which could become the final
v4.0.0
. Any subsequent release candidates should only contain bug fixes: no API changes,
breaking or otherwise.
Breaking Changes
- We've renamed some of the generated message methods on the
ContractRef
struct. They
have been changed from_checked
totry_
(#1621) - We have removed the
Default
implementation forAccountId
s. This is because of
security concerns around the use of the zero address which has a known private key in
thesr25519
anded25519
curves (#1255). - We have replaced the
CallBuilder::callee()
method with acall()
method and also
added adelegate()
method. This streamlines theCall
andDelegateCall
workflows
(#1636)
Added
Changed
- Rename
_checked
codegen call methods withtry_
β #1621 - Bump Substrate and
subxt
dependencies β #1549
Removed
- Remove
Default
implementation for AccountId β #1255
v4.0.0-beta.1
This supersedes #1590, but RC coming soonβ’
Version 4.0.0-beta.1
The coolest feature included in this release is the first first published version of
ink!'s native "end-to-end" (E2E) testing framework.
This enables testing of a contract by deploying and calling it on a Substrate node with
pallet-contracts
. See the erc20
example for usage.
Breaking Changes
This release includes a couple of breaking changes.
- The
CallBuilder::returns()
method does not require an extraMessageResult
anymore
as the type is now added under the hood (#1525) - The
CallBuilder::invoke()
andCreateBuilder::instantiate()
methods now unwrap the
Result
frompallet-contracts
under the hood (#1602)
If you wish to handle the error use the newtry_
variants of those methods instead. - The
CallBuilder::fire()
method has been renamed toinvoke()
(#1604) - The
returns_result
flag has been removed from the#[ink(extension = β¦)]
attribute
(#1569)
We now infer this information at compile time. Ifhandle_status
is set totrue
,
the return type will still be wrapped intoResult
as before. - The Minimum Supported Rust Version (MSRV) has been set to
1.63.0
. This was already
the case, but previously it was enforced bycargo-contract
instead of ink!
(#1609)
Added
Fixed
- Add Determinism enum from pallet-contracts β #1547
- Added missed
WhereClosure
for the generics intostorage_item
β #1536 (thanks @xgreenx)
Changed
- Handle
LangError
from instantiate β #1512 - FFI: no more
__unstable__
wasm import module β #1522 - Clean up CallBuilder
return()
type β #1525 - Fix trait message return type metadata β #1531
- Bump Dylint dependencies β #1551
- Stabilize
take_storage
β #1568 - Chain Extension: Evaluation of method return type at compile time β #1569
- Make more functions be const β #1574 (thanks @yjhmelody)
- Unify fallible and non fallible
instantiate
methods β #1591 - Make
CallBuilder
andCreateBuilder
error handling optional β #1602 - Rename
CallBuilder::fire()
method toinvoke()
β #1604 - chore: add minimum rust version to the ink crate β #1609 (thanks @Kurtsley)