github gear-tech/gear v1.7.0

pre-release9 hours ago

Release v1.7.0 changes

  • Crates versions bumped to "v1.7.0”, runtime spec version bumped to 1700 (#4352);

Update requirements

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

Don't miss a new gear release

NewReleases is sending notifications on new releases.