Skip to content

Releases: gear-tech/gear

build

17 Nov 14:21
9d480ca
Compare
Choose a tag to compare
build Pre-release
Pre-release
refactor(runtime): adjust proxy filters (#4342)

v1.6.2

07 Oct 12:58
93eb5b5
Compare
Choose a tag to compare

Release v1.6.2 changes

  • Versions are bumped to 1.6.2 for crates and 1620 for runtime (#4281).

This release is intended to fix a few issues appeared with publishing previous v1.6.1, also implementing small fixes.
Runtimes are the same with v1.6.1 and v1.6.0.

Note

gtest v1.6.1 was yanked.

  • Gear tooling that run wasms now uses Wasmer instead of Wasmi as underlying executor (#4261);
  • Fixed gtest v1.6.1 bug caused user space panic for some rare cases (#4270);
  • gstd now uses waker-fn crate instead of custom waker for async runtime (#4271);
  • Fixed gstd documentation publishing caused by inclusion of ethexe feature (#4278).

Full Changelog: v1.6.1...v1.6.2

v1.6.1

28 Sep 07:35
94adcbc
Compare
Choose a tag to compare

Release v1.6.1 changes

This release is intended to fix a few issues appeared with cargo on publishing previous v1.6.0. Otherwise, they are identical.

Note

Buggy 1.6.0 gtest and gear-wasm-instrument were yanked.

If you're still on 1.5.0, consider bumping to 1.5.1 first.

  • Crates are now hard pinned to workspace versions (#4254);
  • Fixed gtest bug of already instrumented code instrumentation (#4258);
  • Versions of crates and runtime are bumped to 1.6.1 and 1610 accordingly (#4262).

Full Changelog: v1.6.0...v1.6.1

v1.6.0

24 Sep 10:45
7d1f0f9
Compare
Choose a tag to compare

Release v1.6.0 changes

  • Crates versions bumped to "v1.6.0", runtime spec version bumped to 1600 (#4249);
  • Weights of extrinsic and WASM calls WERE updated (#4245), schedule version bumped to 1600 (#4249).

Important

📖 With this release requirement to minimal stable rust version to compile gear crates (such as gstd) was bumped from v1.80 to v1.81 in order to fix panic info message parsing (#4098).

Tip

To update your stable compiler, run rustup update stable.

Update requirements

Name Character
JS clients 🟡 Recommended (calculate_reply call)
Programs 🟡 Recommended (gtest code)
Node bin 🟡 Recommended (modules serialisation)

Userspace

📚 gsdk and gclient now support voucher operations (#4129);

Tip

Usage example:

#[tokio::test]
async fn sample() -> Result<()> {
    // Creating gear api.
    let api = GearApi::dev().await?;

    // Issue voucher
    let (voucher_id, ..) = api.issue_voucher(/* voucher params */).await?;

    // Upload code with voucher
    let (code_id, _) = api
        .upload_code_with_voucher(voucher_id, WASM_BINARY)
        .await?;
}

📚 subxt dependency bumped to v0.37.0 (#4151);


📚 gear-wasm-builder now can check reentrancy of different versions of the same dependency gstd while building (#4159);

Tip

You can banned list with __GEAR_WASM_BUILDER_DENIED_DUPLICATE_CRATES env variable.


📚 gear-wasm-builder::build() now returns paths to artefacts (#4209);


📚 gsdk now based on builder pattern (#4225);

Tip

- Api::new_with_timeout(endpoint.as_deref(), timeout)

+ Api::builder()
+     .timeout(self.timeout())
+     .build(endpoint.as_deref())

📚gear-wasm-builder now builds WASMs with -Ctarget-cpu=mvp to match actual changes in executors, parsers and upcoming rust releases, solving problem of compiling with beta (#4247).

Runtime

📚 Added governance-ruled option to split gas fees between block producers and treasury (#3652);


📚 Modules serialisation on node side has been optimised (#4055);

Tip

This update will make computations easier for your machine.


📚 Now reservations that were just created and unreserved free locked gas back to execution (#4165);


📚 Previous pallet_gear_voucher::call_deprecated was totally removed from the runtime (#4168);


📚Syscalls that send input bytes now have more internal assertions and return error on out of bounds (#4186);


📚 Serialisation of payload bytes of ReplyInfo type, returned from gear_calculateReplyForHandle rpc call, replaced with hex (#4238).

Important

This may broke your clients, make sure to support hex parsing.

Key feature

🔥📖 gtest has received a significant update, matching it much closer to actual runtime:

  • It now uses real weights from runtime (#4148);
  • Block execution model refined with similar from runtime (#4119);

Tip

It's no longer execute message in place of its sending. You need to manually rotate blocks.

- let res = prog.send_bytes(from, b"Let's go!");
- assert!(!res.main_failed());

+ let mid = prog.send_bytes(from, b"Let's go!"); // send message
+ let res = system.run_next_block(); // run blocks to get run results 
+ assert!(res.succeed.contains(&mid)); // success assert 
  • Value and existential deposit management improved to match runtime (#4111);
  • Delayed sendings (dispatch stash), mailbox, waitlist, rent charging and message queue processing are also adjusted (#4157, #4193, #4194, #4200, #4207);
  • Reservations management now matches runtime (#4196);
  • Mocks bugs are fixed (#4220);
  • Usage panics are more user friendly (#4223).

Full Changelog: v1.5.0...v1.6.0

v1.5.0-1

31 Aug 16:26
Compare
Choose a tag to compare

Release v1.5.0-1 changes

Important

This release is intended to fix the bug of inability to call payout_stakers extrinsic

Full Changelog: v1.5.0...v1.5.0-1

v1.5.0

11 Aug 17:47
Compare
Choose a tag to compare

Release v1.5.0 changes

  • Crates versions bumped to "v1.5.0", runtime spec version bumped to 1500 (#4114);
  • Weights of extrinsic and WASM calls WERE updated (#4136), schedule version bumped to 1500 (#4114).

Important

📖 With this release requirement to minimal stable rust version to compile gear crates (such as gstd) was bumped from v1.73 to v1.80 (#4124).

📖 Moreover, wasm-proc crate is now published on crates-io so could be installed with native cargo interface instead of git dependency (#4124).

Note

While depending on crates-io source of gear packages is recommended way, if you prefer specifying git (and your revision is before #4124), without stable update you may run into following error of gsys crate compilation:

error[E0425]: cannot find function `size_of` in this scope

Tip

To update your stable compiler, run rustup update stable.

Update requirements

Name Character
JS clients ⚪ Insubstantial / 🔴 Required (depending on your application's logic)
Programs ⚪ Insubstantial / 🟡 Recommended (testing code)
Node bin 🟡 Recommended

Userspace

📖 Interface of gtest's mailbox was refactor to match on-chain one (#4010);

Tip

Check out following code snippet how mailbox interactions work now:

/* some testing code */

// Executing some message.
let res = some_program.send(/* args */);

// Asserting execution didn't fail.
assert!(!res.main_failed());

// Asserting some log exists.
assert!(res.contains(&some_log));

// Querying mailbox.
let mailbox = system.get_mailbox(/* some log destination (user) */);

// Asserting mailbox contains the log.
assert!(mailbox.contains(&some_log));

// Sending and executing reply.
let res = mailbox
    .reply(some_log, Calls::default(), 0)
    .expect("sending reply failed: didn't find message in mailbox");

// Asserting reply execution result.
assert!(!res.main_failed());

/* some testing code */

📖 gtest now supports message sending with custom gas limit (#4039);

Note

Previously it was only possible to send message to program with maximal gas limit, so new api was added for gtest's programs:

some_program.send_with_gas(/* usual args */, gas_limit)

📚 Bug of incorrect behavior of gstd::dbg! macros causing compilation failures without debug feature was fixed (#4044);


📖 Added ability to apply custom hook for processing replies on gstd's "*_for_reply" functions (#4046);

Tip

This hook could be used to perform some custom calculations on reply receiving inside handle_reply entry. Note, that it requires non-zero reply deposit to be applied to message's reply future. This functionality could also be used to handle outdated (timed out) replies that you no longer wait, but have to make refund or something.

use gstd::msg;

/* some code */

let _reply = msg::send_for_reply(dest, payload, value, non_zero_reply_deposit)
    .expect("Failed to send message")
    .up_to(Some(5))
    .expect("Failed to set timeout")
    .handle_reply(|| {
        // Imagine that we've receive reply after 1_000 blocks (already outdated,
        // because 5 blocks timeout set above), but this still called.

        debug!("Reply (to `message_id`) payload: {:?}", msg::load_bytes());

        msg::send(msg::source(), "Mate, I got your reply, but it's 955 blocks late", 0);
    })
    .expect("Failed to set reply hook")
    .await
    .expect("Received error reply or timed out");

/* some code */

Important

  1. The hook applies to only one reply.
  2. The hook may be specified just once, as well as will be executed just once.
  3. If you panic in the hook, your reply won't be recorded so initial future will end up with timeout error.

📖 Logic dependent on system signals (e.g. handle_signal entry or critical sections) could now be properly tested with gtest (#4075);


📚 Fixed a huge gasp between on-chain gas consumption and gtest ones (#4088);

Note

Consumed gas inside gtest now pretty close to real one but still can differ.


📖 Logic dependent on reservations could now be properly tested with gtest (#4089);


📚 Added ability to create sails template from cargo-gbuild (#4096).

Tip

That's how you could call it:

cargo-gbuild new <PATH>

Runtime

📚 Substrate version bumped from v1.3.0 to v1.4.0 (#3934);

Important

Make sure to update your JS code according to Substrate's release notes.


📖 Value inheriting logic was redesigned (#3949);

Note

Once program exits (it also specifies some inheritor address) or fails it's initialisation (deployer address), the "grave" is left in storage associated with program's address. On such terminations all balance of the program is transferred to inheritor.

Previously, all other funds that could be transferred (or unlocked) to the program, were automatically transferred to inheritor, what's now no longer actual. From this release, all incoming funds will remain on program's balance until ANYBODY call extrinsic of pallet_gear - claim_value_to_inheritor(program_id). This call transfers all the available funds to inheritor (not the caller) if program is terminated, otherwise returns error.


📖 New invariant has been added to runtime and programs messaging (#4060);

Note

All gasless sending from gear programs now "charges" mailbox inclusion fee within the execution, so could always cover sending into user, otherwise freed.

In other words, gasless messages (non-replies) are always put in user's mailbox, what was different previously and was dependent on remaining message's gas balance.


📖 Similarly to invariant above, all reservation-provisioned messages sent to user are also always inserted in mailbox (#4102).

Key features of the release

📖 Primary executor for gear programs Wasmer has been updated to major v4 from major v2 (#4037).

Note

A lot of bugs and optimisations were applied within the update. Stability and security has been verified due to lots of tests and implementing specific fuzzer based on gear common ones, but aimed to catch executor errors in memory management and codes compilation (#4005).

🔥📖 New builtin actor, that implements pallet-staking functionality has been implemented (#3843);

Tip

Now programs are able to manage staking bonding/unbonding operations within the internal logic. This is great update in terms of flexibility of programs logic and improved funds-management and DeFi experience. Checkout gbuiltin-staking crate for details.

🔥📖 Memory limit for gear programs has been increased to 2GB (of 4GB theoretically possible) (#3954);

Note

To implement this, a lot of PRs and logic adjustments has been implemented in latest releases. In this one, allocations tree was moved into separate storage, so if you query them from external code (e.g. JS clients), make sure to perform updates. This limit is totally safe and tested, but some gap has been left for future changes, so 4GB will be set in observable future.

🔥📖 An interface of upcoming bridge has been added into Vara Network Testnet only (#4015);

Note

pallet-gear-eth-bridge will be tested and in future moved to mainnet with monitoring from trustless relayer, once testing from testnet-to-testnet and audit are finished.

Full Changelog: v1.4.2...v1.5.0

v1.4.2

19 Jul 16:21
Compare
Choose a tag to compare

Release v1.4.2 changes

  • Crates versions bumped to "v1.4.2", runtime spec version bumped to 1420 (#3969);
  • Weights of extrinsic and WASM calls from now on are benched on bare metal machine and WERE updated to fit new network costs (#3994), schedule version was bumped to 1420 (#4035);

Update requirements

Name Character
JS clients ⚪ Insubstantial / 🔴 Required (depending on logic of the program)
Programs 🟡 Recommended
Node bin 🔴 Required

User-space

📚 Supported operating of cargo workspaces in cargo-gbuild (#3960);


📚 Implemented GasTree for gtest (#3962);

Note

From now on, gtests mocking manages messages gas in the same manner as its done on-chain. Previously, all gasless were treated as gas allowance, that wasn't correct.

Warning

That kind of change may fail a lot of your tests, if you didn't calculate gas for them well. Don't worry and properly go through all of the gas limits you apply to your messages.


📚 Added empty implementations for all syscalls for non-wasm target (#3964);

Note

This allows to avoid windows compiling issues, as well as common building for non-wasm targets without extra features.


📚 Implemented new crate for ease of testing: gear-node-wrapper (#4003; #4041);

Note

This crate provides functionality of running separate nodes for tests, operating them through rust codes as OS processes.


📚 Previously implemented RPC call gear_calculateReplyForHandle now has rust api in gsdk and gclient (#3998);


📚 Many gsdk apis, previously required Option<T>, now may accept just T for simplicity (#4022);


📚 According to recent substrate update, primary pallet-balances transfer funcs supported in gsdk and gclient (#4027);

Runtime

📚Allocations of the programs now stored as numerated::IntervalsTree instead of BTreeSet (#3791);

Note

That's one of the latest steps of implementing unlimited memory (up to 4GB due to 32bit arch of WASMs used) for program within Gear Protocol.


📚Fixed core bug of non-atomicity for syscalls that fail and don't revert states on failures (#3901);


📚 Approach of benchmarking was refined and appended with updated weights. Moreover, new benchmarks for WASM notion usages (such as tables etc) were measured (#3929; #4000)

Note

This highly improves security and stability of the network on corner cases and malicious programs.


📚Previous programs pausing logic were totally wiped (#3947);

Key-features of the release

🔥📖 Programs existence balances invariant implemented (#3961);

Note

From now on each active program is guaranteed to have balances key for it with non-zero balance: it has 1 Vara (ED) token locked as fixed deposit, that could only be withdrawn on programs gr_exit termination.

This highly simplifies code base and improves UX of network interacting due to absence of previous restrictions and bound in favour of just one token locked on each program creation. Moreover, it makes possible to guarantee safety of the upcoming updates such as staking built-in.

For already existing programs, migrations will provide supply for it from treasury.

Important

There's no more limits of outgoing value for programs' messaging and users' extrinsic: you can send even 1/(10^12) of token.


📚 Bls381 built-in actor was extended with new cryptographic calls (#3948);

Note

These fns are aggregate_g1 and map_to_g2affine, that are necessary for some operations.

Important

⚠️ This change caused changes in node binary (providing the host calls impl). And due to this change it's necessary to update before runtime upgrade with the release! Make sure to perform update of your RPC and validator in due time.


📚 Gear Protocol primitive types were merged into one single crate (#3919);

Note

If previously you were dependent on multiple gear crates such as gstd, gcore and even gsdk, you might have noticed, that each of these declares it's own primitives that convertible to others. This was causing a plenty of problems and difficulties while developing. Especially if we speak about io crates.

Now all of them (ActorId, CodeId, MessageId etc) are merged into gprimitives and used across all of our libraries within the project.

It's worth noticing that this crate re-exports primitive-types from parity and implements its own NonZeroU256 (#4012);

Full Changelog: v1.4.1...v1.4.2

v1.4.1

13 May 09:41
Compare
Choose a tag to compare

Release v1.4.1 changes

  • Crates versions bumped to "v1.4.1", runtime spec version bumped to 1410 (#3955);
  • Weights of extrinsic and WASM calls were NOT updated as well as schedule version;

Update requirements

Name Character
JS clients ⚪ Insubstantial
Programs ⚪ Insubstantial
Node bin ⚪ Insubstantial

Runtime

📚 Substrate dependency updated to version "1.3.0" (#3921);

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.
Do your own research on updated functionality in substrate by going through #3921 PR's description and parity's release notes.

Full Changelog: v1.4.0...v1.4.1

v1.4.0

08 May 13:32
aaadcdb
Compare
Choose a tag to compare

Release v1.4.0 changes

  • Crates versions bumped to "v1.4.0", runtime spec version bumped to 1400 (#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

v1.3.1

07 May 11:57
Compare
Choose a tag to compare

Release v1.3.1 changes

  • Crates versions bumped to "v1.3.1", runtime spec version bumped to 1310 (#3946);
  • Weights of extrinsic and WASM calls were NOT updated;

Update requirements

Name Character
JS clients ⚪ Insubstantial
Programs ⚪ Insubstantial
Node bin ⚪ Insubstantial

User-space

📚 Fixed bug in gear-wasm-builder with crates containing dashes in name caused by changes in 1.79.0 Rust nightly (#3923);


📚 Fixed bug in publishing crates on crates.io caused by Rust nightly (#3905);

Runtime

🔥 Existential deposit for Vara runtime decreased to 1 Vara 🥳 (#3944);

Note

Previously, minimum balance was 10 Vara for account to exist.


📚 Minimal voucher duration for issuing or prolongation decreased to 1 minute (20 Vara blocks) (#3944);

Note

Previously, minimal duration was 30 minutes (600 Vara blocks).

Full Changelog: v1.3.0...v1.3.1