Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.

Controller account must be alive #6491

Closed
wants to merge 2 commits into from

Conversation

shawntabrizi
Copy link
Member

Closes #6415

This PR updates the logic in the Staking Pallet to require that the controller account is alive and stays alive. This requirement already implicitly exists for stash accounts.

To do this, we introduce a check on the controller account in bond and set_controller to make sure the the account is not is_dead_account(). After passing this check, we place a reference counter on the controller, forcing it to stay alive as long as it stays a controller.

To make sure the account can later be killed, we remove the reference counter from old controllers in set_controller and kill_stash.

Tests have been added and updated to verify this behavior.

@shawntabrizi shawntabrizi added A0-please_review Pull request needs code review. B7-runtimenoteworthy C1-low PR touches the given topic and has a low impact on builders. labels Jun 23, 2020
@shawntabrizi shawntabrizi requested a review from kianenigma as a code owner June 23, 2020 21:03
@shawntabrizi shawntabrizi requested a review from andresilva as a code owner June 23, 2020 22:00
@shawntabrizi shawntabrizi added A3-in_progress Pull request is in progress. No review needed at this stage. and removed A0-please_review Pull request needs code review. labels Jun 24, 2020
@shawntabrizi
Copy link
Member Author

Closing and will open another pr which allows for creating deposit for controllers

@shawntabrizi shawntabrizi deleted the shawntabrizi-live-controller branch June 24, 2020 14:05
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A3-in_progress Pull request is in progress. No review needed at this stage. C1-low PR touches the given topic and has a low impact on builders.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Staking Payouts Only Work for Existing Accounts
1 participant