-
Notifications
You must be signed in to change notification settings - Fork 1.2k
fix: only activate BIP44 descriptors for external signers #7076
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Conversation
When creating a wallet with an external signer (hardware wallet), the
mock signer returns multiple descriptors (BIP44, BIP49, BIP84) for both
receive and internal categories. Previously, all valid descriptors were
being activated by calling AddActiveScriptPubKeyMan() for each one.
This caused a database key collision since multiple descriptors tried to
write to the same key (ACTIVEEXTERNALSPK or ACTIVEINTERNALSPK), resulting
in non-deterministic behavior where sometimes BIP44 would be active and
sometimes BIP84, depending on database flush timing.
The fix follows the pattern from the non-external-signer branch which
stores multiple descriptors but only activates certain types (External
and Internal, but not CoinJoin). Now we:
- Store ALL descriptors returned by the signer in m_spk_managers
- Only activate descriptors matching the BIP44 path pattern /44'/{cointype}'
This ensures deterministic behavior and fixes the intermittent test
failure in wallet_signer.py where the test expected m/44' but sometimes
got m/84'.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
✅ No Merge Conflicts DetectedThis PR currently has no conflicts with other open PRs. |
WalkthroughIn the Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Areas requiring attention:
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: Repository UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🧰 Additional context used📓 Path-based instructions (2)src/**/*.{cpp,h,hpp,cc}📄 CodeRabbit inference engine (CLAUDE.md)
Files:
src/wallet/**/*.{cpp,h}📄 CodeRabbit inference engine (CLAUDE.md)
Files:
🧠 Learnings (2)📓 Common learnings📚 Learning: 2025-09-02T07:34:28.226ZApplied to files:
🧬 Code graph analysis (1)src/wallet/wallet.cpp (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (10)
🔇 Additional comments (1)
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 |
Issue being fixed or feature implemented
When creating a wallet with an external signer (hardware wallet), the mock signer returns multiple descriptors (BIP44, BIP49, BIP84) for both receive and internal categories. Previously, all valid descriptors were being activated by calling AddActiveScriptPubKeyMan() for each one.
This caused a database key collision since multiple descriptors tried to write to the same key (ACTIVEEXTERNALSPK or ACTIVEINTERNALSPK), resulting in non-deterministic behavior where sometimes BIP44 would be active and sometimes BIP84, depending on database flush timing.
What was done?
The fix follows the pattern from the non-external-signer branch which stores multiple descriptors but only activates certain types (External and Internal, but not CoinJoin). Now we:
This ensures deterministic behavior and fixes the intermittent test failure in wallet_signer.py where the test expected m/44' but sometimes got m/84'.
Should fix intermittent test failures like https://github.com/dashpay/dash/actions/runs/20364286460/job/58521843159#step:6:1662
How Has This Been Tested?
Run
wallet_signer.pymultiple timesBreaking Changes
n/a
Checklist: