Skip to content
This repository has been archived by the owner on Oct 25, 2022. It is now read-only.

[M1] Implement Nat.UInt32 correctly #206

Open
willemolding opened this issue Apr 12, 2022 · 0 comments
Open

[M1] Implement Nat.UInt32 correctly #206

willemolding opened this issue Apr 12, 2022 · 0 comments
Assignees
Milestone

Comments

@willemolding
Copy link
Contributor

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

@willemolding willemolding changed the title [M1] Implement ExtendedU32 correctly [M1] Implement Nat.UInt32 correctly Apr 12, 2022
@creativcoder creativcoder added this to the m1 milestone May 9, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants