paritytech / cumulus

Write Parachains on Substrate
GNU General Public License v3.0
618 stars 382 forks source link

DesiredCandidates lower than MinCandidates #2837

Closed lazam closed 11 months ago

lazam commented 12 months ago

We encounter the scenario in Rococo Assethub which was initially set to DesiredCandidates: 1. You can set the DesiredCandidates lower than MinCandidates but the collator can't be removed due to TooFewCandidates. It will be better to have a check and reject the call if the DesiredCandidates <= MinCandidates.

bkchr commented 11 months ago

Not sure this makes sense. The MinCandidates are compared against the candidates + invulnerable. So, it is totally fine to say that desired_candidates == 1 and having min candidates of 2 and then having an invulnerable of 1.

joepetrowski commented 11 months ago

Rococo AH is still on v9430, which is before the change from MinCandidates to MinCollators, so this should already be sorted by https://github.com/paritytech/cumulus/pull/2801

https://github.com/paritytech/cumulus/blob/release-parachains-v9430/pallets/collator-selection/src/lib.rs#L402