Releases: multiversx/mx-sdk-rs
Releases · multiversx/mx-sdk-rs
sc 0.66.0, chain 0.23.0, sdk 0.16.0, scenario-format 0.26.1
- Memory and thread safety:
- Managed type memory management: proper
Dropimplementations for managed types:ManagedBuffer,BigInt,BigFloat,ManagedVec, andManagedMapnow call their VM-side destructor when dropped;- Fixed memory leaks and double-drop issues previously present in
ManagedVecandManagedBuffer; ManagedVecItemderive macro now generatesrequires_dropcorrectly;ManagedVecslice out-of-bounds fix;MultiValueEncoded::to_arg_bufferfix;- Memory benchmarks added for managed types.
- Thread safety:
DebugHandleandStaticApiHandleare now explicitly!Send;- All managed types implement
!Send + !Sync, with tests.
- Managed type memory management: proper
- Mathematical library additions:
nth_rootforBigUint;linear_interpolationandweighted_averagefunctions;ManagedDecimalimprovements:exp_approx: exponential approximation function;compounded_interestandcompounded_interest_factormethods;mul/divwith half-up rounding mode;- Fixed
into_raw_units/as_raw_unitsconversion; nth_rootsupport;- Backwards-compatibility fixes.
SaturatingSub/SaturatingSubAssignforBigUint.BigUint::from_str(implementsFromStr/parse());
sc-metanew features, updates and fixes:sc-metatransaction CLI (sc-meta tx): a new command-line tool for composing and broadcasting transactions directly from the terminal:sc-meta tx deploy- deploy a contract;sc-meta tx call- call a contract endpoint;sc-meta tx query- query a contract (no gas);sc-meta tx sign- sign a transaction offline;sc-meta tx upgrade- upgrade a deployed contract;--payments/--token-transfersflags for specifying ESDT payments;--wait-resultflag (requires--send);--code-metadataargs refactor.
sc-meta reproducible-build- new tooling for building and verifying contracts reproducibly:- Docker-based local build;
sc-meta all downloadwith--overwriteflag;sc-meta all publish/unpublishwith polling and max-attempt logic;- Source pack/unpack (zip) with test & refactor;
artifacts.jsongeneration and code hash verification;repro-build init-configfor project configuration toml;repro-build release-notesCLI;- Integration test and CI support.
sc-meta dataCLI: new subcommand for managing contract data/storage, for scripts.- Wallet improvements:
sc-meta wallet newhides password from console (usesrpassword);sc-meta wallet test-walletCLI command.
- Other improvements:
sc-meta new --forceflag: overwrite an existing template directory;sc-meta new --overwritebugfix;sc-meta install wasm32 --toolchain <toolchain>CLI flag;sc-meta install debuggeron Windows, duplicate-protection, configuresrust-analyzer.debug.engine;sc-meta install allWindows fix;sc-meta all codehashwith fallback;- Detect duplicate contract names;
sc-meta rust versiondisplayed in full;CARGO_NET_GIT_FETCH_WITH_CLIenv flag propagated through contract builds.
- Explorer URLs are displayed after transactions and for new contracts in interactor and
sc-meta txCLI. - Rust VM gas schedule updates:
- Gas schedule v9+ updates;
- Fixed gas accounting for conversions, more hooks, and
ManagedMapoperations; - Overflow check added in multiply-gas helper;
wasmer-prod: fix for missing breakpoint after early exit / out-of-gas.
- Chain core additions:
- Standard code hash function added to
multiversx-chain-core; - VM code hash hook;
- Basic crypto functions consolidated in chain core;
- Deploy address computation impls centralized.
Bech32Addressimprovements:try_from_bech32_stringconstructor with explicit error;FromStrimplementation;- Better error on empty string input.
- Standard code hash function added to
- SDK improvements:
- Interactor gas price support;
- Refactoring: REST API types and naming updated to match the Go SDK implementation;
Wallet::from_pem_fileaccepts anyAsRef<Path>;Walletmethods now takeAsRef<Path>generically.
ManagedByteArraynow implementsSCDisplayandSCBinary.- Dependency upgrades.
sc 0.65.1, chain 0.22.1, sdk 0.15.1
sc-metaimprovements:sc-meta wallet new --shard <id>flag: generates a new wallet whose address belongs to the given shard;sc-meta all proxy- Better crate path handling;
--verboseflag: prints each proxy file path as it is generated.
sc-meta test-gengenerates.insert_ghost_accounts()call in test setup (only used in internal tests).
- SDK:
- Accept trailing slash in gateway URL (automatically normalized);
- Fixed a transaction decode issue in
sdk/core; - Test wallets provided for each shard, including a function that returns the wallet for that
ShardId.
- Chain core: new
ShardIdtype andShardConfiginfrastructure:ShardIdrepresents a shard identifier, with special values for metachain;ShardConfigencodes the shard structure of the network (number of shards, address distribution);- Functionality to get the shard of an
Address; - Utility for checking whether an address is of a system SC.
- Base framework improvements:
ManagedArgBufferimplementsManagedVecItem.Displaytrait implemented byBigInt,BigUint,NonZeroBigUint,PaymentandEsdtTokenPayment.
sc 0.65.0, codec 0.25.0, chain 0.22.0, sdk 0.15.0, scenario-format 0.26.0
- VM:
DebugHandlenow uses aWeakpointer toTxContext, fixing LLDB inspection;- Signal error UTF-8 fix;
VMAddressalias removed;- Removed deprecated
Shareable/with_shared_mut_refinfrastructure.
sc-metanewscen-blackboxtool that reads scenario JSON files (mandos) and generates Rust blackbox tests- Generates strongly-typed Rust blackbox test code from mandos
.scen.jsonfiles; - Supports payments, variadic arguments, block info, token IDs, addresses, H256 constants, timestamps/durations,
- Generates strongly-typed Rust blackbox test code from mandos
- ABI:
rustMethodNamefield added to the JSON ABI, where it differs from the endpoint name;specificTypefield, used forTimestampSeconds,TimestampMillis,DurationSeconds,DurationMillis.PaymentMultiValueABI fix.
- TypeAbi changes:
- Added
TypeAbiUniversalInput, to allow developers to bypass proxy argument type restrictions; IgnoreValueblanketTypeAbiFromimpl removed; since it was conflicting withTypeAbiUniversalInput;- Added
ScenarioValueRaw, an alias forTypeAbiUniversalInput<BytesValue>, used by thesc-meta scen-blackboxtool as a placeholder, for when it cannot determine an appropriate typed value.
- Added
- Testing improvements:
- Support for transaction ids in tests;
AddressandH256const constructors from hex;- Payment API additions and improvements:
.payment()calls can be chained, and arguments are automatically merged into a multi-payment, at compile time;- Deprecated
.esdt()and.multi_esdt(), since they are now superseded by.payment()
- Deprecated
- Utility methods for dealing with
NonZeroBigUint:Payment::try_newwith generic error type;NonZeroBigUint::try_fromforu8,u16,u32,u64,usize, andNonZero<_>;cmp/eqbetweenNonZeroBigUintandBigUint;NonZeroBigUint::one();
TestTokenIdentifierrenamed toTestTokenId(old name kept as deprecated alias);MultiEgldOrEsdtPaymenttoPaymentVecconversion check;- Other deprecations:
MultiEsdtPayment(superseded byPaymentVec);TestEsdtTransfer,Paymentis now used instead;.commit()in blackbox set/check account (no longer needed);
- Scenario payments use
PaymentVecinternally instead ofMultiEgldOrEsdtPayment.
- Codec fixes and improvements:
boolencode/decode correctness fix;num-bigintencoding fix;MultiValueVecnew constructors and unit tests;- Inline annotations adjusted for better performance and consistency.
- Dependency upgrades:
- Upgraded
reqwest, switched TLS backend torustls; - Dependencies upgraded to the latest versions.
- Upgraded
- LLDB pretty-printer fix.
sc 0.64.2, chain 0.21.2, sdk 0.14.2
- Workaround for
mBufferFromBigIntSignedVM hook bug:- The hook was incorrectly converting negative numbers to their absolute value;
- The
mBufferToBigIntSignedVM hook has been added to the deprecated hooks list; - Fixed a related bug in the Rust VM, also pertaining to negative numbers, in
mb_to_small_int_signed(mBufferFromSmallIntSigned).
- VM: added ESDT metadata recreate and metadata update mock built-in functions.
- Upgraded
multiversx-chain-vm-executorto v0.5.1.- Contains upgrade to Wasmer 6.1.0 (wasmer-experimental);
- This fixes and issue with wasmer-prod and wasmer-experimental builds on Linux for certain versions of Rust.
- Big number improvements:
BigInt/BigUintproportionandinto_proportionmethods, for computingself * part / totalefficiently, with overflow checks.BigUint::into_non_zero_or_panicmethod.BigUint::new_uncheckedunsafe constructor fromBigInt.BigInt::overwrite_i64now takes&mut selfinstead of&self.
- New
FungiblePaymenttype, representing a payment with aTokenIdand aNonZeroBigUintamount (no nonce). IncludesManagedVecItem,TypeAbi, and codec implementations. - sc-meta improvements:
- Added
--lockedCLI flag support; - Build error messages now include the full command that was executed.
- Added
- Storage mapper documentation improvements across all mappers.
- Derive substitution list fix:
RefandManagedVecRefno longer incorrectly listed as having an API generic.
sc 0.64.1, chain 0.21.1, sdk 0.14.1
TokenIdbackwards compatibility conversions:- Converting empty token identifiers, as well as
EGLDtoEGLD-000000; - Converting not only upon decode, but also in constructors and conversions (
from); - Added an unsafe unchecked constructor;
- The same conversions apply to
EgldOrEsdtTokenIdentifier.
- Converting empty token identifiers, as well as
- Debugger fixes:
- Fixed error messages when using the
StaticApi. Following changes to the VM a few releases ago, the error messages were being swallowed by the API. - Fixed a crash caused by the error trace in the
StaticApi.
- Fixed error messages when using the
sc 0.64.0, codec 0.24.0, chain 0.21.0, sdk 0.14.0, scenario-format 0.25.0
- Switched to Rust edition 2024, minimum compiler version becomes 1.85.
- New payments API:
- New objects:
TokenIdandPayment. Besides them having shorter names, they treat EGLD the same as all other ESDTs, making their handling easier. EGLD is always serialized asEGLD-000000. Paymentamounts areNonZeroBigUint, a new refinement type that prevents the value from being zero. This prevents at compile time zero-value payments from occurring.- New
call_valuemethods:all()- all payments, EGLD and ESDT;single()- expect precisely one payment, and retrieve that payment. Crash for no payments, or for multiple payments;single_optional()- expect either zero or one payments. Returns an Option of Payment reference;array()- expect the exact number of payments and retrieve them as array.
MultiTransfermarker for forcing an ESDT multi transfer, even when not strictly necessary.- Deprecated
EgldOrMultiEsdtPaymentandcall_value``any_payment. ManagedVecRefrenamed toRef.- Token identifier display fix.
- New objects:
NonZeroBigUintimplementation, including all common operators. Additional fixes for theBigIntandBigUintoperators.- SDK - fixed an issue with parsing transactions with large values in SCRs.
- Upgraded all dependencies.
sc 0.63.3
- Reverted the EsdtTokenIdentifier ABI name to TokenIdentifier.
sc 0.63.2
- Legacy whitebox test block timestamp APIs renamed and made type-safe.
sc 0.63.1
- Blockchain API renames:
epoch_start_block_*->get_epoch_start_block_*, for consistency. - Set block timestamp methods renamed to
block_timestamp_secondsandblock_timestamp_millis, respectively, also for consistency.
sc 0.63.0, chain 0.20.0, sdk 0.13.0, scenario-format 0.24.0
- New block info API, which returns timestamps as either
TimestampSecondsorTimestampMillis, instead of justu64:- New types for measuring time, not only timestamps, but also durations (
DurationSecondsandDurationMillis); - Previous functions deprecated in favor of the new ones as follows:
get_block_timestamp->get_block_timestamp_secondsget_block_timestamp_ms->get_block_timestamp_millis- same for previous block and epoch start block
get_block_round_time_ms->get_block_round_time_millis;
- Support for
TimestampSecondsandTimestampMilliswhen setting up blackbox tests; - Mandos support for millisecond timestamps, in both mandos-go and mandos-rs.
- New types for measuring time, not only timestamps, but also durations (
- Rust VM support for fallible sync calls. Adjusted event logs to match the Go VM.
- Contract build improvements:
- The Rust version is now sent to the wasm build command via CLI, always. This overrides all other settings, giving the framework full control over the Rust version used.
- The Rust version can be configured in
sc-config.toml. This overrides all other settings. If missing, the current config will be detected and used explicitly. - The
wasm-optversion can be specified insc-config.toml. Whilesc-metacannot install or change this version, it will crash if there is a version mismatch, signalling problems with reproducible builds. - The
sc-metastandalone tool signals version incompatibilities when building contracts. Most importantly it writes a warning to console if multiversx-sc version <v0.58and rustc ≥v1.87. - Added a deprecated VM hooks checker mechanism. Currently only checks for legacy call value getters.
- ABI build info improvements:
- Added host;
- Added LLVM version;
- Rustc version guaranteed to match the one used for building the wasm binary;
- Ensured historical backwards compatibility, back to the first version of the ABI format.
TokenIdentifierrenamed toEsdtTokenIdentifier, since the old name was misleading. Old name kept as alias, for backwards compatibility.- Fixed proxy imports in snippets.