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

Introduce Payees and PayoutDestination with Split variant #14451

Open
wants to merge 123 commits into
base: master
Choose a base branch
from

Conversation

rossbulat
Copy link

@rossbulat rossbulat commented Jun 23, 2023

Tracking issue: paritytech/polkadot-sdk#410
Polkadot companion: paritytech/polkadot#7425

This PR is part 1 of a lazy migration to update reward destinations, which removes Controller, refactors RewardDestination into a new PayoutDestination enum, and adds an additional Split enum for the ability to compound a part of rewards and have the rest as free balance.

  • Create PayoutDestination with new variants and introduce Payees storage item to replace Payee.
  • set_payee removes Payee (RewardDestination) and inserts to Payees (PayoutDestination)
  • Introduce update_payee call to lazily migrate from Payee to Payees storage item.
  • Implement Split logic on payout_stakers with getter that migrates Payee to new Payees storage.
  • Review staking benchmarks and ensure they are worst case scenario (Split, existing Payee).
  • Add tests again for fee-less update_payee.
  • Add tests for get_payout_destination, ensure Payees is populated.

@rossbulat rossbulat added A0-please_review Pull request needs code review. C1-low PR touches the given topic and has a low impact on builders. D3-trivial 🧸 PR contains trivial changes in a runtime directory that do not require an audit B1-note_worthy Changes should be noted in the release notes labels Jun 23, 2023
@rossbulat rossbulat marked this pull request as ready for review June 23, 2023 20:19
@rossbulat rossbulat requested review from a team June 23, 2023 20:19
@rossbulat rossbulat added the T1-runtime This PR/Issue is related to the topic “runtime”. label Jun 23, 2023
@rossbulat
Copy link
Author

bot help

@rossbulat
Copy link
Author

bot bench $ pallet dev pallet_staking

@rossbulat
Copy link
Author

bot bench $ pallet dev pallet_staking

@rossbulat
Copy link
Author

bot clean

@rossbulat
Copy link
Author

bot bench $ pallet dev pallet_staking

@command-bot
Copy link

command-bot bot commented Jun 24, 2023

@rossbulat https://gitlab.parity.io/parity/mirrors/substrate/-/jobs/3066318 was started for your command "$PIPELINE_SCRIPTS_DIR/commands/bench/bench.sh" pallet dev pallet_staking. Check out https://gitlab.parity.io/parity/mirrors/substrate/-/pipelines?page=1&scope=all&username=group_605_bot to know what else is being executed currently.

Comment bot cancel 26-5ac9ec4e-a310-4a5f-9d84-6e7fed12fe9e to cancel this command or bot cancel to cancel all commands in this pull request.

@rossbulat
Copy link
Author

bot fmt

@command-bot
Copy link

command-bot bot commented Aug 16, 2023

@rossbulat https://gitlab.parity.io/parity/mirrors/substrate/-/jobs/3397765 was started for your command "$PIPELINE_SCRIPTS_DIR/commands/fmt/fmt.sh". Check out https://gitlab.parity.io/parity/mirrors/substrate/-/pipelines?page=1&scope=all&username=group_605_bot to know what else is being executed currently.

Comment bot cancel 33-9f27c5ce-cc38-48d1-8313-001b8a8b5320 to cancel this command or bot cancel to cancel all commands in this pull request.

@command-bot
Copy link

command-bot bot commented Aug 16, 2023

@rossbulat Command "$PIPELINE_SCRIPTS_DIR/commands/fmt/fmt.sh" has finished. Result: https://gitlab.parity.io/parity/mirrors/substrate/-/jobs/3397765 has finished. If any artifacts were generated, you can download them from https://gitlab.parity.io/parity/mirrors/substrate/-/jobs/3397765/artifacts/download.

@rossbulat
Copy link
Author

bot rebase

@paritytech-processbot
Copy link

Rebased

@rossbulat
Copy link
Author

bot fmt

@command-bot
Copy link

command-bot bot commented Aug 17, 2023

@rossbulat https://gitlab.parity.io/parity/mirrors/substrate/-/jobs/3404653 was started for your command "$PIPELINE_SCRIPTS_DIR/commands/fmt/fmt.sh". Check out https://gitlab.parity.io/parity/mirrors/substrate/-/pipelines?page=1&scope=all&username=group_605_bot to know what else is being executed currently.

Comment bot cancel 43-4b5c0312-669e-4d24-b7e0-8f6806dacc0a to cancel this command or bot cancel to cancel all commands in this pull request.

@command-bot
Copy link

command-bot bot commented Aug 17, 2023

@rossbulat Command "$PIPELINE_SCRIPTS_DIR/commands/fmt/fmt.sh" has finished. Result: https://gitlab.parity.io/parity/mirrors/substrate/-/jobs/3404653 has finished. If any artifacts were generated, you can download them from https://gitlab.parity.io/parity/mirrors/substrate/-/jobs/3404653/artifacts/download.

@rossbulat
Copy link
Author

bot rebase

@paritytech-processbot
Copy link

Rebased

@rossbulat
Copy link
Author

bot rebase

@paritytech-processbot
Copy link

Rebased

@rossbulat
Copy link
Author

bot rebase

@paritytech-processbot
Copy link

Rebased

@rossbulat
Copy link
Author

bot rebase

@paritytech-processbot
Copy link

Rebased

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A0-please_review Pull request needs code review. B1-note_worthy Changes should be noted in the release notes C1-low PR touches the given topic and has a low impact on builders. D3-trivial 🧸 PR contains trivial changes in a runtime directory that do not require an audit T1-runtime This PR/Issue is related to the topic “runtime”.
Projects
Status: ✂️ In progress.
Development

Successfully merging this pull request may close these issues.

6 participants