Investigate fungible trait Holds and Freezes overlap#1873
Merged
mattheworris merged 4 commits intomainfrom Feb 14, 2024
Merged
Conversation
6 tasks
shannonwells
approved these changes
Feb 13, 2024
Collaborator
shannonwells
left a comment
There was a problem hiding this comment.
Looks great, thanks. #themoreyouknow
Collaborator
Interestingly, the changes will allow to slash hold but yet we validate to prevent that. I am curious to learn what new feature makes this case useful. |
2 tasks
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.
Goal
The goal of this PR is to investigate the overlap of
holdandfrozenin the frame system account, used by the balances pallet and the fungible trait (which replaced the Currency trait).Closes #1819
Discussion
Investigation indicates that it is not currently possible to create a situation where
frozenoverlaps withhold[currently indicated byreservedin the frame system account] and thatholdcan be slashed.Democracypallet to create a proposal that would result in some tokens being placed onhold. The tokens onholdwould always be returned to the user at some point in the future, they are not able to be slashed, as near as I can tell.treasurypallet to create a spend proposal that would result in a minimum of 100 tokens being used as a bond and placed onhold. These tokens will be slashed if the proposal is rejected. We can simulate a rejection usingsudoand see that the tokens are slashed.hold.However, experimentation with
holdshows that conditions whereholdandfrozenoverlap cause the transactions to fail.Tests were added to make sure this behavior does not change in the future.
Changes
Two tests were added:
hold. This transaction fails.How to Test
Checklist