Welcome screen uses GiB values as GB, risking running out of space #821

issue BenWestgate openend this issue on May 24, 2024
  1. BenWestgate commented at 4:03 pm on May 24, 2024: contributor

    Is there an existing issue for this?

    • I have searched the existing issues

    Current behaviour

    The welcome screen correctly displays “55 GB of space available” while my system has 54322808 bytes available.

    But it incorrectly says “… 12 GB of data will be stored in this directory” or “610 GB of data” if I uncheck the 2GB pruning. The values it is adding and comparing do not have the same unit. One is a GUI prune setting and/or space available in GB, the other is actually GiB: https://github.com/bitcoin/bitcoin/blob/master/doc/release-process.md#how-to-calculate-m_assumed_blockchain_size-and-m_assumed_chain_state_size

    Since the “how to calculate m_assumed … size” instructions add a 5-10% buffer, what we display when only a 5-7% buffer is added to the values used in our GUI’s space calculations will be too small and may lead to the user running out of space without being warned by the red text XXX GB of space available (of XXX GB needed).

    Expected behaviour

    The Welcome dialog should either use all GB or all GiB for its math. That way it never underestimates the space needed. Converting the assumed_chain_state and assumed_blockchain_size to GB is a matter of multiplying by 1.073741824 and rounding up to the nearest GB.

    That would update the values I was shown to: 13 GB and 655 GB respectively. You can see the gap between GB & GiB has gotten too massive to ignore, especially when estimating -prune=0 space needed.

    Alternatively the units could be switched to GiB and my space available reported as 52 GiB and my prune setting bumped up to be 2 GiB (making it easier to predict what the GUI will show because the -prune command takes MiB).

    I believe GB was used as it is the more familiar unit and matches what the OS and storage manufacturers tend to display so lets apply the first solution. Or update the https://github.com/bitcoin/bitcoin/blob/master/doc/release-process.md#how-to-calculate-assumed-blockchain-and-chain-state-size doc to require using a 13-19% buffer to allow for the previous 5-10% when they are misused as GB values despite being calculated as GiB.

    Steps to reproduce

    bitcoin-qt -choosedatadir notice the addition and subtraction of values that have different units as per our docs.

    Relevant log output

    No response

    How did you obtain Bitcoin Core

    Pre-built binaries

    What version of Bitcoin Core are you using?

    master / 27.0

    Operating system and version

    Debian 12

    Machine specifications

    No response

  2. BenWestgate commented at 5:09 pm on May 24, 2024: contributor
    On further analysis, the code comments in chainparams.h also think these values should be GB so I understand the origin of the gui error. It seems the release-process.md is the odd one out of the 3. This issue can be closed if the doc: PR below is ACK’d. https://github.com/bitcoin/bitcoin/pull/30171
  3. hebasto commented at 9:55 am on July 15, 2024: member

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin-core/gui. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2024-12-30 16:20 UTC

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