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
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

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 ↗(On Diff #8235)

Is this a rebase issue ? It already here in D2803

210 ↗(On Diff #8235)

braces

218 ↗(On Diff #8235)

dito

src/test/blockfilter_tests.cpp
13 ↗(On Diff #8235)

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 ↗(On Diff #8235)

Move comment above

110 ↗(On Diff #8235)

unsigned int => size_t

121 ↗(On Diff #8235)

dito

133 ↗(On Diff #8235)

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 ↗(On Diff #8235)

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.