Commit cbb48e5
Bound Election and Staking by MaxActiveValidators (paritytech#12436)
* bounding election provider with kian
* multi phase implement bounded election provider
* election provider blanket implementation
* staking compiles
* fix test for election provider support
* fmt
* fixing epmp tests, does not compile yet
* fix epmp tests
* fix staking tests
* fmt
* fix runtime tests
* fmt
* remove outdated wip tags
* add enum error
* sort and truncate supports
* comment
* error when unsupported number of election winners
* compiling wip after kian's suggestions
* fix TODOs
* remove,fix tags
* ensure validator count does not exceed maxwinners
* clean up
* some more clean up and todos
* handle too many winners
* rename parameter for mock
* todo
* add sort and truncate rule if there are too many winners
* fmt
* fail, not swallow emergency result bound not met
* remove too many winners resolution as it can be guaranteed to be bounded
* fix benchmark
* give MaxWinners more contextual name
* make ready solution generic over T
* kian feedback
* fix stuff
* Kian's way of solvign this
* comment fix
* fix compile
* remove use of BoundedExecution
* fmt
* comment out failing integrity test
* cap validator count increment to max winners
* dont panic
* add test for bad data provider
* Update frame/staking/src/pallet/impls.rs
Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>
* fix namespace conflict and add test for onchain max winners less than desired targets
* defensive unwrap
* early convert to bounded vec
* fix syntax
* fmt
* fix doc
* fix rustdoc
* fmt
* fix maxwinner count for benchmarking
* add instant election for noelection
* fmt
* fix compile
* pr feedbacks
* always error at validator count exceeding max winners
* add useful error message
* pr comments
* import fix
* add checked_desired_targets
* fmt
* fmt
* fix rust doc
Co-authored-by: parity-processbot <>
Co-authored-by: kianenigma <kian@parity.io>
Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>1 parent daf72d1 commit cbb48e5
File tree
21 files changed
+538
-312
lines changed- bin/node/runtime/src
- frame
- babe/src
- election-provider-multi-phase/src
- election-provider-support/src
- fast-unstake/src
- grandpa/src
- nomination-pools
- benchmarking/src
- test-staking/src
- offences/benchmarking/src
- root-offences/src
- session/benchmarking/src
- staking/src
- pallet
- primitives/npos-elections/src
21 files changed
+538
-312
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
570 | 570 | | |
571 | 571 | | |
572 | 572 | | |
573 | | - | |
| 573 | + | |
574 | 574 | | |
575 | 575 | | |
576 | 576 | | |
| |||
628 | 628 | | |
629 | 629 | | |
630 | 630 | | |
631 | | - | |
| 631 | + | |
| 632 | + | |
| 633 | + | |
| 634 | + | |
| 635 | + | |
| 636 | + | |
| 637 | + | |
| 638 | + | |
632 | 639 | | |
633 | 640 | | |
634 | 641 | | |
| |||
679 | 686 | | |
680 | 687 | | |
681 | 688 | | |
682 | | - | |
683 | | - | |
684 | | - | |
685 | | - | |
686 | | - | |
| 689 | + | |
| 690 | + | |
| 691 | + | |
687 | 692 | | |
688 | 693 | | |
689 | 694 | | |
| |||
726 | 731 | | |
727 | 732 | | |
728 | 733 | | |
729 | | - | |
730 | | - | |
| 734 | + | |
| 735 | + | |
731 | 736 | | |
732 | 737 | | |
733 | | - | |
| 738 | + | |
| 739 | + | |
734 | 740 | | |
735 | 741 | | |
736 | 742 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
178 | 178 | | |
179 | 179 | | |
180 | 180 | | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
181 | 184 | | |
182 | 185 | | |
183 | 186 | | |
| |||
199 | 202 | | |
200 | 203 | | |
201 | 204 | | |
202 | | - | |
| 205 | + | |
203 | 206 | | |
204 | 207 | | |
205 | 208 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
220 | 220 | | |
221 | 221 | | |
222 | 222 | | |
223 | | - | |
224 | | - | |
225 | | - | |
226 | | - | |
227 | | - | |
| 223 | + | |
228 | 224 | | |
229 | 225 | | |
230 | 226 | | |
| |||
403 | 399 | | |
404 | 400 | | |
405 | 401 | | |
406 | | - | |
| 402 | + | |
407 | 403 | | |
408 | 404 | | |
409 | 405 | | |
| |||
0 commit comments