-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| /// 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm, if we're correcting typos there, it should also be "implicitly".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That as well 🤦♂️
| .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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, will do.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
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 <[email protected]> * update substrate: cargo update -p sp-io Co-authored-by: Kian Paimani <[email protected]> Co-authored-by: Guillaume Thiolliere <[email protected]>
|
@thiolliere FWIW when CI is blocking the merge like in #8317 (comment) you can try |
Co-authored-by: Guillaume Thiolliere <[email protected]> Co-authored-by: Kian Paimani <[email protected]>
…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 <[email protected]> * update substrate: cargo update -p sp-io Co-authored-by: Kian Paimani <[email protected]> Co-authored-by: Guillaume Thiolliere <[email protected]>
…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 <[email protected]> * update substrate: cargo update -p sp-io Co-authored-by: Kian Paimani <[email protected]> Co-authored-by: Guillaume Thiolliere <[email protected]>
Closes #8315.
polkadot companion: paritytech/polkadot#2649