Bug description
There is an issue with the Move.history.json file used by the PackageRegistry to store the network environments and related network aliases. The JSON content changes every time. It’s generated, with the entries being reordered randomly.
This behavior results from:
- A
HashMap is used in the PackageRegistry to store the aliases and envs
serde_json - used for serialization + deserialization - doesn't use the preserve_order feature flag.
Probable fixes:
- Use an
IndexMap to store the aliases and envs in the PackageRegistry
- Enable the
preserve_order feature flag for serde_json
Expected behavior
The Move.history.json file shall only be altered in case the Move package has been published to a new environment or a package upgrade has been processed.
Otherwise the Move.history.json file must remain unchanged.
Can the issue reliably be reproduced?
Yes
Example repository
Steps to reproduce
Language
Rust
Language Version
v0.8.7
Version
Hardware specifications
Additional info
As a workaround, so far, we should not commit altered Move.history.json files except their have been published or upgraded packages (No upgrade && No publish --> No Move.history.json commit.
Bug description
There is an issue with the
Move.history.jsonfile used by thePackageRegistryto store the network environments and related network aliases. The JSON content changes every time. It’s generated, with the entries being reordered randomly.This behavior results from:
HashMapis used in thePackageRegistryto store thealiasesandenvsserde_json- used for serialization + deserialization - doesn't use thepreserve_orderfeature flag.Probable fixes:
IndexMapto store thealiasesandenvsin thePackageRegistrypreserve_orderfeature flag forserde_jsonExpected behavior
The
Move.history.jsonfile shall only be altered in case the Move package has been published to a new environment or a package upgrade has been processed.Otherwise the
Move.history.jsonfile must remain unchanged.Can the issue reliably be reproduced?
Yes
Example repository
Steps to reproduce
Language
Rust
Language Version
v0.8.7
Version
Hardware specifications
Additional info
As a workaround, so far, we should not commit altered Move.history.json files except their have been published or upgraded packages (No upgrade && No publish --> No Move.history.json commit.