lbrycrd/src/bench
Wladimir J. van der Laan c775dc4a94
Merge #12254: BIP 158: Compact Block Filters for Light Clients
254c85b687 bench: Benchmark GCS filter creation and matching. (Jim Posen)
f33b717a85 blockfilter: Optimization on compilers with int128 support. (Jim Posen)
97b64d67da blockfilter: Unit test against BIP 158 test vectors. (Jim Posen)
a4afb9cadb blockfilter: Additional helper methods to compute hash and header. (Jim Posen)
cd09c7925b blockfilter: Serialization methods on BlockFilter. (Jim Posen)
c1855f6052 blockfilter: Construction of basic block filters. (Jim Posen)
53e7874e07 blockfilter: Simple test for GCSFilter construction and Match. (Jim Posen)
558c536e35 blockfilter: Implement GCSFilter Match methods. (Jim Posen)
cf70b55005 blockfilter: Implement GCSFilter constructors. (Jim Posen)
c454f0ac63 blockfilter: Declare GCSFilter class for BIP 158 impl. (Jim Posen)
9b622dc722 streams: Unit tests for BitStreamReader and BitStreamWriter. (Jim Posen)
fe943f99bf streams: Implement BitStreamReader/Writer classes. (Jim Posen)
87f2d9ee43 streams: Unit test for VectorReader class. (Jim Posen)
947133dec9 streams: Create VectorReader stream interface for vectors. (Jim Posen)

Pull request description:

  This implements the compact block filter construction in [BIP 158](https://github.com/bitcoin/bips/blob/master/bip-0158.mediawiki). The code is not used anywhere in the Bitcoin Core code base yet. The next step towards [BIP 157](https://github.com/bitcoin/bips/blob/master/bip-0157.mediawiki) support would be to create an indexing module similar to `TxIndex` that constructs the basic and extended filters for each validated block.

  ### Filter Sizes

  [Here](https://gateway.ipfs.io/ipfs/QmRqaAAQZ5ZX5eqxP7J2R1MzFrc2WDdKSWJEKtQzyawqog) is a CSV of filter sizes for blocks in the main chain.

  As you can see below, the ratio of filter size to block size drops after the first ~150,000 blocks:

  ![filter_sizes](https://user-images.githubusercontent.com/881253/42900589-299772d4-8a7e-11e8-886d-0d4f3f4fbe44.png)

  The reason for the relatively large filter sizes is that Golomb-coded sets only achieve good compression with a sufficient number of elements. Empirically, the average element size with 100 elements is 14% larger than with 10,000 elements.

  The ratio of filter size to block size is computed without witness data for basic filters. Here is a summary table of filter size ratios *for blocks after height 150,000*:

  | Stat | Filter Type |
  |-------|--------------|
  | Weighted Size Ratio Mean | 0.0198 |
  | Size Ratio Mean | 0.0224 |
  | Size Ratio Std Deviation | 0.0202 |
  | Mean Element Size (bits) | 21.145 |
  | Approx Theoretical Min Element Size (bits) | 21.025 |

Tree-SHA512: 2d045fbfc3fc45490ecb9b08d2f7e4dbbe7cd8c1c939f06bbdb8e8aacfe4c495cdb67c820e52520baebbf8a8305a0efd8e59d3fa8e367574a4b830509a39223f
2018-08-26 16:57:05 +02:00
..
data Add deserialize + CheckBlock benchmarks, and a full block hex 2016-11-09 11:27:59 -08:00
.gitignore Ignore bench_bitcoin binary. 2015-10-06 17:46:12 +02:00
base58.cpp Update copyright headers to 2018 2018-07-27 07:15:02 -04:00
bech32.cpp bench: Remove unused variable 2018-07-17 10:11:57 +02:00
bench.cpp Update copyright headers to 2018 2018-07-27 07:15:02 -04:00
bench.h Update copyright headers to 2018 2018-07-27 07:15:02 -04:00
bench_bitcoin.cpp util: Replace boost::signals2 with std::function 2018-08-24 08:34:38 -04:00
block_assemble.cpp Merge #13534: Don't assert(foo()) where foo() has side effects 2018-08-13 10:02:50 -04:00
ccoins_caching.cpp Update copyright headers to 2018 2018-07-27 07:15:02 -04:00
checkblock.cpp Merge #13534: Don't assert(foo()) where foo() has side effects 2018-08-13 10:02:50 -04:00
checkqueue.cpp Update copyright headers to 2018 2018-07-27 07:15:02 -04:00
coin_selection.cpp Merge #13780: 0.17: Pre-branch maintenance 2018-08-08 13:55:27 +02:00
crypto_hash.cpp Update copyright headers to 2018 2018-07-27 07:15:02 -04:00
examples.cpp Update copyright headers to 2018 2018-07-27 07:15:02 -04:00
gcs_filter.cpp bench: Benchmark GCS filter creation and matching. 2018-08-25 10:02:37 -07:00
lockedpool.cpp Update copyright headers to 2018 2018-07-27 07:15:02 -04:00
mempool_eviction.cpp Merge #13780: 0.17: Pre-branch maintenance 2018-08-08 13:55:27 +02:00
merkle_root.cpp Update copyright headers to 2018 2018-07-27 07:15:02 -04:00
prevector.cpp Merge #13780: 0.17: Pre-branch maintenance 2018-08-08 13:55:27 +02:00
rollingbloom.cpp Update copyright headers to 2018 2018-07-27 07:15:02 -04:00
verify_script.cpp Merge #13666: Always create signatures with Low R values 2018-08-13 12:07:20 +02:00