All Questions
24 questions
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 ?...
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(...
1
vote
0
answers
64
views
move_pallet: What is correct way to verify old pallet storage is deleted
In trying to use a migration implementation for substrate which can be used to rename BagsList to VoterList, using move_pallet a post migration check is failing when testing the migration with try-...
1
vote
1
answer
39
views
Storage Migrations on Rococo?
GM everyone, has anyone noticed storage migrations stopped running on rococo?
We are on 0.9.43 and can not get migrations to run, both through the pallets or the runtime
running trace logs doesn't ...
3
votes
2
answers
48
views
Is it possible to bootstrap a parachain node from pre-existing solo chainstate?
Let's imagine a scenario where a team is running a substrate private network and have all their chainstate that they want to move to a parachain after acquiring a slot. My question is, when the team ...
3
votes
0
answers
32
views
How to migrate / backup & restore ink smart contract storage?
Is there a way to backup ink smart contract storage and later restore on another chain? Lets say we have chain with 3 validators and deployed smart contract containing certain information in its ...
3
votes
2
answers
70
views
Number of and writes of StorageMap drain
I was wondering about the number of reads and writes when draining a StorageMap which consists of n items. Is the answer (n, 1) or (n, n)?
4
votes
2
answers
155
views
How to write pallet rename data migration?
I want to rename one of our collective pallet instances to be visible in the PolkaddotJs App.
I think the best option would be to migrate raw data.
I assume that all pallet data has the same trie path ...
2
votes
0
answers
40
views
Elections phragmen migration
I am working on Substrate-based node upgrades for solo-chain.
I stick to Polkadot releases and during the upgrade from polkadot-release-v0.8.27 to polkadot-v0.8.28 I found a storage migration. This ...
7
votes
2
answers
133
views
How to identify node update storage migrations?
I am working on Substrate-based node upgrades.
I stick to Polkadot releases and start from polkadot-v0.8.25 to the latest versions. While upgrading I need to make sure that I don’t miss any storage ...
5
votes
2
answers
83
views
How to determine if a parachain runtime migration is too big?
I want to write runtime storage migration for our parachain. This time it will scan large storage maps with more than 10k entries. This may results in very large PoV block size. I'm wondering what the ...
3
votes
1
answer
88
views
Potential storage issue with try-runtime tool
Hey guys I'm seeing a weird thing with the following migration code:
pub struct SomeMigration;
impl OnRuntimeUpgrade for SomeMigration {
fn on_runtime_upgrade() -> Weight {
let ...
0
votes
1
answer
63
views
Is using `put_storage_value` on a storage map while iterating over the same map using `storage_iter` undefined behavior?
The IterableStorageMap API explicitly forbids altering the map while iterating: https://paritytech.github.io/substrate/master/src/frame_support/storage/mod.rs.html#270-272
The frame_support::storage::...
2
votes
1
answer
103
views
Does changing an enum require a storage migration? What about `Error` and `Event`
Say I have instances of this enum stored on-chain:
enum Enum {
V0,
V1,
}
And suppose now that I change the enum in some way:
enum Enum {
V0,
V2,
V1,
}
This is what the substrate ...
4
votes
2
answers
127
views
How to add storage migration in parachain?
I have successfully performed storage migration on standalone chain. But how to do this for parachain ?
Like, How/what wasm should be upload of new version and Where Should I upload ?
Is there any ...
4
votes
1
answer
177
views
How do I fix "SpecVersionNeedsToIncrease" error?
I Just clone this https://github.com/OAK-Foundation/substrate-node-template/tree/nicks-v2 for storage migration. After launch on polkadot ,this error shows:
I'm using following commands to run:
./...
5
votes
1
answer
190
views
Migrate keytype of StorageMap without breakin API
Assume we have a StorageMap MyMap of which we want to extend the type of the decoded keys from KeyTypeOld to an enum including the old type as well as a new one.
Before
pub type MyMap = StorageMap<...
2
votes
1
answer
212
views
Migrating storage without creating a new storage item
I am using Substrate V3 (using decl_storage) and have an existing storage defined like this:
pub Foo get(fn get_foo) config(): map hasher(blake2_128_concat) u32 => H160;
I would like to change ...
2
votes
1
answer
114
views
How to selectively populate state from a snapshot of one chain onto another?
Goal
To use a full snapshot at some block height of one chain and selectively pull in select parts of this state.
Use cases
Migrating state from another chain. Example:
A snapshot of only assets ...
5
votes
2
answers
455
views
Storage Migration Guide Using #[pallet::storage]
I am new to both substrate and rust so trying to educate myself. I've the read documentation for both and am now going through the various tutorials and guides. I'm currently on the Basic Storage ...
2
votes
1
answer
66
views
Migrating to new code base
We have a prototype of substrate-based blockchain running with few nodes.
After some time running and testing we came up with new version of code-base, which consists of the same runtime, pallets and ...
3
votes
1
answer
106
views
Should I do storage migration after remove fields from storage struct type?
I have a map storage, which stores structures. I've just removed a field from the structure, should I write storage migration codes for that? Could substrate work with existing values without a ...
2
votes
1
answer
128
views
Forked Parity pallet, didn't migrate storage, deployed to chain. How to clear original storage from the live chain?
We started a chain using pallet_collator_selection and later forked it.
Both the original and the forked pallet use the LastAuthoredBlock StorageItem.
We did not execute a storage migration from the ...
2
votes
1
answer
71
views
Reclaim used space of a removed StorageItem on a live chain
I am changing the collator_selection pallet by removing the LastAuthoredBlock StorageItem and adding an unrelated one, so although the chain is live, no data migration is needed.
What happens with the ...