Skip to content

refactor: drop redundant CSigningManager argument from AsyncSignIfMember - #7539

Merged
PastaPastaPasta merged 1 commit into
dashpay:developfrom
PastaPastaPasta:claude/sigshares-asyncsignifmember-sigman
Aug 4, 2026
Merged

refactor: drop redundant CSigningManager argument from AsyncSignIfMember#7539
PastaPastaPasta merged 1 commit into
dashpay:developfrom
PastaPastaPasta:claude/sigshares-asyncsignifmember-sigman

Conversation

@PastaPastaPasta

Copy link
Copy Markdown
Member

Issue being fixed or feature implemented

CSigSharesManager::AsyncSignIfMember takes a CSigningManager& argument it does not need. The class has held a CSigningManager& sigman member since a352456 (#4988), declared 34 lines above the method in the same header, and the parameter shadows it.

There is exactly one CSigningManager in a node — node.llmq_ctx->sigman. init.cpp threads it into ActiveContext, which hands the same reference to CSigSharesManager's member and to each caller's own member, so every call site already passes the object the member points at:

Call site Passes
chainlock/signing.cpp:177 m_sigman
instantsend/signing.cpp:356, :415 m_sigman
llmq/ehf_signals.cpp:82 sigman
rpc/quorums.cpp:533 *llmq_ctx.sigman

The parameter comes from 0052fca ("refactor: move AsyncSignIfMember() to CSigSharesManager"). Before that move the method lived on CSigningManager and took the opposite manager, CSigSharesManager& shareman. After the move that argument became this, and a sigman argument was added to reach back for the recovered-sigs db — a mirror-image swap that is correct in isolation, but that nobody reconciled with the member the destination class already had.

Consequence today: the single sigman.GetDb() in the body resolves to the argument, while the surrounding code in the same function reaches for qman and m_chainman as members.

What was done?

Dropped the CSigningManager& sigman parameter from the declaration, the definition, and all five call sites.

The body is untouched — sigman now resolves to the member, which is the same object it already received. Parameter-list continuation lines keep their alignment because the opening paren does not move.

How Has This Been Tested?

Not built or run locally — reviewed by inspection. Verified by grep that no declaration, definition, or call site still passes a CSigningManager to AsyncSignIfMember, and that removing the argument leaves no caller-side variable unused (llmq_ctx in rpc/quorums.cpp is still used a few lines below). Relying on CI for the compile and test run.

Worth noting for reviewers: this class of shadowing is invisible to our warning set. Dash configures -Wshadow-field, which only fires when a field shadows a base class field; a parameter shadowing a member of the same class needs -Wshadow-all (or GCC's -Wshadow).

Breaking Changes

None.

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)

CSigSharesManager has held a CSigningManager& member since a352456, and there is exactly one CSigningManager in a node (llmq_ctx->sigman). ActiveContext hands that same reference to CSigSharesManager and to every caller, so all five call sites already passed the object the member points at.

The parameter was added by 0052fca, which moved AsyncSignIfMember off CSigningManager onto CSigSharesManager. Before the move the method took the opposite manager (CSigSharesManager& shareman); afterwards that argument became 'this' and a sigman argument was added to reach back for the db. The member was already declared 34 lines above the new signature in the same header.

The parameter shadowed that member, so the single sigman.GetDb() in the body silently used the argument while the surrounding code reaches for qman and m_chainman as members. Dropping the parameter leaves the body unchanged; sigman now resolves to the member.

No behavior change.
@coderabbitai

coderabbitai Bot commented Aug 3, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 3e4ca06f-c6a7-4067-9df7-87f1c449520f

📥 Commits

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

📒 Files selected for processing (6)
  • src/chainlock/signing.cpp
  • src/instantsend/signing.cpp
  • src/llmq/ehf_signals.cpp
  • src/llmq/signing_shares.cpp
  • src/llmq/signing_shares.h
  • src/rpc/quorums.cpp

Walkthrough

CSigSharesManager::AsyncSignIfMember no longer accepts an explicit CSigningManager& argument. It uses the manager’s existing signing-manager member. ChainLock, InstantSend, EHF signals, and quorum RPC signing calls now use the updated interface.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Possibly related PRs

  • dashpay/dash#7456: Modifies the same AsyncSignIfMember call paths with snapshot-based signing guards.

Suggested reviewers: knst

🚥 Pre-merge checks | ✅ 4 | ❌ 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 (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes removal of the redundant CSigningManager argument from AsyncSignIfMember.
Description check ✅ Passed The description directly explains the redundant parameter, affected call sites, rationale, testing status, and expected behavior.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit 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.

@thepastaclaw

thepastaclaw commented Aug 3, 2026

Copy link
Copy Markdown

✅ Final review complete — no blockers (commit 7c05e56)

@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 CSigningManager parameter from the declaration, definition, and all five call sites. CSigSharesManager already stores the same signing-manager instance supplied through ActiveContext, so sigman.GetDb() now resolves to the existing member without changing behavior; no stale calls, unused variables, 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(completed after 3 unparseable attempt(s)); verifier=codex/final-verifier=gpt-5.6-sol(completed, Sonnet-verifier fallback); 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 (failed), claude-sonnet-5 — dash-core-commit-history (completed)

@PastaPastaPasta PastaPastaPasta added this to the 24 milestone Aug 4, 2026
@PastaPastaPasta
PastaPastaPasta merged commit dba0e1a into dashpay:develop Aug 4, 2026
42 of 43 checks passed
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