Questions tagged [wasm]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
0 answers
6 views

is the endpoint TransactionPaymentApi_query_info usable on current Westend testnet?

I was trying to query payment_queryInfo on current Westend testnet, and the following payload used to works at spec 9430. { "jsonrpc": "2.0", "method": "...
johnhckuo's user avatar
  • 123
2 votes
0 answers
15 views

Is it possible to register parathread with compact.compressed wasm file

In official guides they use wasm built with export-genesis-wasm command to register a parathread/parachain: https://youtu.be/BaWcQxKRFmM?t=134 https://docs.substrate.io/tutorials/build-a-parachain/...
Данила Алексеев's user avatar
3 votes
2 answers
23 views

Is there any way to extract "method" and "params" of unchecked extrinsic using ScaleCode/TypeInfo traits?

I'm wondering if there is any way to extract information about method and parameter of Extrinsic(Unchecked/CheckedExtrinsic) using TypeInfo and Scale codec. In polkadotJs there is toString method on ...
Mateusz Nowakowski's user avatar
0 votes
0 answers
21 views

Custom RPC Error on sp_api::decl_runtime_apis!

We are adding a custom rpc and following along with https://github.com/AlexD10S/susbtrate-node-template/blob/rpc-custom-methods/pallets/template/rpc/runtime-api/src/lib.rs and https://github.com/...
donkeydonkey's user avatar
0 votes
0 answers
16 views

What is the usecase of `PassBy` trait bound

While working on types between Runtime and Host functions, types going from Runtime to host function requires a PassBy trait bound while types going from Host function to Runtime does not need that ...
vedhavyas's user avatar
  • 155
2 votes
0 answers
27 views

wasm compilation for later rust versions

I am running a parachain on Ubuntu 22.04 jammy. where i am using polkadot 9.43. I see that in release notes it is said that nightly-2023-05-22 was tested for this substrate version https://github.com/...
cocokick's user avatar
  • 165
2 votes
1 answer
43 views

What is default --execution <strategy> and recommended value for node/validator operator?

When executing node as a validator, the documentation states here that there is differents execution strategy available, however as this is optionnal switches, what is default if nothing is set ? ...
Floy's user avatar
  • 21
1 vote
1 answer
123 views

Why is serde always std-gated in substrate?

I regularly see serde implemented for various structs across the substrate ecosystem, usually in the single-liner form below. Why is that gated behind the std feature? In serde's documentation, it's ...
Nate Armstrong's user avatar
0 votes
0 answers
44 views

Unable to verify WASM contract in Substrate Astar

I'm encountering difficulties while attempting to verify my WASM smart contract through Astar's Subscan tool. Despite multiple attempts using various options, the verification process remains ...
Tom Rowbotham's user avatar
1 vote
0 answers
30 views

Moonbase parachain collator not producing blocks using zombienet

I am trying to run zombienet tests with 2 polkadot relay chain nodes and 1 parachain collator running the moonbeam binary. The test config is as follows: test.toml [settings] timeout = 1000 [...
Mihail Kirov's user avatar
1 vote
0 answers
56 views

Is 'Ran out of free Wasm instances' a bad symptom?

I develop a custom chain based on Substrate. The chain business logic involves stateful sessions where the state is managed through Http and unsigned transactions submitted via Offchain workers. Until ...
Yury Yukhananov's user avatar
4 votes
2 answers
56 views

WebAssembly runtime file into ValidationCode

I have a CLI tool that gets a WebAssembly runtime file: let validation_code_content = fs::read_to_string(path_validation_code) .expect("Should have been able to read the validation code ...
Alex Bean's user avatar
  • 5,364
3 votes
2 answers
179 views

Specialization impl does not specialize any associated items

I'm fairly new to Rust and ink! itself. I'm trying to compile and build an extremely basic PSP22 Contract. I get the following error when I compile & build: (running cargo +nightly contract build) ...
0xD1x0n's user avatar
  • 119
5 votes
2 answers
152 views

"ERROR: Loading of original wasm failed" after upgrading rustup

I'm getting the following error when compiling a rust ink! 4.0; ERROR: Loading of original wasm failed It's started happening to me after I rustup update and now my rustc versions are: stable-...
yonatan hornstein's user avatar
5 votes
1 answer
85 views

Substrate Error after updating from polkadot version polkadot 0.9.30 to polkadot 0.9.42

I have a running chain which was on polkadot-v0.9.30 and updated all the libraries on to polkadot-v0.9.42 No error found while uploading but got error after updating panicked at 'Sensible defaults ...
not 0x12's user avatar
  • 343
3 votes
0 answers
29 views

How can I use complex structure in ink! version3

how can i use the complex structure(like Mapping<String, Vec<Map<String, String>>>) in ink! #![cfg_attr(not(feature = "std"), no_std)] use ink_lang as ink; #[ink::...
user4298's user avatar
4 votes
1 answer
159 views

How to interact between a smart contract written in Solidity from a smart contract written in ink!?

In the repository of the cargo-contract CLI tool, which currently "helps you develop smart contracts in Parity's ink!, which is a Rust eDSL allowing you to write smart contracts for blockchains ...
Luke Schoen's user avatar
  • 2,292
3 votes
1 answer
63 views

Error while dividing two u128/Balance types

#[ink(storage)] pub struct Variables { a: u128, b: u128, multiplier: u128 } impl Variables { #[ink(constructor)] pub fn new(a: u128, b: u128) ->...
abhi arjun's user avatar
1 vote
1 answer
68 views

Explain components of Mapping used by Openbrush. Mainly placeholders for the actual type used in the code. Like ApprovalsKey used in bellow example

I am trying to understand the working of upgradeble storage used by openbrush libraries. I am unable to understand Mapping used in impls of psp34 trait eg pub operator_approvals: Mapping<(Owner,...
UPENDRA SINGH's user avatar
3 votes
1 answer
36 views

Prevent unused imports from bloating up runtime wasm

I recently wrote a pallet that uses a (non-substrate) Rust crate as a dependency. This crate conveniently supports no-std and Wasm, but it is also quite extensive and there's a lot of code that my ...
Bernardo Rodrigues's user avatar
2 votes
0 answers
58 views

Failed to compact generated WASM binary in substrate standalone chain [duplicate]

I'm building the substrate standalone chain with this cargo build --release command and facing the issue: thread 'main' panicked at 'Failed to compact generated WASM binary.: Error(UnknownOpcode(192))...
Muhammad Zaryab Rafique's user avatar
9 votes
1 answer
117 views

Smart Contract blockspace allocation in Hybrid Chains

In Rob Habermeier's blogpost about Hybrid Chains, he mentions allocating contract execution to a limited fraction of the chain's blockspace. Is that some functionality that pallet-contracts provides? ...
Bernardo Rodrigues's user avatar
8 votes
4 answers
143 views

Managing deployment of complex set of wasm contracts

We need to deploy a set of several smart contracts, x-compiled from Solidity to wasm, and maintain that deployment (deploy new contract instances and migrate to them once in a while). So what we ...
Andy Wermke's user avatar
6 votes
1 answer
108 views

cannot create module: instance allocation for this module requires 74376 bytes which exceeds the configured maximum of 65536 bytes

Try in to benchmark node pallets after Polkadot upgrade from 0.9.36 to 0.9.38 and get cannot create module: instance allocation for this module requires 74376 bytes which exceeds the configured ...
Dzmitry Lahoda's user avatar
0 votes
0 answers
281 views

Error: Service(Client(VersionInvalid("cannot deserialize module: UnknownOpcode(192)"))) [duplicate]

Link: https://github.com/paritytech/substrate-contracts-node https://use.ink/getting-started/running-substrate When I try to run "substrate-contracts-node --dev" I get this error: ...
Sergio Corrales's user avatar
2 votes
1 answer
230 views

execution failed: execution aborted due to trap: wasm trap: wasm `unreachable` instruction executed. TransactionPaymentApi_query_info

We are currently depositing KSM tokens to our parachain using the following code: kusamaApi.tx.xcmPallet.limitedReserveTransferAssets(params_here) When executing the transaction, the KSM tokens are ...
Michal Danco's user avatar
3 votes
1 answer
119 views

Compiling runtime with std targeting wasm32-unknown-unknown

We are exploring how to wrap part of the runtime logic into a re-usable WASM blob that can be wrapped in a JS library. To do that, we are investigating using wasm-pack and wasm-bindgen. Unfortunately, ...
Antonio Antonino's user avatar
3 votes
1 answer
75 views

Chatbot Trained on Substrate-based Chains and Repositories for General Reference and Help [closed]

I'd like to propose an idea for creating a general reference and help tool utilizing a chatbot trained on data from Substrate-based chains (e.g., Polkadot, Kusama, Parachains) and their associated ...
ALeSD's user avatar
  • 469
10 votes
4 answers
1k views

ERROR: Loading of original wasm failed

I having some trouble running the Flipper example from the Ink! webpage. The cargo contract build outputs the following error log: ERROR: Loading of original wasm failed Caused by: 0: Loading of ...
statisticalanomaly's user avatar
3 votes
1 answer
56 views

Implications of invalid encoded extrinsic calls

We are seeing the following error whenever an invalidly encoded but properly signed extrinsic is submitted in our substrate based chain. { "jsonrpc": "2.0", "error&...
Aramik M's user avatar
6 votes
1 answer
137 views

How to attach debugger to the Runtime WASM

Using lldb (like with VSCode), it is fairly easy to attach it to the client, allowing to debug the client side of the node. However, once the wasmtime is executing the Wasm Runtime, the debugger is ...
Crystalin's user avatar
  • 781
15 votes
5 answers
1k views

cannot run substrate on a fresh macbook m2

I have a brand new macbook m2. I followed all the steps on https://docs.substrate.io/install/macos % rustup show Default host: aarch64-apple-darwin rustup home: /Users/bear/.rustup installed ...
Bernardo Rodrigues's user avatar
4 votes
0 answers
124 views

How to check if a pallet can be compiled to no-std/WASM?

How to check if a pallet can be compiled to no-std/WASM? I ran: cargo build --no-default-features --target wasm32-unknown-unknown But this didn't work. IIUC, we need some ENV to build the pallet to ...
AurevoirXavier's user avatar
2 votes
1 answer
67 views

`RuntimeError: unreachable` while using polkadot js to do sr25519 sign

await cryptoWaitReady(); const json = JSON.parse(xxx); const keyring = new Keyring({ ss58Format: 42 }); const pair = keyring.addFromPair(decoded, json.meta, 'sr25519'); // const pair = keyring....
AurevoirXavier's user avatar
4 votes
1 answer
43 views

How to benchmark a crate's WASM execution performance?

How to benchmark the code's WASM execution performance? I wrote a crate and want to use it in the runtime. I want to know its WASM execution time in ms. How can I get that?
AurevoirXavier's user avatar
2 votes
1 answer
54 views

Modify the Genesis file/WASM after getting the slot but before the parachain creates the block

I want to find a way to check whether the parachain's genesis file/WASM can be changed after getting the slot but before creating the first block by the users who registered the parachain. Is that ...
Jay Pan's user avatar
  • 65
2 votes
1 answer
64 views

How to generate only the Wasm runtime during compilation?

Normally, when you run cargo build, both the native and Wasm runtime, along with the whole client is generated as part of the build process. How would you compile just the Wasm runtime, so that you ...
Shawn Tabrizi's user avatar
  • 15.8k
3 votes
2 answers
79 views

Wasm traps in ink contract but not in a `wasm-pack` test

I have a contract that implements some ZKP verification logic with plonk. The verification logic is contained in some other crate that can be compiled to Wasm, and there are wasm-pack tests like this: ...
Oleksandr Mykhailenko's user avatar
2 votes
1 answer
71 views

How to debug error codes for ink contracts?

Ink contract Transaction emit errors with hex code. How to map that to the actual error and get a trace of error in the contract?
Nikhil Ranjan's user avatar
0 votes
2 answers
101 views

Balance got Reserved while deploying wasm contracts?

i am using pallet-contracts in my substrate based chain when i am deploying the wasm smart-contract some balance is getting reserved.How can i stop this i don't want to reserve the balance,Or is there ...
Amit Kumar Yadav's user avatar
0 votes
2 answers
95 views

Error Compling Contract

I am just starting with wasm and ink. I have installed the following dependency: npm install -g @astar-network/swanky-cli I am trying to compile the contract flipper and I get the following warnings ...
Sequajaa's user avatar
1 vote
0 answers
32 views

Compiling cumulus v0.9.36 with --no-default-features

When attempting to compile cumulus on branch polkadot-v0.9.36 while disabling standard features, this error occurs: nologik@nologik-laptop dkg-substrate % cargo check --workspace --no-default-features ...
Thomas Braun's user avatar
0 votes
1 answer
32 views

Use criterion for statistic driven benchmarking of Substrate pallets

Criterion version 0.4.0 seems to support WASM builds: https://www.tweag.io/blog/2022-03-03-criterion-rs/#first-class-wasm-support Can we us it to benchmark extrinsics of Substrate pallets?
Achim's user avatar
  • 575
7 votes
2 answers
204 views

How is wasmi different from wasmtime?

I found wasmi is a dependency in multiple substrate crates, but there's one crate that also uses wasmtime. How is wasmi different from wasmtime?
RoboT's user avatar
  • 377
1 vote
1 answer
70 views

How forkless runtime upgrades takes place in substrate?

Does code compiled to Wasm enables to forkless runtime upgrades in polkadot substrate development? Someone please explain me how forkless runtime upgrades features enables?
Ganesh11's user avatar
  • 1,208
2 votes
1 answer
71 views

Can we update the genesis head wasm after obtaining a slot?

I have some confusion regarding WASM genesis state. I'm not entirely sure what it contains or how to update it once we've acquired a slot. For some context: assume we have a substrate based chain that ...
shibshib's user avatar
  • 127
0 votes
1 answer
63 views

Could not find `Cargo.lock`

I'm using cross to build my node. And I got this: warning: Could not find `Cargo.lock` for `/root/code/darwinia-network/darwinia-2.0/runtime/pangolin/Cargo.toml`, while searching from `/target/x86_64-...
AurevoirXavier's user avatar
3 votes
1 answer
81 views

How to return uint256 datatype from ink! wasm contract? How to make compatibility with IERC20?

IERC20 interface contains methods with uint256 datatype. If you try to call ink! wasm contract from Solidity (compiled by solang to target subtrate) you will have an issue. interface IERC20{ ...
rust.dev's user avatar
  • 509
1 vote
1 answer
106 views

Unable to decode contract event: Unable to find event [closed]

Ive got this error on my console although transaction was succeeded. what causes this error..?
Steve's user avatar
  • 83
1 vote
1 answer
74 views

What is the 'wasm' argument in CodePromise?

I'm building an application that allows anyone to deploy PSP34 using Openbrush contract. I want to allow users to deploy a new contract from the UI and upload an image to mint the NFT. I have ...
Steve's user avatar
  • 83