Skip to content

Add Compact to the Encoding module in the exported interface

Raphaël Proust requested to merge compact-encodings into master

Compact encoding

This MR adds a whole new set of combinators to the data-encoding library: Compact. These combinators are designed to make it easy to create encodings with more compact representations. The main source of compactness is to share tags. E.g., a product (tup2) of two sums (union) which require 4 bits each can now be encoded using a single byte of tag (instead of two).

How to review

If you have been involved in the review of the compact encoding in the tezos repository, then you are better off reviewing commit-by-commit: the first commit imports the code from tezos as is, each subsequent commit is a small incremental improvement (test, bugfix, documentation, interface change, etc.)

If you have not been involved in the review of the compact encoding in the tezos repository, then you are better off reviewing the whole diff of the MR: many commits fix some fairly simple shortcomings introduced in the original commit so you risk wasting time and energy reviewing easily improvable code to discover later that it's already been improved.

Status:

  1. Wait for tezos/tezos!4339 (merged) to be merged
  2. Upstream the changes from 4339 to here
  3. Work on the issues (listed in comments below) (most issues addressed, some issues to follow-up)
  4. Merge
  5. Release
  6. Update Tezos to use the released data-encoding

Fixes #44 (closed)

Edited by Raphaël Proust

Merge request reports