Skip to content
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

Merged

Conversation

dharjeezy
Copy link
Contributor

closes #5448

@dharjeezy dharjeezy changed the title Add new try-state check invariant for nomination-pools (points >= stake) Add new try-state check invariant for nomination-pools (points <= stake) Aug 26, 2024
@gpestana gpestana requested review from Ank4n and gpestana August 26, 2024 17:23
@gpestana gpestana added the T2-pallets This PR/Issue is related to a particular pallet. label Aug 26, 2024
Copy link
Contributor

@gpestana gpestana left a 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:

  1. The try-state check should be implemented in the nomination pools pallet
  2. In the nomination pools checks, we are already iterating over all bonded pools, here we can check if the invariant holds true
  3. The fn Pool::points_to_balance method may be helpful to check the invariant.

@dharjeezy dharjeezy requested a review from gpestana August 27, 2024 10:26
prdoc/pr_5465.prdoc Outdated Show resolved Hide resolved
@gpestana gpestana changed the title Add new try-state check invariant for nomination-pools (points <= stake) Add new try-state check invariant for nomination-pools (points >= stake) Aug 27, 2024
Co-authored-by: Gonçalo Pestana <g6pestana@gmail.com>
@Ank4n Ank4n enabled auto-merge August 28, 2024 01:24
@Ank4n Ank4n added this pull request to the merge queue Aug 28, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Aug 28, 2024
@Ank4n Ank4n enabled auto-merge August 29, 2024 11:54
@Ank4n Ank4n added this pull request to the merge queue Aug 29, 2024
Merged via the queue into paritytech:master with commit 61bfcb8 Aug 29, 2024
182 of 184 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T2-pallets This PR/Issue is related to a particular pallet.
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Add new try-state check invariant for nomination-pools (points >= stake)
3 participants