You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This issue needs further investigation to determine whether it's actually a problem or somehow everything just works out. It's not a blocker for Ethereum mainnet because such small vectors are not used presently.
The text was updated successfully, but these errors were encountered:
Checking the spec, we should not do that. Packing should only be done for "basic objects". A basic object is one of these three types uintN, byte, or boolean.
merkleize(pack(value)) if value is a basic object or a vector of basic objects.
mix_in_length(merkleize(pack(value), limit=chunk_count(type)), len(value)) if value is a list of basic objects.
I interpreted the "or a vector of basic objects" in that sentence to mean that we should!
Funnily I think it means we should not pack Vector<Vector<u8, 2>, 4>, because the outer vector is not a vector of basic objects. But we should pack Vector<u8, 8>
@dapplion Notes that SSZ
Vector
s that fit inside 32-bytes, e.g.Vector<u8, U16>
should be packed when tree-hashing, but we do not pack them:milhouse/src/vector.rs
Lines 249 to 255 in 6c82029
In Milhouse the packing logic is relevant here:
milhouse/src/utils.rs
Lines 33 to 38 in 6c82029
This design decision was inherited from
ssz_types
which has a similar issue:https://github.com/sigp/ssz_types/blob/e22576e3760ece4cb633748c4f68c6d9b1d92eb3/src/fixed_vector.rs#L180-L199
This issue needs further investigation to determine whether it's actually a problem or somehow everything just works out. It's not a blocker for Ethereum mainnet because such small vectors are not used presently.
The text was updated successfully, but these errors were encountered: