This repository was archived by the owner on Nov 15, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Economic fixes for democracy module #4256
Merged
Merged
Conversation
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
shawntabrizi
reviewed
Dec 1, 2019
Co-Authored-By: Shawn Tabrizi <[email protected]>
shawntabrizi
approved these changes
Dec 1, 2019
Member
shawntabrizi
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good and makes sense to me.
marcio-diaz
reviewed
Dec 1, 2019
Contributor
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. Although, I don't get why we can't reap the pre-image automatically (on bake_referendum?).
Co-Authored-By: Shawn Tabrizi <[email protected]>
Member
Author
because it may not have an associated |
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.
Democracy currently has a state bloat attack since public proposals are allowed to include
Calls which get stored indefinitely in state. This revamps that system so that only a fixed-length hash of theCallis stored, and only when the motion is accepted does the underlying preimageCallget uploaded to the chain. To protect the chain from griefing, there is a substantial refundable deposit for uploading preimage data on the chain of around 1 cent per byte (around $10,000 for 1MB), but this is waived in the case that the preimage is for a motion that has already passed and is in the enactment period.Once a proposal is enacted, then the preimage is dropped and the deposit refunded. A preimage deposit can also be dropped/refunded once it times out, the time out period is the
voting_period + enactment_period.Since there already exist proposals in Kusama, an additional sudo function is introduced;
clear_proposalsto get rid of them around upgrade time.Additionally, the tests have been updated to reflect the fact that the per-block logic happens during
initialize_blockrather than atfinalize_block.Breaking change
Democracy module requires additional configuration items
PreimageByteDeposit,Slashin the config trait. Here's an example of how it might look: