Skip to content

refactor: drop redundant CConnman argument from NetHandler::ProcessGetData - #7538

Merged
PastaPastaPasta merged 1 commit into
dashpay:developfrom
PastaPastaPasta:claude/coinjoinsrv-processgetdata-connman-c6b106
Aug 4, 2026
Merged

refactor: drop redundant CConnman argument from NetHandler::ProcessGetData#7538
PastaPastaPasta merged 1 commit into
dashpay:developfrom
PastaPastaPasta:claude/coinjoinsrv-processgetdata-connman-c6b106

Conversation

@PastaPastaPasta

@PastaPastaPasta PastaPastaPasta commented Aug 3, 2026

Copy link
Copy Markdown
Member

Issue being fixed or feature implemented

NetHandler::ProcessGetData takes a CConnman& argument that no implementation actually needs. Every handler that overrides it already holds its own CConnman&:

  • CCoinJoinServer::connman
  • NetGovernance::m_connman
  • NetDKG::ActiveDKG::connman

In a running node there is exactly one CConnmannode.connman in init.cpp — and that is the same object PeerManagerImpl passes as m_connman at the call site, so the argument was always identical to the member.

The parameter is a mechanical artifact of a56c106 ("refactor: drop dependency of PeerManager on CoinJoinServer"), which moved these branches out of PeerManagerImpl::ProcessGetData. The moved lines read m_connman.PushMessage(...), so m_connman was promoted to a parameter to keep the hunk a 1:1 move. Nobody reconciled it with the members the handlers already had.

In CCoinJoinServer::ProcessGetData the parameter additionally shadowed the class member of the same name, so the body silently used the argument while every other method in the file uses the member.

What was done?

Dropped CConnman& connman from the NetHandler::ProcessGetData virtual and from all three overrides; each handler now replies through the CConnman it already holds.

msgMaker stays a parameter — it is CNetMsgMaker(pfrom.GetCommonVersion()), genuinely per-peer state the handler cannot reconstruct on its own.

NetDKG keeps its CConnman where it already lived, in the active-mode-only ActiveDKG bundle, and replies via m_active->connman. One consequence worth noting for review: this makes the existing m_active == nullptr early return guard the replies rather than merely short-circuit them, so the comment above it is updated to say so. That is not a behavior change — the class doc already documents ProcessGetData as active-mode only, because the underlying Get* calls return false by construction in observer mode.

No behavior change: same object, same call, in every case.

How Has This Been Tested?

Not built or run locally — this branch was reviewed by inspection. Verified by grep that no ProcessGetData declaration, definition, or call site still carries a CConnman argument. Relying on CI for the compile and test run.

Breaking Changes

None. NetHandler is an internal interface with no external implementors.

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)

@coderabbitai

coderabbitai Bot commented Aug 3, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@PastaPastaPasta, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 3 minutes

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 3ac5c8d0-101f-49ab-ad88-a0701279f93b

📥 Commits

Reviewing files that changed from the base of the PR and between fff8664 and c01370e.

📒 Files selected for processing (8)
  • src/coinjoin/server.cpp
  • src/coinjoin/server.h
  • src/governance/net_governance.cpp
  • src/governance/net_governance.h
  • src/llmq/net_dkg.cpp
  • src/llmq/net_dkg.h
  • src/net_processing.cpp
  • src/net_processing.h

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.

@thepastaclaw

thepastaclaw commented Aug 3, 2026

Copy link
Copy Markdown

✅ Final review complete — no blockers (commit c01370e)

…tData

Every NetHandler that overrides ProcessGetData already holds its own CConnman reference, and in a running node there is exactly one CConnman (node.connman), which is also what PeerManagerImpl passes as m_connman. The parameter was a mechanical artifact of a56c106, which moved these branches out of PeerManagerImpl::ProcessGetData and promoted the m_connman local to a parameter to keep the hunk a 1:1 move.

In CCoinJoinServer the parameter additionally shadowed the class member of the same name. Drop the parameter from the virtual and have each handler use its own member. msgMaker stays a parameter: it carries the peer's common version and is genuinely per-peer.

NetDKG keeps its CConnman in the active-mode-only ActiveDKG bundle and replies through m_active->connman, which is where it is actually used. That makes the existing m_active null check guard the replies rather than merely short-circuit them, so the comment above it is updated to say so; the class doc already documents ProcessGetData as active-mode only.

No behavior change.
@PastaPastaPasta
PastaPastaPasta force-pushed the claude/coinjoinsrv-processgetdata-connman-c6b106 branch from 91016d8 to c01370e Compare August 3, 2026 22:09

@PastaPastaPasta PastaPastaPasta left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

LGTM; waiting for CI to be happy, if this builds it's ok

@thepastaclaw thepastaclaw left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Final validation — Codex + Sonnet

The refactor consistently removes the redundant CConnman parameter from NetHandler::ProcessGetData, all three overrides, and the sole dispatch call site. Each handler uses the same existing CConnman reference supplied during runtime construction, while observer-mode NetDKG still exits safely before sending replies; no stale signatures, behavioral regressions, or commit-history concerns were found.

Source: reviewers codex/general=gpt-5.6-sol(completed); codex/dash-core-commit-history=gpt-5.6-sol(completed); claude/general=claude-sonnet-5(completed); claude/dash-core-commit-history=claude-sonnet-5(failed); claude/dash-core-commit-history=claude-sonnet-5(failed); claude/dash-core-commit-history=claude-sonnet-5(completed); verifier=codex/final-verifier=gpt-5.6-sol(completed) fallback_for_sonnet_verifier=true; coordinator=openclaw-agent/cliproxy/gpt-5.6-sol(orchestration-only).

Review provenance

  • Codex reviewers: gpt-5.6-sol — general (completed), gpt-5.6-sol — dash-core-commit-history (completed)
  • Verifier: gpt-5.6-sol — final-verifier (fallback)
  • Sonnet reviewers: claude-sonnet-5 — general (completed), claude-sonnet-5 — dash-core-commit-history (failed), claude-sonnet-5 — dash-core-commit-history (failed), claude-sonnet-5 — dash-core-commit-history (completed)

@PastaPastaPasta PastaPastaPasta added this to the 24 milestone Aug 4, 2026
@PastaPastaPasta
PastaPastaPasta merged commit 6890d91 into dashpay:develop Aug 4, 2026
47 checks passed
@PastaPastaPasta
PastaPastaPasta deleted the claude/coinjoinsrv-processgetdata-connman-c6b106 branch August 4, 2026 14:14
PastaPastaPasta added a commit to PastaPastaPasta/dash that referenced this pull request Aug 4, 2026
The shadowMember re-enable left dangling parameter names after dashpay#7538/dashpay#7539
dropped those parameters (connman_in / signing_manager), which broke the
build. Finish the ProcessVoteAndRelay cleanup by removing the now-unused
CConnman plumbing from GovernanceSigner, governance RPC helpers, and node
interfaces. Cap cppcheck jobs and treat abnormal cppcheck exits as failures
so CI analysis cannot pass vacuous when the child process dies.
PastaPastaPasta added a commit to PastaPastaPasta/dash that referenced this pull request Aug 4, 2026
The shadowMember re-enable left dangling parameter names after dashpay#7538/dashpay#7539
dropped those parameters (connman_in / signing_manager), which broke the
build. Finish the ProcessVoteAndRelay cleanup by removing the now-unused
CConnman plumbing from GovernanceSigner, governance RPC helpers, and node
interfaces. Cap cppcheck jobs and treat abnormal cppcheck exits as failures
so CI analysis cannot pass vacuous when the child process dies.
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.

2 participants