Skip to main content

Questions tagged [frame]

Questions about Substrate's framework for developing custom runtime logic.

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

BlockNumber is no more availabe on frame_system [duplicate]

I updated my code to polkadot-v1.6.0, its now gives error: error[E0576]: cannot find associated type `BlockNumber` in trait `frame_system::Config` --> pallets/support/src/lib.rs:22:31 | 22 | ...
Amiya Behera's user avatar
1 vote
1 answer
21 views

Error: could not compile `sc-network` when bumping to v1.11.0

I'm encountering an issue with cargo build --release after updating a solo chain to Polkadot-SDK v1.11.0. The error message appears when compiling 'sc-network' in the file located at: https://github....
Mateo Baldassarre's user avatar
0 votes
2 answers
41 views

No metadata hash in transaction

I see from the RFC (https://github.com/polkadot-fellows/RFCs/blob/main/text/0078-merkleized-metadata.md#inclusion-in-an-extrinsic) that it's possible to not provide the hash when crafting a polkadot ...
dierreh's user avatar
2 votes
1 answer
70 views

How to enable free execution for specific extrinsics using the SkipCheckIfFeeless

Context I'm currently working on a faucet/claiming pallet that allows new users to claim a certain amount of tokens. We have some logic in place to gatekeep who can receive the tokens, and each user ...
Just's user avatar
  • 23
2 votes
1 answer
73 views

removing a StorageMap from a pallet

I am looking to completely remove a StorageMap from the inclusion runtime module of the polkadot relay chain. I am writing a migration for it and I'm wondering whether it's enough to call clear on the ...
Alin Dima's user avatar
1 vote
1 answer
41 views

Why does `transferAll` leave an existential deposit despite keep alive flag set to false?

I recently had to transfer all the funds of an account A to an account B. To do so, I used extrinsic balances.transferAll(B, false) where the second argument is the keepAlive flag (see documentation) ...
GDethier's user avatar
0 votes
0 answers
25 views

Whitelisted keys when benchmarking extrinsic calls

There are a few storage keys that are always whitelisted before each benchmarking pallet extrinsic call (:transaction_level, :extrinsic_index, and :intrablock_entropy), apart from the whitelisted keys ...
lime's user avatar
  • 121
1 vote
1 answer
30 views

Pallet without FRAME

In the Polkadot Blockchain Academy book it is mentioned that FRAME facilitates and accelerates the development of pallets: Without FRAME: 2210 lines of code. With FRAME: 310 lines of code. ...
Tomasz Waszczyk's user avatar
1 vote
0 answers
31 views

Get weights data from a benchmarked pallet

Is there a way to get some informations for an already benchmarked pallet on the weights like the minimum and maximum weights that can be used for a function (worst case/best case) ?
SailorSnoW's user avatar
1 vote
1 answer
40 views

Imported pallet and got "use codec::alloc::vec;"

I work on a pallet with interior dispatch mutability where I need to make calls cancel_as_multi and as_multi and after importing contracts pallet, compiler forces me to change contracts pallet. But I ...
Tomasz Waszczyk's user avatar
1 vote
1 answer
23 views

Ensure that a call is dispatched from a specific pallet

So I want my instance of the pallet membership to be managed only by a specific pallet, and not even the Root origin. Is there anyway to create an EnsureOrigin object that can verify that a specific ...
SailorSnoW's user avatar
2 votes
1 answer
30 views

Dynamic Collectives

In substrate all the existing frames assume a "static" set of Collectives, defined at runtime and with direct management of members using membership frame. Does anyone have or know of a good ...
Jake Thompson's user avatar
2 votes
1 answer
53 views

Storage migrations for frame pallets

I've noticed that some of the frame pallets have migrations and others don't, so I was just wondering if all the required migrations are implemented by the frame pallets, or if it depends on the ...
Sebastian's user avatar
  • 411
1 vote
0 answers
19 views

Add a `StorageMap` to a pallet (metadata) from outside the pallet

my problem is the following: There is a pallet which contains some storage, some extrinsics, and a type in its Config implementing trait CustomPalletHooks to which it delegates some logic. Assuming ...
Antonio Antonino's user avatar
0 votes
0 answers
15 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. ...
Saman H. Pasha's user avatar
4 votes
1 answer
105 views

boxed argument of a dispatchable

there are cases when we want to Box an argument of a dispatchable. One such case is when the type is large, for instance, xcm::MultiLocation and we do not want to blow the size of Call type. these ...
muharem's user avatar
  • 419
0 votes
1 answer
23 views

Removing an error member with #[pallet::error]

Say i have enum: #[pallet::error] pub enum Error<T> { Error1, Error2, Error3, } However i realise that Error2 is in fact not in use and i can remove it. Will i have any consequence ...
gatsey's user avatar
  • 183
1 vote
0 answers
62 views

Batch signed transactions

I need to execute some list of signed extrinsics in order, but because of the randomness that can exist in the transaction pool I have no way to actually ensure that they will execute in the proper ...
Valentin Fernandez's user avatar
3 votes
1 answer
67 views

duplicate lang item in crate `ink_env` - astar-frame/astar

Trying to build Astar shibuya-runtime crate is failing after adding the ink_env dependency an astar-frame chain-extension. Here are the changes to both Astar and astar-frame. Run: cargo build --...
Snowmead's user avatar
  • 625
5 votes
1 answer
73 views

Trait item implementation is missing: `reserve_withdraw_assets`

I am running the Astar node locally and pointing to the astar-frame repository which is cloned on my local machine. In the Astar node repository, I added the paths-override method to the point all ...
Snowmead's user avatar
  • 625
5 votes
1 answer
155 views

adding an account

I just want to simply add an account in the development config but have no idea how to do it, i tried simply adding the seed in the development_config function but it dosent work, what can i do to add ...
Muhammed Rasheed's user avatar
2 votes
1 answer
157 views

Why has the pallet_randomness_collective_flip been removed in polkadot-v0.9.39?

I noticed that the pallet_randomness_collective_flip has been removed in polkadot-v0.9.39, why is this? What are the alternatives? Thanks,
Sebastian's user avatar
  • 411
1 vote
1 answer
29 views

How does the pay_tips parameter work for NFTs?

Who is it voluntary for? The buyer or the creator of the NFT? Does the tip get awarded to the creator after every transfer? Is it voluntary for the buyer each time or is it only voluntary during the ...
Jordan Greenberg's user avatar
2 votes
2 answers
121 views

Transaction Fee Withdrawal

As I've checked the pallet-tx-payment, I've figured it out the fee is withdrawn twice pub fn validate() { let (final_fee, _) = self.withdraw_fee(who, call, info, len)?; ... } pub fn ...
coco_yoon's user avatar
  • 119
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
1 vote
1 answer
88 views

Substrate BoundedVec Error Cannot Borrow as mutable

I have substrate pallet structure as follows #[derive( Encode, Decode, CloneNoBound, PartialEqNoBound, Eq, RuntimeDebugNoBound, TypeInfo, MaxEncodedLen, )] #[scale_info(skip_type_params(...
Kalanamith's user avatar
4 votes
2 answers
57 views

DispatchError::Other(_) always being mapped to DispatchError::Other("")

I'm trying to pass some custom error messages to the frame_system::note_applied_extrinsic() but it seems to be ignoring my message and always using an empty string "". Adding this test to ...
Artur Gontijo's user avatar
2 votes
1 answer
38 views

Why not implement the sp_std::fmt::Debug for AccountId32 in non-std

https://github.com/paritytech/substrate/blob/d443f148ce0aa6a51798b86c6b3ae54113786f94/primitives/core/src/crypto.rs#L584-L595 Why not implement the sp_std::fmt::Debug for AccountId32 in non-std like ...
zjb0807's user avatar
  • 21
3 votes
1 answer
90 views

Different between batch and batchAll functionality in Pallet Utility

Two functions batch and batch_all are slightly similar batch: https://github.com/paritytech/substrate/blob/master/frame/utility/src/lib.rs#L201 batch_all: https://github.com/paritytech/substrate/...
CocDap's user avatar
  • 678
1 vote
1 answer
62 views

How to implement the `Get` trait for a `Pallet<T>`?

I'm writing a pallet that implements evm::executor::stack::PrecompileSet. The goal is to use this pallet in conjunction with Frontier's pallet-evm, which has the following types in its Config trait: ...
Bernardo Rodrigues's user avatar
2 votes
1 answer
45 views

When may `apply_extrinsic` panic?

This question is about these lines in FRAME Executive's apply_extrinsic function pub fn apply_extrinsic(uxt: Block::Extrinsic) -> ApplyExtrinsicResult { // --snip-- // We don't ...
JoshOrndorff's user avatar
  • 1,191
3 votes
1 answer
109 views

Multisig storage showing calls from another one

I figured there seem to be something wrong with a multisig I have on Rococo. It's this one: 5FRz8z6U87LBXLUuBRRy4JtVAh2jhkDSbR5ntCGM2Ds631dJ Checking the storage on it with multisig.multisigs("...
Tbaut's user avatar
  • 253
4 votes
1 answer
29 views

Why do some storage items use the static type and others not?

In the various frame pallets in substrate there are two ways of declaring storage. For example some pallet storage is declared with <T: Config> while others are declared <T: Config<I>, ...
T9b's user avatar
  • 468
2 votes
2 answers
178 views

Accessibility of functions inside custom pallet

I have two custom pallets pallet1 and pallet2. In pallet1 I have a bunch of calls with assigned weights declared under pallet call macro like this #[pallet::call] impl<T: Config> Pallet<T> ...
Derek Shaw's user avatar
0 votes
1 answer
29 views

construct_runtime macro panics in a mock environment while it builds in normal runtime [closed]

Trying to create a mock environment for testing a pallet, but getting an error msg failed to resolve: could not find tt_error_token in the crate root whenever trying to add my pallet in the mock ...
Nakul Amate's user avatar
7 votes
1 answer
39 views

What is the ValidAtTimestamp error supposed to mean?

In pallet-timestamp, what is InherentError::ValidAtTimestamp supposed to mean exactly? let minimum = (Self::now() + T::MinimumPeriod::get()).saturated_into::<u64>(); if t > *(data + ...
b0zero's user avatar
  • 533
1 vote
1 answer
35 views

configuring an associated type of a pallet to a pallet

To what will the Currency associated type of pallet-assets be configured if I configure it to pallet-balances like done in statemint? Will it be set to something within pallet-balances, what exactly? ...
Daan van der Plas's user avatar
4 votes
1 answer
95 views

Whitelist a call subset of a pallet

Is there a way to whitelist a call subset of a pallet? And hide the rest from the end user. // something like Pallet { fn call_a(){} fn call_b(){} }; // Some Pallet ... construct_runtime!( pub ...
muharem's user avatar
  • 419
1 vote
0 answers
24 views

BoundedBTreeMap error with Debug trait

Consider the following snippet #[weight = 100_000_000] //TODO: update weights pub fn test( _origin, _outputs: frame_support::BoundedBTreeSet<JoyBalanceOf<...
mr_bovo's user avatar
  • 171
2 votes
1 answer
65 views

Is it possible to call some of the pallet extrinsics from `on_initialize` hook?

Probably a dumb question, but is it possible to do something like this? #[pallet::hooks] impl<T: Config> Hooks<BlockNumberFor<T>> for Pallet<T> { fn on_initialize(now: ...
Szegoo's user avatar
  • 657
1 vote
1 answer
55 views

How to fix broken trait bounds when instantiating a pallet?

I'm trying to change pallet_assets to pallet_assets::<Instance1> in preparation for more pallet instances. Commit here and compilation error here. The trouble seems to come from the HandleCredit ...
joepetrowski's user avatar
  • 2,955
5 votes
0 answers
60 views

How to use sp_tracing?

When I walk through the sp_tracing documents, it's an overview and does not show us how to use it I have some questions about sp_tracing: How to use it? What command that we run it? (Debug Mode?) ...
CocDap's user avatar
  • 678
4 votes
2 answers
102 views

`runtime::Error` type

Is there any way to tell the construct_runtime! macro to build/export a top-level Error enum type in the same way it provides the top-level Call and Event types? As far as I can tell the only way to ...
dan_chainflip's user avatar
5 votes
2 answers
191 views

SignedExtension to mutate Origin

Please see edits 2 and beyond, as they reshape the question a lot. TLDR: I need a way to mutate an origin for all but some specific calls so that it's dispatched as RawOrigin::Signed to pass ...
Gabe's user avatar
  • 115
3 votes
2 answers
139 views

What does #[pallet::compact] do?

What does #[pallet::compact] do?
Nikita Chernega's user avatar
2 votes
1 answer
277 views

how to get the current block author?

I am creating a new pallet, i have a simple task, get the current block author, i want to check whether I am the current one that is proposing the block or not by comparing the current block author ...
dadzerlaze's user avatar
  • 1,083
0 votes
1 answer
164 views

How to create dex pallet? [closed]

I want to create dex pallet(without using pallet-contracts) with functionality like uniswap with pools of liquidity, this dex gonna work with my multi-token-pallet. So now I'm thinking about how to ...
Nikita Chernega's user avatar
0 votes
1 answer
55 views

How to loose couple trait with config?

I want to loose couple my MultiToken pallet to new Dex pallet, so I created MultiToken trait for interface. Here I need Config to infer AccountId and OriginFor types In my Dex pallet I need to add ...
Nikita Chernega's user avatar
0 votes
1 answer
123 views

How to get access to pallet storage from tests

I have approvals map in my pallet So when i try to get value from my storage, I'm getting this error So how to properly use pallet storage in tests?
Nikita Chernega's user avatar
1 vote
1 answer
38 views

Setting a value to an arbitrary key at genesis?

I am wondering if it is possible to set a value to an arbitrary storage key at genesis. Let's say I want to populate the key 0x3fba98689ebed1138735e0e7a5a790abee99a84ccbfb4b82e714617e5e06f6f7 at ...
Alejandro Martínez's user avatar