Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

election-provider: allow smaller solutions. #450

Open
kianenigma opened this issue Oct 3, 2022 · 2 comments
Open

election-provider: allow smaller solutions. #450

kianenigma opened this issue Oct 3, 2022 · 2 comments
Labels
I5-enhancement An additional feature request.

Comments

@kianenigma
Copy link
Contributor

Currently, the election-provider-multi-phase pallet has a very very strict check that any solution must be of a certain size to pass the feasibility check.

This is not needed. In staking, we actually two values:

  • Validators: akin to DesiredTargets
  • MinimumValidators: missing.

We need to change the fn desired_targets API to actually return two numbers, analogous to the two values above.

If MinimumValidators is not reached, we raise an error. More than Validators is also not allowed. The range between [MinimumValidators, Validators] is allowed, where we prefer the larger solutions.

I think we don't need to actually encode

where we prefer the larger solutions.

In any way. A solution that has more validators probably also higher ElectionScore by nature. Else, we can explicitly sort/compare based on the number of winners first, then ElectionScore.

@kianenigma
Copy link
Contributor Author

kianenigma commented Oct 4, 2022

cc @jakoblell curious what you think before we start this. I think we have discussed this before, but can't find any records of it.

@juangirini juangirini transferred this issue from paritytech/substrate Aug 24, 2023
@jakoblell
Copy link

In any way. A solution that has more validators probably also higher ElectionScore by nature.

Quite the opposite. The most significant part of the solution score is min_support (that means the stake behind the smallest validator still getting elected) and if you distribute the same total staking amount among a smaller number of validators, the min_support value can significantly increase due to this (assuming that the nominations allow that, but this will likely be the case).

So if we want to compare different solutions with a different validator set size, this will need some kind of adjusted score value to account for the number of validators, for example as suggested in https://github.com/paritytech-secops/srlabs_findings/issues/243.

@the-right-joyce the-right-joyce added I5-enhancement An additional feature request. and removed J0-enhancement labels Aug 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
I5-enhancement An additional feature request.
Projects
Status: ⌛️ Sometime-soon
Development

No branches or pull requests

3 participants