fees: validate buckets read from estimates file #36639

pull fametrano wants to merge 1 commits into bitcoin:master from fametrano:fees-validate-buckets changing 2 files +60 −0
  1. fametrano commented at 6:00 AM on October 24, 2026: none

    A block_policy_estimates.dat whose bucket list lacks the infinite last bucket makes a later feerate lookup read past the end of the bucket map.

    The estimator relies on the last bucket being infinite, so that every feerate finds a bucket. I reject a list whose first bucket is not positive, that does not strictly increase, or that does not end with the infinite bucket. I tested this with a new unit test that changes one bucket of a valid file at a time. It fails without the change and passes with it.

    This is one of several PRs from a large audit of Bitcoin Core that I did with the help of LLM tools. The audit produced its evidence all at once, which is why the PRs arrive together. I understand each change fully and will answer review questions myself.

  2. fees: validate buckets read from estimates file
    A block_policy_estimates.dat whose bucket list lacks the infinite last
    bucket makes a later feerate lookup read past the end of the bucket map.
    
    The estimator relies on the last bucket being infinite, so that every
    feerate finds a bucket. I reject a list whose first bucket is not
    positive, that does not strictly increase, or that does not end with the
    infinite bucket. I tested this with a new unit test that changes one
    bucket of a valid file at a time. It fails without the change and passes
    with it.
    de3bd168a3
  3. DrahtBot added the label TX fees and policy on Oct 24, 2026
  4. DrahtBot commented at 6:00 AM on October 24, 2026: contributor

    <!--e57a25ab6845829454e8d69fc972939a-->

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

    <!--006a51241073e994b41acfe9ec718e94-->

    External sites

    <!--021abf342d371248e50ceaed478a90ca-->

    Reviews

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

    <!--5faf32d7da4f0f540f40219e4f7537a3-->

  5. ismaelsadeeq commented at 6:44 AM on October 25, 2026: member

    A block_policy_estimates.dat whose bucket list lacks the infinite last bucket

    The node never writes such a file, the only way to get the input you're guarding against is a hand edited file or maybe corruption. Is it worth being defensive here?

    This is one of several PRs from a large audit of Bitcoin Core that I did with the help of LLM tools.

    It's good that you're scanning the codebase, but code is cheap now and review time isn't, it's the scarce resource here. Every PR needs at least two ACKs before merge (depending on the change), so ~16 PRs in 24 hours is effectively ~32 review requests in a day. I'd recommend filtering the list down and opening only the impactful ones. For the reset, it may be better to open an issue.

  6. sedited commented at 8:50 AM on October 26, 2026: contributor

    Agree with @ismaelsadeeq, don't think this adds anything worthwhile. Closing again.

  7. sedited closed this on Oct 26, 2026


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-10-30 15:51 UTC

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