Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reset crowdloan rewards storage in Moonbase runtime only. #710

Closed
wants to merge 11 commits into from

Conversation

JoshOrndorff
Copy link
Contributor

This PR adds a runtime migration to the moonbase runtime that will delete all of pallet crowdloan rewards' storage so it can be re-initialized.

@JoshOrndorff JoshOrndorff changed the base branch from master to point_to_latest_crowdloan_changes August 19, 2021 19:01
// Delete all crowdlaon rewards storage
// Supply only the pallet name, no storage item name or map key
// This will cause the entire pallet's storage to be deleted
frame_support::storage::migration::remove_storage_prefix(b"CrowdloanRewards", &[], &[]);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any idea what the ramifications of this are on storage proof size?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we need to know what was stored there in order to delete it. So I think the storage proof will just need to contain sibling nodes down to the root of this pallet so they can calculate the correct post-state root.

I'm not that confident that I'm right, but that makes sense to me.

This comment was marked as duplicate.

runtime/moonbase/src/lib.rs Show resolved Hide resolved
// Delete all crowdlaon rewards storage
// Supply only the pallet name, no storage item name or map key
// This will cause the entire pallet's storage to be deleted
frame_support::storage::migration::remove_storage_prefix(b"CrowdloanRewards", &[], &[]);

This comment was marked as duplicate.

@girazoki
Copy link
Collaborator

I think we cannot delete all storage items (more than 12K) at once due to weight constrains. KillPrefix only allowed me to remove 4000 items at most,

Base automatically changed from point_to_latest_crowdloan_changes to master August 19, 2021 21:35
@JoshOrndorff
Copy link
Contributor Author

I'm going to close this for now. If we want it or something like it we can re-open or open a new one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants