Web3 Ultimate Execution Engine
"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
"1.0.4"
(#3630).This release does not affect gear protocols execution layer or user space libraries, so there is no need to update programs.
Node binary updates: NOT NECESSARY External node/runtime api changes level: PATCH
The only option how to execute runtime now is
wasm
.
Cost of governance operations on Vara runtime reduced by 5 times (#3620).
Fixed bug of incorrect post-calculation of Gear::run
s extrinsic weight (#3535).
All of the explorers (e.g.
polkadot.js.org/apps
) now show block weight correctly.
v0.9.43
to v1.0.0
(#3608).
pallet-im-online
no longer keeps data of heartbeat in storage, migrations applied;- Internal changes and improvement are present.
"1.0.3"
(#3522).This release does not affect gear protocols execution layer or user space libraries, so there is no need to update programs.
Node binary updates required: RECOMMENDED.
External node/runtime api changed: MAYBE.
API was slightly changed according to substrate changes, may not require any updates at the moment.
Patched substates default block proposer totally replaced with custom one. Gear block authorship now proposes block without
Gear::run
extrinsic (internal message queue processing with programs execution) in case ofGear::run
took too long time to execute, instead of previous logic of dropping the whole block.This unique mechanic makes Gear protocol implementors much more stable and fault-tolerant, even with weak hardware.
Node binary argument
--ws-port
was renamed into--rpc-port
, as well as--unsafe-ws-external
into--unsafe-rpc-external
.
v0.9.41
to v0.9.42
(#3584).Changed behaviour and named API of
pallet-balances
:
- Config, error names and constant changes;
- Change of
fn set_balance()
intofn force_set_balance()
with different arguments (setting reserved balance now deprecated);- For any
pallet-balances
interaction it's required to have balance greater or equal to existential deposit (10 Vara for Vara Network).
v0.9.42
to v0.9.43
(#3584).Stakings "controller" instance was deprecated. Now "stash" and "controller" is the same.
JS
-related code"1.0.2"
(#3436).Client updates required: NO External node/runtime api changed: NO Programs code refactoring level after update libs: PATCH
nightly-2023-09-18
nightly-2023-10-14
to nightly-2023-09-18
(#3451).It's recommended to use toolchain files for such pins. For more details see: https://rust-lang.github.io/rustup/overrides.html
gtest
bug that caused test panic in System::spend_blocks
(#3481);gtest
s constants with real runtime (#3510).Constants become public
use gtest::constants
and properly documented.EXISTENTIAL_DEPOSIT
bumped from 500 value to 10_000_000_000_000 value (10 tokens).
keep_alive
field of send_message
extrinsic while destination is user (#3458);