-
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
[SSZ] Are Lists limited to 0 values legal SSZ types? #1863
Comments
I don't think these need to be strictly illegal, and in fact we used to have a type that was set to length Using it as a "feature flag" of sorts is the main use case I can currently think of |
The reasoning for the fixed-length types here is that fixed-length types do not have an offset if a dynamic type has a collection of them. Making it impossible to say how many there are: it's a However, lists will ALWAYS have an offset if any type wraps them, because they couldn't be presented otherwise (Well, except a list at top-most level type, which has a natural scope by input-length, e.g. a byte list doesn't have a length-encoding envelop in SSZ). Besides, it is a previously used feature of configuring the lists of block-operations in the beacon block to have a 0 limit, to disable the use of that operation. Previously used in transfers. And currently we are considering disabling slashings in some testnets, as a fun way to stress the networks by publishing validator keys, and having everyone sign arbitrary things without retribution. |
I think the spec is correct for flexible configuration as @protolambda mentioned, and py-ecc should be changed to follow the spec definition. Opened an issue ethereum/py-ssz#116 |
I'm going to revisit the "new" (no changes, but more details) SSZ spec draft, and work on tests for a lot of these invalid/valid edge cases. 👍 |
List types limited to 0 values, i.e.
List[type, 0]
, are not included in the list of illegal types in the SSZ specification.However, line 177 of the py-ssz reference implementation, rules out LIst types limited to 0 values by requiring that the maximum length of homogenous composites must be at least 1.
The text was updated successfully, but these errors were encountered: