-
Notifications
You must be signed in to change notification settings - Fork 36.2k
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
Log/report in 10% steps during VerifyDB #8136
Conversation
Perhaps we should also reduce the number 288. Maybe a limit specified in number of transactions is better? |
Agree with @sipa, but could be a different PR (very likely more controversial). |
Sure, that's independent of this PR.
|
concept ACK |
edit: moved comment to #8138 (comment) |
int percentageDone = std::max(1, std::min(99, (int)(((double)(chainActive.Height() - pindex->nHeight)) / (double)nCheckDepth * (nCheckLevel >= 4 ? 50 : 100)))); | ||
if (reportDone < percentageDone/10) { | ||
// report every 10% step | ||
LogPrintf("[%d%%]...", percentageDone); |
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.
It's inventive to print a partial line here instead of a full line - however this can only work if there is nothing else happening in the background, otherwise partial log messages will mix.
As this is only called during AppInit2 I suppose it's safe.
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 think its fragile but okay as long as it is somewhere on the upper section of AppInit2(). :-)
3868879
to
1008655
Compare
Fixed @laanwj nit. |
Tested with
|
1008655
to
8b78486
Compare
Thanks for testing! |
Tested ACK 8b78486
Slightly tangential: the progress reporting is quite distorted, by far most of the time is spent at 0%, then it seems to take a sprint for 100%. |
8b78486 Log/report in 10% steps during VerifyDB (Jonas Schnelli)
8b78486 Log/report in 10% steps during VerifyDB (Jonas Schnelli)
8b78486 Log/report in 10% steps during VerifyDB (Jonas Schnelli)
73d7288 [Doc] Mention reindex-chainstate in the release notes (random-zebra) c45c0ec Skip MoneySupply update during reindex/reindex-chainstate (random-zebra) efe193f Scan for better chains in ThreadImport (random-zebra) 0aceea3 Make ProcessNewBlock dbp const and update comment (Pieter Wuille) 8255e82 [Cleanup] Remove fVerifyingBlocks global flag (random-zebra) 30c7aed Add -reindex-chainstate that does not rebuild block index (random-zebra) 79d5cb2 Verify DB with original default check-level 3 (random-zebra) ed96859 Reduce default number of blocks to check at startup (Pieter Wuille) d4516fa Log/report in 10% steps during VerifyDB (Jonas Schnelli) cce2c9e doc: Mention dbcache increase in release notes (random-zebra) 11dc022 [GUI] Update default db cache size in the options model (random-zebra) 9b7f764 Bump `-dbcache` default to 300MiB (Wladimir J. van der Laan) Pull request description: This was attempted already in #1864 and #1907. Third time's a charm. Now the speed is acceptable and (unlike what was happening in #1907) the process can be interrupted. Further, as it is performed in ThreadImport, the GUI is open and functional during the chainstate reindex, instead of being seemingly stuck at the splash screen. This PR also includes a few improvements coming from bitcoin#10919, bitcoin#8273, bitcoin#8136 and bitcoin#8611. Here's a quick comparison of the data I had testing here (empty wallet with GUI, empty pivx.conf / default values). The reindexes have been performed with 0 network connections. <table> <tr> <th>Mainnet (height=2847011)</th><th>Master</th><th>this PR</th> </tr><tr> <td>online sync</td><td>8 hr 13 min</td><td>6 hr 42 min</td> </tr><tr> <td>-reindex (offline)</td><td>7 hr 14 min</td><td>6 hr 21 min</td> </tr><tr> <td>-reindex-chainstate (offline)</td><td>N/A</td><td>6 hr 13 min</td> </tr><tr> <td>startup (synced node)</td><td>100 sec</td><td>83 sec</td> </tr><tr> <td>RAM (synced node)</td><td>1.65 GiB</td><td>1.5 GiB</td> </tr><tr> <td>utxo_cache (synced node)</td><td>28.9MiB</td><td>39.5MiB</td> </tr> </table> ACKs for top commit: furszy: re-ACK 73d7288, tested again. Tree-SHA512: fb828d89692ccb6105eae5411b70a3c7a129d98d3101121cf604171de1b818a8c68b3771cc69fcf0a04642fe1327ee7ce360a72ecd7ef019b1614bd83c081de5
By default Bitcoin-Core does verify the last 288 blocks. This can take a couple of minutes on slow systems.
This PR adds a simple progress report during
VerifyDB
in 10% steps into the debug log.I think misusing the debug.log for this – relatively long taking process – is okay.
Example: