Better Handling of Candidates Who Become Invulnerable (#2801)

* remove candidate when to invulnerable

* fix

* candidates to collators

* make parameters consistent and more reasonable

* add call to kick invulnerable candidates

* factor removal into weight

* fix: use accrue instead of add

* make set_invulnerables non-atomic

* benchmark add_invulnerable to account for candidate removal

* don't remove from candidates with set_invulnerables

* fix bounds on benchmarking

* protect against zero min invulnerables underflow

* extra event and tests

* make candidates/invulnerables self-cleaning on session change

* add integrity test

* unused imports

* make rococo-contracts have 1 collator
This commit is contained in:
joe petrowski
2023-07-07 13:18:27 +02:00
committed by GitHub
parent 8f75f13e5a
commit 5a8134029a
23 changed files with 594 additions and 261 deletions
@@ -318,9 +318,9 @@ impl pallet_collator_selection::Config for Runtime {
type Currency = Balances;
type UpdateOrigin = CollatorSelectionUpdateOrigin;
type PotId = PotId;
type MaxCandidates = ConstU32<1000>;
type MinCandidates = ConstU32<0>;
type MaxInvulnerables = ConstU32<100>;
type MaxCandidates = ConstU32<100>;
type MinEligibleCollators = ConstU32<1>;
type MaxInvulnerables = ConstU32<20>;
// should be a multiple of session or things will get inconsistent
type KickThreshold = Period;
type ValidatorId = <Self as frame_system::Config>::AccountId;