Questions tagged [runtime]
Questions that have to do with the FRAME runtime
232
questions
0
votes
1
answer
55
views
What are the risks of panicking inside an extrinsic call?
Let's imagine the following extrinsic.
#[pallet::call_index(1)]
#[pallet::weight(T::WeightInfo::might_panic_extrinsic())]
pub fn might_panic_extrinsic(origin: OriginFor<T>) -> DispatchResult {...
0
votes
1
answer
29
views
How to parse a raw signature from PolkadotJS in Substrate runtime
The Polkadot claims pallet verifies and extracts an ethereum address from an EcdsaSignature. Is there a similar implementation for doing this with an Sr25519Signature signed by a wallet using ...
2
votes
0
answers
14
views
when will `‘Balances::transfer' will be removed` take into effect on main-net?
In this link Balances::transfer will be removed it say 'transfer' is deprecated.
I have experienced this change on test-net and fixed my Dapp after got failure report.
But when does it take into ...
1
vote
0
answers
37
views
How do I monitor runtime upgrades with sidecar?
We need to monitor the spec version of the block, that is, the runtime upgrade.
Of course, we know that openGov's suggestions will determine the upgrade.
So we're going to run this guide to monitor ...
2
votes
0
answers
29
views
What is the rationale behind the node architecture (Runtime + Host)
Is the separation of the Runtime business logic from the host intended solely for enabling forkless upgrades, or does it also aim to facilitate compatibility with different hosts?
0
votes
0
answers
15
views
Why can't runtime APIs have default implementations?
I encountered a compile error error: A runtime API function cannot have a default implementation! when attempting to define a default implementation for a runtime API.
Why is this not possible?
2
votes
1
answer
73
views
Reusing old Pallet Instance Number
This may come out nonsensical but I'll ask it anyway.
construct_runtime!(
pub enum Test
{
System: frame_system::{Pallet, Call, Storage, Config<T>, Event<T>} = 0,
...
2
votes
1
answer
21
views
How come SignedExtra satisfies SignedExtension trait bound in substrate runtime?
In substrate runtime, https://github.com/paritytech/polkadot-sdk/blob/f60318f68687e601c47de5ad5ca88e2c3f8139a7/substrate/bin/node/runtime/src/lib.rs#L2106C10-L2106C21
pub type SignedExtra = (
// ...
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 ...
0
votes
0
answers
12
views
Standalone Runtime
I want to use Substrate Runtime in my application without consensus layer (outer node). I only want to create extrinsics in memory and pass them to runtime (or FRAME) of my custom pallets to proceed. ...
0
votes
1
answer
18
views
How do I cargo expand a non-compiling runtime?
cargo expand is a very useful tool to see the expanded macros that a runtime generates, but if the runtime doesn't compile then it does not output anything.
Any tips?
0
votes
0
answers
18
views
thread 'tokio-runtime-worker' has overflowed its stack fatal runtime error: stack overflow Aborted (core dumped)
we are running a stand alone Blockchain network by using POA consensus mechanism. The chain was working fine and after producing 8 Lac Blocks the nodes we down and now i have tried to re-execute same ...
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/...
1
vote
1
answer
42
views
How to Add and configure Democracy Pallet to Substrate Runtime
I've made an attempt to incorporate the "pallet-democracy" into my Substrate runtime. In the runtime/Cargo.toml file of my Substrate node template, I've added the following configuration:
...
1
vote
1
answer
36
views
Two different Assets Pallet instance for pallet_asset_conversion Pallet
While reviewing the substrate runtime code, I noticed that the pallet_asset_conversion Pallet references two distinct instances for the Assets Pallet within its Runtime Config:
impl ...
0
votes
1
answer
72
views
Cycle detected when computing layout of `RuntimeCall`
My pallet is using the following frame pallets: Democracy, Utility & Collective.
The error I get is:
cycle used when elaborating drops for `<impl at /home/kazu/Polkadot/fair-squares/runtime/src/...
0
votes
0
answers
15
views
`sp_io::crypto::ed25519_batch_verify` was removed amid Polkadot 0.9.39 and 0.9.43. What is replacement in Runtime?
We useded25519_batch_verify in runtime from sp_io::crypto mod.
sp_io::Crypto and Verify traits require self, but I cannot find implementation.
In substrate primitives core I see verify calling
fn ...
1
vote
1
answer
30
views
How to entirely clear a pallet storage on a living chain?
Would it be possible to clear a pallet storage with a call on a live chain ?
Precisely I would like to remove all contracts and code hash existing on my chain (as sudo).
0
votes
1
answer
21
views
Error in deploying call_runtime contract from ink!
I am running call_runtime from ink. It builds successfully, but when trying to upload contract, It gives system.ExtrinsicFailed contracts.CodeRejected error. Someone please advice what I am doing ...
0
votes
0
answers
21
views
Can a Substrate Runtime bulk-read many storage keys at once?
This question is about the Substrate host functions and storage implementation and is not specific to FRAME (although relevant FRAME-related information is welcome).
Imagine that the runtime knows it ...
3
votes
1
answer
37
views
How to avoid double work when building with srtool
I'm integrating srtool into my CI build. As a result of the build, I aim to obtain the client and the runtime. I can compile the runtime with srtool action and run cargo build to get the client. But ...
0
votes
0
answers
20
views
After runtime upgrade council proposals calls becomes <unknown>
We experienced an issue where we had a motion open before upgrading our runtime, after this upgrade this motion became "uncloseable". When inspecting the chainstate for the council, ...
0
votes
1
answer
44
views
Error transfering "Arithmetic: Underflow"
In the example above, we try to transfer 1 TFT from Eve to Dave. This extrinsic fails with Underflow error. When I looked at the error description I found: https://github.com/paritytech/substrate/blob/...
5
votes
2
answers
76
views
Understanding the Use Case of `saturating_inc()`
I was in search of a function to increment a value of type T, and I stumbled upon the trait Saturating in the Substrate documentation.
Upon examining the saturating_inc() function, I found the ...
3
votes
0
answers
36
views
Filter pallet call by origin
Is there a way to access the call origin when using BaseCallFilter from
frame_system::Config?
Something like:
// Disallow any call to a given pallet
pub struct CallFilter;
impl frame_support::traits::...
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 ...
1
vote
1
answer
31
views
Error WrongProposalWeight when proposing a runtime upgrade using the council
When trying to propose a system.setCode motion the extrinsic fails with WrongProposalWeight. We are experiencing this issue only with the above extrinsic and on polkadot-0.9.42 version.
On an earlier ...
1
vote
1
answer
36
views
Db weights in Runtime
I see that the DB weights (Rocks or Parity) are directly imported as constants in the runtime code. This means that whenever the runtime is built, it will use those constants. Why was this approach ...
4
votes
1
answer
27
views
ModuleError, BadState
Setup
I'm currently integrating staking functionality into my pallet. Here is a snipped of the relevant part:
let who = ensure_signed(origin.clone())?;
let required_stake = T::RequiredStake::get();
...
0
votes
2
answers
49
views
duplicated sessionkey
In polkadot.js staking , when i put the session key, the result is "duplicated session key"
I use the command in SSH "echo '{"id":1,"jsonrpc":"2.0","...
3
votes
2
answers
44
views
Substate node not compiling on Archlinux
Recently anytime i try to run substrate-node i get this error message, all attempts to update packages hasn't been helpful
Error: Service(Client(VersionInvalid("cannot deserialize module: ...
6
votes
1
answer
43
views
Parachain support for light clients
What is required from a technical point of view (specific pallets and APIs) for parachains to support light clients? I saw that only a few parachains have the option to interact with the light clients....
3
votes
1
answer
17
views
Query chain for types in a storagemap
I want to get the meta function description of pallets storage maps. Returning an output like this:
{ Twox64Concat, [u8; 16], u32 } = query.storagemap(pallet: "template", storagemap: "...
3
votes
1
answer
92
views
Is it possible to use a flat structure storage in the Runtime?
The Runtime storage in Substrate is based on a tree structure rather than a flat structure. While this allows for efficient integrity verification, it incurs data retrieval overhead. According to the ...
2
votes
1
answer
232
views
1002: Verification Error: Runtime error: Execution failed: Execution aborted due to trap: wasm trap: wasm `unreachable`
I've added pallet-nft and pallet-uniques in Relay Chain. All the things are working fine but when I'm signing the transaction in the pallet-uniques fn create(collection,admin), it is showing me this ...
2
votes
0
answers
56
views
Why Hosts set storage information directly and not through the Runtime
Why Host set storage information directly and not through the Runtime api? (e.g. Grandpa Authorities, Accounts, Code, Heap_Pages)
Is this an expected behavior or legacy?
4
votes
0
answers
56
views
What is the core functionality (pallets) that should be part of the specification
We are working on an alternative implementation of the Polkadot protocol, but since the spec is missing a lot of details regarding the Runtime, we rely heavily on the Substrate implementation.
So we ...
4
votes
1
answer
48
views
offchain-workers vs asynchronous task
There is not much info about using an asynchronous task in substrate docs i.e. task_manager in service.rs
I want to know when one should be using offchain-worker and when one should use background ...
4
votes
1
answer
34
views
What is the best practice to change on-chain storage from asynchronous task?
I want to change some of the on_chain data after running some asynchronous task running in task_manager. What is the best way to achieve this?
Thanks
4
votes
1
answer
44
views
Change state from a task
I have a asynchronous task running in service.spawn_essential_task(task).
Which does some stuff and wants to write data in storage. How can i achieve this?
Changing state by making runtime_apis to ...
1
vote
1
answer
106
views
How to interact substrate node with reactjs frontend?
In ink! smart contract, we upload .contract file on chain and get the deployed contract address and use metadata.json file in frontend to interact with contract. Can someone tell me what's the ...
1
vote
1
answer
42
views
What's the difference between the runtime Block type and the opaque::Block type?
In a substrate runtime, take the node-template as an example, we have two definitions from Block, among other types such as BlockId but let's focus on Block.. :
// runtime/src/lib.rs
pub type Block = ...
3
votes
1
answer
55
views
How to filter extrinsics senders?
Let's imagine that we have some blacklist pallet that stores accounts that are restricted to make some calls. How do we implement origins filtering based on that blacklist for other pallets?
We could ...
5
votes
2
answers
59
views
Is there a canonical resource describing when migrations are needed
My understanding is that when anything about the storage type is changed for example the encoded type stored, the keys, prefix etc then a storage migration is required.
But when else?
Is there a ...
2
votes
2
answers
78
views
Calling std-based host function from a pallet
Based on:
Use std only rust library to extend substrate runtime interface?
How to understand [runtime-interface] and `Externalities`?
I understand that I should be able to:
have a crate that is not ...
2
votes
2
answers
78
views
How to integrate Fellowship
I'm trying to integrate Fellowship in this PR according to https://github.com/paritytech/polkadot/pull/5205,
but when I run make check-all it gives the following error:
error[E0277]: the trait bound `...
2
votes
0
answers
27
views
no matching package named `sc-network-statement` found
sc-network-statement = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42" }
I am using this package from substrate ...
0
votes
1
answer
60
views
epoch_config must not be None
This is my substrate-code. Running cargo build --release works fine but while starting node using ./target/release/node-template --dev, I get this error.
Thread 'main' panicked at 'epoch_config must ...
4
votes
1
answer
55
views
Are on_idle hooks transactional?
Trying to call a function marked as #[require_transactional] from on_idle() hook triggers the error Err : Transactional(NoLayer).
I realise the transactional macro is optional for extrinsics and the ...
6
votes
1
answer
63
views
decl_runtime_api behaving in a weird way
In the project we are currently working on, we declared some runtime apis in our custom pallet, we tried to update the dependencies from 0.9.28 to 0.9.42 but the build fails with the following error:
...