HomePhabricator

Convert CCompactSize to proper formatter

Description

Convert CCompactSize to proper formatter

Summary:
Serialization improvements step 5 (blockencodings)

This PR is probably the most involved change in the sequence of changes extracted from #10785.

In order to implement the differential encoding of BIP152, this change changes VectorFormatter to permit a stateful sub-formatter, which is then used by DifferenceFormatter. A CustomUintFormatter is added as well to do the 48-bit serialization of short ids.

This is a backport of Core PR18112 [1/5]
https://github.com/bitcoin/bitcoin/pull/18112/commits/3ca574cef0b4423f21b2c3efd8f5c9f71d52f219

Test Plan: ninja all check-all

Reviewers: #bitcoin_abc, deadalnix

Reviewed By: #bitcoin_abc, deadalnix

Differential Revision: https://reviews.bitcoinabc.org/D8786

Details

Provenance
Pieter Wuille <pieter.wuille@gmail.com>Authored on Feb 4 2020, 03:49
PiRKCommitted on Jan 6 2021, 08:56
PiRKPushed on Jan 6 2021, 08:56
Reviewer
Restricted Project
Differential Revision
D8786: Convert CCompactSize to proper formatter
Parents
rABC9290166fe3a2: Pass chain params explicitely to EncodeSecret and DecodeSecret
Branches
Unknown
Tags
Unknown