From 974ef47c03dc137659b24185d20713ac1dc589ba Mon Sep 17 00:00:00 2001 From: Joanne Fuller Date: Thu, 18 Jun 2020 14:47:10 +1000 Subject: [PATCH] Clarification of types. --- ssz/simple-serialize.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ssz/simple-serialize.md b/ssz/simple-serialize.md index b8a6bc9a2..700a428e8 100644 --- a/ssz/simple-serialize.md +++ b/ssz/simple-serialize.md @@ -66,6 +66,8 @@ * **union**: union type containing one of the given subtypes * notation `Union[type_0, type_1, ...]`, e.g. `union[null, uint64]` +*Note*: Both `Vector[boolean, N]` and `Bitvector[N]` are valid, yet distinct due to their different serialization requirements. Similarly, both `List[boolean, N]` and `Bitlist[N]` are valid, yet distinct. Generally `Bitvector[N]`/`Bitlist[N]` are preferred because of their serialization efficiencies. + ### Variable-size and fixed-size We recursively define "variable-size" types to be lists, unions, `Bitlist` and all types that contain a variable-size type. All other types are said to be "fixed-size". @@ -88,9 +90,9 @@ Assuming a helper function `default(type)` which returns the default value for ` | `boolean` | `False` | | `Container` | `[default(type) for type in container]` | | `Vector[type, N]` | `[default(type)] * N` | -| `Bitvector[boolean, N]` | `[False] * N` | +| `Bitvector[N]` | `[False] * N` | | `List[type, N]` | `[]` | -| `Bitlist[boolean, N]` | `[]` | +| `Bitlist[N]` | `[]` | | `Union[type_0, type_1, ...]` | `default(type_0)` | #### `is_zero`