Proto/Michelson: extract ty_size
The following discussion from !5937 (closed) should be addressed:
-
@JViennot-NL started a discussion: With the new format of types, the structure of the memory allocated for a type has also changed. Now a sub-type will only occur once in the memory of a type.
For example, considering the type
(int, int) pair ty_ex_c
, we will only count once the size of the sub-type(int, yes) ty
, whereas before we would have count it two times.This imply that if we want to precisely predict the true memory size allocated to a type, we have to check for occurrence of sub-types in it. For the moment we used an over approximating function in order for the branch to compile. However a simple and not very efficient draft has been done in the commit Proto: exact ty size function as a first approach of the problem.