Skip to content

refactor: remove dead m_dsq client-side relay from MessageProcessingResult#7229

Merged
PastaPastaPasta merged 1 commit intodashpay:developfrom
UdjinM6:chore/remove-dead-dsq-relay
Mar 16, 2026
Merged

refactor: remove dead m_dsq client-side relay from MessageProcessingResult#7229
PastaPastaPasta merged 1 commit intodashpay:developfrom
UdjinM6:chore/remove-dead-dsq-relay

Conversation

@UdjinM6
Copy link

@UdjinM6 UdjinM6 commented Mar 16, 2026

Issue being fixed or feature implemented

Client-side DSQ relay was removed in #7070 but the m_dsq field and its population in CCoinJoinClientQueueManager::ProcessMessage were left behind as dead code. The network has been running without client-side DSQ relay with no issues since masternodes handle DSQ propagation through their own CCoinJoinServer::ProcessDSQUEUE path.

Alternative to #7227

What was done?

Remove the dead code and fix transitive include dependencies that were masked by msg_result.h pulling in coinjoin/coinjoin.h. This also resolves two circular dependency chains that went through that link.

How Has This Been Tested?

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)

…esult

Client-side DSQ relay was removed in dashpay#7070 but the m_dsq field and its
population in CCoinJoinClientQueueManager::ProcessMessage were left
behind as dead code. The network has been running without client-side
DSQ relay with no issues since masternodes handle DSQ propagation
through their own CCoinJoinServer::ProcessDSQUEUE path.

Remove the dead code and fix transitive include dependencies that were
masked by msg_result.h pulling in coinjoin/coinjoin.h. This also
resolves two circular dependency chains that went through that link.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@UdjinM6 UdjinM6 added this to the 24 milestone Mar 16, 2026
@UdjinM6 UdjinM6 requested a review from knst March 16, 2026 09:11
@github-actions
Copy link

This pull request has conflicts, please rebase.

@github-actions
Copy link

⚠️ Potential Merge Conflicts Detected

This PR has potential conflicts with the following open PRs:

Please coordinate with the authors of these PRs to avoid merge conflicts.

@coderabbitai
Copy link

coderabbitai bot commented Mar 16, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 74a0d712-641f-4551-b6d3-78ecabdbed1c

📥 Commits

Reviewing files that changed from the base of the PR and between 32fa1a8 and d142fc8.

📒 Files selected for processing (6)
  • src/coinjoin/client.cpp
  • src/instantsend/net_instantsend.h
  • src/instantsend/signing.h
  • src/msg_result.h
  • src/rpc/quorums.cpp
  • test/lint/lint-circular-dependencies.py
💤 Files with no reviewable changes (2)
  • src/coinjoin/client.cpp
  • test/lint/lint-circular-dependencies.py

Walkthrough

The pull request removes the m_dsq field from the MessageProcessingResult struct and eliminates code that populates it in CCoinJoinClientQueueManager::ProcessMessage. The empty() method is updated to no longer reference this removed field. Forward declarations and header includes are added to reduce coupling and resolve circular dependencies. The circular dependency test expectations are updated to reflect two resolved dependency cycles involving msg_result, coinjoin, spork, chainlock, and instantsend modules.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically describes the main change: removing the dead m_dsq field from MessageProcessingResult in the client-side DSQ relay refactoring.
Description check ✅ Passed The description is directly related to the changeset, explaining the removal of dead code (m_dsq field and its population) and the resolution of circular dependencies.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
📝 Coding Plan
  • Generate coding plan for human review comments

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.

@UdjinM6
Copy link
Author

UdjinM6 commented Mar 16, 2026

⏺ DSQ Relay Flow (post-#7070, current network behavior)

  ┌─────────────────────────────────────────────────────────────────────┐
  │                    MASTERNODE MESH (server path)                    │
  │                                                                     │
  │  ┌──────────────┐    PeerRelayDSQ()    ┌──────────────┐             │
  │  │ Originating  │────────────────────▶ │ Masternode B │             │
  │  │ Masternode A │                      │              │             │
  │  │              │    CCoinJoinServer:: │  ProcessDSQ  │             │
  │  │ Creates DSQ  │    ProcessDSQUEUE()  │  ──────────  │             │
  │  │ Signs w/ BLS │                      │ Validates    │             │
  │  └──────┬───────┘                      │ Stores queue │             │
  │         │                              │ Relays onward│             │
  │         │ PeerRelayDSQ()               └──────┬───────┘             │
  │         │                                     │                     │
  │         ▼                                     │ PeerRelayDSQ()      │
  │  ┌──────────────┐                             ▼                     │
  │  │ Masternode C │◀──── PeerRelayDSQ() ──-┌──────────────┐           │
  │  │              │                        │ Masternode D │           │
  │  └──────┬───────┘                        └──────┬───────┘           │
  │         │                                       │                   │
  └─────────┼───────────────────────────────────────┼────────────────-──┘
            │                                       │
            │ SENDDSQUEUE                           │ SENDDSQUEUE
            │ (m_wants_dsq = INV/ALL)               │
            ▼                                       ▼
     ┌──────────────┐                         ┌──────────────┐
     │ Wallet Node  │                         │ Wallet Node  │
     │              │                         │              │
     │  CCoinJoinClient                       │ Processes    │
     │  QueueManager::                        │ DSQ locally  │
     │  ProcessMessage()                      │              │
     │  ─────────────                         │ Joins queue  │
     │  Validates DSQ                         │ if ready     │
     │  Stores in queue                       └──────────────┘
     │  ✗ NO RELAY (dead
     │    code removed)
     └──────────────┘

    ┌───────────────────────────────────────────────────────-┐
    │ Key distinction:                                       │
    │                                                        │
    │  Server path (MN→MN): CCoinJoinServer::ProcessDSQUEUE  │
    │    → calls PeerRelayDSQ() directly on PeerManager      │
    │    → full gossip propagation across MN mesh            │
    │                                                        │
    │  Client path (MN→Wallet): CCoinJoinClientQueueManager  │
    │    → processes DSQ locally (validation, queue storage) │
    │    → previously relayed via m_dsq → PostProcessMessage │
    │    → relay removed in #7070, dead code cleaned up now  │
    └──────────────────────────────────────────────────────-─┘

  Masternodes form the relay backbone — each one that receives a valid DSQ
  re-broadcasts it via PeerRelayDSQ(). Wallet nodes are leaf consumers:
  they receive DSQs from their masternode peers, validate and store them locally,
  but don't propagate further.

Copy link

@thepastaclaw thepastaclaw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

Clean dead-code removal of the unused m_dsq field from MessageProcessingResult. PostProcessMessage never consumed m_dsq — DSQ relay is handled entirely through PeerRelayDSQ called from coinjoin/server.cpp. The transitive include fixes and two circular dependency chain removals are correct.

Reviewed commit: d142fc8

Copy link
Member

@PastaPastaPasta PastaPastaPasta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

utACK d142fc8

@PastaPastaPasta PastaPastaPasta merged commit 39851c3 into dashpay:develop Mar 16, 2026
77 of 84 checks passed
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.

3 participants