Web3 Ultimate Execution Engine
"v1.4.1"
, runtime spec version bumped to 1410
(#3955);Name | Character |
---|---|
JS clients | ⚪ Insubstantial |
Programs | ⚪ Insubstantial |
Node bin | ⚪ Insubstantial |
[!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"
, runtime spec version bumped to 1400
(#3951);1400
in order to re-instrument codes with new restrictions check (#3952);Name | Character |
---|---|
JS clients | 🔴 Required |
Programs | ⚪ Insubstantial / 🔴 Required (depending on logic of the program) |
Node bin | ⚪ Insubstantial |
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);[!TIP] Check out
cargo-gbuild
extension that allows you to build optimised and valid gear programs (wasm) withoutgear-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.
[!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.
1024
in favour of security and platform stability (#3911);[!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 */ }
[!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.
[!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"
, runtime spec version bumped to 1310
(#3946);Name | Character |
---|---|
JS clients | ⚪ Insubstantial |
Programs | ⚪ Insubstantial |
Node bin | ⚪ Insubstantial |
gear-wasm-builder
with crates containing dashes in name caused by changes in 1.79.0 Rust nightly (#3923);crates.io
caused by Rust nightly (#3905);[!NOTE] Previously, minimum balance was 10 Vara for account to exist.
[!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"
, runtime spec version bumped to 1300
(#3869);1300
in order to re-instrument codes with CHEAPER costs;Name | Character |
---|---|
JS clients | ⚪ Insubstantial |
Programs | 🟡 Recommended |
Node bin | 🔴 Required |
gtest
now uses real instruction costs for its executions, so charging has became more like on-chain (#3808);gtest
bug caused panic in tests on zero balance call of gr_exit()
(#3848);gear-wasm-builder
bug caused compile problems when following gear-wiki steps (#3864);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();
gstd
containing reply error code was extended (#3808);[!NOTE] Async futures of
gstd
s "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.
[!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.
stack end
parameter that optimises its handling and increases pallets simplicity and safety (#3811);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.
[!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 ofbls12-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"
, runtime spec version bumped to 1210
;Name | Character |
---|---|
JS clients | ⚪ None |
Programs | ⚪ None |
Node bin | ⚪ None |
"v1.2.0"
, runtime spec version bumped to 1200
(#3806);1200
to force new checks (#3806);Name | Character |
---|---|
JS clients | ⚪ Insubstantial |
Programs | ⚪ Insubstantial |
Node bin | 🟡 Recommended |
gear-wasm-builder
(#3649);gcli
for submitting transactions (#3753);[!NOTE] Previously, if passed
--gas-limit=0
or skipped, than rpc callcalculate_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.
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 lastwake
, 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.
gr_send_commit
results in an error was fixed (#3785);[!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.
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.
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
[!NOTE] There are some rents presented in Gear protocol: rent for storing message in
Waitlist
,Mailbox
andDispatchStash
(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!
[!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!
"v1.1.1"
, runtime spec version bumped to 1110
;1110
.Name | Character |
---|---|
JS clients | ⚪ Insubstantial |
Programs | ⚪ Insubstantial |
Node bin | ⚪ Insubstantial |
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);
gring
(#3619);[!NOTE] This increases stability of the protocol and adds more recovery cases from some state invalidity.
decline
a voucher issued for you, marking it expired (#3725);[!TIP] This significantly increases UX of signless apps.
"v1.1.0"
, runtime spec version bumped to 1100
(#3679);1100
(#3677).Name | Character |
---|---|
JS clients | 🔴 Required |
Programs | 🟡🔴 Recommended / Required |
Node bin | ⚪ Insubstantial |
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;
gtest
(#3419, #3511);gsdk
API functions that returns WS subscriptions were renamed (#3456);[!TIP]
blocks
andfinalized_blocks
changed tosubscribe_blocks
andsubscribe_finalized_blocks
accordingly: Check out followinggsdk
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 {
// .. //
}
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.
nightly-2023-09-05
(#3536);[!NOTE] It won't cause users due to changes about compiling below.
gear-wasm-builder
if not shortcuts used (#3538);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).
gcli
commands (#3573);gcli
(#3568);dbg!
macro for gstd
(#3610);[!NOTE] Its usage is identical to Rust
std
one: link
gtest
(#3605);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
gstd
s 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.
}
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 prefixPanic 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; (!) [NEWgstd
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!
gear-wasm-builder
added (#3459).[!IMPORTANT] Previously compilation of program using
gear-wasm-builder
were forcing usingnightly
toolchain from your system. It caused a lot of limitations, problems and legacy code. Even if you were building your crate ascargo +nightly-z-y-x build
it called justcargo +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: (!) [NEWgear_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.
📖 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.
[!WARNING] It causes
ProgramStorage
as well asMemoryPages
storage: keeping relations changed fromprogram id -> page number
toprogram id -> session id -> page number
It may brake your JS code!
Numerated
as initial step of road to 4GB memory limitation for programs (#3471);[!NOTE] Such WASMs may be produced by the aim only, common recommended flow is correct.
StakingAdmin
origin for pallet-staking
to be used from governance (#3633);[!NOTE] Keeping programs on-chain is now totally free in order to implement more optimal solution proposal.
[!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).
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.
<wasm:stripped>
is no longer returned: extrinsic errors are printed properly with dedicated format (#3655);[!TIP] Check out details in pull request description.
[!NOTE] No new calls implemented. To calculate gas for voucher call use default gear api with your origin.
"1.0.5"
(#3635).Client updates required: NO External node/runtime api changed: NO Programs code refactoring level after update libs: NO