Fix TotalIssuance on migration and TotalStake check#1166
Merged
sam0x17 merged 12 commits intodevnet-readyfrom Jan 30, 2025
Merged
Fix TotalIssuance on migration and TotalStake check#1166sam0x17 merged 12 commits intodevnet-readyfrom
sam0x17 merged 12 commits intodevnet-readyfrom
Conversation
6e74ccc to
9637986
Compare
ales-otf
commented
Jan 23, 2025
d15288b to
4163b91
Compare
2bc042e to
bf9ab94
Compare
bf9ab94 to
d39a6ea
Compare
sam0x17
approved these changes
Jan 30, 2025
JohnReedV
approved these changes
Jan 30, 2025
This was referenced Feb 3, 2025
Merged
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
Fixes the issue we have with try-runtime.
It splits the state checker into two parts:
TotalIssuanceTotalStakeFirst, there is a bug in "migrate rao". It was increasing the currency issuance, because it returned a part of lock to coldkey. But
TotalIssuancestorage hadn't been updated. We haveframe_config::Config::SingleBlockMigrations, whereTotalIssuanceis recalculated, but it happens before pallet's migrations are triggered. Probably, we should refactor migrations to useframe_config::Config::SingleBlockMigrationsinstead to prevent such issues in the future.Another issue was related to removing of
Stakestorage. Because of that, it's not possible to sum all the stakes to checkTotalStake. From the chat:Related Issue(s)
Type of Change
Checklist
cargo fmtandcargo clippyto ensure my code is formatted and linted correctlyScreenshots (if applicable)
Please include any relevant screenshots or GIFs that demonstrate the changes made.
Additional Notes
Please provide any additional information or context that may be helpful for reviewers.