2

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 data of the old - now inaccessible in code - StorageItem?

Is there some automated mechanism to prune storage data when it's no longer referenced or do I need to declare a migration from old StorageItem to nothing in order to reclaim the now-unused storage e.g. by following https://docs.substrate.io/how-to-guides/v3/storage-migrations/basics/ and using drain/kill instead of translate?

1 Answer 1

3

Yes, you will need to kill/drain the old storage items. There is no way the chain can detect that storage items are unused and prune them automatically.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.