-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Tvl pool staking #14775
base: master
Are you sure you want to change the base?
Tvl pool staking #14775
Conversation
frame/nomination-pools/src/lib.rs
Outdated
expected_tvl += T::Staking::total_stake(&bonded_pool.bonded_account()) | ||
.expect("all pools must have total stake"); |
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.
Rather than spread the try_state logic for expected TVL across multiple areas of the try-state hook, could you please move it all together?
It's fine to iterate over pools again for this purpose.
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 put the TVL checks into one place now but the check for TVL integrity is now done via the PoolMembers instead of all BondingPools. I would love some feedback on the way it's done now.
@@ -724,4 +724,99 @@ pub mod v5 { | |||
Ok(()) | |||
} | |||
} | |||
|
|||
/// This migration accumulates and initializes the [`TotalValueLocked`] for all pools. | |||
pub struct VersionUncheckedMigrateV5ToV6<T>(sp_std::marker::PhantomData<T>); |
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 hope nobody is us using nomination pools on parachains, but we should mention in the migration that it is using lots of weight and may not be suitable for parachains.
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 pointing it out. How do you think this mention should be done? Just a comment in the code?
The CI pipeline was cancelled due to failure one of the required jobs. |
Description
Please include a summary of the changes and the related issue. Please also include relevant motivation and context, including:
paritytech/polkadot-sdk#155
Use Github semantic linking to address any open issues this PR relates to or closes.
Closes paritytech/polkadot-sdk#155