Skip to content

Conversation

@random-zebra
Copy link

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.

Mainnet (height=2847011)Masterthis PR
online sync8 hr 13 min6 hr 42 min
-reindex (offline)7 hr 14 min6 hr 21 min
-reindex-chainstate (offline)N/A6 hr 13 min
startup (synced node)100 sec83 sec
RAM (synced node)1.65 GiB1.5 GiB
utxo_cache (synced node)28.9MiB39.5MiB

@random-zebra random-zebra added Upstream UTXO DBs and Indexes Startup Wallet startup changes and/or improvements labels May 16, 2021
@random-zebra random-zebra added this to the 6.0.0 milestone May 16, 2021
@random-zebra random-zebra self-assigned this May 16, 2021
@random-zebra random-zebra force-pushed the 202105_reindex-chainstate branch 2 times, most recently from e3b21f6 to 35c1f04 Compare May 21, 2021 15:21
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.

nice work, code review ACK 35c1f04b96ba284b9449fcea8dd6a82805b5a8e1.
Will give it a full run.

furszy
furszy previously approved these changes May 26, 2021
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.

Reindex and resync tested, ACK 35c1f04

@furszy
Copy link

furszy commented Jun 22, 2021

This needs another rebase. Once it's done and v5.2 release is completed, will move forward with it.

laanwj and others added 12 commits June 22, 2021 16:42
Also cap the allocation for the leveldb-specific cache for the UTXO set
to 8MiB.
This avoids that the extra cache memory goes to the much less effective
leveldb cache instead of our application-level cache.
Since the setting is always created with default value, nodes launched
with the GUI will keep the cache size at 100 (previous default).

Create a new setting and update the value to the new default, only if it
was previously set to 100.
>>> based on bitcoin/bitcoin@316623f

without switching to AcceptBlock in LoadExternalBlockFile, as we need to
sequentially Accept and ActivateBestChain for PoS validation
@random-zebra
Copy link
Author

Rebased

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.

re-ACK 73d7288, tested again.

@furszy
Copy link

furszy commented Jun 28, 2021

Moving forward..

@furszy furszy merged commit 0e264e2 into PIVX-Project:master Jun 28, 2021
random-zebra added a commit that referenced this pull request Jul 12, 2021
… more.

017ee3e Validation cleanup: Inside ConnectBlock, move coinSpend parse and validation to zerocoin_verify file. (furszy)
e8206e8 Remove unneeded hashBlock arg from ContextualCheckZerocoinSpend and ContextualCheckZerocoinSpendNoSerialCheck (furszy)
c402eef Remove dead zerocoin.h/cpp (furszy)
0a3f069 Remove dead mintpool.h/cpp. (furszy)

Pull request description:

  Built on top of #2391.

  Made the following changes:
  1) Removed dead `mintpool.h/cpp`.
  2) Removed dead `zerocoin.h/cpp`.
  3) Removed unneeded hashBlock arg from `ContextualCheckZerocoinSpend` and `ContextualCheckZerocoinSpendNoSerialCheck`.
  4) Validation cleanup: Inside ConnectBlock, moved coinSpend parse and validation to `zerocoin_verify` files.

ACKs for top commit:
  random-zebra:
    utACK 017ee3e

Tree-SHA512: 1df0d91906234741e3baee5af828d8cfb77a701597d10f09d88b0a11c4c4899aeeb1ca9c801fd57cfbe64fbd747041d92f2752a218c4b17d4d03dedf75c5855a
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.

5 participants