This repository was archived by the owner on Nov 15, 2023. It is now read-only.
Multi-stage pallet-contracts v9 migration#13063
Closed
Dinonard wants to merge 1 commit intoparitytech:masterfrom
Closed
Multi-stage pallet-contracts v9 migration#13063Dinonard wants to merge 1 commit intoparitytech:masterfrom
Dinonard wants to merge 1 commit intoparitytech:masterfrom
Conversation
Contributor
Author
Member
|
I will look into this. Just have my hands full right now. Thanks for the PR. |
|
Hey, is anyone still working on this? Due to the inactivity this issue has been automatically marked as stale. It will be closed if no further activity occurs. Thank you for your contributions. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Using
pallet-contractsV9 storage migration can result in huge PoV size, essentially stopping the block production.This happened on
Shibuyatestnet and hardfork was required to recover it.To bypass this limitation, a multi-stage storage migration logic was introduced (AstarNetwork/Astar#803).
This PR intends to add multi-stage migration logic directly into
pallet-contracts, as requested in #12908.Personally I'm not sure if code such as this should be part of
pallet-contractsor core substrate.I'm very much looking forward to review & comments 🙂 .
Solution Overview
A new extrinsic call
migrate_storageis introduced.Caller has to specify the version to which migration is being done and can specify max allowed weight limit of the migration.
Extrinsic call is used because unlike
on_initializeoron_idlelogic, it gives more control in case something goes wrong. If we specify too large weigh limit, our call would just get rejected (or we could override in the tx queue).The migration step will execute migration logic until weight limit has been reached. At this point, migration state is saved and can be reused in the following call to resume migration from the point where it stopped.
OPEN QUESTIONS
migrate_storageextrinsic call?