Trim compact solution for length during preparation#8317
Conversation
Starts addressing #8315
| /// | ||
| /// Note that this solution is already computed, and winners are elected based on the merit of | ||
| /// the total stake in the system. Nevertheless, some of the voters may be removed here. | ||
| /// Sometimes, removing a voter can cause a validator to also be implicitely remoted, if |
There was a problem hiding this comment.
| /// Sometimes, removing a voter can cause a validator to also be implicitely remoted, if | |
| /// Sometimes, removing a voter can cause a validator to also be implicitely removed, if |
This is why you should never trust me.
There was a problem hiding this comment.
Hm, if we're correcting typos there, it should also be "implicitly".
| .map(|(who, stake, _)| (who.clone(), stake)) | ||
| .collect::<Vec<_>>(); | ||
| voters_sorted.sort_by_key(|(_, y)| *y); | ||
| voters_sorted.reverse(); |
There was a problem hiding this comment.
While we are waiting for audit, mind adding a test to ensure that we always remove based on least stake as well? i.e. say if we mess up the sorting order here, then we'd remove highest stake.
|
bot merge |
|
Merge aborted: Checks failed for 4c9f8d7 |
|
needs to merge master to make CI happy, or manuall merge and then merge the companion |
|
@coriolinus were you going to respond to the audit note in this branch or on a follow up? |
|
damn should I revert, when I see the green flag audit with thumb-up I didn't consider it was a failing audit |
|
I opened the revert #8613 I think we shouldn't mark D1-audited when the audit is not successful. |
|
I think it is also okay to keep this merged and just add comments from audit in a follow up (if any). |
|
I'd planned to handle the audit note here, but I don't mind moving it to a follow-up. |
|
Yeah, so lets keep it in the follow-up for this one. Note to self: don't mark |
|
I think it is more my bad not to have written the linked audit message |
) * Companion for Trim compact solution for length during preparation paritytech/substrate#8317 * eliminate potential for overflow in OffchainSolutionLengthLimit * Apply suggestions from code review Co-authored-by: Guillaume Thiolliere <gui.thiolliere@gmail.com> * update substrate: cargo update -p sp-io Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com> Co-authored-by: Guillaume Thiolliere <gui.thiolliere@gmail.com>
|
@thiolliere FWIW when CI is blocking the merge like in #8317 (comment) you can try |
Co-authored-by: Guillaume Thiolliere <gui.thiolliere@gmail.com> Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>
…649) * Companion for Trim compact solution for length during preparation paritytech/substrate#8317 * eliminate potential for overflow in OffchainSolutionLengthLimit * Apply suggestions from code review Co-authored-by: Guillaume Thiolliere <gui.thiolliere@gmail.com> * update substrate: cargo update -p sp-io Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com> Co-authored-by: Guillaume Thiolliere <gui.thiolliere@gmail.com>
…649) * Companion for Trim compact solution for length during preparation paritytech/substrate#8317 * eliminate potential for overflow in OffchainSolutionLengthLimit * Apply suggestions from code review Co-authored-by: Guillaume Thiolliere <gui.thiolliere@gmail.com> * update substrate: cargo update -p sp-io Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com> Co-authored-by: Guillaume Thiolliere <gui.thiolliere@gmail.com>
Closes #8315.
polkadot companion: paritytech/polkadot#2649