Add MinPointsToBalance to nomination pools#11377
Conversation
|
Is it worth making |
ggwpez
left a comment
There was a problem hiding this comment.
Looks good, benchmarks still need to be re-run 👍
frame/nomination-pools/src/lib.rs
Outdated
| ensure!( | ||
| next_bonded_balance < BalanceOf::<T>::max_value().div(10u32.into()), | ||
| next_bonded_balance < | ||
| BalanceOf::<T>::max_value().div(MinPointsToBalance::<T>::get().into()), |
There was a problem hiding this comment.
Can we prevent someone puts zero in here? Otherwise it panics.
Maybe use a checked_div?
…ytech/substrate into rb-points-to-balance-ratio
This PR does not add a new storage item. Can you update the description so I can review intention vs code? |
yes. The description has been amended. |
|
needs companions |
|
companions need to be happy here. |
paritytech/polkadot#5520 Needs another review. Requested @ggwpez |
|
bot rebase |
|
Rebasing |
|
bot merge |
|
Error: "Check reviews" status is not passing for paritytech/polkadot#5520 |
|
bot merge |
|
Error: Statuses failed for f4730be |
|
bot rebase |
|
Rebasing |
|
cumulus CI seems to be breaking here Dunno where |
* add MinPointsToBalance to pools * add min_points_to_balance to benchmark mock * fmt * comments Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * check min_points_to_balance.is_zero * comment * comment * storage to constant * fix * comment Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> Co-authored-by: parity-processbot <>
* add MinPointsToBalance to pools * add min_points_to_balance to benchmark mock * fmt * comments Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * check min_points_to_balance.is_zero * comment * comment * storage to constant * fix * comment Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> Co-authored-by: parity-processbot <>
* add MinPointsToBalance to pools * add min_points_to_balance to benchmark mock * fmt * comments Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * check min_points_to_balance.is_zero * comment * comment * storage to constant * fix * comment Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> Co-authored-by: parity-processbot <>
This PR adds a new runtime constant item for the minimum points to balance ratio to join a nomination pool. Attempts to address #10792.
The name
MinPointsToBalancehas been used as an attempt to keep it short.fixes #11377
The previously hardcoded value of 10, where
OverFlowRiskhas been tested, has been replaced with the storage item.Tests have been amended to take the new ratio into consideration.
polkadot companion: paritytech/polkadot#5520