This repository has been archived by the owner on Mar 5, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 86
Add blockchain:analyze/1 and blockchain:repair/1 #324
Merged
Merged
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
This PR also fixes a silly bug when we did not report we were doing an 'assume valid' sync and the sync height looked like it was going backwards. |
Codecov Report
@@ Coverage Diff @@
## master #324 +/- ##
==========================================
- Coverage 70.13% 67.54% -2.59%
==========================================
Files 66 66
Lines 6304 6279 -25
==========================================
- Hits 4421 4241 -180
- Misses 1883 2038 +155
Continue to review full report at Codecov.
|
evanmcc
approved these changes
Dec 19, 2019
Vagabond
force-pushed
the
adt/blockchain-repair
branch
from
December 20, 2019 00:55
628cf09
to
f0a2485
Compare
evanmcc
approved these changes
Dec 20, 2019
There are many things that go wrong when syncing is interrupted by some kind of hard power down (OTAs or unplugging). This patch intends to try to add some repair facilities for the common scenarios observed during sync corruption. The common sync failures are: * Missing blocks * Ledger inconsistency To detect these failures several checks have been added: * Check the delayed ledger is the right number of blocks behind * Check the blockchain and the ledger agree on the blockchain height * Check the delayed ledger advanced to the leading ledger fingerprints the same as the leading ledger And several repair tools have been added: * Advance the lagging ledger * Re-sync a missing block (only gap one block wide is doable right now) * Apply all the differences from an advanced lagging ledger to the leading ledger To analyze the problems, use blockchain:analyze. Analyze will report a single problem at a time. To repair the current analyzed problem (if it is one we can repair), use blockchain:repair. It will only repair a single problem at a time. It is recommended you use analyze after each repair to check if there are more problems, and to repair them if needed.
Vagabond
force-pushed
the
adt/blockchain-repair
branch
from
December 20, 2019 22:50
f85ec92
to
054d846
Compare
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
There are many things that go wrong when syncing is interrupted by some
kind of hard power down (OTAs or unplugging). This patch intends to try
to add some repair facilities for the common scenarios observed during
sync corruption.
The common sync failures are:
To detect these failures several checks have been added:
the same as the leading ledger
And several repair tools have been added:
leading ledger
To analyze the problems, use blockchain:analyze. Analyze will report a
single problem at a time.
To repair the current analyzed problem (if it is one we can repair), use
blockchain:repair. It will only repair a single problem at a time. It is
recommended you use analyze after each repair to check if there are more
problems, and to repair them if needed.