HomePhabricator

Use the DifferentialIndexedItemFormatter for the compact blocks

Description

Use the DifferentialIndexedItemFormatter for the compact blocks

Summary:
This makes the code more consistent between compact proofs and compact blocks, which will make it easier to factorize the code.

Note that this introduce a change in behavior: previously a malformed compact block with overflowing transaction indexes could have its header attached if valid. Now a malformed compact block due to overflowing indexes is detected invalid at deserialization time and the header is not processed. This is not a concern has a malformed compact block is either the result of a malfunctioning node or a malicious one.

A unit test is added to check the index overflow, similar to what is done for the compact proofs. This code is not factorized because it requires to manually build the stream, which makes it difficult to reuse the code.

Depends on D11568.

Test Plan:

ninja all check-all

Reviewers: #bitcoin_abc, PiRK, sdulfari

Reviewed By: #bitcoin_abc, PiRK, sdulfari

Subscribers: sdulfari

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

Details

Provenance
FabienAuthored on Jun 3 2022, 19:20
FabienPushed on Jun 7 2022, 20:53
Reviewer
Restricted Project
Differential Revision
D11569: Use the DifferentialIndexedItemFormatter for the compact blocks
Parents
rABC5aea9cadfd90: [Cashtab] Route to onboarding if no wallet present
Branches
Unknown
Tags
Unknown