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! 5.1.0 #2317

Merged
merged 11 commits into from
Nov 28, 2024
Merged

Release ink! 5.1.0 #2317

merged 11 commits into from
Nov 28, 2024

Conversation

cmichi
Copy link
Collaborator

@cmichi cmichi commented Nov 21, 2024

Version 5.1.0

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 paritytech to the new GitHub organization use-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-xcm

We also added a new page on our documentation website: TODO.

You can view the Rust docs of the two functions here:

(2) Call an ink! contract from a polkadot-sdk runtime

ink! 5.1 comes with basic support for calling contracts from a Polkadot runtime.
We've added this example
that demonstrates how to call flipper from a polkadot-sdk runtime 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:

  • Contract calls can only be made to trait messages. This makes sense in the
    pallet-contracts context, as it is better to depend on a trait rather
    than a contract impl, since you are working against an interface.
  • Only contract messages can be called currently, no constructors.
  • The API could be nicer.

(3) E2E Testing

We replaced our drink sandbox dependency with an internal ink! crate.
In case you use DRink!:

First, you should upgrade your drink dependency to version = "0.18.0".
Second, these are the two changes you have to make:

- #[ink_e2e::test(backend(runtime_only(sandbox = ink_e2e::MinimalSandbox)))]
+ #[ink_e2e::test(backend(runtime_only(sandbox = ink_e2e::DefaultSandbox)))]
- ink_e2e = { version = "5", features = ["drink"] }
+ ink_e2e = { version = "5", features = ["sandbox"] }

Compatibility

The compatibility changes a bit to ink! 5.0:

  • Rust: >= 1.81
  • cargo-contract: >= 5.0.0
  • polkadot-sdk: >= v1.12.0
    (this release stabilized the pallet-contracts XCM functions that ink! uses)
  • substrate-contracts-node: >= 0.42.0
  • DRink!: >= 0.18.0

Added

  • [Runtime-to-Contract Calls] Environment agnostic contract invocation API, for calling contracts from runtime ‒ #2219
  • [Runtime-to-Contract Calls] Add no-panic-handler feature ‒ #2164
  • [Runtime-to-Contract Calls] Add example for calling a contract from a runtime pallet ‒ #2189
  • [XCM] Add xcm_execute and xcm_send support ‒ #1912
  • [Linter] Add links to detailed lint description ‒ #2170
  • [E2E] Adds a message to SandboxErr to add context for easier debugging ‒ #2218
  • [E2E] Add ability to take and restore snapshots ‒ #2261 (thanks @0xLucca!)
  • [E2E] Demonstrate usage of seeds for secret URIs in E2E test for chain snapshots ‒ #2163

Changed

  • Update repository URLs & references from paritytech GitHub organization to new use-ink one ‒ #2220 and #2248
  • [E2E] Update subxt and polkadot-sdk dependencies ‒ #2174
  • [Drink backend] Replace drink sandbox with internal ink_sandbox#2158

Fixed

  • [XCM] Fix XCM-support to single encode the XCM message ‒ #2278
  • [Examples] ERC-721: burn() clears token approval ‒ #2099
  • [E2E] Fix outdated docs for [ink_e2e::test]#2162
  • [E2E] Build contracts before initializing node rpc ‒ #2168
  • [E2E] set_account_balance now can't set balance below existential deposit ‒ #1983 (thanks @0xLucca!)
  • [E2E] Fix outdated docs for [ink_e2e::test]#2162

Copy link

codecov bot commented Nov 27, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 60.55%. Comparing base (6b56589) to head (7ebf3b6).
Report is 5 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #2317   +/-   ##
=======================================
  Coverage   60.55%   60.55%           
=======================================
  Files         141      141           
  Lines        5785     5785           
  Branches     2394     2394           
=======================================
  Hits         3503     3503           
  Misses       2282     2282           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link

github-actions bot commented Nov 27, 2024

🦑 📈 ink! Example Contracts ‒ Changes Report 📉 🦑

These are the results when building the integration-tests/* contracts from this branch with cargo-contract and comparing them to ink! master:

Contract Upstream Size (kB) PR Size (kB) Diff (kB) Diff (%) Change
call-builder-return-value 8.924 8.924 0 0
e2e-runtime-only-backend 1.925 1.925 0 0
lang-err/call-builder-delegate 2.612 2.612 0 0
lang-err/call-builder 5.66 5.66 0 0
lang-err/constructors-return-value 2.011 2.011 0 0
lang-err/contract-ref 5.087 5.087 0 0
lang-err/integration-flipper 1.91 1.91 0 0
mother 12.681 12.681 0 0
sr25519-verification 1.082 1.082 0 0
storage-types 11.369 11.369 0 0
call-runtime 1.881 1.881 0 0
combined-extension 2.046 2.046 0 0
conditional-compilation 1.46 1.46 0 0
contract-storage 7.459 7.459 0 0
contract-terminate 1.314 1.314 0 0
contract-transfer 1.52 1.52 0 0
contract-xcm 18.805 18.805 0 0
cross-contract-calls 7.471 7.471 0 0
cross-contract-calls/other-contract 1.591 1.591 0 0
custom-allocator 7.993 7.993 0 0
custom-environment 2.062 2.062 0 0
dns 7.142 7.142 0 0
e2e-call-runtime 1.182 1.182 0 0
erc1155 14.566 14.566 0 0
erc20 6.993 6.993 0 0
erc721 9.754 9.754 0 0
events 4.955 4.955 0 0
flipper 1.701 1.701 0 0
incrementer 1.538 1.538 0 0
lazyvec 5.103 5.103 0 0
mapping 8.281 8.281 0 0
multi-contract-caller 6.42 6.42 0 0
multi-contract-caller/accumulator 1.363 1.363 0 0
multi-contract-caller/adder 1.733 1.733 0 0
multi-contract-caller/subber 1.751 1.751 0 0
multisig 21.135 21.135 0 0
payment-channel 5.72 5.72 0 0
psp22-extension 7.372 7.372 0 0
rand-extension 2.957 2.957 0 0
runtime-call-contract 1.592 1.592 0 0
static-buffer 2.602 2.602 0 0
trait-dyn-cross-contract-calls 2.808 2.808 0 0
trait-dyn-cross-contract-calls/contracts/incrementer 1.571 1.571 0 0
trait-erc20 7.286 7.286 0 0
trait-flipper 1.46 1.46 0 0
trait-incrementer 1.63 1.63 0 0
upgradeable-contracts/delegator 3.869 3.869 0 0
upgradeable-contracts/delegator/delegatee 1.652 1.652 0 0
upgradeable-contracts/delegator/delegatee2 1.652 1.652 0 0
upgradeable-contracts/set-code-hash-migration 1.74 1.74 0 0
upgradeable-contracts/set-code-hash-migration/migration 1.302 1.302 0 0
upgradeable-contracts/set-code-hash-migration/updated-incrementer 1.93 1.93 0 0
upgradeable-contracts/set-code-hash 1.74 1.74 0 0
upgradeable-contracts/set-code-hash/updated-incrementer 1.717 1.717 0 0
wildcard-selector 3.234 3.234 0 0

Link to the run | Last update: Thu Nov 28 14:08:09 CET 2024

@cmichi cmichi merged commit e4fd25d into master Nov 28, 2024
11 checks passed
@cmichi cmichi deleted the cmichi-release-5.1 branch November 28, 2024 11:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant