Open kwannoel opened 3 years ago
In GitLab by @fahree on May 26, 2021, 21:37
My guess is that the string contents get compiled to some variant of a Bytes
type that thinks it's fixed-size, even though it's actually variable-sized... which we don't support yet. Sigh.
In GitLab by @kwanzknoel on May 27, 2021, 15:58
assigned to @kwanzknoel
In GitLab by @kwanzknoel on Jun 2, 2021, 03:06
I have done a bit more digging:
The Bytes
type is variably sized.
Within consensus-code-gen
we call compile-consensus-statement
.
This calls param-length
which attempts to extract the static length of the value from the type.
In the case of Bytes
this is not statically available, and fails.
For Bytes
this should not have to be done. Reason being when encoded, the first Stack Address contains a UInt16
which provides us with the size of the Bytes
during runtime.
I shall look into it further to see how we can support variable-sized primitive data-types.
EDIT: Following #80, we can make Bytes
constant size, by just supplying the length of the EVM memory offset. We then use the type descriptor of imm/non-imm to discriminate marshalling / unmarshalling.
In GitLab by @kwanzknoel on Jun 2, 2021, 03:07
Another possible (simpler?) workaround is to do what etherjs does and just have fixed length strings, padded with null bytes.
In GitLab by @kwanzknoel on Jun 2, 2021, 03:30
marked this issue as related to #194
In GitLab by @kwanzknoel on Jun 2, 2021, 03:55
removed the relation with #194
In GitLab by @kwanzknoel on Jun 2, 2021, 03:55
marked this issue as related to #80
In GitLab by @fahree on Jun 3, 2021, 23:37
In GitLab by @fahree on Jun 3, 2021, 23:46
The more I think about it, the more I believe we should first implement the unoptimized general case as an interpreter, then go for optimizations and compilation.
In GitLab by @alex413 on Jun 22, 2021, 03:32
Is this currently blocking anything?
In GitLab by @kwanzknoel on Jun 24, 2021, 02:01
Nope.
In GitLab by @kwanzknoel on May 25, 2021, 17:41
Trace: