-
Notifications
You must be signed in to change notification settings - Fork 2.6k
bounding staking: BoundedElectionProvider
trait
#12362
bounding staking: BoundedElectionProvider
trait
#12362
Conversation
BoundedElectionProvider
trait
/// Elect a new set of winners, without specifying any bounds on the amount | ||
/// of data fetched from [`ElectionProviderBase::DataProvider`]. | ||
/// An implementation could nonetheless impose its own custom limits. | ||
/// | ||
/// The result is returned in a target major format, namely as *vector of | ||
/// support*. | ||
/// | ||
/// This should be implemented as a self-weighing function. The implementor | ||
/// should register its appropriate weight at the end of execution with the | ||
/// system pallet directly. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/// Elect a new set of winners, without specifying any bounds on the amount | |
/// of data fetched from [`ElectionProviderBase::DataProvider`]. | |
/// An implementation could nonetheless impose its own custom limits. | |
/// | |
/// The result is returned in a target major format, namely as *vector of | |
/// support*. | |
/// | |
/// This should be implemented as a self-weighing function. The implementor | |
/// should register its appropriate weight at the end of execution with the | |
/// system pallet directly. | |
/// Same a [`BoundedElectionProvider`], but no bounds are imposed on the number of winners. |
To avoid duplicate facts.
Also, I would move both of these docs to the trait, and leave the function to have a very small, rather rudimentary document like:
/// Perform the actual election process.
fn elect() -> ..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, some docs could be improved.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks broadly good
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems fine, did not look too closely.
bot merge |
* master: (42 commits) Adapt `pallet-contracts` to WeightV2 (#12421) Improved election pallet testing (#12327) Bump prost to 0.11+ (#12419) Use saturating add for alliance::disband witness data (#12418) [Fix] Rename VoterBagsList -> VoterList to match pdot (#12416) client/beefy: small code improvements (#12414) BEEFY: Simplify hashing for pallet-beefy-mmr (#12393) Add @koute to `docs/CODEOWNERS` and update stale paths (#12408) docs/CODEOWNERS: add @acatangiu as MMR owner (#12406) Remove unnecessary Clone trait bounds on CountedStorageMap (#12402) Fix `Weight::is_zero` (#12396) Beefy on-demand justifications as a custom RequestResponse protocol (#12124) Remove contracts RPCs (#12358) pallet-mmr: generate historical proofs (#12324) unsafe_pruning flag removed (#12385) Carry over where clauses defined in Config to Call and Hook (#12388) Properly set the max proof size weight on defaults and tests (#12383) BEEFY: impl TypeInfo for SignedCommitment (#12382) bounding staking: `BoundedElectionProvider` trait (#12362) New Pallet: Root offences (#11943) ...
* add a bounded election provider trait * extract common trait election provider base * fmt * only bound the outer support vector * fix tests * docs * fix rust docs * fmt * fix rustdocs * docs * improve docs * small doc change
This PR is in preparation for bounding the staking pallet by
MaxActiveValidators
. paritytech/polkadot-sdk#255This will split up the trait
ElectionProvider
into bounded and unbounded subtraits. TheBoundedElectionProvider
does not have any implementation yet. The follow up PR for this would beElectionProviderMultipPhase
implementingBoundedElectionProvider
.