Skip to content

fix: register shareman recovery interface in ActiveContext#7244

Merged
PastaPastaPasta merged 1 commit intodashpay:developfrom
thepastaclaw:fix-shareman-recovery
Mar 25, 2026
Merged

fix: register shareman recovery interface in ActiveContext#7244
PastaPastaPasta merged 1 commit intodashpay:developfrom
thepastaclaw:fix-shareman-recovery

Conversation

@thepastaclaw
Copy link
Copy Markdown

Summary

Add missing shareman->RegisterRecoveryInterface() call in ActiveContext::Start() and corresponding UnregisterRecoveryInterface() in Stop().

Problem

ActiveContext::Start() registers recovery interfaces for cl_signer and is_signer but not shareman. Without this, completed sig share sessions are only cleaned up via the 5-second Cleanup() interval instead of promptly via HandleNewRecoveredSig.

Under CI load with frozen mocktime, this manifests as flaky test failures in feature_llmq_signing.py and interface_zmq_dash.py where InstantSend locks don't arrive within expected timeouts.

Root Cause

The registration was likely dropped during the sig share refactoring that split share management into a separate shareman object. The cl_signer and is_signer registrations survived but shareman was missed.

Fix

Two lines:

  • shareman->RegisterRecoveryInterface() in Start() (after is_signer)
  • shareman->UnregisterRecoveryInterface() in Stop() (before is_signer, maintaining reverse order)

Validation

  • Verified CSigSharesManager declares both RegisterRecoveryInterface() and UnregisterRecoveryInterface() in src/llmq/signing_shares.h
  • Confirmed shareman is a unique_ptr<CSigSharesManager> in ActiveContext
  • Stop() unregisters in reverse order of Start() registration (LIFO)

Closes #7243

@thepastaclaw
Copy link
Copy Markdown
Author

@coderabbitai review

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 23, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 23, 2026

✅ No Merge Conflicts Detected

This PR currently has no conflicts with other open PRs.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 23, 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: 71cd3157-276e-4a1a-b724-24f1b038cfb3

📥 Commits

Reviewing files that changed from the base of the PR and between 06110b9 and 5506d0a.

📒 Files selected for processing (1)
  • src/active/context.cpp
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/active/context.cpp

Walkthrough

ActiveContext::Start() registers the recovery interface for shareman after registering recovery interfaces for cl_signer and is_signer. Correspondingly, ActiveContext::Stop() unregisters the recovery interface for shareman before unregistering recovery interfaces from is_signer and cl_signer. Two lines of code were added to support this sequential registration and unregistration pattern.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

🚥 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 accurately summarizes the main change: registering the shareman recovery interface in ActiveContext, which is the primary objective of this pull request.
Description check ✅ Passed The description is well-detailed and directly related to the changeset, explaining the problem, root cause, fix, and validation performed.
Linked Issues check ✅ Passed The changes fully meet the requirements from issue #7243: registering shareman recovery interface in Start() and unregistering in Stop() with proper LIFO order maintained.
Out of Scope Changes check ✅ Passed All changes are directly in scope—only two lines added to register/unregister shareman's recovery interface in the specified methods, with no extraneous modifications.

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

✨ 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 and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
coverage-report-summary.md (1)

123-125: Use portable paths in reproduction instructions.

Line 124 hardcodes a local path (~/Projects/dash/worktrees/coverage), which won’t work for most contributors. Prefer a placeholder or repo-relative instruction.

Suggested doc tweak
- cd ~/Projects/dash/worktrees/coverage
+ # From your local Dash checkout/worktree:
+ cd <path-to-dash-worktree>/worktrees/coverage
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@coverage-report-summary.md` around lines 123 - 125, Replace the hardcoded
local path string "~/Projects/dash/worktrees/coverage" in
coverage-report-summary.md with a portable, repo-relative instruction; e.g.,
tell readers to change to the repository root and then to the worktrees/coverage
directory or use a placeholder like "<repo-root>/worktrees/coverage" so
contributors can reproduce the steps on any machine.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@coverage-report-summary.md`:
- Around line 123-125: Replace the hardcoded local path string
"~/Projects/dash/worktrees/coverage" in coverage-report-summary.md with a
portable, repo-relative instruction; e.g., tell readers to change to the
repository root and then to the worktrees/coverage directory or use a
placeholder like "<repo-root>/worktrees/coverage" so contributors can reproduce
the steps on any machine.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 4ba6a3e5-c7ad-4c03-a0fc-062383124ddb

📥 Commits

Reviewing files that changed from the base of the PR and between 65366a4 and 06110b9.

📒 Files selected for processing (2)
  • coverage-report-summary.md
  • src/active/context.cpp

Copy link
Copy Markdown
Author

@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 2-line wiring fix that correctly adds the missing RegisterRecoveryInterface()/UnregisterRecoveryInterface() calls for shareman in ActiveContext::Start()/Stop(). The fix matches the existing cl_signer/is_signer pattern and Stop() ordering is correctly reversed (LIFO). Both Claude and Codex confirmed the fix is correct with no blocking issues.

Reviewed commit: 06110b9

💬 1 nitpick(s)

cl_signer->Start();
cl_signer->RegisterRecoveryInterface();
is_signer->RegisterRecoveryInterface();
shareman->RegisterRecoveryInterface();
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

💬 Nitpick: Registration inconsistency: external wiring vs self-contained constructor

CEHFSignalsHandler self-registers as a CRecoveredSigsListener in its constructor (ehf_signals.cpp:28) and unregisters in its destructor (ehf_signals.cpp:33), making it impossible to forget. In contrast, shareman, cl_signer, and is_signer rely on ActiveContext::Start()/Stop() to call RegisterRecoveryInterface() externally — which is exactly how this bug was introduced. Moving registration into each object's constructor/destructor (or its own Start()/Stop()) would prevent this class of bug. Not blocking for this PR.

source: ['claude']

Add missing shareman->RegisterRecoveryInterface() call in
ActiveContext::Start() and corresponding UnregisterRecoveryInterface()
in Stop().

Without this, completed sig share sessions are only cleaned up via the
5-second Cleanup() interval instead of promptly via
HandleNewRecoveredSig. Under CI load with frozen mocktime, this
manifests as flaky test failures in feature_llmq_signing.py and
interface_zmq_dash.py.

The registration was likely dropped during the sig share refactoring
that split share management into a separate shareman object.

Closes dashpay#7243
@thepastaclaw thepastaclaw force-pushed the fix-shareman-recovery branch from 06110b9 to 5506d0a Compare March 24, 2026 13:39
@PastaPastaPasta PastaPastaPasta marked this pull request as ready for review March 24, 2026 14:34
@PastaPastaPasta PastaPastaPasta requested a review from knst March 24, 2026 14:34
Copy link
Copy Markdown

@UdjinM6 UdjinM6 left a comment

Choose a reason for hiding this comment

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

utACK 5506d0a

Copy link
Copy Markdown
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 5506d0a

@PastaPastaPasta PastaPastaPasta merged commit 3863c88 into dashpay:develop Mar 25, 2026
44 of 46 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.

fix: missing shareman->RegisterRecoveryInterface() in ActiveContext::Start

4 participants