init: correct first-run disk space estimates #35948

pull l0rinc wants to merge 2 commits into bitcoin:master from l0rinc:l0rinc/init-first-run-disk-space changing 6 files +65 −17
  1. l0rinc commented at 10:35 PM on August 10, 2026: contributor

    Problem: The GUI interprets and displays the assumed chain sizes as decimal GB, but the first-run disk-space check converts the blockchain estimate as GiB. For pruned nodes, the warning also displays the full-chain estimate even though the check uses the lower of the prune target and that estimate. The release process likewise tells maintainers to measure both assumed sizes in GiB.

    Fix: Add overflow-checked _MB and _GB byte-unit literals, use them for the GUI's existing decimal byte conversions and the assumed blockchain size, round the estimate used by the check up to GB for display, and document both assumed sizes in GB.

    This PR revives the stale #29678.

  2. util: add `_MB` and `_GB` byte unit literals
    Use a checked scale factor so decimal and binary byte units share one conversion path.
    a0691df432
  3. init: correct first-run disk space estimates
    The assumed chain sizes are maintained and displayed in decimal GB, while the first-run check converted the full-chain estimate as GiB and always displayed that full size for pruned nodes.
    Use `_GB` for the byte conversion, display the same rounded-up estimate that the check uses, and document the release-process values in GB.
    
    Co-authored-by: Luke Dashjr <luke-jr+git@utopios.org>
    fc4342822b
  4. DrahtBot commented at 10:35 PM on August 10, 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/35948.

    <!--021abf342d371248e50ceaed478a90ca-->

    Reviews

    See the guideline and AI policy for information on the review process.

    Type Reviewers
    ACK mercie-ux

    If your review is incorrectly listed, please copy-paste <code>&lt;!--meta-tag:bot-skip--&gt;</code> into the comment that the bot should ignore.

    <!--174a7506f384e20aa4161008e828411d-->

    Conflicts

    Reviewers, this pull request conflicts with the following ones:

    • #35852 (scripted-diff: Use inline const(expr) over static constexpr in headers by maflcko)
    • #33324 (blocks: add resumable reobfuscation for existing block files by l0rinc)

    If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

    <!--5faf32d7da4f0f540f40219e4f7537a3-->

  5. mercie-ux commented at 6:28 AM on August 12, 2026: none

    ACK fc4342822b

    Traced the 856 in chainparams.cpp through both the old and new math. Found a real 63 GB gap between what the check silently required and what the GUI ever showed. Confirmed.

  6. DrahtBot added the label Needs rebase on Aug 14, 2026
  7. DrahtBot commented at 5:49 PM on August 14, 2026: contributor

    <!--cf906140f33d8803c4a75a2196329ecb-->

    🐙 This pull request conflicts with the target branch and needs rebase.


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-08-14 18:51 UTC

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