-
Notifications
You must be signed in to change notification settings - Fork 997
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
Handle endianess in client implementation #1149
Comments
Another alternative would be to make this function pure and then have the clients call |
@dangerousfood Endianess of the deposit data is not an issue because it isnt processed by the contract, it is simply appended with the It does become an issue though when processing the logs from the contract where all the integers are by default big endian, so if we dont handle endianess in the contract, we would have to handle it on the client's end. Its trivial for a client to handle the endianess . Agree on not handling it in the contract , if we want to optimize for gas efficiency we shouldn't be converting byte arrays in the contract. |
So would you agree on my second approach? The clients calling |
we are only calling |
@dangerousfood Wouldn't the
since the spec for ssz uses little-endian we wouldn't need to change anything. Deposit Flow
In my opinion, where clients would have to handle endianess on would be at step 5. Like @djrtwo said,the only two paths to convert would be in the contract or on the client's end. If we are optimizing it for gas efficiency then it should be handled on the client-side. We don't need to call |
I imagine calling |
Calling |
This design seems like it would have a high gas cost. An alternative might be to expect the client implementers to provide little endian values for the contract.
https://github.com/ethereum/deposit_contract/blob/a251fa8bf27f2b0ac74182db98bc311046b08d54/deposit_contract/contracts/validator_registration.v.py#L28-L44
The text was updated successfully, but these errors were encountered: