It’s not clear what m_assumed_*_size are actually set based on, but historically it was in GB, not GiB, and that’s still used in the GUI which is more user-facing.
Could just as easily change the GUI if GiB is preferred.
It’s not clear what m_assumed_*_size are actually set based on, but historically it was in GB, not GiB, and that’s still used in the GUI which is more user-facing.
Could just as easily change the GUI if GiB is preferred.
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
For details see: https://corecheck.dev/bitcoin/bitcoin/pulls/29678.
See the guideline for information on the review process.
| Type | Reviewers |
|---|---|
| Concept ACK | hebasto, murchandamus, BrandonOdiwuor |
| Stale ACK | sedited |
If your review is incorrectly listed, please copy-paste <!–meta-tag:bot-skip–> into the comment that the bot should ignore.
Reviewers, this pull request conflicts with the following ones:
CeilDiv helper in UTXO Flushing warning by l0rinc)_MiB/_GiB consistently for byte conversions 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.
Possible places where comparison-specific test macros should replace generic comparisons:
2026-01-29 07:26:52
Indeed, there is inconsistency in GB/GiB unit usage.
For instance, the value of the m_assumed_blockchain_size variable in GiB is used with the “GB” units in the user-faced messages here: https://github.com/bitcoin/bitcoin/blob/45f757c72672fc351bf669e731744f2f5e269233/src/init.cpp#L1707 and here: https://github.com/bitcoin/bitcoin/blob/45f757c72672fc351bf669e731744f2f5e269233/src/qt/forms/intro.ui#L206
Concept ACK.
It would be nice to mention the second commit changes in the PR description, no?
Could just as easily change the GUI if GiB is preferred.
The GUI now uses “GB” (SI prefix) as a unit, based on the mindset of non-technical/non-CS users. @GBKS What are modern guidelines in this regard?
I’m not sure what the latest convention is, cc @hebasto. A few years ago #15163 made it so RPC, code and GUI all use KiB / MiB / GiB.
(though for pruning it seems the config file uses MiB, but the GUI converts it to GB - yet there are translated error strings using
MiB, confusing…)
For the GUI, the conversion to/from GB is still used: https://github.com/bitcoin/bitcoin/blob/45f757c72672fc351bf669e731744f2f5e269233/src/qt/optionsmodel.h#L26-L34
The GUI now uses “GB” (SI prefix) as a unit, based on the mindset of non-technical/non-CS users.
GB is standard for general audiences, and GiB for technical, scientific, or engineering contexts. I’d recommend keeping GB in the GUI.
I am curious about use cases where it is essential for the user to know the GiB value in order to make decisions.
All of these changes seem consistent to me.
Concept ACK on generally using GB to refer to 1,000,000,000 bytes and GiB to refer to 1024³ bytes everywhere.
GB to represent 10003 bytes for consistency with GUI
Introduce `CeilDiv()` for integral ceiling division without the typical `(dividend + divisor - 1) / divisor` overflow.
`CeilDiv()` asserts non-negative arguments and a non-zero divisor.
Add unit tests covering return type deduction, max-value behavior, and divisor checks.