You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
We fallback to the on-chain election if nothing else works, which is okay, but we stall the chain for a long time. This is not good. We should try and somehow make the on-chain sequential run smoother, at the cost of not including all voters.
Some thoughts on the matter:
we can and should sacrifice the small staked voters, but we always want to keep all candidates.
Currently, we don't keep a sorted list of voters anywhere, so we need to take into account that we need to sort them, and then take the top x.
We must first find the sweet spot where for any number of voters more than this, it is wroth it to first sort and then run phragmen.
We must also measure exactly how much weight seq-phragmen is taking in Benchmark exactly how much weight on-chian seq-phragmen takes. #8347, and then we need to alter Benchmark exactly how much weight on-chian seq-phragmen takes. #8347 or generally make it suitable, so you can query the weight before executing anything. For example, assume pallet-multi-phase-election wants to fallback to on-chain election. Before actually calling onchain::elect(...), we ideally want to know how many voters we are allowed to pass in, in order for the weight of the elect call to be below a certain threshold t. This might make the API a bit messy, but we can add new functions to trait ElectionProvider to accommodate this, namely predict_elect_weight() -> Weight where this would return a best effort guess of how much weight is to be consumed, if we call elect, with exactly the same data.
@coriolinus I wonder if you have opinions on this, and the linked issue.