Skip to content

Conversation

@random-zebra
Copy link

From bitcoin#7113

For each 'bit' in the filter we really maintain 2 bits, which store either:

0: not set
1-3: set in generation N
After (nElements / 2) insertions, we switch to a new generation, and wipe entries which already had the new generation number, effectively switching from the last 1.5 * nElements set to the last 1.0 * nElements set.

This is 25% more space efficient than the previous implementation, and can (at peak) store 1.5 times the requested amount of history (though only 1.0 times the requested history is guaranteed).

The existing unit tests should be sufficient.

Also included bitcoin#13948

sipa and others added 2 commits February 5, 2021 02:28
For each 'bit' in the filter we really maintain 2 bits, which store
either:
0: not set
1-3: set in generation N

After (nElements / 2) insertions, we switch to a new generation, and
wipe
entries which already had the new generation number, effectively
switching
from the last 1.5 * nElements set to the last 1.0 * nElements set.

This is 25% more space efficient than the previous implementation, and
can
(at peak) store 1.5 times the requested amount of history (though only
1.0 times the requested history is guaranteed).

The existing unit tests should be sufficient.
This commit removes the `CBloomFilter::CBloomFilter(const unsigned int,
const double, const unsigned int)` constructor, which became obsolete
with 086ee67.
@random-zebra random-zebra added this to the 5.1.0 milestone Feb 5, 2021
@random-zebra random-zebra self-assigned this Feb 5, 2021
Copy link

@furszy furszy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good, ACK 1378196

Copy link
Collaborator

@Fuzzbawls Fuzzbawls left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

utACK 1378196

@furszy furszy merged commit c5edef0 into PIVX-Project:master Feb 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants