-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Conversation
log!( | ||
info, | ||
"Running migration with current storage version {:?} / onchain {:?}", |
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.
is migration needed? are any pools already there?
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.
There are on westend and there will be on Kusama by the time this PR makes it into a release.
if let Some(newest_era_to_remove) = | ||
current_era.checked_sub(T::PostUnbondingPoolsWindow::get()) |
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.
This seems like a subtle change. I assume the value is the same, but just one less storage read?
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.
made a small change to make maybe_merge_pools a bit more comprehensible. This function is only used in a few instances and should be trivial to check.
Should be easy to verify, and it was intentional.
bot merge |
Waiting for commit status. |
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.
Couldn't have done it without you! 👌
* make pool roles optional * undo lock file changes? * add migration * Fix * fix review comments
* make pool roles optional * undo lock file changes? * add migration * Fix * fix review comments
* make pool roles optional * undo lock file changes? * add migration * Fix * fix review comments
Main feature that's being added is:
None
.root
to none, I will never change any of the roles again.nominator
to none, I will never change my nominations.state_toggler
to none, I will never be able to destroy this pool (unless if it gets slashed up to 90%, which should really rarely happen).Any pool needs to set nominations at least once. To prevent mistakes about this, the
create
call MUST specify all roles. Then, a call toupdate_roles
can remove any of the roles that should no longer exist. Similar to a chain, a pool can operate for a while withroot
and then destroy it.Other than this
I added a test to demonstrate a confusion that you cannot bail out of slashing, if you unbond in the same era
made a small change to make
maybe_merge_pools
a bit more comprehensible. This function is only used in a few instances and should be trivial to check.(unfortunately) Needs a migration that moves the current pool roles in westend and kusama to the new format. This should be fine. This is exactly for now we proposed deploying pools on kusama with a bound on the maximum number of pools (128), so we can do such surgeries easier.
To avoid needing to migrate Polkadot pools as well, we should merge this before 0.23 and deploying anything to Polkadot.
polkadot compnaion: paritytech/polkadot#5524