This repository has been archived by the owner on Nov 15, 2023. It is now read-only.
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.
Bounded for Sudo Test and Tips #11596
Bounded for Sudo Test and Tips #11596
Changes from all commits
d24bed7
038cba0
3a06cf2
807e719
621957c
91c5add
e57c795
d95402b
529a425
868724d
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
Note that I am concerned here about having this BoundedVec controlled by
Tippers
, which is a constant used in a different pallet. Chances to make mistakes here could be high.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.
I dont see where else this is used
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.
not sure what your response means. I am worried that this
tips
pallet has a bounded vec whose limit is the maximum length of theTippers
. Tippers are defined in the council pallet, which can change in size, potentially smaller.I wonder if someone will catch that if they reduce the council size, it may corrupt existing state in the tips pallet.
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.
Okay, so the tight coupling here could cause issues.
A test could help with usability, checking that
LengthBoundMaximum<Tippers>::get()
has a specific value, but does not solve the problem.Then a developer would at least spot the broken test and know that something is wrong.
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.
Well, it sounds to me the proper way to fix this is to run a migration whenever the council is reduced in size -- it actually makes sense to remove the vote on the tips whenever the council is reduced in size and hence someone is evicted from being a councilor; it doesn't make sense to still count their vote afterwards.
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.
A migration makes sense, but it is difficult to see that only because you change the
DesiredMembers
of the elections provider, you suddenly need a migration in theTips
pallet…Some metadata diff tooling could notice this though.
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.
Huh, perhaps then elections provider should provide some lifecycle hook functions so that other pallets can listen in onto the council election event? Sounds like something that would fit this situation without undergoing a migration.