Skip to main content

Questions tagged [storage]

Questions about storing and accessing stored data on a Substrate blockchain.

29 questions from the last 365 days
Filter by
Sorted by
Tagged with
0 votes
0 answers
4 views

Are storage reads in the pre-dispatch cached?

Are storage reads in the pre-dispatch cached? Example, I'm doing a storage read in the pre-dispatch. Now the same storage read happens when executing the given extrinsic. Do I benefit from caching ...
Daan - R0GUE's user avatar
  • 2,884
1 vote
0 answers
25 views

ImOnline Pallet Migration Causing Storage Root Mismatch

my name is Jimmy and I am a member of the Gossamer team at ChainSafe Systems. We are building a Golang implementation of the Polkadot host and are currently using Paseo as one of the networks to test ...
Jimmy Johnson's user avatar
0 votes
1 answer
18 views

the trait bound `I: scale_info::TypeInfo` is not satisfied

I am writing Pallet which has generic parameter T and static parameter I, but as soon as I wish to create storage for Struct with generic parameter T I receive tons of errors. What am I doing wrong? ...
Dudo's user avatar
  • 21
0 votes
1 answer
23 views

Substrate storage query response does not seems to be correct for System.digests

I am developing a series of Java tools for Substrate based chains, polkadot4j (it is currently under heavy development). I have problem in querying the storage for the pallet system and storage entry ...
mhrsalehi's user avatar
  • 103
1 vote
1 answer
35 views

How to migrate the storagemap into storagedoublemap through runtime upgrade?

Whenever i try to do runtime upgrade within the pallet which has storagemap and then I replace it with storagedoublemap, it removes all the data present in the storagemap. How can i migrate this data ?...
Arunjot Singh's user avatar
1 vote
2 answers
58 views

Should one use mutate or insert to update storage?

What should one use to update the values, mutate or insert? And why in algorithm point of view? <SimpleMap<T>>::insert(&user, entry); <SimpleMap<T>>::mutate(&user, |...
Amiya Behera's user avatar
0 votes
0 answers
13 views

Substrate: function can be called only from offchain workers

i just made a pallet where there is a function callable from users, this function will save some input data inside a storageMap, then offchain worker take the input data, do some operations and should ...
Jacopo Mosconi's user avatar
0 votes
0 answers
4 views

Would it be possible to show historical on-chain storage state for a particular block number?

Is there any way to present historical on-chain storage state for a particular block number? I couldn't find way to do this. Can someone please help me to answer this?
Boleng's user avatar
  • 568
3 votes
1 answer
39 views

How to import big data into the runtime?

I am having a scenario where my chain is responsible for keeping records of airdrop accounts. Initially, all accounts have a zero balance. When I receive a list of accounts with the respective ...
Deepak Chaudhary's user avatar
1 vote
2 answers
23 views

How to use `setStorage` in Polkadot JS Apps? Entries cannot be decoded after setting

I need to manually change the storage entry of a storage map which does not have a setter function. Unfortunately, after calling setStorage($STORAGE_KEY, $NEW_VALUE) the corresponding storage cannot ...
0x5hmoo's user avatar
  • 349
0 votes
0 answers
19 views

how to use substrate-rpc-client query storage

I am trying to use substrate-rpc-client for querying a storage item in our chain, the documentation is very sparse on how to go about this. just says client.storage(StorageKey(vec![]), Some(H256::...
Emmanuel Thomas's user avatar
2 votes
2 answers
28 views

As a registrar, how to find unjudged indentities in the indentity pallet?

If I am a registrar, how can I find the judgements that I need/can judge? As far as I know there is not storage that provides that inforamtion. How the registrar can know what indetity has to be ...
Superluminal's user avatar
1 vote
1 answer
21 views

Remove undecodable storage keys from StorageDoubleMap

I want to remove keys from the storage which cannot be decoded by using unhashed. I know there are undecodable keys because when counting the number of storage keys via MyStorage::<T>::iter_keys(...
0x5hmoo's user avatar
  • 349
1 vote
2 answers
33 views

EnsureOriginBy using an account set on a pallet's storage

I'm working on a feature that requires pallet-nfts ForceOrigin to only be callable by an account configured inside a separated pallet's storage. For example in pallet-A I have the following #[pallet::...
Valentin Fernandez's user avatar
0 votes
1 answer
27 views

What are the "values" in the substrate Merkle Patricia tree?

I've read Shawn's substrate storage deep dive recently. It is very informative and I roughly understand different key systems exist and how the keys are caclulated. However, one thing that puzzles me ...
Kailai's user avatar
  • 383
0 votes
0 answers
52 views

How to mutate a Vec<u16> in a struct in a DoubleStorageMap?

How do I mutate a DoubleStorageMap with a Vec<T::AccountId> as a value using a struct? Data::<T>::mutate( id.clone(), user_id.clone(), |params: &mut DataParams<T::AccountId>...
bobby dy's user avatar
0 votes
0 answers
39 views

Updating SLOT_DURATION on Mainnet - Seeking Assistance!

We are facing a challenge regarding our mainnet and we need the guidance and expertise of the community. Currently, we are looking to update the SLOT_DURATION to optimize the performance of our ...
Lucas Cardeal's user avatar
2 votes
1 answer
53 views

The necessity of bitfields in Polkadot, and potential replacement with threshold signatures

My question is related to the usage of bitfields in data availability system, described in https://spec.polkadot.network/chapter-anv. Polkadot uses bitfields to know if a relay-chain block is stored ...
Oguzhan Ersoy's user avatar
0 votes
2 answers
67 views

How to get the validators list?

Is it possible to get the list of validators which validate a particular block? For instance, let's say we have at block 10 and if this block is finalised then I need to find the list of validators ...
Deepak Chaudhary's user avatar
3 votes
1 answer
80 views

Feeding state from one parachain to another

I am interested in developing a pallet into which data from another parachain can be fed. For instance, consider two parachains: Para A and Para B. Para B implements the collectives pallet, and for ...
Szegoo's user avatar
  • 642
2 votes
1 answer
63 views

How to update the pallet's storage from the runtime api?

Is it possible to update the storage of pallets through runtime api? Is yes. Do we have any resources for this same?
Deepak Chaudhary's user avatar
3 votes
0 answers
25 views

Difficulty Storing Consensus-Derived Value in Storage: Observing Value in Pallet Log but Not in Storage

I'm trying to store a value obtained from the consensus, specifically sc_consensus_babe::fn import_block. While I can observe the value in the pallet through the log, it doesn't seem to be stored in ...
Deepak Chaudhary's user avatar
1 vote
1 answer
39 views

How to change the NextAuthorities set from custom pallet?

The NextAuthorities is only updated in function enact_epoch_change() in pallet_babe and this function is called in Trait EpochChangeTrigger (pallet_babe) and OnSessionHandler so, in the ...
Latte Xu's user avatar
  • 125
1 vote
1 answer
28 views

Is it possible to define a storage inside the pallet without config trait?

Actually I want to define a storage without config trait but if I'm doing this then I'm getting lot of error. Is it possible? /// Author of current block. #[pallet::storage] pub type Author<...
Deepak Chaudhary's user avatar
0 votes
0 answers
25 views

Uncaught runtime errors: [u8;16]:: Expected input with 16 bytes (128 bits), found 21 bytes

I created a value id by this: let encoded_payload = (owner.clone(), task_description.clone()).encode(); let id = frame_support::Hashable::blake2_128(&encoded_payload);// hashvalue of combined ...
Latte Xu's user avatar
  • 125
1 vote
1 answer
43 views

query storage to front-end

In the pallet-template, I have this storage: #[pallet::storage] #[pallet::getter(fn getscoreboard)] pub(super) type ScoreBoard<T: Config> = StorageMap <_, Twox64Concat, T::...
Latte Xu's user avatar
  • 125
1 vote
1 answer
38 views

Mutual value among pallets

How to access value X in pallet A from another pallet? For example, I saw a few pallets define type Currency = Balance, is it truly the value Balance in pallet_balances? If not, how to define a ...
Latte Xu's user avatar
  • 125
1 vote
1 answer
25 views

How to store and query the raw text?

I want to query the task from storage. Here is the Task struct and StorageMap #[derive(Clone, Encode, Decode, PartialEq, RuntimeDebug, TypeInfo, MaxEncodedLen, Default)] #[scale_info(...
Latte Xu's user avatar
  • 125
1 vote
1 answer
46 views

Concerns about returning all elements from a `StorageDoubleMap`

I defined a storage item as StorageDoubleMap, and I need to provide a method that returns the list of elements with the first key (k1). This getter method has to be provided by the pallet. I found a ...
magecnion's user avatar
  • 394