v1.2.0 Technical Update — Enhancing the Ecosystem

Gear Protocol
3 min readMar 19, 2024

--

v1.2.0 Releasae Version

The developer community is happy to announce the release of version v1.2.0 and runtime version 1200 to Gear Protocol. These updates further improve the user experience and overall the entire ecosystem.

The following mark the highlights of this release:

Crates and Runtime Version Update

This release upgraded the crates and runtime versions to “v1.2.0” (#1200). This adjustment ensures the continued integrity of Gear protocol within the execution layer and user space libraries. Importantly, this update does not necessitate any modifications to existing programs.

User-space

  • Compile-time Code Requirement Checks (#3649): All code uploads now undergo comprehensive requirement checks during compilation.
  • Enhanced Error Descriptions: Updates (#3695, #3757) have improved the error-handling process by providing detailed descriptions for errors caused by incorrect code uploads.
  • Optional Gas Limit Argument: The gas limit argument has been made optional when using gcli for submitting transactions (#3753). Previously, if the gas limit was set to zero or skipped, the rpc call calculate_gas was executed. However, with the latest changes, explicitly setting — gas-limit=0 now results in using zero as the gas limit, while skipping the argument triggers automatic calculation of the gas limit.

Node Binary Updates:

This update requires updating Node bin to ensure optimal performance, security and compatibility.

Runtime Enhancements & Bug Fixes

  • The bug causing the return of Error::DuplicateWake between program executions was resolved (#3475). Previously, the flow of program execution wake(x) -> wait/wake(self) -> wake(x) resulted in an error on the last wake.

Note: Waking the same message within one execution (wake(x) -> wake(x)) remains an error according to protocol design.

  • A bug causing missing re-instrumentation in reading state RPC calls, leading to an inability to read state, has been addressed (#3759).
  • Another bug where the block gas limit was returning the block has limit from the RPC call during finite waits has been resolved (#3780).
  • An issue causing payload expiration while gr_send_commit resulted in errors has been fixed (#3785).
  • To prevent validator memory overflow, the total amount of outgoing bytes has been restricted (#3743).

Note:

  • While the limit of outgoing messages within one message remains unchanged at 1024, the total amount of bytes kept in memory for sending has now been limited to 64MB.
  • Programs sending more than 64MB within one execution won’t function properly after the upgrade. Ensure timely migration to avoid disruption.

New Code Restrictions

  • Codes with export declared as imports (#3694) are no longer supported.
  • Codes declaring data section outside static memory (0..WASM min memory pages) are now restricted (#3733).

Key-features of the release

New RPC Call Implementation (#3790)

  • The release introduces a new RPC call, gear_calculateReplyForHandle. This call processes messages to predict reply details such as payload, value, and reply code.
  • It also improves the UI/UX aspect of decentralized applications.
  • None of the updates affect the blockchain database directly. Instead, they serve informational and query purposes, offering insights to predict replies for message sending operations.
  • While the RPC call related to gas calculation remains unchanged, aliases have been introduced. These aliases will become defaults, with legacy names being deprecated. Thus, update your client code to ensure compatibility with the new approach.

Rent Distribution Redesign (#3686):

  • The Gear protocol incorporates various rents for storing messages in Waitlist, Mailbox, and DispatchStash, as well as reserving gas for program usage.
  • Previously, when removing elements from paid storage, the reserved gas was sent solely to the current block producer, which posed fairness concerns over the long term.
  • With the redesign, a special pool now handles these charges, and they’re distributed among all validators at the end of each era based on their era points.
  • The update aims to improve fairness and efficiency in gas reservation and distribution within the protocol.

Module for Adding Builtin Actors (#3624):

  • This update introduces a module enabling the addition of builtin actors to specific parts of the runtime.
  • Program identifiers (program ids) can now be derived for dedicated parts of the runtime, granting access to data and runtime calls.
  • One of the use cases include programmatic staking capabilities become available, allowing programs to stake their balances.

Full Changelog

For a comprehensive list of changes, please refer to the Full Changelog.

Be prepared and stay tuned for essential technical updates!

--

--

Gear Protocol

A new advanced smart-contract engine allowing anyone to launch any dApp. Easiest and cost-effective way to run WebAssembly