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

[M1] Implement Nat.UInt32 correctly #206

@willemolding

Description

@willemolding

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions