Gear Technical Updates | March 2023 Recap

Gear Protocol
3 min readApr 6, 2023

Welcome to the March 2023 update, exemplifying another month of considerable progress.

Let’s explore the major tech updates below:

A notable update is Pull Request #2174, which introduced a proposal for errors that stabilizes ExtError and new stable simple errors. These errors can now be used in handle_signal and handle_reply entry points, making error handling more convenient for users. With the addition of new error values, the update has simplified error handling in Gear’s software. These changes will enhance the user experience and improve overall performance.

Another significant update is the addition of the gr_panic sys-call — a new API function smart contracts can call in case of a irrecoverable error — through Pull Request #2200.

Pull Request #2239 modified the signatures of the gr_alloc and gr_free sys-calls to make them more compatible with languages other than Rust and ensured that calling API functions will not halt Gear programs from running, unless it is a gas charging error.

Several charging-related changes were made to enhance the performance of its software.

  • Charging was removed for pages before execution, except for static pages. Wasm can have a data section in static pages placed in memory during wasm instantiation. The feature inspired Gear’s update
  • Charging for pages in alloc was removed, except for charging for grow.
  • Charging was added for pages accesses in sys-calls.
  • Gear also refactored lazy-pages to work effectively with signal and host function accesses. These changes enhance the overall performance of Gear’s software and provide a better user experience.

The gsdk and gclient APIs in Gear’s software were updated through Pull Request #2325 to provide more flexibility in mailbox messaging. Users can now pass an optional parameter in the “get_mailbox_account_message” function to retrieve all messages or only those for a specified address. The gclient API also includes new functions for fetching messages by signer or specified destination. These changes aim to improve mailbox messaging efficiency and user experience.

Pull Request #1781 in Gear’s software introduced updates to the lifecycle of delayed messages in “gtest” library. The changes include adding delayed dispatches into a queue and processing them after a set number of blocks. These updates aim to improve the user’s experience with managing delayed messages.

Here’s a summary of the technical changes:

Core Updates

Pull Request #2174

Contributors made changes to error handling more convenient for users. They added new error values that are easier to handle in certain parts of our software.

Pull Request #2200

A new API function called “gr_panic” was added, which can be called from smart contracts in case of a irrecoverable error.

Pull Request #2239

Signatures of “gr_alloc” and “gr_free” API functions were changed to simplify language compatibility when writing smart contracts in languages other than Rust. Gear also ensured that calling API functions won’t stop Gear programs from running unless it’s a gas charging error.

Pull Request #2216

Gas charging for the memory pages has been completely reworked. Some double charging fees has been removed, so the overall execution cost has been reduced.

Pull Request #2379

It’s possible to get all mailbox messages when writing tests using the “gclient” library.

Pull Request #1781

Now “gtest” library supports delayed messages which made writing tests more convenient

Pull Request #2331

Now it is possible to copy uploaded program from one network to another using the “gclient” library (see docs for detail: https://docs.gear.rs/gclient/struct.GearApi.html#method.migrate_program)

The Gear community has worked to enhance the Gear Protocol to ensure it runs smoothly and users have a positive experience.

Join Gear and Start Building

If you’re a builder or developer looking to leverage Gear Protocol’s unique capabilities for decentralized and autonomous smart contract development, join the Gear community. Asynchronous messaging and gas reservation support enable multiple use cases, facilitating new decentralized functionality and value for users in the blockchain ecosystem. Contact Gear at hello@gear-tech.io to learn more and start collaborating with the Gear Community.

--

--

Gear Protocol

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