Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

uint256 are serialized as arbitrary endian #1196

Closed
denravonska opened this issue Jul 1, 2018 · 4 comments
Closed

uint256 are serialized as arbitrary endian #1196

denravonska opened this issue Jul 1, 2018 · 4 comments
Assignees
Labels

Comments

@denravonska
Copy link
Member

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.

@tomasbrod
Copy link
Member

I am doing regression tests for this.
The chain data can't be changed, but we can ensure serialization won't change.

@jamescowens
Copy link
Member

@denravonska @cyrossignol isn't this fixed by #1535?

@denravonska
Copy link
Member Author

@jamescowens It looks like it's the same as before, see here.

@jamescowens
Copy link
Member

Closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants