Update Rust crate ink to v5 - #6
Open
renovate[bot] wants to merge 1 commit into
Open
Conversation
renovate
Bot
force-pushed
the
renovate/ink-5.x
branch
2 times, most recently
from
May 5, 2024 11:35
af4e9e4 to
dbeb918
Compare
renovate
Bot
force-pushed
the
renovate/ink-5.x
branch
from
July 25, 2026 18:59
dbeb918 to
0507e88
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
4.2→5.0Release Notes
use-ink/ink (ink)
v5.1.1Compare Source
Fixed
v5.1.0Compare Source
This is the first ink! release outside of Parity. ink! was started at Parity and
during this year became a community project maintained by the ink! Alliance, a
loose group of former Parity employees and teams who want ink! to ensure a bright
future for ink!.
You can find more details about the community handover in
this X post.
Generally, the only thing changing on the user-facing side is that the repositories
have been moved from
paritytechto the new GitHub organizationuse-ink.❣ We want to say a big thank you to our Polkadot community, which recently decided on
funding the continued maintenance and development of ink! with
a Polkadot Treasury grant.
Highlights
This version of ink! comes with three highlights plus some minor fixes.
(1) XCM Support
ink! 5.1 supports the usage of XCM in contracts, developers are no longer limited
to cross-contract calls, but can now execute cross-parachain calls.
We added a contract example that demonstrates the usage:
contract-xcmWe also added a new page on our documentation website:
https://use.ink/basics/xcm.
You can view the Rust docs of the two functions here:
xcm_sendxcm_execute(2) Call an ink! contract from a
polkadot-sdkruntimeink! 5.1 comes with basic support for calling contracts from a Polkadot runtime.
We've added this example
that demonstrates how to call
flipperfrom apolkadot-sdkruntime pallet.Calling a contract from the runtime is an interesting application for parachains,
as they can put logic into a contract instead of their runtime. Contracts have
a number of advantages, as they are easier to upgrade and allow for
faster development iteration cycles.
The limitations currently are:
pallet-contractscontext, as it is better to depend on a trait ratherthan a contract impl, since you are working against an interface.
(3) E2E Testing
We replaced our
drinksandbox dependency with an internal ink! crate.In case you use DRink!:
First, you should upgrade your
drinkdependency toversion = "0.18.0".Second, these are the two changes you have to make:
Compatibility
The compatibility changes a bit to ink! 5.0:
>= 1.81cargo-contract:>= 5.0.0polkadot-sdk: >= v1.12.0(this release stabilized the
pallet-contractsXCM functions that ink! uses)substrate-contracts-node:>= 0.42.0>= 0.18.0For the linter in
cargo-contractthe Rust toolchain version changed.To upgrade:
Added
no-panic-handlerfeature ‒ #2164xcm_executeandxcm_sendsupport ‒ #1912Changed
paritytechGitHub organization to newuse-inkone ‒ #2220 and #2248subxtandpolkadot-sdkdependencies ‒ #2174drinksandbox with internalink_sandbox‒ #2158Fixed
burn()clears token approval ‒ #2099[ink_e2e::test]‒ #2162set_account_balancenow can't set balance below existential deposit ‒ #1983 (thanks @0xLucca!)[ink_e2e::test]‒ #2162v5.0.0Compare Source
ℹ️ We've created a migration guide from ink! 4 to ink! 5. It also contains an
overview over all breaking changes and newly added features.
👉 You can view it here.
Summary
This release addresses the rest of the severities described in the OpenZeppelin security review of ink! and
cargo-contract.One of the notable addressed issues is 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 #1827 and #2031.
ink! 5.0.0 features a significant number of new features:
to build even more sophisticated and advanced contracts for supported chains - #1958.
we have disallowed unchecked arithmetic expressions.
cargo-contractwill fail to compile the contract with the raw arithmetic operation - #1831.These are the main features we have introduced in this release. We also encourage developers
to have a look at more detailed changelog entries to find out about any breaking changes that may affect
the development of new ink! contracts.
Compatibility
See the compatibility section of our migration guide for a detailed description. On a high level:
>= 1.70cargo-contract:>= 4.0.0polkadot-js/apiandpolkadot-js/api-contract:>= 10.12.1substrate-contracts-node:>= 0.39.0Changelog
Added
instantiate_v2with additional limit parameters #2123non_fallible_apilint - #2004create_call_builderfor testing existing contracts - #2075call_v2cross-contract calls with additional limit parameters - #2077delegate_dependencyapi calls - #2076set_code_hashgeneric - #1906StorageVecdatastructure built on top ofLazy- #1995MappingandLazy- #1910storage_never_freedlint - #1932strict_balance_equalitylint - #1914no_mainlint - #2001scaledependencies, introduce#[ink::scale_derive]- #1890sr25519_verifyfunction toink_env#18402.0- #1827set_block_numberto off-chain test apiEngine- #1806call_runtime‒ #1749E2EBackendtrait - #1867Changed
anonymousink! event item configuration argument - #2140#2137, #2132
MaxEncodedLenfor output buffer size #2128Mapping: Reflect all possible failure cases in comments ‒ #2079.callto.call_builder‒ #2078runtime_onlyattribute argument - #2083additional_contractsparameter #2098TypeSpecdirectly - #1999#[ink::chain_extension]macro and the definition of the chain extension.ink_lintingto mandatory and extra libraries - #2032drinkAPI - #2005scaledependencies, introduce#[ink::scale_derive]‒ #1890decode_allfor decoding cross contract call result - #1810build_message+ callback - #1782Fixed
StorageVectype by excluding thelen_cachedfield from its type info - #2052approve_forin the ERC-721 example - #2092transfer_token_fromnow ensures the token owner is correct - #2093RootLayout::new()is generic again to allow usingink_metadatain purePortableFormcontexts - #1989Configuration
📅 Schedule: (UTC)
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.