Skip to content

feat: add dashd integration tests for SPV sync#464

Draft
xdustinface wants to merge 2 commits intov0.42-devfrom
feat/dashd-integration-tests
Draft

feat: add dashd integration tests for SPV sync#464
xdustinface wants to merge 2 commits intov0.42-devfrom
feat/dashd-integration-tests

Conversation

@xdustinface
Copy link
Collaborator

@xdustinface xdustinface commented Feb 21, 2026

Adds comprehensive integration tests that verify SPV sync against a real dashd instance with pre-generated regtest blockchain: dashpay/regtest-blockchain

Includes:

  • CI infrastructure: contrib/setup-dashd.py for cross-platform dashd/test-data setup, GitHub Actions caching and log retention on test failure
  • Shared test utilities in dash-spv/src/test_utils/: DashCoreNode (dashd process management, RPC), DashdTestContext (common setup), filesystem helpers
  • FFI test utilities in dash-spv-ffi/src/test_utils/: CallbackTracker (callback verification), FFITestContext (FFI client wrapper lifecycle management)
  • SPV tests: basic sync, empty wallet, multi-wallet, restart consistency, restart with fresh wallet, multiple restarts, random restarts, peer disconnection (exclusive and non-exclusive mode), incremental transactions (single block, across blocks)
  • FFI tests: wallet sync, incremental sync, restart consistency, all-callbacks verification, post-sync transaction and disconnect callbacks

Based on:

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 21, 2026

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/dashd-integration-tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Base automatically changed from feat/sync-cycle to v0.42-dev February 25, 2026 22:10
@github-actions github-actions bot added the merge-conflict The PR conflicts with the target branch. label Feb 27, 2026
@github-actions
Copy link

This PR has merge conflicts with the base branch. Please rebase or merge the base branch into your branch to resolve them.

@xdustinface xdustinface force-pushed the feat/dashd-integration-tests branch from 10e52ea to 41ba821 Compare February 27, 2026 18:36
@github-actions github-actions bot removed the merge-conflict The PR conflicts with the target branch. label Feb 27, 2026
@xdustinface xdustinface marked this pull request as ready for review February 27, 2026 18:52
@xdustinface xdustinface marked this pull request as draft February 27, 2026 18:53
Adds a `thread_local` flag to `LoggingConfig` that uses `tracing::subscriber::set_default` (thread-local) instead of `try_init` (global). This allows multiple independent loggers in the same process, primarily for parallel tests where each test needs its own log subscriber. The `LoggingGuard` now holds an optional `DefaultGuard` to keep the thread-local subscriber alive. Additionally, the FFI client's tokio runtime builder propagates the caller's tracing dispatcher to worker threads via `on_thread_start`, so spawned async tasks capture logs through the correct subscriber.
Adds comprehensive integration tests that verify SPV sync against a real `dashd` instance
with pre-generated regtest blockchain: [dashpay/regtest-blockchain](https://github.com/dashpay/regtest-blockchain)

### Includes:
- CI infrastructure: `contrib/setup-dashd.py` for cross-platform dashd/test-data setup, GitHub Actions caching and log retention on test failure
- Shared test utilities in `dash-spv/src/test_utils/`: `DashCoreNode` (`dashd` process management, RPC), `DashdTestContext` (common setup), filesystem helpers
- FFI test utilities in `dash-spv-ffi/src/test_utils/`: `CallbackTracker` (callback verification), `FFITestContext` (FFI client wrapper lifecycle management)
- SPV tests: basic sync, empty wallet, multi-wallet, restart consistency, restart with fresh wallet, multiple restarts, random restarts, peer disconnection (exclusive and non-exclusive mode), incremental transactions (single block, across blocks)
- FFI tests: wallet sync, incremental sync, restart consistency, all-callbacks verification, post-sync transaction and disconnect callbacks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant