dcrd/gcs
Dave Collins 81ae286f23
database: Prepare v3.0.0.
This updates the database module dependencies, the copyright year in the
files modified since the previous release, and serves as a base for
database/v3.0.0.

The updated direct dependencies in this commit are as follows:

- github.com/decred/dcrd/dcrutil/v4@v4.0.0
- github.com/syndtr/goleveldb@v1.0.1-0.20210819022825-2ae1ddf74ef7

The full list of updated direct dependencies since the previous
database/v2.0.2 release are as follows:

- github.com/decred/dcrd/chaincfg/chainhash@v1.0.3
- github.com/decred/dcrd/chaincfg/v3@v3.1.0
- github.com/decred/dcrd/dcrutil/v4@v4.0.0
- github.com/decred/dcrd/wire@v1.5.0
- github.com/decred/slog@v1.2.0
- github.com/syndtr/goleveldb@v1.0.1-0.20210819022825-2ae1ddf74ef7

Finally, all modules in the repository that depend on the module are
tidied to ensure they are updated to use the latest versions hoisted
forward as a result.
2021-11-19 23:32:36 -06:00
..
blockcf2 multi: Add isAutoRevocationsEnabled to CheckSSRtx. 2021-09-06 09:03:27 -05:00
bench_test.go gcs: Implement version 2 filters. 2019-09-03 10:30:31 -05:00
bits_test.go gcs: update error types. 2020-11-11 14:12:03 -06:00
bits.go gcs: Overhaul tests and benchmarks. 2019-08-20 09:36:10 -05:00
doc.go multi: Fix various typos. 2021-03-01 10:57:51 -06:00
error_test.go gcs: update error types. 2020-11-11 14:12:03 -06:00
error.go gcs: update error types. 2020-11-11 14:12:03 -06:00
fastreduce_old.go multi: update build tags to pref. go1.17 syntax. 2021-10-19 20:21:44 -05:00
fastreduce.go multi: update build tags to pref. go1.17 syntax. 2021-10-19 20:21:44 -05:00
gcs_test.go gcs: update error types. 2020-11-11 14:12:03 -06:00
gcs.go multi: Address a bunch of lint issues. 2019-12-30 13:54:41 -06:00
go.mod dcrutil: Prepare v4.0.0. 2021-11-19 11:54:59 -06:00
go.sum database: Prepare v3.0.0. 2021-11-19 23:32:36 -06:00
README.md multi: Update README.md files for go modules. 2021-01-22 14:39:23 -06:00

gcs

Build Status ISC License Doc

Package gcs provides an API for building and using Golomb-coded sets.

A Golomb-Coded Set (GCS) is a space-efficient probabilistic data structure that is used to test set membership with a tunable false positive rate while simultaneously preventing false negatives. In other words, items that are in the set will always match, but items that are not in the set will also sometimes match with the chosen false positive rate.

This package currently implements two different versions for backwards compatibility. Version 1 is deprecated and therefore should no longer be used.

Version 2 is the GCS variation that follows the specification details in DCP0005.

Version 2 sets do not permit empty items (data of zero length) to be added and are parameterized by the following:

  • A parameter B that defines the remainder code bit size
  • A parameter M that defines the false positive rate as 1/M
  • A key for the SipHash-2-4 function
  • The items to include in the set

A comprehensive suite of tests is provided to ensure proper functionality.

GCS use in Decred

GCS is used as a mechanism for storing, transmitting, and committing to per-block filters. Consensus-validating full nodes commit to a single filter for every block and serve the filter to SPV clients that match against the filter locally to determine if the block is potentially relevant. The required parameters for Decred are defined by the blockcf2 package.

For more details, see the Block Filters section of DCP0005.

Installation and Updating

This package is part of the github.com/decred/dcrd/gcs/v2 module. Use the standard go tooling for working with modules to incorporate it.

License

Package blockchain is licensed under the copyfree ISC License.