Skip to content

Revision 2 is the first marked posting block. It adds the 0x00 marker, a revision byte, and a mode byte that chooses between front-coded keys and numeric keys.

SEAM 1 writers still produce it: it is the fallback whenever a block is not packed into revision 3, 4 or 5. Revision 5 also nests it as inner block.

The value starts with 0x00 and the next byte is 0xE2. Early builds wrote 0x02 as the revision byte; readers accept both. See Block head.

After the common head the body starts with two bytes, then depends on the mode.

Field Encoding Meaning
mode u8 0, 1 or 2, see below
nvars u8 number of payload varints per entry in mode 1 (1 or 2); recorded but unused in modes 0 and 2
Mode Keys Per entry
0 front-coded varint shared ‖ varint unshared ‖ suffix ‖ varint payload_len ‖ payload
1 9-byte numeric keys: tag u8 ‖ first key u64 BE after nvars, once a delta varint for entries after the first (keys strictly rising), then exactly nvars payload varints
2 the same 9-byte numeric keys, same prefix the same delta varint, then varint payload_len ‖ payload

A writer picks mode 1 when all keys are 9-byte numeric keys and all payloads are plain varints, mode 2 when only the keys are numeric, and mode 0 otherwise.

  • An explicit marker and revision byte, so new revisions can be added.
  • Numeric keys stored as deltas.

Revision 3 replaces the numeric modes with bit-split integer keys.