Locking + autocompounding#48
Conversation
| Balance: Saturating + Copy, | ||
| { | ||
| /// Returns the total amount of locked balance that is not part of staking. | ||
| pub fn total(&self) -> Balance { |
There was a problem hiding this comment.
the name is misleading as it is not the total locked balance as you perfectly explain on the comment.
There was a problem hiding this comment.
And how'd you name it then? 🤔
I mean, I don't think a very verbose name is the solution. That's why I added the comment for.
| pub type NextSystemOperation<T: Config> = StorageValue<_, OperationFor<T>, ValueQuery>; | ||
|
|
||
| #[pallet::storage] | ||
| pub type LockedBalances<T: Config> = |
There was a problem hiding this comment.
also a comment here could help to understand that this is the non staked locked balance
| let bond = | ||
| T::Currency::balance_frozen(&FreezeReason::CandidacyBond.into(), &candidate); | ||
| let _ = T::Currency::thaw(&FreezeReason::CandidacyBond.into(), &candidate); | ||
| let _ = T::Currency::thaw(&FreezeReason::Releasing.into(), &candidate); |
There was a problem hiding this comment.
Please elaborate on why it is also needed also on the candidacy_bond migration when it is addressed on the release_queue migration
There was a problem hiding this comment.
Because releasing the candidacy bond does not create an element in the release queue that gets inspected. That was actually a bug detected in the previous security audit which forced us to have a separate mechanism for handling the release of the candidacy bond, yet that amount gets locked under the Releasing reason.
Overview
This pull request introduces two major features to the
pallet-collator-stakingmodule:Features
1. Locking
2. Autocompounding
Implementation Notes
lock_stakeunlock_stakeenable_autocompounddisable_autocompoundMigration