Skip to content

Releases: gear-tech/gear

build

06 Feb 21:42
0a9b9bc
Compare
Choose a tag to compare
build Pre-release
Pre-release
fix(crates-io): fix late partial publishing  (#4491)

v1.7.1

03 Feb 11:45
b006a00
Compare
Choose a tag to compare

Release v1.7.1 changes

  • Crates versions bumped to "v1.7.1”, runtime spec version bumped to 1710 (#4487);
  • Weights of extrinsic and WASM calls WERE NOT updated.

Update requirements

Important

Upcoming release will deprecate previous approach of reading state inside programs using fn state() and applicable RPC calls read_state/read_state_using_wasm as well as gmeta crate, in favor of sails-like approach of calculate_reply_for_handle and required dispatch (read, immutable) functions inside fn handle. Make sure to migrate your programs to the new approach. Previously uploaded programs will work for some amount of releases.

Warning

It's still not recommended to use windows-based nodes for blocks validation.

Name Character
JS clients βšͺ Insubstantial
Programs βšͺ Insubstantial
Node bin 🟑 Recommended

Key features

πŸ”₯πŸ“š Optimized performance of weak hardware validators caused by sandbox executor (#4420);

Tip

Due to this update, it's recommended to update node binary.


πŸ”₯πŸ“š Builtin actors implementation got extended by tracking block gas allowance (#4345).

Note

This update increases stability on corner cases and makes execution time more predictable.

Userspace

πŸ“š Changed test-purpose implementation of ActorId's From<u64> (#4377);

Tip

Now it puts u64 bytes from idx 12, instead of 0.


πŸ“š Fixed gtest memory limit for programs: up to 2gb, matching real production (#4391);


πŸ“š Recommended nightly rust version bumped to one of the latest (#4404);


πŸ“š gear-wasm-builder now pays attention on workspace patches (#4478);


πŸ“š gcore's function with_read_on_stask renamed to with_read_on_stack_or_heap (#4452);


πŸ“š Fixed conditional compilation of stack_debug macro in gcore (#4374).

Runtime

πŸ“š Removed legacy unreachable error type "UnsupportedMessage" in core execution crates (#4453);


πŸ“š Fixed gas benchmark for reservation_reply_per_byte syscall condition (#4361);


πŸ“š Removed floats from runtime on substrate migration regression (#4477).

Full Changelog: v1.7.0...v1.7.1

v1.7.0

23 Nov 18:10
de47744
Compare
Choose a tag to compare

Release v1.7.0 changes

  • Crates versions bumped to "v1.7.0”, runtime spec version bumped to 1700 (#4352);
  • Weights of extrinsic and WASM calls WERE updated (#4359), schedule version bumped to 1700 (#4359).

Update requirements

Warning

Since this release it's recommended to avoid using windows-based nodes for validation purposes, since they may produce unpredictable and non-consensus outcomes.

Name Character
JS clients πŸ”΄ Required (runtime metadata ext)
Programs 🟑 Recommended (gr_commit changed behaviour)
Node bin πŸ”΄ Required (runtime metadata ext)

Key features

πŸ”₯πŸ“š substrate version has been updated to 2409 (#4289):

Important

This change requires update of clients to support MetadataHashExtension and complete removal of native executor.

Tip

Added extension brings support of Ledger, using Polkadot Generic App πŸ₯³.


πŸ”₯πŸ“– New Built-in Actor with pallet-proxy functionality (#4259);


πŸ“– Sending messages by parts across wakes is deprecated now (#4304).

Important

Deprecation can break logic of programs that rely on this feature: calling gr_init -> any wait/wake logic, so the execution changes -> gr_push/gr_commit of previously initialized handle, since handle no longer exists.

Support of mentioned functionality was meaningless since the same workflow can be implemented in userspace just storing tempopary payloads in the memory. Removal of this improves protocol stability and reduces average gas consumption of the messages due to less load on storage.

Pseudocoded sample of code that now panics:

use gstd::msg::MessageHandle;

// Entry of your program: in gstd, sails or any other notations.
fn handle() {
	let msg_handle = MessageHandle::init();
	
	msg_handle
		.push("This part is pushed in the first execution;")
		.unwrap();

	// 
	//	Any type of wait-wake (interrupting) logic happens here.
	//
	//	Pay attention on async calls:
	//	they're more likely cause interruptions.
	//

	msg_handle
		.push("But this part is pushed in the second execution")
		.uwnrap();	// < Here the program will panic, since handle
					// < become unavailable after wake.
	
	msg_handle.commit(ActorId::from(42), 0).unwrap();
}

How to replace it:

use gstd::msg;

// Entry of your program: in gstd, sails or any other notations.
fn handle() {
	let mut buf = b"This part is pushed in the first execution;".to_vec();

	// 
	//	Any type of wait-wake (interrupting) logic happens here.
	//

	buf.push(b"But this part is pushed in the second execution".to_vec());

	gstd::msg::send_bytes(ActorId::from(42), buf, 0).uwnrap();
}

Resulting code costs less gas for execution, being also more readable and Rust-native.

Userspace

πŸ“– Message handles invalidate after wake (#4304);

Note

Details are in the end of release key features.


πŸ“š gbuiltin-* crates are now published on crates.io (#4306);


πŸ“š Fixed gclient issue of missing static pages on program dump (#4319).

Runtime

πŸ“š pallet-proxy filters adjusted to deny gear pallets usage for NonPayable type (#4342).

Full Changelog: v1.6.2...v1.7.0

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