forked from dashpay/dash
-
Notifications
You must be signed in to change notification settings - Fork 718
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
[WIP] Implement rewind block index to last checkpoint functionality #2298
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
random-zebra
added a commit
that referenced
this pull request
May 5, 2021
529ff1f [Refactoring] Stop writing zerocoin mints in the DB (random-zebra) 6b51e1c [Cleanup] Remove unused ReadCoinMint/EraseCoinMint (key 'm') in zc DB (random-zebra) Pull request description: We should have never databased the "public coins" in the first place, and it's beyond useless now. With this simple removal we get a 20~25% speedup during they sync of the interested blocks [`863787` -> `1880000`], and, as bonus, we save 60MB of disk space. ACKs for top commit: Fuzzbawls: ACK 529ff1f furszy: Now that we have #2298 and #2364 test, ACK 529ff1f . Tree-SHA512: 9d053538158cd271e64ab70bc3aa913256d3a4386c02e961c2776b45b0694221d3f0919a5992c8e652271783fc2d81729df48fbbb11d0c3f1ba9704e0654c893
furszy
added a commit
that referenced
this pull request
May 5, 2021
cb276f4 [Cleanup] Remove zerocoin accumulators (random-zebra) 4772fbd [Cleanup] Remove unused PrivateCoin class (random-zebra) 1371fa4 [Cleanup] Remove now unused randKBitBignum (random-zebra) 0da394b [Cleanup] Remove unused Parameter generation utility for zerocoin (random-zebra) Pull request description: Remove some dead code. More cleanup in the area will be done after #2298 ACKs for top commit: Fuzzbawls: ACK cb276f4 furszy: ACK cb276f4 and merging.. Tree-SHA512: 229ac954b0f3f03a3e627c0ac01d2a26294b80d0f5699fc3cac0c79853a653a755799460ceb09ff2aaf3c6e151314868509223a9c5d8c6f26ef29b39fd2a184e
PeterL73
added a commit
to PeterL73/PIVX
that referenced
this pull request
Nov 11, 2022
add testnet checkpoints - 925056 (lastblock before v5.5) - 925057 (firstblock after v5.5) - 925063 (added to circumvent failure on last (default 6) blocks verification due to PIVX-Project#2772) add -rewindblockindextolastcheckpoint option add RewindBlockIndexToLastCheckpoint to init Step 7: load block chain modify RewindBlockIndexToLastCheckpoint - check if rewind is needed - use targetHeight instead of targetHash - add progress indicator on rewind - clearWitnessCaches - zap all transactions from wallet - rescan wallet transactions - restore wallet transaction metadata after rescan (unless -zapwallettxes=2) add functional test
PeterL73
added a commit
to PeterL73/PIVX
that referenced
this pull request
Nov 11, 2022
add testnet checkpoints - 925056 (lastblock before v5.5) - 925057 (firstblock after v5.5) - 925063 (added to circumvent failure on last (default 6) blocks verification due to PIVX-Project#2772) add -rewindblockindextolastcheckpoint option add RewindBlockIndexToLastCheckpoint to init Step 7: load block chain modify RewindBlockIndexToLastCheckpoint - check if rewind is needed - use targetHeight instead of targetHash - add progress indicator on rewind - clearWitnessCaches - zap all transactions from wallet - rescan wallet transactions - restore wallet transaction metadata after rescan (unless -zapwallettxes=2) add functional test
PeterL73
added a commit
to PeterL73/PIVX
that referenced
this pull request
Nov 11, 2022
add testnet checkpoints - 925056 (lastblock before v5.5) - 925057 (firstblock after v5.5) - 925063 (added to circumvent failure on last (default 6) blocks verification due to PIVX-Project#2772) add -rewindblockindextolastcheckpoint option add RewindBlockIndexToLastCheckpoint to init Step 7: load block chain modify RewindBlockIndexToLastCheckpoint - check if rewind is needed - use targetHeight instead of targetHash - add progress indicator on rewind - clearWitnessCaches - zap all transactions from wallet - rescan wallet transactions - restore wallet transaction metadata after rescan (unless -zapwallettxes=2) add functional test
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Adding functionality to rollback the chain up to the last known checkpoint.
As we have a max depth reorg limit, this is useful in many scenarios. The one that happen often is over every upgrade enforcement where users update late and continue running on a forked chain for a long time. With this, they will be able to get back to the main chain just pressing a button in the GUI, without having to invalidate the chain manually nor sync from scratch.
Another future step forward from this PR would be to automate the rewind process but there are several other factors that need to be contemplated in order to do it.
TODO: