-
Notifications
You must be signed in to change notification settings - Fork 36.6k
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
Explain when reindex-chainstate can be used instead of reindex #13662
Conversation
e55f03f
to
6c53e46
Compare
src/init.cpp
Outdated
@@ -384,7 +384,7 @@ void SetupServerArgs() | |||
"Warning: Reverting this setting requires re-downloading the entire blockchain. " | |||
"(default: 0 = disable pruning blocks, 1 = allow manual pruning via RPC, >%u = automatically prune block files to stay under the specified target size in MiB)", MIN_DISK_SPACE_FOR_BLOCK_FILES / 1024 / 1024), false, OptionsCategory::OPTIONS); | |||
gArgs.AddArg("-reindex", "Rebuild chain state and block index from the blk*.dat files on disk", false, OptionsCategory::OPTIONS); | |||
gArgs.AddArg("-reindex-chainstate", "Rebuild chain state from the currently indexed blocks", false, OptionsCategory::OPTIONS); | |||
gArgs.AddArg("-reindex-chainstate", "Rebuild chain state from the currently indexed blocks. Only necessary in pruning mode or if blocks on disk might be corrupted.", false, OptionsCategory::OPTIONS); |
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.
If the blocks on disk are corrupted, you should do a "full" reindex, not rebuild the chainstate.
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.
Oops, I got the comment the wrong way around.
6c53e46
to
65a449f
Compare
@@ -384,7 +384,7 @@ void SetupServerArgs() | |||
"Warning: Reverting this setting requires re-downloading the entire blockchain. " | |||
"(default: 0 = disable pruning blocks, 1 = allow manual pruning via RPC, >%u = automatically prune block files to stay under the specified target size in MiB)", MIN_DISK_SPACE_FOR_BLOCK_FILES / 1024 / 1024), false, OptionsCategory::OPTIONS); | |||
gArgs.AddArg("-reindex", "Rebuild chain state and block index from the blk*.dat files on disk", false, OptionsCategory::OPTIONS); | |||
gArgs.AddArg("-reindex-chainstate", "Rebuild chain state from the currently indexed blocks", false, OptionsCategory::OPTIONS); | |||
gArgs.AddArg("-reindex-chainstate", "Rebuild chain state from the currently indexed blocks. When in pruning mode or if blocks on disk might be corrupted, use full -reindex instead.", false, OptionsCategory::OPTIONS); |
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.
I believe it will automatically prompt you to use -reindex
when needed while in pruning mode, so maybe no need to mention it here?
Then, you could move the note about corruption to reindex. E.g. "Rebuild chain state and block index from the blk*.dat files on disk . Only needed when blocks on disk are corrupted. "
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.
I just sabotaged a pruned node by deleting the most recent blkxxxxx.dat
file and then started bitcoind: Please restart with -reindex or -reindex-chainstate to recover.
Restarting that pruned node with -reindex-chainstate
will result in the same error message and won't tell the user they need to use -reindex
instead. So I think it's better to mention pruned node in the help here.
Concept ACK |
utACK 65a449f |
…reindex 65a449f Explain when reindex-chainstate can be used instead of reindex (Sjors Provoost) Pull request description: Save users from having to Google this: https://bitcoin.stackexchange.com/a/60711 Tree-SHA512: 3128565d037c77265a2ecf3bce137b8d27740f513802a4e683be06f21a75b82ee6cc22eb903181c4f438a2990cb682ce1d076f4d3af33d5aaa79b783a9f664b1
…reindex Summary: 65a449f8e3 Explain when reindex-chainstate can be used instead of reindex (Sjors Provoost) Pull request description: Save users from having to Google this: https://bitcoin.stackexchange.com/a/60711 Tree-SHA512: 3128565d037c77265a2ecf3bce137b8d27740f513802a4e683be06f21a75b82ee6cc22eb903181c4f438a2990cb682ce1d076f4d3af33d5aaa79b783a9f664b1 Backport of Core PR13662 bitcoin/bitcoin#13662 Test Plan: make check ./bitcoind --help Verify help test for `-reindex-chainstate`. Reviewers: deadalnix, Fabien, jasonbcox, O1 Bitcoin ABC, #bitcoin_abc Reviewed By: Fabien, O1 Bitcoin ABC, #bitcoin_abc Differential Revision: https://reviews.bitcoinabc.org/D4741
…reindex Summary: 65a449f8e3 Explain when reindex-chainstate can be used instead of reindex (Sjors Provoost) Pull request description: Save users from having to Google this: https://bitcoin.stackexchange.com/a/60711 Tree-SHA512: 3128565d037c77265a2ecf3bce137b8d27740f513802a4e683be06f21a75b82ee6cc22eb903181c4f438a2990cb682ce1d076f4d3af33d5aaa79b783a9f664b1 Backport of Core PR13662 bitcoin/bitcoin#13662 Test Plan: make check ./bitcoind --help Verify help test for `-reindex-chainstate`. Reviewers: deadalnix, Fabien, jasonbcox, O1 Bitcoin ABC, #bitcoin_abc Reviewed By: Fabien, O1 Bitcoin ABC, #bitcoin_abc Differential Revision: https://reviews.bitcoinabc.org/D4741
…reindex Summary: 65a449f8e3 Explain when reindex-chainstate can be used instead of reindex (Sjors Provoost) Pull request description: Save users from having to Google this: https://bitcoin.stackexchange.com/a/60711 Tree-SHA512: 3128565d037c77265a2ecf3bce137b8d27740f513802a4e683be06f21a75b82ee6cc22eb903181c4f438a2990cb682ce1d076f4d3af33d5aaa79b783a9f664b1 Backport of Core PR13662 bitcoin/bitcoin#13662 Test Plan: make check ./bitcoind --help Verify help test for `-reindex-chainstate`. Reviewers: deadalnix, Fabien, jasonbcox, O1 Bitcoin ABC, #bitcoin_abc Reviewed By: Fabien, O1 Bitcoin ABC, #bitcoin_abc Differential Revision: https://reviews.bitcoinabc.org/D4741
…reindex Summary: 65a449f8e3 Explain when reindex-chainstate can be used instead of reindex (Sjors Provoost) Pull request description: Save users from having to Google this: https://bitcoin.stackexchange.com/a/60711 Tree-SHA512: 3128565d037c77265a2ecf3bce137b8d27740f513802a4e683be06f21a75b82ee6cc22eb903181c4f438a2990cb682ce1d076f4d3af33d5aaa79b783a9f664b1 Backport of Core PR13662 bitcoin/bitcoin#13662 Test Plan: make check ./bitcoind --help Verify help test for `-reindex-chainstate`. Reviewers: deadalnix, Fabien, jasonbcox, O1 Bitcoin ABC, #bitcoin_abc Reviewed By: Fabien, O1 Bitcoin ABC, #bitcoin_abc Differential Revision: https://reviews.bitcoinabc.org/D4741
…ead of reindex 65a449f Explain when reindex-chainstate can be used instead of reindex (Sjors Provoost) Pull request description: Save users from having to Google this: https://bitcoin.stackexchange.com/a/60711 Tree-SHA512: 3128565d037c77265a2ecf3bce137b8d27740f513802a4e683be06f21a75b82ee6cc22eb903181c4f438a2990cb682ce1d076f4d3af33d5aaa79b783a9f664b1
…ead of reindex 65a449f Explain when reindex-chainstate can be used instead of reindex (Sjors Provoost) Pull request description: Save users from having to Google this: https://bitcoin.stackexchange.com/a/60711 Tree-SHA512: 3128565d037c77265a2ecf3bce137b8d27740f513802a4e683be06f21a75b82ee6cc22eb903181c4f438a2990cb682ce1d076f4d3af33d5aaa79b783a9f664b1
…ead of reindex 65a449f Explain when reindex-chainstate can be used instead of reindex (Sjors Provoost) Pull request description: Save users from having to Google this: https://bitcoin.stackexchange.com/a/60711 Tree-SHA512: 3128565d037c77265a2ecf3bce137b8d27740f513802a4e683be06f21a75b82ee6cc22eb903181c4f438a2990cb682ce1d076f4d3af33d5aaa79b783a9f664b1
…ead of reindex 65a449f Explain when reindex-chainstate can be used instead of reindex (Sjors Provoost) Pull request description: Save users from having to Google this: https://bitcoin.stackexchange.com/a/60711 Tree-SHA512: 3128565d037c77265a2ecf3bce137b8d27740f513802a4e683be06f21a75b82ee6cc22eb903181c4f438a2990cb682ce1d076f4d3af33d5aaa79b783a9f664b1
Save users from having to Google this: https://bitcoin.stackexchange.com/a/60711