Skip to main content

Questions tagged [wasm]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
1 answer
23 views

XVM Ink Wasm to EVM: Contract Reverted. Decoding Failed

I tried to deploy a XVM Wasm contract wrapping around a deployed EVM Solidity contract in my local node. Steps Deploy my EVM Solidity contract via Remix connecting to my local node //SPDX-License-...
Russo's user avatar
  • 1,193
1 vote
0 answers
13 views

How can I manage the issue of excessive gas estimation in MetaMask when deploying a dapp contract on my WASM+EVM chain and calling its functions?

i am trying to deploy a dapp contract on my WASM + EVM based substrate chain but while calling the contract functions it gives me high gas estimation, how can i handle this issue?
Arunjot Singh's user avatar
1 vote
1 answer
47 views

How to debug an extrinsic (the runtime code) after migration to wasm-only execution in Polkadot?

Polkadot is moving away from native execution mode and in the first step they removed the native execution mode. This means that the --execution Native does not work anymore which is the solution in ...
Shabgard's user avatar
0 votes
1 answer
49 views

IEEE 754 Floating Point Numbers wasm impelementation

We are looking to enable reproducible floating point operations on chain by implementing the IEEE 754 standard as an on-chain wasm function. As discussed in this stackoverflow post, substrate does not ...
Mathis Wellmann's user avatar
1 vote
1 answer
75 views

`The trait Deserialize is not implemented for a` GenesisConfig

I am in the process of upgrading a project from version 0.9.42 to 1.6.0, where the BuildGenesisConfig was added and BuildGenesis was deprecated, and I encounter an error (the trait Serialize is not ...
Benjamin Gallois's user avatar
0 votes
0 answers
19 views

Why are any of the `RuntimeApiSubsystemClient` trait methods marked `async` when its not needed?

The trait RuntimeApiSubsystemClient and its implementation DefaultSubsystemClient (https://github.com/paritytech/polkadot-sdk/blob/c421b87978404954dec4555895d50ef028b73cf0/polkadot/node/subsystem-...
Mathis Wellmann's user avatar
0 votes
0 answers
20 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
24 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
32 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
33 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
18 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
40 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
49 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
167 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
62 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
49 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
101 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
58 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,722
3 votes
2 answers
218 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
196 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
100 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 ...
Kalanamith's user avatar
3 votes
0 answers
33 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
5 votes
1 answer
217 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,332
3 votes
1 answer
80 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
72 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,...
the dev's user avatar
  • 477
3 votes
1 answer
58 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
120 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
145 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
117 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
2 votes
1 answer
325 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
165 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
77 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
  • 499
10 votes
4 answers
2k 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
4 votes
1 answer
73 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
  • 139
6 votes
1 answer
211 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
  • 790
15 votes
5 answers
2k 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
5 votes
0 answers
193 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
  • 10.5k
2 votes
1 answer
91 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
  • 10.5k
4 votes
1 answer
59 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
  • 10.5k
2 votes
1 answer
63 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
  • 75
2 votes
1 answer
80 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
  • 16k
3 votes
2 answers
86 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
88 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
105 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
100 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
40 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
35 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
297 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
80 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,241