-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Avoid Unstable Sort #12455
Avoid Unstable Sort #12455
Conversation
Nothing you changed here is in any way consensus critical. The only place that is used on chain is in contracts and that has a comment above the code that explains why it is safe. |
Was this the offending lint? Might want to set it to clippy::stable_sort_primitive |
Understood, but as a rule, we should just not have it in the code base. If anything, we can put rules to explicit and easily audit for it. Else, someone needs to check each one each time to make sure it is not consensus critical. |
Doesn't that lint apply only to a vec of primitive types? In that case, it's safe to use even in consensus-critical code. Besides that, That being said, I do agree a ban for now is warranted as the risks outweigh the potential benefits. |
It is deterministic, but not between rust versions, which is the problem we ran into. There was some optimization made, and it changed the final order between rust versions. |
bot merge |
But why does this matter if the state transition function is defined as wasm? It was about the native runtime? |
AFAIR, we had this report about
As always ;) What @shawntabrizi probably means is this: https://medium.com/polkadot-network/a-polkadot-postmortem-24-05-2021-e96b25c184db and this was about But yeah, if we got the native runtime removed it should be easier. However, I could still imagine that host code is may leading to a consensus problem, but it would be much harder to provoke. |
* dont use unstable sort * remove comment * add clippy rule
Following the norm set by: #6754
Undoes regressions caused by: #11154 (comment)