-
Notifications
You must be signed in to change notification settings - Fork 925
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
Little vs big endian #556
Comments
Good call. Agreed on consistency. |
Hmmm, I feel not fully confident of this change for some reasons:
That's said, IMHO it's okay to only use little-endian in SSZ. |
/cc @arnetheduck 😆 |
Yeah, there is actually a bug in the spec right now. The amount and timestamp logged in contract code snippet below: deposit_amount: bytes[8] = slice(concat("", convert(msg.value / GWEI_PER_ETH, bytes32)), start=24, len=8)
deposit_timestamp: bytes[8] = slice(concat("", convert(block.timestamp, bytes32)), start=24, len=8)
deposit_data: bytes[528] = concat(deposit_amount, deposit_timestamp, deposit_input) |
/cc @vbuterin |
My general take on this would be that for types that have a This goes for hashes, keys and other similar types. The deposit is a little bit more tricky indeed. We can drop the idea of little endian completely and lose the other benefits, or one of the sides will have to make way - one alternative is to do the decoding on the Eth2 side by encoding deposits as a canonical |
I'm thinking we properly encode |
fixed the deposit contract endian formatting bug here ethereum/deposit_contract#8 I think it makes sense to convert everything in the state transition spec to little endian. Fine with converting BLS spec too, but would rather just conform that to whatever other blockchains are using so we can wait on that change. |
SSZ has been updated to little endian integer encoding, but the phase 0 spec still uses big endian encoding at a few of sites. Is there a specific reason for this? If not I'd advocate for using little endian here as well for the sake of consistency.
The text was updated successfully, but these errors were encountered: