-
Notifications
You must be signed in to change notification settings - Fork 117
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
ARC-43 No Length in Dynamic Arrays of Static Types #214
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This proposal presumes that the decoder knows where the value ends. But the ABI was designed to allow decoding by walking along without knowing ahead of time where the end of a value is. PR #212 would break that design, and require extra encoding bytes, and then this PR would work. But, why would we do PR #212 which adds encoding bytes so that we can do this PR, which removes some?
What's the value of this? In what scenarios will a decoder not know how long the data its decoding is?
The byte savings isn't really the main motivation. It's mostly opcode savings. Not needing to extract/add len when working with bytes/strings and also just being able to concat to add to an array rather than concat + increment prefix |
It's exactly the property you need so that PR #212 is not needed. You don't have to know how much of the input remains to be decoded, so you don't have to |
The use case #212 is trying to solve is extracting a value from a tuple without decoding the entire structure. I would think that's a much more common use-case than fully decoding the entire tuple every time you want to read one element. |
In the public discord ARC meeting this seemed to be unanimously supported. |
So this is only for top-level objects, right? The ARC says: So we're talking the individual values in ApplicationArgs[0-15] only? |
Exactly, I will clarify this in the ARC. |
I just realized that this introduces weirdness with Personally, I'd prefer to just change booleans to be encoded as |
Proposes the removal of element length prefix on non-nested static types.
This alone is not super important, but if we are making breaking changes to the ABI might as well include this QOL change.