Skip to content

First-startup disk check ignores the chainstate #36811

Open

Description

@stringintech

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: 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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions