Fix offchain election to respect the weight (#7215)
* Mockup * Fix offchain election to respect the weight * Fix builds a bit * Update frame/staking/src/offchain_election.rs Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com> * Update frame/staking/src/offchain_election.rs Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com> * Make it build, binary search * Fix a number of grumbles * one more fix. * remove unwrap. * better alg. * Better alg again. * Final fixes * Fix * Rollback to normal * Final touches. * Better tests. * Update frame/staking/src/lib.rs Co-authored-by: Guillaume Thiolliere <gui.thiolliere@gmail.com> * Proper maxExtWeight * Final fix * Final fix for the find_voter Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com> Co-authored-by: Guillaume Thiolliere <gui.thiolliere@gmail.com>
Showing
- .gitignore 1 addition, 0 deletions.gitignore
- bin/node/runtime/src/lib.rs 10 additions, 5 deletionsbin/node/runtime/src/lib.rs
- frame/babe/src/mock.rs 1 addition, 0 deletionsframe/babe/src/mock.rs
- frame/grandpa/src/mock.rs 1 addition, 0 deletionsframe/grandpa/src/mock.rs
- frame/offences/benchmarking/src/mock.rs 1 addition, 0 deletionsframe/offences/benchmarking/src/mock.rs
- frame/session/benchmarking/src/mock.rs 1 addition, 0 deletionsframe/session/benchmarking/src/mock.rs
- frame/staking/fuzzer/src/mock.rs 1 addition, 0 deletionsframe/staking/fuzzer/src/mock.rs
- frame/staking/src/benchmarking.rs 2 additions, 2 deletionsframe/staking/src/benchmarking.rs
- frame/staking/src/lib.rs 16 additions, 8 deletionsframe/staking/src/lib.rs
- frame/staking/src/mock.rs 23 additions, 15 deletionsframe/staking/src/mock.rs
- frame/staking/src/offchain_election.rs 378 additions, 39 deletionsframe/staking/src/offchain_election.rs
- frame/staking/src/testing_utils.rs 33 additions, 8 deletionsframe/staking/src/testing_utils.rs
- frame/staking/src/tests.rs 3 additions, 3 deletionsframe/staking/src/tests.rs
- frame/system/src/extensions/check_weight.rs 2 additions, 2 deletionsframe/system/src/extensions/check_weight.rs
- primitives/npos-elections/compact/src/lib.rs 49 additions, 0 deletionsprimitives/npos-elections/compact/src/lib.rs
- primitives/npos-elections/src/tests.rs 63 additions, 0 deletionsprimitives/npos-elections/src/tests.rs
Please register or sign in to comment