substrate icon indicating copy to clipboard operation
substrate copied to clipboard

Introduce `Payees` and `PayoutDestination` with `Split` variant

Open rossbulat opened this issue 2 years ago • 92 comments

Tracking issue: https://github.com/paritytech/polkadot-sdk/issues/410 Polkadot companion: https://github.com/paritytech/polkadot/pull/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.

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

rossbulat avatar Jun 23 '23 15:06 rossbulat

bot help

rossbulat avatar Jun 23 '23 20:06 rossbulat

bot bench $ pallet dev pallet_staking

rossbulat avatar Jun 23 '23 20:06 rossbulat

bot bench $ pallet dev pallet_staking

rossbulat avatar Jun 23 '23 21:06 rossbulat

bot clean

rossbulat avatar Jun 24 '23 17:06 rossbulat

bot bench $ pallet dev pallet_staking

rossbulat avatar Jun 24 '23 17:06 rossbulat

@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.

command-bot[bot] avatar Jun 24 '23 17:06 command-bot[bot]

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

command-bot[bot] avatar Jun 24 '23 17:06 command-bot[bot]

bot rebase

rossbulat avatar Jun 24 '23 20:06 rossbulat

Rebased

bot rebase

rossbulat avatar Jun 25 '23 13:06 rossbulat

Branch is already up-to-date

bot rebase

rossbulat avatar Jun 26 '23 11:06 rossbulat

Rebased

bot bench $ pallet dev pallet_staking

rossbulat avatar Jun 27 '23 10:06 rossbulat

@rossbulat https://gitlab.parity.io/parity/mirrors/substrate/-/jobs/3076574 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 1-e2670b82-fa1e-4d42-afa9-6536221d5cbd to cancel this command or bot cancel to cancel all commands in this pull request.

command-bot[bot] avatar Jun 27 '23 10:06 command-bot[bot]

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

command-bot[bot] avatar Jun 27 '23 10:06 command-bot[bot]

bot rebase

rossbulat avatar Jun 27 '23 10:06 rossbulat

Rebased

bot bench $ pallet dev pallet_staking

rossbulat avatar Jun 27 '23 10:06 rossbulat

@rossbulat https://gitlab.parity.io/parity/mirrors/substrate/-/jobs/3076884 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 2-96182715-da03-4f82-96c4-d512f894a727 to cancel this command or bot cancel to cancel all commands in this pull request.

command-bot[bot] avatar Jun 27 '23 10:06 command-bot[bot]

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

command-bot[bot] avatar Jun 27 '23 11:06 command-bot[bot]

bot rebase

rossbulat avatar Jul 07 '23 19:07 rossbulat

Rebased

This pull request has been mentioned on Polkadot Forum. There might be relevant details there:

https://forum.polkadot.network/t/revision-of-rewarddestination-to-account-for-split-and-controller-removal/3360/1

Polkadot-Forum avatar Jul 08 '23 14:07 Polkadot-Forum

bot rebase

rossbulat avatar Jul 17 '23 07:07 rossbulat

Rebased

bot bench $ pallet dev pallet_staking

rossbulat avatar Jul 17 '23 07:07 rossbulat

@rossbulat https://gitlab.parity.io/parity/mirrors/substrate/-/jobs/3198751 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 7-68a9790e-3167-49ef-9b35-31b5d6692a3f to cancel this command or bot cancel to cancel all commands in this pull request.

command-bot[bot] avatar Jul 17 '23 07:07 command-bot[bot]

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

command-bot[bot] avatar Jul 17 '23 08:07 command-bot[bot]

bot rebase

rossbulat avatar Jul 20 '23 13:07 rossbulat