This repository was archived by the owner on Nov 15, 2023. It is now read-only.
bounding staking: BoundedElectionProvider trait#12362
Merged
paritytech-processbot[bot] merged 13 commits intomasterfrom Sep 28, 2022
Merged
bounding staking: BoundedElectionProvider trait#12362paritytech-processbot[bot] merged 13 commits intomasterfrom
BoundedElectionProvider trait#12362paritytech-processbot[bot] merged 13 commits intomasterfrom
Conversation
BoundedElectionProvider trait
kianenigma
reviewed
Sep 27, 2022
Comment on lines
+396
to
+405
| /// 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. |
Contributor
There was a problem hiding this comment.
Suggested change
| /// 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() -> ..
Contributor
Author
There was a problem hiding this comment.
kianenigma
approved these changes
Sep 27, 2022
Contributor
kianenigma
left a comment
There was a problem hiding this comment.
LGTM, some docs could be improved.
ggwpez
approved these changes
Sep 28, 2022
Member
ggwpez
left a comment
There was a problem hiding this comment.
Seems fine, did not look too closely.
Contributor
Author
|
bot merge |
ordian
added a commit
that referenced
this pull request
Oct 5, 2022
* 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) ...
ark0f
pushed a commit
to gear-tech/substrate
that referenced
this pull request
Feb 27, 2023
* 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 file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR is in preparation for bounding the staking pallet by
MaxActiveValidators. paritytech/polkadot-sdk#255This will split up the trait
ElectionProviderinto bounded and unbounded subtraits. TheBoundedElectionProviderdoes not have any implementation yet. The follow up PR for this would beElectionProviderMultipPhaseimplementingBoundedElectionProvider.