Release v1.4.0 changes
- Crates versions bumped to
"v1.4.0"
, runtime spec version bumped to1400
(#3951); - Weights of extrinsic and WASM calls were NOT updated, schedule version was bumped to
1400
in order to re-instrument codes with new restrictions check (#3952);
Update requirements
Name | Character |
---|---|
JS clients | 🔴 Required |
Programs | ⚪ Insubstantial / 🔴 Required (depending on logic of the program) |
Node bin | ⚪ Insubstantial |
User-space
📚 Refactored gtest
's structures Program
and System
to make their creation a bit more consistent (#3913);
Note
Some of methods were renamed but kept the same idea, please follow cargo recommendations while migrating. Programs now constructed using builder pattern.
📚 gstd
's new macro actor_id!
was implemented (#3916);
Tip
This macro improves user experience by adding an ability to calculate in compile-time bs58 and ss58 addresses conversion into ActorId
. Check out the following code.
- ActorId::from_bs58(address)
+ actor_id!(address)
📚 gring
from now on supports Vara-specific addresses instead of basic bs58 ones (#3918);
📚 New approach of building gear programs in Rust were implemented through cargo extension (#3835);
Tip
Check out cargo-gbuild
extension that allows you to build optimised and valid gear programs (wasm) without gear-wasm-builder
and any build script. This tool is about to be improved and extended, but for now is almost the most native approach while working outside cargo workspaces etc.
Runtime
📚 Underlying executor engine for gear protocol had redesigned and improved its stability and speed by new memory representation and type-safe accesses into memory through host calls (#3846; #3922);
📚 Minor bug of freeing all the pages program previously allocated, that they kept stored on-chain, was fixed (#3894);
⚠️ New gear program's code restrictions
Important
Any program uploaded and that don't fit new requirements will become invalid, so unaccessible. But in general, program authors shouldn't worry - these cases don't match common development flow and can be produced mostly by purpose to break something.
📚 Global and table WASM imports now are forbidden in favour of security and platform stability (#3911);
📚 WASM data segments' item amount now limited with 1024
in favour of security and platform stability (#3911);
Key-features of the release
🔥📚 "Waiting init list" was deprecated and removed (#3812);
Note
Previously, any message that sent into active (uploaded and valid) program, that wasn't yet initialised (finished init()
successfully): for example, has complex and long init function with interruptions; was added into waitlist and waked once this program finish its initialisation. From now these messages won't be added into waitlist, but at this moment failed and error reply for them will be sent.
Important
This may break your business logic in case of creation of program (from extrinsics or programs) that contains async init with further handle-message sending without awaiting initialisation.
Tip
Best practice in creating actors from actors is using something like this:
if gstd::prog::create_program_for_reply(/* args */).unwrap().await.is_ok() { /* do something with the prog */ }
🔥📚 Validator's payouts for gas were optimised (#3840);
Note
Now instead of performing transfer and depositing event about transfer of funds from gear-bank
to current block producer to cover burned gas fee, all of the transfers are aggregated and performed once per block at the very end. This improves platform performance and avoids a lot of spam in event stream of the network.
📚 Substrate dependency updated to version "1.2.0" (#3898);
Important
Required migrations are applied, most of the apis kept compatible, but please make sure to test your clients on working correctly with updated metadata: for example, extrinsic frame_balances::transfer
was removed, that may cause errors.
Do your own research on updated functionality in substrate by going through #3898 PR's description and parity's release notes.
Full Changelog: v1.3.1...v1.4.0