Gear Tech Gear Versions Save

Web3 Ultimate Execution Engine

build

1 week ago

v1.4.1

1 month ago

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: https://github.com/gear-tech/gear/compare/v1.4.0...v1.4.1

v1.4.0

1 month ago

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: https://github.com/gear-tech/gear/compare/v1.3.1...v1.4.0

v1.3.1

1 month ago

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: https://github.com/gear-tech/gear/compare/v1.3.0...v1.3.1

v1.3.0

1 month ago

Release v1.3.0 changes

  • Crates versions bumped to "v1.3.0", runtime spec version bumped to 1300 (#3869);
  • Weights of extrinsic and WASM calls WERE updated (#3876), schedule version bumped to 1300 in order to re-instrument codes with CHEAPER costs;

Update requirements

Name Character
JS clients ⚪ Insubstantial
Programs 🟡 Recommended
Node bin 🔴 Required

User-space

📚 gtest now uses real instruction costs for its executions, so charging has became more like on-chain (#3808);


📚 Fixed gtest bug caused panic in tests on zero balance call of gr_exit() (#3848);


📚 Fixed gear-wasm-builder bug caused compile problems when following gear-wiki steps (#3864);


📚 Added new function to gtest that allows to query already submitted within the system code by it's code id (#3878);

[!TIP] It's interface looks like following code snippet:

let mut sys = gtest::System::new();

// ...
// Uploading some code here, and storing code_id
// ... 

let _code: Vec<u8> = sys.submitted_code(code_id).unwrap();

📚 Error type of gstd containing reply error code was extended (#3808);

[!NOTE] Async futures of gstds "for_reply" sendings now in case of error return not only error reply code, but the payload as well, so even general case of unwrapping communication result become more informative.

Runtime

📚 Node client was highly optimised in terms of executing programs and initialising WASM modules on-chain (#3801);

[!NOTE] Now it uses in-memory LRU caching instead of legacy variant of always touching disk space. This significantly decreases execution costs, but increases load on hardware RAM, which is totally safe since it limited in a conservative way. Previous approach still valid and will be dynamically turned on in case of any problems with RAM caching.


📚 Instrumented on-chain codes now always contain stack end parameter that optimises its handling and increases pallets simplicity and safety (#3811);

Key-features of the release

📚 Gear repo migrated to a new fork (polkadot-sdk) and updated used substrate version to v1.1.0 (#3814);

[!IMPORTANT] Please make sure everything you use as standard substrate interface is properly migrated in your JS applications.

🔥📖 First builtin actor implemented 🥳 (#3771);

[!NOTE] Basing on #3624 (look up release v1.2.0 for details), the first actor will be available on-chain by its unique account id that could be queried in a decentralised and trusted way by RPC call of pallet-gear-builtin. This actor implements logic of bls12-381 interfaces that are executed outside of WASM runtime, so they're cheap and fits in a block a lot of times, which wasn't previously possible. Any actor (especially programs) may send request for calculations to the actor and wait for reply with results if enough gas was applied, so be care there!

[!TIP] Having such basic and useful cryptography makes real a lot of scenarios of web2 to be implemented on-chain!

[!IMPORTANT] Calculations of this builtin are implemented with runtime interface of the node, so upgrade of your node client is MUST TO UPDATE in order to be able import blocks or keep online. Nodes replacement must be preformed before upgrades of the network.

Full Changelog: https://github.com/gear-tech/gear/compare/v1.2.1...v1.3.0

v1.2.1

2 months ago

Release v1.2.1 changes

  • Crates versions bumped to "v1.2.1", runtime spec version bumped to 1210;

Update requirements

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

Runtime

📚 Bug fixes and stability improvements

Full Changelog: https://github.com/gear-tech/gear/compare/v1.2.0...v1.2.1

v1.2.0

3 months ago

Release v1.2.0 changes

  • Crates versions bumped to "v1.2.0", runtime spec version bumped to 1200 (#3806);
  • Weights of extrinsic and WASM calls was NOT updated, schedule version bumped to 1200 to force new checks (#3806);
  • ⚠️ Gas price multiplier dumped from 25 value per gas to 6 value per gas, so all transactions and execution become 4x+ times cheaper in terms of tokens (#3806).

Update requirements

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

User-space

📚 All requirements for codes to be uploaded now checked at compile time using gear-wasm-builder (#3649);



📚 Gas limit argument become optional if using gcli for submitting transactions (#3753);

[!NOTE] Previously, if passed --gas-limit=0 or skipped, than rpc call calculate_gas took place. Now this behaviour was changed: if explicitly set --gas-limit=0 than zero is used, while if skipped - it will be calculated.

Runtime

📚 Bug of returning Error::DuplicateWake between program executions was fixed (#3475);

[!NOTE] Previously, flow of program execution wake(x) -> wait/wake(self) -> wake(x) was returning error on the last wake, while now it properly wakes the message.

[!IMPORTANT] Don't forget that waking the same message within one execution (wake(x) -> wake(x)) is still an error and will be like that according to protocol design.


📚 Bug of missing re-instrumentation in reading state RPC calls, resulting in inability to read state, was fixed (#3759);


📚 Bug of returning block gas limit from calculate gas RPC call in case of finite waits was fixed (#3780);


📚 Bug of expiring payload while gr_send_commit results in an error was fixed (#3785);


📚 The total amount of outgoing bytes was limited to prevent validators memory overflow (#3743);

[!IMPORTANT] While amount of outgoing messages allowed within one message is kept the same - 1024 pcs, total amount of bytes kept in memory at the same time for sendings was limited by 64MB.

[!WARNING] If your program was sending more than 64MB within one execution, it won't work on upgrade. Make sure to migrate it in time.

⚠️ New code restrictions

📚 Now it's unable to upload or use codes that declare export as imports (#3694);


📚 Now it's unable to upload or use codes that declare data section outside static memory: 0..WASM min memory pages, (#3733);


[!WARNING] If your program doesn't fit in new restrictions, on upgrading runtime to this version, it will stop working. Make sure to migrate it in time.

Key-features of the release

📚 New RPC call gear_calculateReplyForHandle was implemented (#3790);

[!TIP] This RPC call accepts arguments similar to Gear::send_message extrinsic and allows to run queue with the message to collect reply details: payload, value and reply code. Combination of this with gas calculation will serve a great UI/UX for your dApp!

[!NOTE] None of the changes will be applied to the blockchain database. It's usage only for informational/query purposes to "predict" reply for such sending.

[!IMPORTANT] RPC call related to gas calculation kept the same, but now has aliases. These aliases soon will become defaults and legacy names will be deprecated, so it's recommended to change your client code for new approach. Checkout following snapshot:

- gear_calculateInitCreateGas
+ gear_calculateGasForCreate

- gear_calculateInitUploadGas
+ gear_calculateGasForUpload

- gear_calculateHandleGas
+ gear_calculateGasForHandle

- gear_calculateReplyGas
+ gear_calculateGasForReply

🔥📖 Rent distribution was redesigned (#3686);

[!NOTE] There are some rents presented in Gear protocol: rent for storing message in Waitlist, Mailbox and DispatchStash (delayed sending), rent for storing gas reservation for the program. They're reserving some gas for future payment on elements entry into that paid storage. Once removed from the storage, reserve was used to pay exact amount for blocks held in there: it has been sending to the current block producer, that's a little unfair, while still approximated on a long distance.

New behaviour implements special pool for such charges, which is now split between all validators at the end of each era, according to their era points!

🔥📖 Module for adding builtin actors was implemented (#3624);

[!NOTE] Now it's possible to derive some program ids to dedicated parts of the runtime that has access to any data and calls of the runtime. Furthermore, it will be visible for existing programs.

For example, this module will allow staking builtin actor to be implemented, so the programs will be able to stake their balance just as like as real users do!

Full Changelog: https://github.com/gear-tech/gear/compare/v1.1.1...v1.2.0

v1.1.1

4 months ago

Release v1.1.1 changes

  • Crates versions bumped to "v1.1.1", runtime spec version bumped to 1110;
  • Weights of extrinsic and WASM calls updated, schedule version bumped to 1110.

Update requirements

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

User-space

📚 New testing function has been added to gtest that allows to assert that message panicked with specific string (#3670);

[!TIP] Check out following gtest API snapshot:

 let panic_msg = "panic!";
- assert_eq!(result.log().len(), 1);
-     assert!(matches!(
-         result.log()[0].reply_code(),
-         Some(ReplyCode::Error(ErrorReplyReason::Execution(
-             SimpleExecutionError::UserspacePanic
-        )))
-     ));
-     let payload = String::from_utf8(result.log()[0].payload().into())
-         .expect("Unable to decode panic message");
-     assert!(payload.contains(&format!("panicked with '{panic_msg}'")));
+ result.assert_panicked_with(panic_msg);

📖 New CLI util implementing keystore/keyring has been added: gring (#3619);


📚 Crates.io bug with gtest on v1.1.0 version fixed (#3704);

Runtime

📚 Programs code reinstrumentation failure no longer supposed to be unreachable so from now on handled as succeeded error case (#3690);

[!NOTE] This increases stability of the protocol and adds more recovery cases from some state invalidity.


📖 Added ability to decline a voucher issued for you, marking it expired (#3725);

[!TIP] This significantly increases UX of signless apps.

Full Changelog: https://github.com/gear-tech/gear/compare/v1.1.0...v1.1.1

v1.1.0

4 months ago

Release v1.1.0 changes

  • Crates versions bumped to "v1.1.0", runtime spec version bumped to 1100 (#3679);
  • Weights of extrinsic and WASM calls updated, schedule version bumped to 1100 (#3677).

Update requirements

Name Character
JS clients 🔴 Required
Programs 🟡🔴 Recommended / Required
Node bin ⚪ Insubstantial

User-space libraries

📖 New syscall gr_env_vars() that allows to query some actual blockchain parameters added (#3403);

[!TIP] Check out following gstd API snapshot:

use gstd::exec;

let vars = exec::env_vars();

// Current multiplier percent recommended to use with explicit gas amounts.
let _ = vars.performance_multiplier;

// Current value of existential deposit (minimum balance).
let _ = vars.existential_deposit;

// Current value of mailbox threshold (minimum gas applied for message to user to be inserted into `Mailbox`).
let _ = vars.mailbox_threshold;

// Current value of gas multiplier (how much value, where value is 10^(-12) Token, is in a single gas).
let _ = vars.gas_multiplier;

📖 Crate level documentation added for gtest (#3419, #3511);


* Public gsdk API functions that returns WS subscriptions were renamed (#3456);

[!TIP] blocks and finalized_blocks changed to subscribe_blocks and subscribe_finalized_blocks accordingly: Check out following gsdk API snapshot:

use gsdk::Api;

let api = Api::new(None).await?;
- let blocks = api.blocks().await?;
+ let blocks = api.subscribe_blocks().await?; 
     
while let Ok(block) = blocks.next().await {
     // .. // 
}

📖 All usages of Rust nightly's features moved under each own gstd feature, general feature "nightly" that enables all of the others added as well (#3470);

[!WARNING] It may break compilation: please, doublecheck your features set of gstd import according to latest docs. As well as It mayn't cause users due to changes about compiling below.


[!NOTE] It won't cause users due to changes about compiling below.


📚 Added ability to pre-process out binary in gear-wasm-builder if not shortcuts used (#3538);


📚 New syscall free_range that allows to free multiple pages at once added (#3467);

[!NOTE] This syscall is now used in lates versions of default galloc allocator for gear programs, so its usage become cheaper (#3611).


📚 Added ability to derive custom CLI applications based on gcli commands (#3573);


📚 Logging for uploaded program id added in gcli (#3568);


📚 Added dbg! macro for gstd (#3610);

[!NOTE] Its usage is identical to Rust std one: link


📚 Time-limited wait of programs now will be handled and processed by gtest (#3605);


📚 Timestamp increase for each block for gtest set same as for real chain: 3 sec per block (#3516);


📖 gstd now has critical hooks: the code guaranteed to be executed even if panic occurs (#3503);

[!TIP] This API allows to revert state changes applied if something went wrong with business process. Check out a small demo and dive into gstds module docs for more info:

use gstd::{critical, msg};

#[gstd::async_main]
async fn main() {
    let source = msg::source();

    critical::set_hook(move || {
        msg::send(source, "I failed :c", 0).expect("Failed to send emergency message");
    });

    let reply = msg::send_for_reply(source, "Say my name", 0, 0)
        .expect("Failed to send message")
        .await
        .expect("Received error reply");

    // here goes "reply" processing //

    // processing ends panicking,
    // but user guaranteed to receive emergency message.
}

🥳 Stable compiler

📖 Several panic handler verbose modes introduced through gstd features, allowing to optimally extract panic message even without nightly features, moreover panic handler no longer depend on compile mode or "debug" feature (#3527)

[!TIP] gstd panic format: panicked with '{message}'[ at '{location}']: location is optional. Note that resulting error reply with panic will have prefix Panic occurred: as well. This formatting is similar to Rust defaults.

gstd panic handler lvls:

  • panic-handler: message <unknown> without location;
  • panic-message: message from panic info without location; (!) [NEW gstd DEFAULT]
  • panic-location: message and location from panic info.

Nightly features optimise panic message extracting, but are no longer required.

[!IMPORTANT] This changes allow building gear programs with Rust stable toolchain!


📖 Usage of actual toolchain for building with gear-wasm-builder added (#3459).

[!IMPORTANT] Previously compilation of program using gear-wasm-builder were forcing using nightly toolchain from your system. It caused a lot of limitations, problems and legacy code. Even if you were building your crate as cargo +nightly-z-y-x build it called just cargo +nightly build etc. Now it will compile with toolchain that you specify in your cargo command. Furthermore, since gear programs are compiled with stable toolchain: this method is now strongly recommended! Don't forget to adjust your scripts and actions.

[!NOTE] gear_wasm_builder::build() uses your given toolchain: (!) [NEW gear_wasm_builder DEFAULT] gear_wasm_builder::recommended_nightly() uses your given toolchain but checks if it matches recommended nightly: for cases if you use nightly features and want to keep toolchain on recommended by core.

🥳 Crates.io

📖 All of gear programs user-space libraries now published on crates.io (#3103, #3515, #3594, #3629).

[!TIP] Now it's possible to import these packages as any other Rust ones in your toml. Say no to GitHub refs!

[dependencies]
galloc = "1.1.0"
gcli = "1.1.0"
gclient = "1.1.0"
gcore = "1.1.0"
gear-wasm-builder = "1.1.0"
gmeta = "1.1.0"
gsdk = "1.1.0"
gstd = "1.1.0"
gtest = "1.1.0"

[!IMPORTANT] An error occurred while publishing side-dependencies, so if you face some issues with version "1.1.0" use "1.1.1-rc.0" instead.

Runtime

📖 Program memory pages storage are now represented as triple map (#3166);

[!WARNING] It causes ProgramStorage as well as MemoryPages storage: keeping relations changed from program id -> page number to program id -> session id -> page number It may brake your JS code!


📚 Stack limitations are precised for more stable behaviour of the system (#3462);


📚 Added create Numerated as initial step of road to 4GB memory limitation for programs (#3471);


📚 Codes with non-empty WASM functions inputs and outputs of gear entry points are now rejected by the system on upload (#3559);

[!NOTE] Such WASMs may be produced by the aim only, common recommended flow is correct.


📚 Added StakingAdmin origin for pallet-staking to be used from governance (#3633);


📖 Current rent functionality is now removed (#3590);

[!NOTE] Keeping programs on-chain is now totally free in order to implement more optimal solution proposal.


📖 Added revokable functionality for vouchers (#3606);

[!IMPORTANT] It may break your JS code!

  • Previous flow was deprecated and APIs removed.
  • Check out new extrinsics and their docs at pallet-gear-voucher.
  • Previously issued voucher couldn't be revoked and is still supported: it's recommended to finish them until upcoming releases.
  • Vouchers now can be used for Gear::upload_code as well (#3672).

📖 Removed support for syscall gr_pay_program_rent, since program rent is removed (#3664);

[!IMPORTANT] It invalidates any uploaded program that uses this syscall - they won't be able to execute! Make sure to migrate them until runtime upgrade to current release.

🥳 Calculate gas RPC calls bug fixes

📚 Fixed bug of incorrect calculations for rare waiting cases (#3609);


📚 <wasm:stripped> is no longer returned: extrinsic errors are printed properly with dedicated format (#3655);

[!TIP] Check out details in pull request description.


📚 Gas calculation doesn't return error in any case for zero-balanced accounts (as well as for vouchers) (#3653);

[!NOTE] No new calls implemented. To calculate gas for voucher call use default gear api with your origin.


📚 Return error instead of invalid huge gas in case of failing init as well as for traps in handle (#3674).

Full Changelog: https://github.com/gear-tech/gear/compare/v1.0.5...v1.1.0

v1.0.5

4 months ago

Release v1.0.5 changes

  • Crates and runtime version bumped to "1.0.5" (#3635).

Client updates required: NO External node/runtime api changed: NO Programs code refactoring level after update libs: NO

Runtime

  • Runtime logic optimisations and stability improvements.

Full Changelog: https://github.com/gear-tech/gear/compare/v1.0.4...v1.0.5