-
Notifications
You must be signed in to change notification settings - Fork 766
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
Add new try-state check invariant for nomination-pools (points >= stake) #5465
Add new try-state check invariant for nomination-pools (points >= stake) #5465
Conversation
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.
Thanks for picking up on this issue @dharjeezy.
The invariant that we want to check is not quite the one you implemented. What we want to verify is that for each bonded pool (in the nominations pool pallet), the points of a pool is never lower than the pool's balance. If that's the case, we want the try-state checks to fail.
A couple ideas:
- The try-state check should be implemented in the nomination pools pallet
- In the nomination pools checks, we are already iterating over all bonded pools, here we can check if the invariant holds true
- The
fn Pool::points_to_balance
method may be helpful to check the invariant.
Co-authored-by: Gonçalo Pestana <g6pestana@gmail.com>
61bfcb8
closes #5448