Skip to content

Cleanup int, uint, uint64, Int, Uint, UInt, UVarint, Uint64, etc. #615

@icorderi

Description

@icorderi

The spec has uppercase, lower case, newtype defs, encoding expectations, size bounds all used indiscriminately in the doc.

We need to finalize expected size bound and encoding for each numerical type.

We proposed the following sets of numbers:

  • Special number types:
    • Varint64 (64-bit number encoded cheaply on low values),
    • UVarint64 (64-bit unsigned number encoded cheaply on low values),
    • BigInt (arbitrary length integer, currently using leb128 encoding)
    • optional [U]Varint{16-32} to complete to the family (this doesn't affect the chain storage but puts memory size bounds and helps advise implementations on expected sizes, i.e. a UVarint64 for a MethodID inside an actor seems a bit much).
  • Primitive number types: uint{8-64}, int{8-64} (this are NOT varlen encoded, LE/BE needs to be specified in the encoding section of the spec)

Note: Varint and UVarint default to 64-bit, but it might be best to be consistent across the board and express numbers with their sizes.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions