fix: return removed code for m_dsq to relay Dsq queue#7227
fix: return removed code for m_dsq to relay Dsq queue#7227knst wants to merge 1 commit intodashpay:developfrom
Conversation
It has been removed too early in dashpay#7070, it's still used by CCoinJoinClientQueueManager::ProcessMessage
✅ No Merge Conflicts DetectedThis PR currently has no conflicts with other open PRs. |
|
This pull request has conflicts, please rebase. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
WalkthroughThe change adds DSQ (Dispute Settlement Queue) item relaying to the post-processing flow in Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes 🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
📝 Coding Plan
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. Comment Tip CodeRabbit can use OpenGrep to find security vulnerabilities and bugs across 17+ programming languages.OpenGrep is compatible with Semgrep configurations. Add an |
thepastaclaw
left a comment
There was a problem hiding this comment.
Code Review
This is a correct and necessary 3-line bug fix. PR #7070 refactored the server side to call PeerRelayDSQ directly but also removed the m_dsq relay loop from PostProcessMessage, which the client side (CCoinJoinClientQueueManager::ProcessMessage) still depends on. Without this fix, DSQ messages received by non-masternode nodes are never relayed, breaking CoinJoin queue propagation. All findings are non-blocking suggestions.
Reviewed commit: a910cb7
🟡 2 suggestion(s) | 💬 1 nitpick(s)
1 additional finding(s) omitted (not in diff).
🤖 Prompt for all review comments with AI agents
These findings are from an automated code review. Verify each finding against the current code and only fix it if needed.
In `src/net_processing.cpp`:
- [SUGGESTION] lines 3646-3648: No test covers the client-side m_dsq relay path, risking repeat regression
The DSQUEUE → `m_dsq.push_back()` → `PostProcessMessage` → `RelayDSQ` flow has no unit or functional test coverage. This exact path was silently broken by #7070 without any test catching it. A regression test exercising `CCoinJoinClientQueueManager::ProcessMessage` and verifying that `result.m_dsq` is non-empty (or that `RelayDSQ` is called) would prevent this from recurring. Neither `src/test/` nor `test/functional/` reference `m_dsq`, `DSQUEUE`, or `RelayDSQ`.
In `src/coinjoin/client.cpp`:
- [SUGGESTION] line 145: Client DSQ relay still uses indirect m_dsq path unlike the refactored server
PR #7070 refactored the server side (`coinjoin/server.cpp`) to call `m_peer_manager->PeerRelayDSQ(dsq)` directly (lines 208, 533, 741), bypassing `MessageProcessingResult.m_dsq`. The client side still uses the old indirect path via `ret.m_dsq.push_back(dsq)`, which is the sole reason this `PostProcessMessage` loop needs to exist. As the PR description itself notes, the same refactoring should be done for `coinjoin/client` and `coinjoin/walletman`. This would eliminate the asymmetry and remove the fragile dependency on a relay loop that has already been accidentally deleted once.
| for (const auto& dsq : result.m_dsq) { | ||
| RelayDSQ(dsq); | ||
| } |
There was a problem hiding this comment.
🟡 Suggestion: No test covers the client-side m_dsq relay path, risking repeat regression
The DSQUEUE → m_dsq.push_back() → PostProcessMessage → RelayDSQ flow has no unit or functional test coverage. This exact path was silently broken by #7070 without any test catching it. A regression test exercising CCoinJoinClientQueueManager::ProcessMessage and verifying that result.m_dsq is non-empty (or that RelayDSQ is called) would prevent this from recurring. Neither src/test/ nor test/functional/ reference m_dsq, DSQUEUE, or RelayDSQ.
source: ['claude', 'codex']
🤖 Fix this with AI agents
These findings are from an automated code review. Verify each finding against the current code and only fix it if needed.
In `src/net_processing.cpp`:
- [SUGGESTION] lines 3646-3648: No test covers the client-side m_dsq relay path, risking repeat regression
The DSQUEUE → `m_dsq.push_back()` → `PostProcessMessage` → `RelayDSQ` flow has no unit or functional test coverage. This exact path was silently broken by #7070 without any test catching it. A regression test exercising `CCoinJoinClientQueueManager::ProcessMessage` and verifying that `result.m_dsq` is non-empty (or that `RelayDSQ` is called) would prevent this from recurring. Neither `src/test/` nor `test/functional/` reference `m_dsq`, `DSQUEUE`, or `RelayDSQ`.
| for (const auto& dsq : result.m_dsq) { | ||
| RelayDSQ(dsq); | ||
| } |
There was a problem hiding this comment.
💬 Nitpick: A comment noting the sole caller would help prevent re-deletion
Since the server side now calls PeerRelayDSQ directly, only CCoinJoinClientQueueManager::ProcessMessage populates m_dsq. A brief comment here would help future developers understand why this loop exists and avoid accidentally removing it again.
| for (const auto& dsq : result.m_dsq) { | |
| RelayDSQ(dsq); | |
| } | |
| for (const auto& dsq : result.m_dsq) { | |
| // Relays DSQ messages populated by CCoinJoinClientQueueManager::ProcessMessage (client-side) | |
| RelayDSQ(dsq); | |
| } |
source: ['claude']
|
pls see #7229 |
|
Accordingly #7229 (comment) it is a dead code, not a fix. |
…geProcessingResult d142fc8 refactor: remove dead m_dsq client-side relay from MessageProcessingResult (UdjinM6) Pull request description: ## 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)_ ACKs for top commit: PastaPastaPasta: utACK d142fc8 Tree-SHA512: e8a8f0ac1b126021bbf1a9c61df4af7e062ce15e5541753232b967a4432965c650d3760df1e95fac9741e6fa87edc789683ada91e7e41d7269db473195c1601e
Issue being fixed or feature implemented
It has been removed too early in #7070, but that still used by CCoinJoinClientQueueManager::ProcessMessage
How Has This Been Tested?
N/A
Breaking Changes
N/A
Checklist: