Repository navigation
test(dash-spv): corrupt every storage part in the resync tests - #1503
Conversation
The restart and runtime corruption tests now take the corrupted file as a test case, so each part of the storage can get its own case. The restart case moves out of `test_sync_restart_consistency`, and the runtime test rescans the funded wallet instead of an empty one, so it also checks the balance the client syncs back to.
The restart test corrupts block headers, filter headers, filters and blocks, and restarts with a fresh wallet, so the client downloads the wiped files again and the wallet syncs back to its balance. The runtime test corrupts block headers, filters and blocks.
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
|
✅ Review complete in 4m 49s Planner (8s) Review (internal · solo): 1 finding Judge (1m 11s) Posted: 0 findings Review metadataConfig:
Account limits:
Judge decisions:
Timing:
Last reviewed
|
|
Waiting for bot review — coderabbitai not yet. Wait for the missing reviews, or a writer can post |
There was a problem hiding this comment.
✅ Approved.
What this does: Tests that the SPV client wipes and syncs again when a storage file is corrupted now cover each storage type (block headers, filter headers, filters, blocks). They cover both corruption while the client is stopped and corruption while it runs.
What to test
The review model wrote these steps. Check what a step runs before you follow it.
Setup: Load the regtest dashd environment with eval $(python3 contrib/setup-dashd.py) or use just dash-spv::test.
- Run
just dash-spv::test test_restart_corruption_resyncs. Expect four cases to pass: block headers, filter headers, filters and blocks. - Run
just dash-spv::test test_runtime_corruption_resyncs. Expect three cases to pass, each emitting aStorageCorruptedevent before the resync finishes. - Run
just dash-spv::test test_sync_restart_consistency. Expect it to pass without the corruption step, including the boundary-block mining check when mining is supported. - Run a single case with
DASHD_TEST_LOG=1and--nocapture. Expect the log to show the corrupted segment being wiped and downloaded again.
Checked and left out: 1 finding
Not finished checking · 1 possible problem
- Runtime corruption of a cached segment may never be read, so the block headers and blocks cases could time out ·
dash-spv/tests/dashd_sync/tests_restart.rs:310
The progress comment has the full log under "Judge decisions", in its "Review metadata" fold.
About this review
- Reviewed
34fa90b, round 1 - 107 changed lines read in 4m 49s
- Found by
claude-opus-5-5, judged byclaude-opus-5-5 - Tokens: 1.9M in (1.5M from cache) · 29k out · about $2.66 at API prices
- Runner: self-hosted · started after 16s · peak memory 2.9 GiB of 30.0 GiB
- How Manki reviews
|
Bots are done — your move: post |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## dev #1503 +/- ##
==========================================
- Coverage 87.53% 87.51% -0.03%
==========================================
Files 270 270
Lines 71309 71309
==========================================
- Hits 62421 62405 -16
- Misses 8888 8904 +16
|
…run 45500430786)
The dashd tests corrupted one storage file at a time: block headers on restart and filters at runtime.
This PR turns both tests into test cases over the corrupted file. The restart test corrupts block headers, filter headers, filters and blocks, and restarts with a fresh wallet, so the client downloads the wiped files again and the wallet syncs back to its balance. The runtime test corrupts block headers, filters and blocks while the client runs, and rescans the funded wallet so the client reads the corrupted file. Masternodes and the ChainLock are not covered, since the regtest chain stores neither.
PR Hygiene ·
34fa90b/self-revieweddash-spv(dash-spv/tests/dashd_sync/tests_restart.rs) — approved by xdustinfaceWhen every merge requirement is met, the
PR Hygienecheck passes. Reviewer limits do not block merging; other required GitHub checks and protections still apply.Summary by CodeRabbit