First-startup disk check ignores the chainstate #36811

issue stringintech opened this issue on November 9, 2026
  1. stringintech commented at 11:16 AM on November 9, 2026: contributor

    On first startup, init.cpp warns when free disk space may not fit the block files. The check never counts the chainstate (AssumedChainStateSize()), which seems incomplete, at least for pruned nodes, where the chainstate can dominate disk usage depending on the pruning configuration. For unpruned nodes it matters less, since the block files dominate, and the release process says m_assumed_blockchain_size doesn't need to exclude the chainstate.

    To address this fully, the check also has to handle a datadir and blocks dir on separate volumes. In that case each volume needs its own check, which means detecting whether two paths share a volume. That takes a new platform-specific helper.

    I've tried to address these in: https://github.com/bitcoin/bitcoin/compare/master...stringintech:bitcoin:refs/heads/2026/11/init-warn-chainstate-size

    Counting the chainstate also affects the functional tests. Tests on non-regtest chains can hit this warning depending on the free space of the machine running them, and they work around it in different ways: some pass -prune just to keep the estimate small, and some truncate stderr. With the chainstate counted, the -prune workaround no longer avoids the warning unless the host has enough free space for the chainstate. Rather than that, the above branch takes a more direct approach and handles it with a test framework flag that drops the warning before stderr is checked when a node stops.

    IMO a full fix is worth having. However, given that this warning is non-blocking, I'd like to hear whether others think the added complexity is justified, or see a different way to address this.

Contributors

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-11-16 01:51 UTC

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