Description
There are a few cases when migrations did not verify that the resulting state of a pallet is decodable with the new runtime.
This can easily happen when using StorageMap::translate
since it just ignores un-decodable elements and carries them over into the new runtime.
We could add a check that tries to decode the whole state after a migration (or batch thereof) to verify that the state is not corrupted.
Sure there could still be un-decodable data in storage in the form of blobs (eg pallet-preimage) but decoding errors needs to be handled in these cases anyway. This would help but not completly solve with the introduction of BoundedVec
.
Migrations still need to truncate any unbounded vectors or use WeakBoundedVec
instead since otherwise someone could front-run the migration. cc @kianenigma
Metadata
Metadata
Assignees
Type
Projects
Status