Verify blockfilters when reading from disk

Shepherd an existing PR to merge which validates compact block filters in a more performant and comprehensive way when loading them from disk.
Check Out Task
Task Bounty Details


Bitcoin Issue


Estimated Effort


Current Status


Paid in USD or equivalent BTC upon acceptance

Bitcoin Issue

This bounty requires resurrecting an existing PR that has fallen out of date. The PR verifies that compact block filters do not have corrupted data when deserialized from disk. Data corruption due to faulty disk hardware or operation is not uncommon; performing this verification ensures that a node is not working with invalid compact block filters.

From the original PR:

What's stored in the block filter index data files is the block_hash and the encoded gcs filter.
If there's a disk error that corrupts the encoded filter there's no way for the node to know.
Clients that use the "header" chain will notice the error though.

From a reviewer:

"This change" is replacing slower, less comprehensive checks that filters contain the right number of elements with faster checks verifying complete hashes of the filters. It also adds a benchmark. So this seems better in every respect.

In order to claim this bounty, you should open a replacement PR with the same or similar code changes after rebasing.

You should mention the original PR in the description of the replacement PR.

Prerequisite Skills


Code Guidelines

Repository Code Guidelines Page

Definition of Done

Get a PR merged which implements the change in the existing PR

Check Out Task