Commit 002f1b2
committed
Merge #6969: feat: add evodb verify and repair RPC commands
f8be956 refactor: rename second BuildNewListFromBlock variant to RebuildListFromBlock (UdjinM6)
f3ee1d7 refactor: move verification progress log out of VerifySnapshotPair (UdjinM6)
f482f01 fix: drop redundant thread safety annotations (UdjinM6)
6df3a7c docs: add release notes for evodb verify/repair RPCs (UdjinM6)
7decd15 docs: add comprehensive evodb verify/repair documentation (UdjinM6)
17b556a feat: add evodb verify and repair RPC commands (UdjinM6)
5379fce refactor: add CDeterministicMNList::IsEqual method (UdjinM6)
496ed89 refactor: add BuildNewListFromBlock overload accepting explicit prevList (UdjinM6)
Pull request description:
## Issue being fixed or feature implemented
#6961 should fix the issue for new nodes migrating to v23. This PR aims to provide tools for nodes that updated before the fix implemented in #6961.
## What was done?
Preparatory Refactoring (2 commits)
1. BuildNewListFromBlock overload - Added method overload that accepts explicit prevList parameter instead of loading from database.
Needed for repair to rebuild from trusted snapshots.
2. CDeterministicMNList::IsEqual - Added equality comparison method to verify recalculated diffs produce correct results.
Main Feature (1 commit)
3. evodb verify and repair RPCs - Core implementation:
- Two new hidden RPC commands for diagnosing/repairing corrupted evodb diffs
- evodb verify - Read-only verification between snapshots (every 576 blocks)
- evodb repair - Recalculates corrupted diffs from blockchain data
- Fail-fast on critical errors, efficient 16MB batched writes, cache clearing
Documentation (2 commits)
4. Comprehensive docs - Full technical documentation in doc/evodb-verify-repair.md
5. Release notes - Short user-facing notes in doc/release-notes-6969.md
Key Points
- Purpose: Repair corrupted evodb diffs without full reindex (when possible)
- Use cases: After crashes, disk corruption, or suspected database issues
- Limitations: Can't repair missing snapshots (needs reindex), requires unpruned blocks
- Performance: I/O intensive, logs progress every 100 snapshot pairs
- Safety: Verifies repairs before committing, clears caches, clear error messages
## How Has This Been Tested?
1. Sync on testnet/mainet with v22.1.3 (save evodb from datadir for repeated experiments) and stop the node
2. Start v23 (with `--noconnect` to avoid altering blocks and chainstate), wait for migration to finish and stop the node
3. Start a node with this patch and run:
1. `evodb verify`, should see a bunch of errors in `verificationErrors`
2. `evodb repair`, should see same errors in `verificationErrors` and none in `repairErrors` (can specify start/stop params from errors in `verificationErrors` to speed things up a bit, `verificationErrors` should look accordingly)
3. `evodb verify` or `evodb repair` again, should see no errors now
## Breaking Changes
n/a
## Checklist:
- [ ] I have performed a self-review of my own code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have added or updated relevant unit/integration/functional/e2e tests
- [ ] I have made corresponding changes to the documentation
- [ ] I have assigned this pull request to a milestone _(for repository code-owners and collaborators only)_
ACKs for top commit:
PastaPastaPasta:
utACK f8be956
Tree-SHA512: 0cddb7f9fb3ae5519ae8cdb868aafbaeace35ca9f5fa7319d7ddbee3466e7765a21a8bae402983e3fc8f0a2ffab32c8bc60149af65bc2522143ca939b081c605File tree
7 files changed
+785
-8
lines changed- doc
- src
- evo
- rpc
7 files changed
+785
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
0 commit comments