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

ssz intX type is actually uint #112

Closed
darrenlangley opened this issue Sep 20, 2018 · 2 comments · Fixed by #120
Closed

ssz intX type is actually uint #112

darrenlangley opened this issue Sep 20, 2018 · 2 comments · Fixed by #120
Labels

Comments

@darrenlangley
Copy link

Hi all,

I noticed that ssz (https://github.com/ethereum/beacon_chain/blob/master/ssz/ssz.py) treats the type intX more like a uint rather than an int.

This works fine when signed int usually go between -128 to 128:

typ = 'int8'
value = 255
print(serialize(value, typ))

Also this errors with overflow:

typ = 'int8'
value = -1
print(serialize(value, typ))

If this is expected than cool, although it is a bit confusing calling it int rather than uint.

@djrtwo
Copy link
Contributor

djrtwo commented Sep 21, 2018

This lack of clarity has come up a few times over the past week. I believe we should probably support uint vs int explicitly.

@mratsim
Copy link
Contributor

mratsim commented Sep 21, 2018

I was thinking about that but was holding off creating an issue while waiting for a first draft of the spec in https://github.com/ethereum/eth2.0-specs so that we could discussed it there.

Edit: PR #114

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

Successfully merging a pull request may close this issue.

4 participants