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

Payout function should refund #8428

@kianenigma

Description

@kianenigma

Current payout function of staking assumes that any payout pays exactly T::MaxNominationPerValidator accounts, not to mention that it also assumes the worse case of account target as well: Staked.

We should make this refund along two axes:

  1. If we pay X nominators, we should take this into account.
  2. Each payout variant should have its own weight benchmark, and we must add them up. So the function will still use the upfront worse case weight, but will refund quite a bit along the way.

Once we have this, we can bump the MaxNominationPerValidator to a much larger number safely, effectively nilling the chance of oversubscribed nominators.

related paritytech/polkadot#2637

Metadata

Metadata

Assignees

Labels

I9-optimisationAn enhancement to provide better overall performance in terms of time-to-completion for a task.U2-some_time_soonIssue is worth doing soon.Z2-mediumCan be fixed by a coder with good Rust knowledge but little knowledge of the codebase.Z6-mentorAn easy task where a mentor is available. Please indicate in the issue who the mentor could be.

Type

No type

Projects

Status

✅ Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions