EPMB/Signed: Make invulnerables non-eject-able#9511
Conversation
|
/cmd prdoc --bump patch |
| Ok(Some((discarded, _score))) => { | ||
| if Pallet::<T>::is_invulnerable(&discarded) { | ||
| // invulnerable accounts are never ejected. | ||
| return Err(Error::<T>::QueueFull.into()); |
There was a problem hiding this comment.
Since we're force-inserting and keeping right, and if the one to be ejected is an invulnerable we return an Error, the entire queue becomes locked if the lowest score belongs to an invulnerable account even if I'm submitting a higher score.
Could we instead eject the lowest non-invulnerable?
To demonstrate, if we imagine the array is a tuple of score and I/N for invulnerable/not:
[(20, I), (50, N), (70, N)]
And assume the limit is 3, then if I submit a result with score 80, we hit this logic and it can't eject the invulnerable at the bottom, so the queue is declared full, when really we should end up with a queue
[(20, I), (70, N), (80, N)]
There was a problem hiding this comment.
Yeah this is a good idea, I'll explore doing it as such.
The only scenario that it would be useful for will be:
If the queue is full minus an invulnerable who has happen to submit a suboptimal solution. The cost of filling the queue for N-1 is still quite large.
I think a much better approach would be to have two separate queues here altogether, but that might take more time.
|
All GitHub workflows were cancelled due to failure one of the required jobs. |
Co-authored-by: Dónal Murray <donal.murray@parity.io>
|
Created backport PR for
Please cherry-pick the changes locally and resolve any conflicts. git fetch origin backport-9511-to-unstable2507
git worktree add --checkout .worktree/backport-9511-to-unstable2507 backport-9511-to-unstable2507
cd .worktree/backport-9511-to-unstable2507
git reset --hard HEAD^
git cherry-pick -x 56d3c42cf4b8b650ae416db0482ad56eb64938c9
git push --force-with-lease |
Follow-up to #8877 and audits: Make it such that invulnerable accounts cannot be ejected from the election signed queue altogether. --------- Co-authored-by: cmd[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Dónal Murray <donal.murray@parity.io>
Follow-up to #8877 and audits: Make it such that invulnerable accounts cannot be ejected from the election signed queue altogether. --------- Co-authored-by: cmd[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Dónal Murray <donal.murray@parity.io>
Follow-up to #8877 and audits: Make it such that invulnerable accounts cannot be ejected from the election signed queue altogether.