util: avoid redundant rolling Bloom insertions #36234

pull JeremyRubin wants to merge 1 commits into bitcoin:master from JeremyRubin:rolling-bloom-dedup-fix changing 3 files +74 −3
  1. JeremyRubin commented at 6:45 PM on September 12, 2026: contributor

    Re-inserting a value already represented by the current generation advances its entry counter without adding membership information. Repeating one value can therefore expire unrelated entries sooner than the configured capacity implies.

    Detect current-generation membership before rotating. Only repeats already represented by that generation are free; refreshing an older entry consumes capacity normally. Retain the computed hashes so insertion does not hash the value twice.

    One trade off is how insert into current generation when present in past generation. For this patch, the intended behavior is to count this as a fresh insert, so that the entry expires with the current insert generation.

  2. util: avoid redundant rolling Bloom insertions
    Re-inserting a value already represented by the current generation
    advances its entry counter without adding membership information.
    Repeating one value can therefore expire unrelated entries sooner than
    the configured capacity implies.
    
    Detect current-generation membership before rotating. Only repeats
    already represented by that generation are free; refreshing an older
    entry consumes capacity normally. Retain the computed hashes so
    insertion does not hash the value twice.
    25ce2fa1f6
  3. DrahtBot added the label Utils/log/libs on Sep 12, 2026
  4. DrahtBot commented at 6:45 PM on September 12, 2026: contributor

    <!--e57a25ab6845829454e8d69fc972939a-->

    The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

    <!--006a51241073e994b41acfe9ec718e94-->

    Code Coverage & Benchmarks

    For details see: https://corecheck.dev/bitcoin/bitcoin/pulls/36234.

    <!--021abf342d371248e50ceaed478a90ca-->

    Reviews

    See the guideline and AI policy for information on the review process. A summary of reviews will appear here.

    <!--5faf32d7da4f0f540f40219e4f7537a3-->

  5. sedited requested review from instagibbs on Sep 12, 2026
  6. instagibbs commented at 7:31 PM on September 14, 2026: member

    Are there any worrying usage patterns that you've seen this resolves, or is this more of a general correctness issue that was noticed?


instagibbs


github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-09-22 05:51 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me