Questions tagged [wasm]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
4 votes
0 answers
26 views

Is the WASM blob created from ink! contract always deterministic

The contract's source code is provided during the contract verification on a block explorer (or some other source verifier). The block explorer needs to compile that source and verify if the generated ...
user avatar
  • 41
1 vote
3 answers
40 views

Get "Contract.ContractTrapped" error in Shibuya wasm

Get "Contract.ContractTrapped" erro when call new "xxx" contract from inside an depolyed contract in substrate of Shibuya testnet, bellow is my detailed operation: 1、Here are two ...
user avatar
0 votes
1 answer
28 views

How can I read JSON files in substrate

I am trying to modify the kitties pallet(https://docs.substrate.io/tutorials/v3/kitties/pt1/) in order to read some json data from an already existing file. So, I need to read the contents of the file ...
user avatar
8 votes
2 answers
81 views

Why does Substrate have a Wasm runtime?

Having a Wasm runtime is a key design decision in Substrate's architecture. It's clear that it's a key part of Substrate's forkless upgradability feature, but I'm still curious to understand what ...
user avatar
  • 1,597
1 vote
1 answer
39 views

How can I increase contract memory in pallet-contracts + chain-extension?

I am exposing some external functions to ink! contracts via a chain-extension in pallet-contracts. I am essentially passing a vector of bytes as a parameter to a contract method and directly ...
user avatar
2 votes
1 answer
23 views

Is it feasible to modify the contracts pallet to integrate it into a non-substrate rust-based blockchain?

Is it feasible to modify the contracts pallet to integrate it into a non-substrate rust-based blockchain? Say one that runs on Tendermint.
user avatar
1 vote
1 answer
23 views

Are there any tools available for creating a mock version of a contract in JS/TS?

Currently, we use "live" versions of our contracts running on a substrate contracts node in our JavaScript tests. This makes them integration tests and difficult to include in simple GitHub ...
user avatar
  • 568
0 votes
2 answers
51 views

How to execute an ELF binary after a successful transaction

I am working on figuring out an efficient way to run an ELF binary after successful transaction. I also want to pass arguments along the execution. Example: /bin/ping 1.1.1.1 OCW might be a solution, ...
user avatar
  • 3
4 votes
2 answers
46 views

How to change the number of heap pages

We are running into an allocator memory error where the number of heap pages appears to be insufficient to run a transaction on our validator (substrate-node). This is the error in question: 2022-04-...
user avatar
2 votes
2 answers
67 views

How to enable `std` features in pallets?

I'm trying to implement simple PoW for my node. After debugging all other stuff I've encountered the problem where finality-grandpa and storage do not get compiled because standard library macros are (...
user avatar
  • 134
2 votes
1 answer
23 views

large wasm size for polkadot 0.9.17

We have recently upgraded our runtime to polkadot 0.9.17. We noticed the wasm runtime seems too large i.e. 5.3 MB which exceeds the limit. Is there a way or best approach to reduce the wasm size? ...
user avatar
1 vote
1 answer
38 views

Collator panicked at 'Storage root must match that calculated.'

We have a few collators for the Kintsugi parachain actively syncing and producing blocks when they suddenly fall-over due to the following error: Apr 02 21:06:00 ubuntu-s-2vcpu-4gb-amd-fra1-01 ...
user avatar
6 votes
1 answer
58 views

What is the relationship between `sandbox`, `executor` and `runtime`?

I was recently reading the code for Substrate wasmtime, but I ran into some problems. I don't really understand the difference between runtime and sandbox. For example, in the runtime.rs file, we can ...
user avatar
7 votes
2 answers
69 views

Wasm interpreter in pallet-contracts

I have a question about how pallet-contracts interprets a Wasm contract. Are the following assumptions correct? pallet-contracts interprets contracts through the simple wasmi interpreter gas metering ...
user avatar
5 votes
1 answer
43 views

Building a substrate node template with a global cargo `target` directory

I'm trying to build a substrate-node-template with the following command: cargo build I have my cargo target-dir set inside a global ~/.cargo/config.toml file: [build] target-dir = "/home/foo/....
user avatar
  • 319
2 votes
1 answer
27 views

Is the genesis built on the MAC different from the genesis built on Linux

If you register parathread with genesis and WASM generated on the MAC, then run the blockchain on Linux. Will this future run blockchain and fail?
user avatar
  • 511
6 votes
1 answer
61 views

Performance of same logic with a contract using pallet-contracts vs. a native pallet (excluding metering)

I'm wondering what is current state of the art of Substrate's pallet-contracts performance as compared to the same functional implementation as a pallet. I acknowledge that different logic can have ...
user avatar
  • 315
7 votes
2 answers
68 views

What is the proper way of executing a runtime upgrade on a parachain?

I would like to upgrade my parachain. What is the proper way of executing a runtime upgrade on a parachain? Which RPC method to call? Should this be applied to collators or rpc-nodes?
user avatar
  • 236
1 vote
1 answer
20 views

Using BitcoinDevKit as a pallet dependency

When I add BitcoinDevKit as a dependency to the pallet-template, I get compilation errors within the socks crate that I don't get when compiling BDK standalone. It seems that BDK supports compilation ...
user avatar
  • 225
2 votes
1 answer
34 views

SessionsPerEra doesn't seem to be affecting sessions per era

Am I fundamentally misunderstanding how staking handles election timings, please? I've been trying to change the number of eras in a session, to increase the number of elections for testing. I ...
user avatar
0 votes
1 answer
22 views

Wasmi is not related to the polkadot or substrate?

Does wasmi only function as an interpreter that changes the rust code to wasm? Wasmi is not related to the function of Polkadot, such as scale codec(encode, decode extrinsics) or signing and signature ...
user avatar
  • 415