Fixes newly initialized bloom filters being constructed with isEmpty(false), which still works but loses the possible speedup when checking for key membership in an empty filter.
trivial: fix bloom filter init to isEmpty = true #9060
pull robmcl4 wants to merge 1 commits into bitcoin:master from robmcl4:fix-bloom-filter-empty-init changing 1 files +1 −1-
robmcl4 commented at 1:12 AM on November 2, 2016: contributor
-
cccf73db04
trivial: fix bloom filter init to isEmpty = true
Fixes newly initialized bloom filters being constructed with isEmpty(false), which still works but loses the possible speedup when checking for key membership in an empty filter.
-
gmaxwell commented at 1:39 AM on November 2, 2016: contributor
I don't see anything wrong with doing this, though the IsEmpty/IsFull optimizations were largely a pretextual optimization intended to make unexploitable a remote crash vulnerability (integer division by zero) that existed in the original bloom filtering code without disclosing it. I'm doubtful that they are all that useful. :)
(if someone does want to remove them entirely, make sure to actually remove the vulnerability too! :) )
-
TheBlueMatt commented at 1:42 AM on November 2, 2016: contributor
We need to be better about documenting such failures after sufficient time has passed...
On November 1, 2016 9:39:50 PM EDT, Gregory Maxwell notifications@github.com wrote:
I don't see anything wrong with doing this, though the IsEmpty/IsFull optimizations were largely a pretextual optimization intended to make unexploitable a remote crash vulnerability (integer division by zero) that existed in the original bloom filtering code without disclosing it.
You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: #9060 (comment)
- laanwj added the label Bug on Nov 2, 2016
-
laanwj commented at 9:36 AM on November 2, 2016: member
utACK https://github.com/bitcoin/bitcoin/pull/9060/commits/cccf73db0483cc3945bf8389ce197df35e931e16, as long as we still have these optimizations they should at least be correct.
- laanwj merged this on Nov 2, 2016
- laanwj closed this on Nov 2, 2016
- laanwj referenced this in commit 1107653d05 on Nov 2, 2016
- robmcl4 deleted the branch on Nov 2, 2016
- dagurval cross-referenced this on Jan 15, 2018 from issue Bloom filter updates by dagurval
- theStack cross-referenced this on Apr 28, 2020 from issue CBloomFilter: Missing updateemptyfull? by alexzk1
- theStack cross-referenced this on Apr 28, 2020 from issue net: remove is{Empty,Full} flags from CBloomFilter, clarify CVE fix by theStack
- fanquake referenced this in commit 551dc7f664 on May 6, 2020
- sidhujag referenced this in commit e9d4768e75 on May 12, 2020
- str4d cross-referenced this on Mar 5, 2021 from issue Backport bloom filter improvements by str4d
- zkbot referenced this in commit be459619a8 on Mar 5, 2021
- zkbot referenced this in commit 78de0cdf46 on Apr 15, 2021
- bitcoin locked this on Sep 8, 2021