-
Notifications
You must be signed in to change notification settings - Fork 38.7k
log: correct size output in disk space check #34305
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
The output should be the additional space needed, otherwise we are always warning that 810GB will be stored, even when a user is pruning. For example on machine with ~20GB free disk, pruning to 40GB: ```bash ./build/bin/bitcoind -prune=40000 ... 2026-01-15T11:45:33Z [warning] Disk space for "/root/.bitcoin/blocks" may not accommodate the block files. Approximately 810 GB of data will be stored in this directory. Warning: Disk space for "/root/.bitcoin/blocks" may not accommodate the block files. Approximately 810 GB of data will be stored in this directory. ``` This PR: ```bash ./build/bin/bitcoind -prune=40000 ... 2026-01-15T11:41:49Z [warning] Disk space for "/root/.bitcoin/blocks" may not accommodate the block files. Approximately 39 GB of data will be stored in this directory. Warning: Disk space for "/root/.bitcoin/blocks" may not accommodate the block files. Approximately 39 GB of data will be stored in this directory. ```
|
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. Code Coverage & BenchmarksFor details see: https://corecheck.dev/bitcoin/bitcoin/pulls/34305. ReviewsSee the guideline for information on the review process.
If your review is incorrectly listed, please copy-paste ConflictsReviewers, this pull request conflicts with the following ones:
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. |
l0rinc
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tested ACK 2a42d39
With small prune values it shows the pruning value:
mkdir -p demo && cmake -B build && cmake --build build -j$(nproc) && ./build/bin/bitcoind -datadir=demo -prune=400000
2026-01-15T12:33:14Z [warning] Disk space for "[...]/bitcoin/demo/blocks" may not accommodate the block files. Approximately 390 GB of data will be stored in this directory.For very big values it shows the current blocksdir size instead:
mkdir -p demo && cmake -B build && cmake --build build -j$(nproc) && ./build/bin/bitcoind -datadir=demo -prune=4000000
2026-01-15T12:33:45Z [warning] Disk space for "[...]/bitcoin/demo/blocks" may not accommodate the block files. Approximately 810 GB of data will be stored in this directory.| ), | ||
| fs::quoted(fs::PathToString(args.GetBlocksDirPath())), | ||
| chainparams.AssumedBlockchainSize() | ||
| (additional_bytes_needed / 1024 / 1024 / 1024) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might be worth noting that this will be capped to current blockchain max size:
Line 1925 in 2a42d39
| std::min(chainman.m_blockman.GetPruneTarget(), assumed_chain_bytes) : |
willcl-ark
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tACK 2a42d39
With 520GB free on /tmp I see:
master:
❯ /run/current-system/sw/bin/bitcoind -daemon=0 -datadir=/tmp/size-warn -prune=600000
<snip>
2026-01-15T13:16:00Z [warning] Disk space for "/tmp/size-warn/blocks" may not accommodate the block files. Approximately 810 GB of data will be stored in this directory.
Warning: Disk space for "/tmp/size-warn/blocks" may not accommodate the block files. Approximately 810 GB of data will be stored in this directory.
PR
❯ ./build/bin/bitcoind -daemon=0 -datadir=/tmp/size-warn -prune=600000
<snip>
2026-01-15T13:13:51Z init message: Pruning blockstore…
2026-01-15T13:13:51Z [warning] Disk space for "/tmp/size-warn/blocks" may not accommodate the block files. Approximately 585 GB of data will be stored in this directory.
Warning: Disk space for "/tmp/size-warn/blocks" may not accommodate the block files. Approximately 585 GB of data will be stored in this directory.
The output should be the additional space needed, otherwise we are always warning that 810GB will be stored, even when a user is pruning.
For example on machine with ~20GB free disk, pruning to 40GB:
This PR: