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 v4.0.0 #1653

Merged
merged 9 commits into from
Feb 15, 2023
Merged

Release v4.0.0 #1653

merged 9 commits into from
Feb 15, 2023

Conversation

ascjones
Copy link
Collaborator

@ascjones ascjones commented Feb 14, 2023

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) and Mapping::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 the ChainExtension 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 of sha256 for calculating storage keys ‒ #1393
  • Storage Refactoring ‒ #1331
  • Add support for language level errors (LangError) ‒ #1450
  • Return LangErrors from constructors ‒ #1504
  • Update scale-info requirement to 2.3#1467
  • Merge Mapping::insert(key, val) and Mapping::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 and CreateBuilder error handling optional ‒ #1602
  • Rename CallBuilder::fire() method to invoke()#1604
  • chore: add minimum rust version to the ink crate ‒ #1609 (thanks @Kurtsley!)
  • Rename _checked codegen call methods with try_#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 into storage_item#1536 (thanks @xgreenx!)

Removed

  • Implement ecdsa_to_eth_address() and remove eth_compatibility crate ‒ #1233
  • Remove wee-alloc#1403
  • Remove ink_env::random function ‒ #1442
  • Remove Default implementation for AccountId ‒ #1255

@codecov-commenter
Copy link

codecov-commenter commented Feb 15, 2023

Codecov Report

Merging #1653 (7087fe9) into master (21606c0) will decrease coverage by 0.08%.
The diff coverage is n/a.

❗ Current head 7087fe9 differs from pull request most recent head 7afcc07. Consider uploading reports for the commit 7afcc07 to get more accurate results

@@            Coverage Diff             @@
##           master    #1653      +/-   ##
==========================================
- Coverage   70.76%   70.68%   -0.08%     
==========================================
  Files         206      206              
  Lines        6416     6416              
==========================================
- Hits         4540     4535       -5     
- Misses       1876     1881       +5     
Impacted Files Coverage Δ
crates/allocator/src/bump.rs 85.95% <0.00%> (-2.48%) ⬇️
crates/ink/ir/src/ast/attr_args.rs 82.60% <0.00%> (-2.18%) ⬇️
crates/metadata/src/layout/mod.rs 80.00% <0.00%> (-0.84%) ⬇️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

CHANGELOG.md Outdated Show resolved Hide resolved
CHANGELOG.md Outdated Show resolved Hide resolved
@ascjones ascjones marked this pull request as ready for review February 15, 2023 12:39
@ascjones ascjones requested a review from SkymanOne as a code owner February 15, 2023 12:39
Copy link
Collaborator

@cmichi cmichi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🙌

Copy link
Contributor

@SkymanOne SkymanOne left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yay!

CHANGELOG.md Show resolved Hide resolved
Copy link
Contributor

@HCastano HCastano left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@ascjones ascjones merged commit ad4f5e5 into master Feb 15, 2023
@ascjones ascjones deleted the v4.0.0 branch February 15, 2023 16:41
@HCastano HCastano mentioned this pull request Feb 22, 2023
@ascjones ascjones mentioned this pull request Jan 17, 2024
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.

5 participants