Discussed in #253
Originally posted by streetycat May 6, 2023
I am reviewing the encoding format for types. But I find that our encoding process only explicitly sorts the HashMap. Other types(as HashSet/BTreeMap/BTreeSet) depends on the iter in Rust. I have read the documents for those types, The iters for BTreeMap and BTreeSet return elements in ascending order. but I have not found how it is sorted in HashSet.
I am reading the code in raw_types.rs.
I think we have to explicitly define the encoding order of the fields/elements of the composite type, otherwise different results may be encoded.
Discussed in #253
Originally posted by streetycat May 6, 2023
I am reviewing the encoding format for types. But I find that our encoding process only explicitly sorts the HashMap. Other types(as HashSet/BTreeMap/BTreeSet) depends on the iter in
Rust. I have read the documents for those types, The iters for BTreeMap and BTreeSet return elements in ascending order. but I have not found how it is sorted in HashSet.I am reading the code in raw_types.rs.
I think we have to explicitly define the encoding order of the fields/elements of the composite type, otherwise different results may be encoded.