Task summary
Mina uses its own unsigned numeric data type Nat.UInt32 for a number of internal types including AccountNonce and GlobalSlotNumber.
This has slightly different serialization to a bin_prot integer from what I can tell. For the most part they are compatible but in some edge cases they are not.
Our codebase uses i32 and coverts to u32 in order to maintain compatibility. This is a hack solution and can fail in certain cases (which are not covered properly by tests)
Tasks for this issue
- Explicitly support
Nat.UInt32 as a serialization type. Currently we use ExtendedU32 wrapper around i32
- Add conversions from this to rust types (e.g. u32)
- Replace this in our other serialization-types where required
- Add test coverage for edge cases for ExtendedU32 (e.g. minvalue, maxvalue etc)
Specification reference
Other information and links