Unverified Commit c16fcc47 authored by Andrei Sandu's avatar Andrei Sandu Committed by GitHub
Browse files

ParaInherent create: update `apply_weight_limit` wrt elastic scaling (#3573)

Changes the way we perform the random selection of backed candidates
when there isn't enough room for all of them. Instead of picking
individual backed candidates `apply_weight` now operates on chains of
candidates. This is fully backwards compatible and relies on the node
side (provisioner/prospective parachains) doing the heavy lifting and
providing the candidates in the order they form a chain.

The same approach can be implemented for bitfields random selection once
https://github.com/paritytech/polkadot-sdk/pull/3479

 is merged.

The approach taken in this PR aims for reduced additional complexity at
the cost of being less fair wrt how many backed candidates from each
chain are picked. It favors elastic scaling parachains vs parachains not
using elastic scaling, but from my perspective it should be fine as this
should happen under exceptional circumstances like dispute storms.

Note: to make things more fair we can consider specializing `random_sel`
such that it will try to pick candidates one by one in the order
provided by the provisioner such that non elastic scaling parachains
have the same chance of getting a candidate backed.

---------

Signed-off-by: default avatarAndrei Sandu <[email protected]>
parent 4ae73988
Pipeline #452813 passed with stages
in 41 minutes and 42 seconds
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment