brson · GitHub

Per 225cf4f #r1144119247 it is crucial that for all equivalent pairs of RawVals and ScVals, the pair has the same comparison results.

It looks to me that RawVal uses a custom Compare trait - RawVals don't appear to implement Ord; ScVal does implement Ord. So presumably the result of Compare on RawVals needs to be equivalent to the results of Ord::cmp (and PartialOrd::partial_cmp).

This should be testable with the fuzzing infrastructure in stellar/rs-soroban-sdk#878 so I intend to try that. Fuzzing won't guarantee all possible values compare the same, but better than nothing.

cc @graydon @dmkozh

Read the original on github.com ↗