Skip to content

Conversation

@random-zebra
Copy link

Extracted from #1864
Implements --reindex-chainstate startup flag, to throw out and reindex only the chainstate, keeping the block index.

@random-zebra random-zebra added Upstream UTXO DBs and Indexes Startup Wallet startup changes and/or improvements labels Oct 10, 2020
@random-zebra random-zebra added this to the 5.0.0 milestone Oct 10, 2020
@random-zebra random-zebra self-assigned this Oct 10, 2020
Copy link

@furszy furszy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

utACK dd37959

@random-zebra
Copy link
Author

The reindex is too slow, making this option not really usable. Closing for now, will revisit it later.

@Fuzzbawls Fuzzbawls removed this from the 5.0.0 milestone Dec 4, 2020
furszy added a commit that referenced this pull request Jun 28, 2021
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Startup Wallet startup changes and/or improvements Upstream UTXO DBs and Indexes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants