Skip to content

uint256 are serialized as arbitrary endian #1196

@denravonska

Description

@denravonska

The uint128/160/256 are stored internally as an array of 32 bit integers where the most significant value is stored in the first integer. Serialization is done by taking a char pointer to the memory location of the first integer and the data is written sequentially. This means that the data is serialized in big endian overall, but the integers themselves are written as little endian.

This will both fail on big endian machines and when we rebase to a modern base where the data representation has been changed to use bytes instead of 32 bit integers. This affects the existing chain.

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions