Page MenuHomePhabricator

blockfilter: add block filters
ClosedPublic

Authored by markblundeberg on Apr 23 2019, 03:18.

Details

Summary

Part of BIP158, this is made from last backports from PR 12254:
97b64d67d blockfilter: Unit test against BIP 158 test vectors.
a4afb9cad blockfilter: Additional helper methods to compute hash and header.
cd09c7925 blockfilter: Serialization methods on BlockFilter.
c1855f605 blockfilter: Construction of basic block filters.

plus a fix from PR 14073:
f05599557 blockfilter: Omit empty scripts from filter contents.

Two test cases containing segwit coinbase transactions were removed from
blockfilter_tests.json due to their failing to parse, and inapplicability.

Test Plan

make check

Diff Detail

Repository
rABC Bitcoin ABC
Branch
bip158d
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 5576
Build 9214: Bitcoin ABC Buildbot (legacy)
Build 9213: arc lint + arc unit

Event Timeline

Fabien requested changes to this revision.Apr 25 2019, 08:57
Fabien added a subscriber: Fabien.
Fabien added inline comments.
src/blockfilter.cpp
7

Is this a rebase issue ? It already here in D2803

210

braces

218

dito

src/test/blockfilter_tests.cpp
13

Could you reorder these to match the other tests:

  • move blockfilter.h first on its own line,
  • move test/*.h after the other project includes
  • move univalue.h after boost includes
71

Move comment above

110

unsigned int => size_t

121

dito

133

dito

This revision now requires changes to proceed.Apr 25 2019, 08:57
markblundeberg marked 8 inline comments as done.

address Fabien comments

src/blockfilter.cpp
7

ah yeah, that's due to the SipHash diff D2800, applied out of normal order

Fabien added inline comments.
src/test/blockfilter_tests.cpp
51 ↗(On Diff #8278)

Nit: on in

This revision is now accepted and ready to land.May 4 2019, 09:54
This revision was automatically updated to reflect the committed changes.