Release v1.2.0 changes
- Crates versions bumped to
"v1.2.0"
, runtime spec version bumped to1200
(#3806); - Weights of extrinsic and WASM calls was NOT updated, schedule version bumped to
1200
to force new checks (#3806); - ⚠️ Gas price multiplier dumped from 25 value per gas to 6 value per gas, so all transactions and execution become 4x+ times cheaper in terms of tokens (#3806).
Update requirements
Name | Character |
---|---|
JS clients | ⚪ Insubstantial |
Programs | ⚪ Insubstantial |
Node bin | 🟡 Recommended |
User-space
📚 All requirements for codes to be uploaded now checked at compile time using gear-wasm-builder
(#3649);
📚 Errors related to incorrect codes uploaded now contain a full description and become more user friendly (#3695, #3757);
📚 Gas limit argument become optional if using gcli
for submitting transactions (#3753);
Note
Previously, if passed --gas-limit=0
or skipped, than rpc call calculate_gas
took place. Now this behaviour was changed: if explicitly set --gas-limit=0
than zero is used, while if skipped - it will be calculated.
Runtime
📚 Bug of returning Error::DuplicateWake
between program executions was fixed (#3475);
Note
Previously, flow of program execution wake(x) -> wait/wake(self) -> wake(x)
was returning error on the last wake
, while now it properly wakes the message.
Important
Don't forget that waking the same message within one execution (wake(x) -> wake(x)
) is still an error and will be like that according to protocol design.
📚 Bug of missing re-instrumentation in reading state RPC calls, resulting in inability to read state, was fixed (#3759);
📚 Bug of returning block gas limit from calculate gas RPC call in case of finite waits was fixed (#3780);
📚 Bug of expiring payload while gr_send_commit
results in an error was fixed (#3785);
📚 The total amount of outgoing bytes was limited to prevent validators memory overflow (#3743);
Important
While amount of outgoing messages allowed within one message is kept the same - 1024 pcs, total amount of bytes kept in memory at the same time for sendings was limited by 64MB.
Warning
If your program was sending more than 64MB within one execution, it won't work on upgrade. Make sure to migrate it in time.
⚠️ New code restrictions
📚 Now it's unable to upload or use codes that declare export as imports (#3694);
📚 Now it's unable to upload or use codes that declare data section outside static memory: 0..WASM min memory pages
, (#3733);
Warning
If your program doesn't fit in new restrictions, on upgrading runtime to this version, it will stop working.
Make sure to migrate it in time.
Key-features of the release
📚 New RPC call gear_calculateReplyForHandle
was implemented (#3790);
Tip
This RPC call accepts arguments similar to Gear::send_message
extrinsic and allows to run queue with the message to collect reply details: payload, value and reply code. Combination of this with gas calculation will serve a great UI/UX for your dApp!
Note
None of the changes will be applied to the blockchain database. It's usage only for informational/query purposes to "predict" reply for such sending.
Important
RPC call related to gas calculation kept the same, but now has aliases. These aliases soon will become defaults and legacy names will be deprecated, so it's recommended to change your client code for new approach. Checkout following snapshot:
- gear_calculateInitCreateGas
+ gear_calculateGasForCreate
- gear_calculateInitUploadGas
+ gear_calculateGasForUpload
- gear_calculateHandleGas
+ gear_calculateGasForHandle
- gear_calculateReplyGas
+ gear_calculateGasForReply
🔥📖 Rent distribution was redesigned (#3686);
Note
There are some rents presented in Gear protocol: rent for storing message in Waitlist
, Mailbox
and DispatchStash
(delayed sending), rent for storing gas reservation for the program. They're reserving some gas for future payment on elements entry into that paid storage. Once removed from the storage, reserve was used to pay exact amount for blocks held in there: it has been sending to the current block producer, that's a little unfair, while still approximated on a long distance.
New behaviour implements special pool for such charges, which is now split between all validators at the end of each era, according to their era points!
🔥📖 Module for adding builtin actors was implemented (#3624);
Note
Now it's possible to derive some program ids to dedicated parts of the runtime that has access to any data and calls of the runtime. Furthermore, it will be visible for existing programs.
For example, this module will allow staking builtin actor to be implemented, so the programs will be able to stake their balance just as like as real users do!