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
bitfield_bytes(bits): return the bits of the bitlist or bitvector, packed in bytes, aligned to the start. Length-delimiting bit for bitlists is excluded.
However when this function is called for merkleisation of bitvectors or bitlists, the output expected from bitfield_bytes is BYTES_PER_CHUNK-byte chunks, as indicated by the specification of merkleize, generally,
merkleize(chunks, limit=None)
and then the specific definition for bitvectors or bitlists:
merkleize(bitfield_bytes(value), limit=chunk_count(type)) if value is a bitvector. mix_in_length(merkleize(bitfield_bytes(value), limit=chunk_count(type)), len(value)) if value is a bitlist.
The text was updated successfully, but these errors were encountered:
I suppose the spec is misleading but the implementations are correct? (py-ssz is correct)
/cc @protolambda for checking remerkleable
Ideally, maybe rename bitfield_bytes to pack_bits would be more clear.
pack(value): given ordered objects of the same basic type, serialize them, pack them into BYTES_PER_CHUNK-byte chunks, right-pad the last chunk with zero bytes, and return the chunks. pack_bits(bits): Given the bits of bitlist or bitvector, get bitfield_bytes by packing them in bytes and aligning to the start. Length-delimiting bit for bitlists is excluded. And them pack bitfield_bytes into BYTES_PER_CHUNK-byte chunks, right-pad the last chunk with zero bytes, and return the chunks.
merkleize(pack_bits(value), limit=chunk_count(type)) if value is a bitvector. mix_in_length(merkleize(pack_bits(value), limit=chunk_count(type)), len(value)) if value is a bitlist.
The simple-serialise (Merkleisation section) reads:
However when this function is called for merkleisation of bitvectors or bitlists, the output expected from
bitfield_bytes
isBYTES_PER_CHUNK
-byte chunks, as indicated by the specification ofmerkleize
, generally,and then the specific definition for bitvectors or bitlists:
The text was updated successfully, but these errors were encountered: