-
Notifications
You must be signed in to change notification settings - Fork 44
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
[LSP2] Adding 2 bytes
as length of the compact bytes array
#145
Comments
This is a good suggestion as so far, the only way to do this is by looping through the bytes, which can be expensive if there are a lot of elements. What do you think @frozeman @skimaharvey @b00ste ? |
Definitely could be useful to have an easy way to know the number of elements without having to loop over all the elements. The only thing I am not sure about is that it will kind of force us to verify the validity of the length value in comparison to each length element (length value = the total number of length elements) so we will need to loop over the entire compact byte array when storing. |
I'm currently in the process of opening a lengthy issue on CBAs and decided to look if there's anything open related to CBAs. Found this issue and I'd like to join the "brainstorming" 🙂
@skimaharvey Why will it force you to validate the length? Are we forced to validate the length on Solidity's arrays? I'll put the question differently: if we are calling If that's true we can receive some ABI from It all results in the following question: if we do not validate ABI in |
Is this implemented already I think? |
It's actually not. It's an extra 2 byte at the beginning to return the |
In the case of |
I think you are talking about |
What this issue is about ?
Problem
Solution
2 bytes
as length of the compact bytes array at the startThe text was updated successfully, but these errors were encountered: