Skip to content

backport: Merge bitcoin#29144, 28946, 28980, 28554, 28414#7354

Open
vijaydasmp wants to merge 5 commits into
dashpay:developfrom
vijaydasmp:June_2026_1
Open

backport: Merge bitcoin#29144, 28946, 28980, 28554, 28414#7354
vijaydasmp wants to merge 5 commits into
dashpay:developfrom
vijaydasmp:June_2026_1

Conversation

@vijaydasmp

Copy link
Copy Markdown

bitcoin back ports

@github-actions

github-actions Bot commented Jun 9, 2026

Copy link
Copy Markdown

✅ No Merge Conflicts Detected

This PR currently has no conflicts with other open PRs.

@vijaydasmp vijaydasmp changed the title backport: Merge bitcoin#29144, 28946, 28980 backport: Merge bitcoin#29144, 28946, 28980, 28554, 27302, 28414 Jun 10, 2026
@vijaydasmp vijaydasmp force-pushed the June_2026_1 branch 2 times, most recently from c3073b7 to e5faf0f Compare June 13, 2026 17:43
achow101 added 4 commits June 14, 2026 06:14
e901404 settings: add auto-generated warning msg for editing the file manually (furszy)
966f5de init: improve corrupted/empty settings file error msg (furszy)

Pull request description:

  Small and simple issue reported [here](https://community.umbrel.com/t/bitcoin-docker-container-keeps-restarting/2144).

  Improving a confusing situation reported by users who did not understand why a
  settings parsing error occurred when the file was empty and did not know how to solve it.

  Empty setting file could be due (1) corruption or (2) an user manually cleaning up the file content.
  In both scenarios, the 'Unable to parse settings file' error does not help the user move forward.

ACKs for top commit:
  achow101:
    ACK e901404
  hebasto:
    re-ACK e901404.
  ryanofsky:
    Code review ACK e901404. Just whitespace formatting changes and shortening a test string literal since last review
  shaavan:
    Code review ACK e901404

Tree-SHA512: 2910654c6b9e9112de391eedb8e46980280f822fa3059724dd278db7436804dd27fae628d2003f2c6ac1599b07ac5c589af016be693486e949f558515e662bec
8f6ab31 init: don't delete PID file if it was not generated (willcl-ark)

Pull request description:

  In a similar vein to bitcoin#28784, if a second `bitcoind` is started using the same datadir it will fail to start up, but during shutdown remove the PID file from the first `bitcoind` instance.

ACKs for top commit:
  achow101:
    ACK 8f6ab31
  andrewtoth:
    ACK 8f6ab31
  romanz:
    ACK bitcoin@8f6ab31

Tree-SHA512: c9af703cbfa179d33ef9580a51e86c1b0acbd28daa18c8d2e5e5ff796ab4d3e2009a962a47e6046a0e5ece936f8a06ee8af5fdf8ff4ae1e52cbcdbec4b942271
…n and backup requirement

ca09415 rpc, doc: encryptwallet, mention HD seed rotation and new backup (furszy)

Pull request description:

  Small and simple PR, updating the `encryptwallet` help message.

  Better to notify users about the HD seed rotation and the new
  backup requirement before executing the encryption process.
  Ensuring they are prepared to update previous backups and
  securely safeguard the updated wallet file.

ACKs for top commit:
  S3RK:
    ACK ca09415
  achow101:
    ACK ca09415

Tree-SHA512: f0ee65f5cea66450566e3a85e066d4c06b3293dd0e0b2ed5fafdb7fb11da0a2cd94407299a3c57a0706c2ed782f8eabb73443e85d8099a62a3fb10a02636ab46
…s passed to getnetworkhashps RPC

9ac114e Throw error if invalid parameters passed to getnetworkhashps RPC endpoint (Jameson Lopp)

Pull request description:

  When writing some scripts that iterated over many blocks to generate hashrate estimates I realized that my script was going out of range of the current chain tip height but was not encountering any errors.

  I believe that passing an invalid block height to this function but receiving the hashrate estimate for the chain tip instead should be considered unexpected behavior.

ACKs for top commit:
  Sjors:
    re-utACK 9ac114e
  kevkevinpal:
    reACK [9ac114e](bitcoin@9ac114e)
  achow101:
    ACK 9ac114e

Tree-SHA512: eefb465c2dd654fc48267f444e1809597ec5363cdd131ea9ec812458fed1e4bffbbbb0617d74687c9f7bb16274b598d8292f5eeb7953421e5d2a8dc2cc081f2b
@vijaydasmp vijaydasmp force-pushed the June_2026_1 branch 3 times, most recently from f6efcb6 to fd42f3d Compare June 14, 2026 03:15
…sspsbt if complete

2e249b9 doc: add release note for PR bitcoin#28414 (Matthew Zipkin)
4614332 test: remove unnecessary finalizepsbt rpc calls (ismaelsadeeq)
e3d484b wallet rpc: return final tx hex from walletprocesspsbt if complete (Matthew Zipkin)

Pull request description:

  See bitcoin#28363 (comment)

  `walletprocesspsbt` currently returns a base64-encoded PSBT and a boolean indicating if the tx is "complete". If it is complete, the base64 PSBT can be finalized with `finalizepsbt` which returns the hex-encoded transaction suitable for `sendrawtransaction`.

  With this patch, `walletprocesspsbt` return object will ALSO include the broadcast-able hex string if the tx is already final. This saves users the extra step of calling `finalizepsbt` assuming they have already inspected and approve the transaction from earlier steps.

ACKs for top commit:
  ismaelsadeeq:
    re ACK 2e249b9
  BrandonOdiwuor:
    re ACK 2e249b9
  Randy808:
    Tested ACK 2e249b9
  achow101:
    ACK 2e249b9
  ishaanam:
    ACK 2e249b9

Tree-SHA512: 229c1103265a9b4248f080935a7ad5607c3be3f9a096a9ab6554093b2cd8aa8b4d1fa55b1b97d3925ba208dbc3ccba4e4d37c40e1491db0d27ba3d9fe98f931e
@vijaydasmp vijaydasmp marked this pull request as ready for review June 14, 2026 15:29

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: baf55e1735

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +225 to +227
"For security reasons, the encryption process will generate a new HD seed, resulting\n"
"in the creation of a fresh set of active descriptors. Therefore, it is crucial to\n"
"securely back up the newly generated wallet file using the backupwallet RPC.\n",

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Remove the false HD seed-rotation warning

For every nonblank HD wallet, this help text claims encryption generates a new seed and descriptors, but CWallet::EncryptWallet() explicitly keeps the existing seed and mnemonic for descriptor wallets and only tops up legacy HD wallets (src/wallet/wallet.cpp:872-883). This can mislead users about which backup material controls their funds; document Dash's actual behavior instead of the Bitcoin Core seed-rotation behavior.

Useful? React with 👍 / 👎.

Comment thread src/util/settings.cpp
Comment on lines +133 to +136
if (!values.contains("_warning_")) {
out.pushKV("_warning_", strprintf("This file is automatically generated and updated by %s. Please do not edit this file while the node "
"is running, as any changes might be ignored or overwritten.",
PACKAGE_NAME));

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Keep the warning field out of runtime settings

After the first settings write, the next startup reads _warning_ into m_settings.rw_settings because ReadSettings() imports every JSON key. ArgsManager::ReadSettingsFile() then treats it as an unknown setting and logs Ignoring unknown rw_settings value _warning_, followed by logging it as a setting, on every normal startup. Filter this metadata key while reading (or before settings validation) so the generated warning is not interpreted as configuration.

Useful? React with 👍 / 👎.

@coderabbitai

coderabbitai Bot commented Jun 14, 2026

Copy link
Copy Markdown

Review Change Stack

Walkthrough

This PR merges four independent improvements. walletprocesspsbt now includes an optional hex field in its response when the PSBT is complete, containing the serialized raw transaction for direct use with sendrawtransaction; all related functional tests are updated to consume this field instead of calling finalizepsbt separately. WriteSettings now conditionally inserts a _warning_ auto-generated file notice into settings.json, and ReadSettings emits a more specific corruption/crash-oriented error message on JSON parse failure. In src/init.cpp, a g_generated_pid flag ensures the PID file is removed only by the process that created it, replacing an inlined try/catch with a RemovePidFile helper. GetNetworkHashPS tightens parameter validation to reject 0 and out-of-range values for lookup and height. Additionally, encryptwallet gains stronger backup and HD seed regeneration warnings.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • dashpay/dash#7256: Modifies the same getnetworkhashps function in src/rpc/mining.cpp, specifically around nblocks/height parameter handling.

Suggested reviewers

  • PastaPastaPasta
  • knst
  • UdjinM6
  • thepastaclaw
🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 18.18% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Description check ❓ Inconclusive The description 'bitcoin back ports' is vague and provides minimal context about what is being backported, despite the PR involving substantial changes across multiple components. Expand the description to briefly summarize the key changes (e.g., settings file handling, PID file management, PSBT processing) or reference the specific Bitcoin PR numbers.
✅ Passed checks (3 passed)
Check name Status Explanation
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.
Title check ✅ Passed The title accurately summarizes the main change: this PR backports six Bitcoin Core PRs to the Dash repository, which is the primary purpose of the changeset.

✏️ 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.

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/wallet/rpc/encrypt.cpp`:
- Around line 223-227: The help text in the encryptwallet RPC command (around
lines 223-227) claims encryption always generates a fresh HD seed and
descriptors, but the actual returned message (around lines 270-273)
distinguishes between HD-enabled and non-HD wallets with different backup
guidance. Update the help text to conditionally describe the backup behavior
based on wallet type: for HD-enabled wallets, mention the fresh HD
seed/descriptors generation and backupwallet requirement; for non-HD wallets,
provide the appropriate alternative guidance. This aligns the help documentation
with the actual runtime behavior and prevents conflicting instructions to users.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: ae84c2f5-b22f-4a95-95bc-2abe0a3435e6

📥 Commits

Reviewing files that changed from the base of the PR and between 7fcc54a and baf55e1.

📒 Files selected for processing (16)
  • doc/release-notes-28414.md
  • src/init.cpp
  • src/qt/test/optiontests.cpp
  • src/rpc/mining.cpp
  • src/test/settings_tests.cpp
  • src/util/settings.cpp
  • src/wallet/rpc/encrypt.cpp
  • src/wallet/rpc/spend.cpp
  • test/functional/feature_filelock.py
  • test/functional/feature_settings.py
  • test/functional/rpc_blockchain.py
  • test/functional/rpc_psbt.py
  • test/functional/wallet_fundrawtransaction.py
  • test/functional/wallet_multisig_descriptor_psbt.py
  • test/functional/wallet_send.py
  • test/functional/wallet_signer.py

Comment on lines +223 to +227
"If the wallet is already encrypted, use the walletpassphrasechange call.\n"
"** IMPORTANT **\n"
"For security reasons, the encryption process will generate a new HD seed, resulting\n"
"in the creation of a fresh set of active descriptors. Therefore, it is crucial to\n"
"securely back up the newly generated wallet file using the backupwallet RPC.\n",

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Keep the backup guidance consistent with the actual wallet state.

The new help text says encryption always generates a fresh HD seed/descriptors, but the returned message still distinguishes HD-enabled wallets from non-HD wallets, and the provided GUI/docs snippets show those cases need different backup guidance. As written, users can get conflicting instructions about whether to preserve seed-based backups or make a new backupwallet backup.

Based on the provided GUI/docs snippets, the RPC text should match the same HD/non-HD behavior.

🛠 Suggested wording adjustment
-                "For security reasons, the encryption process will generate a new HD seed, resulting\n"
-                "in the creation of a fresh set of active descriptors. Therefore, it is crucial to\n"
-                "securely back up the newly generated wallet file using the backupwallet RPC.\n",
+                "For security reasons, encrypting the wallet changes the backup procedure.\n"
+                "If the wallet is HD-enabled, preserve the existing seed-based backup guidance; otherwise,\n"
+                "create a new backup with the backupwallet RPC.\n",
...
-        return "wallet encrypted; The keypool has been flushed. You need to make a new backup with the backupwallet RPC.";
+        return "wallet encrypted; The keypool has been flushed. Make sure you create a new backup with the backupwallet RPC.";

Also applies to: 270-273

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/wallet/rpc/encrypt.cpp` around lines 223 - 227, The help text in the
encryptwallet RPC command (around lines 223-227) claims encryption always
generates a fresh HD seed and descriptors, but the actual returned message
(around lines 270-273) distinguishes between HD-enabled and non-HD wallets with
different backup guidance. Update the help text to conditionally describe the
backup behavior based on wallet type: for HD-enabled wallets, mention the fresh
HD seed/descriptors generation and backupwallet requirement; for non-HD wallets,
provide the appropriate alternative guidance. This aligns the help documentation
with the actual runtime behavior and prevents conflicting instructions to users.

@thepastaclaw

thepastaclaw commented Jun 14, 2026

Copy link
Copy Markdown

✅ Review complete (commit baf55e1)

@vijaydasmp vijaydasmp changed the title backport: Merge bitcoin#29144, 28946, 28980, 28554, 27302, 28414 backport: Merge bitcoin#29144, 28946, 28980, 28554, 28414 Jun 14, 2026

@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.

Code Review

Backport PR cherry-picking five small Bitcoin Core PRs (29144, 28946, 28980, 28554, 28414). All five adapt cleanly to Dash with appropriate symbol/branding substitutions, tests updated correctly, and no consensus-affecting changes. No blocking issues. One nitpick on PR title scope mismatch. Most agent findings critique upstream design choices on a backport, which is out of scope per the backport review process.

💬 1 nitpick(s)

@@ -0,0 +1,5 @@
RPC Wallet

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💬 Nitpick: PR title references bitcoin#27302 but no corresponding cherry-pick is present

The PR title lists six PR numbers (29144, 28946, 28980, 28554, 27302, 28414) but the PR range only contains merge commits for five (29144, 28946, 28980, 28554, 28414). bitcoin#27302 does not appear to be cherry-picked in this branch. Either correct the title to remove 27302, or add the missing cherry-pick if it was intended to be part of this batch.

source: ['claude']

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.

3 participants