Skip to content

Conversation

@UdjinM6
Copy link

@UdjinM6 UdjinM6 commented Nov 4, 2025

Issue being fixed or feature implemented

The issue was introduced via 392b51b

What was done?

How Has This Been Tested?

Breaking Changes

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)

@UdjinM6 UdjinM6 added this to the 23.1 milestone Nov 4, 2025
@github-actions
Copy link

github-actions bot commented Nov 4, 2025

✅ No Merge Conflicts Detected

This PR currently has no conflicts with other open PRs.

@coderabbitai
Copy link

coderabbitai bot commented Nov 4, 2025

Walkthrough

A conditional logic change was made in the CheckDecryptionKey function within the scriptpubkey manager. The condition that controls whether the HD chain seed is decrypted was inverted: previously, seed decryption occurred when the chain existed and was not encrypted; now it occurs when the chain exists and is encrypted. This alters the execution path to skip decryption for plaintext HD chains and perform decryption exclusively for encrypted chains.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

  • Key consideration: The inversion of the encryption condition check requires careful verification that this is intentional and aligns with the intended wallet decryption behavior.
  • Context needed: Understanding why the logic was inverted and confirming there are no unintended side effects on wallet initialization or decryption flows for both encrypted and unencrypted key chains.

Pre-merge checks and finishing touches

✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies a logic error fix in the CheckDecryptionKey function, which directly corresponds to the main change described in the raw summary.
Description check ✅ Passed The description references the specific commit that introduced the issue and mentions the function being fixed, demonstrating relevance to the changeset despite incomplete template sections.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 9b1b2c6 and d89646d.

📒 Files selected for processing (1)
  • src/wallet/scriptpubkeyman.cpp (1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
src/**/*.{cpp,h,cc,cxx,hpp}

📄 CodeRabbit inference engine (CLAUDE.md)

src/**/*.{cpp,h,cc,cxx,hpp}: Dash Core C++ codebase must be written in C++20 and require at least Clang 16 or GCC 11.1
Dash uses unordered_lru_cache for efficient caching with LRU eviction

Files:

  • src/wallet/scriptpubkeyman.cpp
🧠 Learnings (1)
📓 Common learnings
Learnt from: kwvg
Repo: dashpay/dash PR: 6761
File: src/chainlock/signing.cpp:247-250
Timestamp: 2025-07-29T14:32:48.369Z
Learning: In PR #6761, kwvg acknowledged a null pointer check issue in ChainLockSigner::Cleanup() method but deferred it to follow-up, consistent with the pattern of avoiding scope creep in refactoring PRs.
Learnt from: knst
Repo: dashpay/dash PR: 6805
File: src/wallet/rpc/wallet.cpp:357-357
Timestamp: 2025-08-08T07:01:47.332Z
Learning: In src/wallet/rpc/wallet.cpp, the upgradetohd RPC now returns a UniValue string message (RPCResult::Type::STR) instead of a boolean, including guidance about mnemonic backup and null-character passphrase handling; functional tests have been updated to assert returned strings in several cases.
⏰ 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)
  • GitHub Check: mac-build / Build source
  • GitHub Check: arm-linux-build / Build source
  • GitHub Check: win64-build / Build source
  • GitHub Check: linux64_sqlite-build / Build source
  • GitHub Check: linux64-build / Build source
  • GitHub Check: linux64_fuzz-build / Build source
  • GitHub Check: linux64_ubsan-build / Build source
  • GitHub Check: linux64_tsan-build / Build source
  • GitHub Check: linux64_nowallet-build / Build source
  • GitHub Check: Lint / Run linters
🔇 Additional comments (1)
src/wallet/scriptpubkeyman.cpp (1)

225-231: Critical logic fix correctly applied.

This fix properly inverts the condition to decrypt only when the HD chain is encrypted. The previous logic would have attempted to decrypt plaintext chains (causing failure at line 550-551 in DecryptHDChain) and skipped decryption verification for encrypted chains, defeating the purpose of CheckDecryptionKey.


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
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 d89646d

Copy link
Collaborator

@knst knst left a comment

Choose a reason for hiding this comment

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

utACK d89646d

@DashCoreAutoGuix
Copy link

Guix Automation has began to build this PR tagged as v23.0.0-devpr6938.d89646d5. A new comment will be made when the image is pushed.

@DashCoreAutoGuix
Copy link

Guix Automation has completed; a release should be present here: https://github.com/dashpay/dash-dev-branches/releases/tag/v23.0.0-devpr6938.d89646d5. The image should be on dockerhub soon.

@knst
Copy link
Collaborator

knst commented Nov 5, 2025

so far as #6932 is already merged; consider updating release notes here

@UdjinM6 UdjinM6 modified the milestones: 23.1, 23 Nov 7, 2025
@PastaPastaPasta PastaPastaPasta merged commit c781298 into dashpay:develop Nov 7, 2025
57 of 60 checks passed
PastaPastaPasta added a commit to PastaPastaPasta/dash that referenced this pull request Nov 7, 2025
d89646d fix: logic error in `CheckDecryptionKey` (UdjinM6)

Pull request description:

  ## Issue being fixed or feature implemented
  The issue was introduced via dashpay@392b51b

  ## What was done?

  ## How Has This Been Tested?

  ## Breaking Changes

  ## 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 d89646d
  knst:
    utACK d89646d

Tree-SHA512: 31419798b3c05bb3c4c30cf02b819c899e0d0e0048775d907099c6507afaf189d12eeb8ec33232801e1874fe9c156558e7936a43f34cce1409ca273c3bc1919c
PastaPastaPasta added a commit that referenced this pull request Nov 8, 2025
6fd7059 chore: mark v23 as release (pasta)
ae08f53 docs: integrate 6946 release notes into final (pasta)
74a222d Merge #6946: feat: show seed on wallet creation (pasta)
877343a Merge #6943: fix: don't treat arrays/objects as string literals for composite methods (pasta)
00368fb Merge #6940: fix: reuse best clsig to avoid potential race condition (pasta)
8eceb98 Merge #6938: fix: logic error in `CheckDecryptionKey` (pasta)
3f30664 Merge #6929: fix: repair `makeseeds.py`, `getblockchaininfo[softforks]` help text, drop extra `generate`s from test, resolve macOS GID issue (pasta)
7ba4f1c Merge #6928: docs: update man pages for 23.0 (pasta)
a6c1d6a Merge #6920: chore: update minimum chain work, tx stats, checkpoints, seeds and SECURITY.md for v23 (pasta)
84df1f0 Merge #6909: chore: Translations 2025-10 (pasta)
a6449b1 Merge #6885: fix: improve governance/proposal dialog strings (pasta)

Pull request description:

  ## Issue being fixed or feature implemented
  See commits

  ## Checklist:
    _Go over all the following points, and put an `x` in all the boxes that apply._
  - [ ] 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
  - [x] I have assigned this pull request to a milestone _(for repository code-owners and collaborators only)_

ACKs for top commit:
  UdjinM6:
    utACK 6fd7059

Tree-SHA512: a0d93a61a4f4978fbe120bea832ce683a8ae7c16c892a381d91ddc4b25344c0f3ad3306a1a30a166a7dfa6e38e4532708587cc23cc372126828b8e22d141dc85
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants