Skip to content

backport: Merge bitcoin#28587, 28056, 27905#7356

Open
vijaydasmp wants to merge 3 commits into
dashpay:developfrom
vijaydasmp:June_2026_2
Open

backport: Merge bitcoin#28587, 28056, 27905#7356
vijaydasmp wants to merge 3 commits into
dashpay:developfrom
vijaydasmp:June_2026_2

Conversation

@vijaydasmp

Copy link
Copy Markdown

Bitcoin back ports

@github-actions

github-actions Bot commented Jun 11, 2026

Copy link
Copy Markdown

⚠️ Potential Merge Conflicts Detected

This PR has potential conflicts with the following open PRs:

Please coordinate with the authors of these PRs to avoid merge conflicts.

c1e6c54 descriptors: disallow hybrid public keys (Pieter Wuille)

Pull request description:

  Fixes bitcoin#28511

  The descriptor documentation (`doc/descriptors.md`) and [BIP380](https://github.com/bitcoin/bips/blob/master/bip-0380.mediawiki) explicitly require that hex-encoded public keys start with 02 or 03 (compressed) or 04 (uncompressed). However, the current parsing/inference code permit 06 and 07 (hybrid) encoding as well. Fix this.

ACKs for top commit:
  darosior:
    ACK c1e6c54
  achow101:
    ACK c1e6c54

Tree-SHA512: 23b674fb420619b2536d12da10008bb87cf7bc0333ec59e618c0d02c3574b468cc71248475ece37f76658d743ef51e68566948e903bca79fda5f7d75416fea4d
@vijaydasmp vijaydasmp force-pushed the June_2026_2 branch 3 times, most recently from eb78da1 to d833080 Compare June 14, 2026 03:56
fanquake added 2 commits June 14, 2026 23:01
…o `template_request`

f6a2619 Added `longpollid` and `data` params to `template_request` bitcoin#27998 (Rhythm Garg)

Pull request description:

  This PR will add the optional parameters `longpollid` and `data` to `template_request` as they were missing when calling `help getblocktemplate` in RPCHelpMan.

  I request the maintainers to review this and let me know about any mistakes in the descriptions of the parameters.

  This PR refers to the issue bitcoin#27998

ACKs for top commit:
  ItIsOHM:
    > tACK [f6a2619](bitcoin@f6a2619)
  russeree:
    tACK bitcoin@f6a2619
  stickies-v:
    tACK f6a2619

Tree-SHA512: 6c592db59cb11b2d031ce5265c547fa296266278f6c25f96afe18a420e0d547f4d483e0f66de75d52c0c319ac1585f3558b9f70c12ef208c96ec96a51f786c6a
…ndex

e639364 validation: add missing insert to m_dirty_blockindex (Martin Zumsande)

Pull request description:

  When the status of a block index is changed, we must add it to `m_dirty_blockindex` or the change might not get persisted to disk.
  This is missing from one spot in `FindMostWorkChain()`, where `BLOCK_FAILED_CHILD` is set.
  Since we have [code](https://github.com/bitcoin/bitcoin/blob/f0758d8a6696657269d9c057e7aa079ffa9e1c16/src/node/blockstorage.cpp#L284-L287) that later sets missing `BLOCK_FAILED_CHILD` during the next startup, I don't think that this can lead to bad block indexes in practice, but I still think it's worth fixing.

ACKs for top commit:
  TheCharlatan:
    ACK e639364
  stickies-v:
    ACK e639364

Tree-SHA512: a97af9c173e31b90b677a1f95de822e08078d78013de5fa5fe4c3bec06f45d6e1823b7694cdacb887d031329e4b4afc6a2003916e0ae131279dee71f43e1f478
@vijaydasmp vijaydasmp changed the title backport: Merge bitcoin#28587, 25634, 28056, 27866, 27905, backport: Merge bitcoin#28587, 28056, 27905 Jun 14, 2026
@vijaydasmp vijaydasmp marked this pull request as ready for review June 14, 2026 19:02
@thepastaclaw

thepastaclaw commented Jun 14, 2026

Copy link
Copy Markdown

✅ Review complete (commit 7e8d383)

@coderabbitai

coderabbitai Bot commented Jun 14, 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

Run ID: 10e8eb39-70ab-4f93-aeaf-ade56b38aaf6

📥 Commits

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

📒 Files selected for processing (5)
  • src/pubkey.h
  • src/rpc/mining.cpp
  • src/script/descriptor.cpp
  • src/test/descriptor_tests.cpp
  • src/validation.cpp

Walkthrough

The PR makes three independent changes. First, CPubKey gains a new IsValidNonHybrid() const noexcept method that returns true only when the key's header byte is 0x02, 0x03, or 0x04, excluding hybrid keys (0x06/0x07). This method is then wired into descriptor.cpp: ParsePubkeyInner uses it to reject hybrid hex pubkeys with an explicit error, and InferScript switches its TxoutType::PUBKEY acceptance check from IsValid() to IsValidNonHybrid(). Three new CheckUnparsable test cases cover combo, pk, and pkh descriptors with hybrid key payloads. Separately, FindMostWorkChain in validation.cpp now inserts affected CBlockIndex* entries into m_blockman.m_dirty_blockindex when marking them BLOCK_FAILED_CHILD or BLOCK_CONFLICT_CHAINLOCK, closing a missing dirty-tracking gap. A minor getblocktemplate RPC help text update adds longpollid and data parameter descriptions.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Suggested reviewers

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

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% 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 extremely vague and generic, conveying minimal information about what changes are being made or why they matter. Expand the description to briefly outline the three main changes: descriptor validation updates, RPC documentation additions, and block validation fixes.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies this as a backport of three specific Bitcoin Core commits (28587, 28056, 27905), which matches the actual changeset that implements three distinct improvements across multiple files.
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.

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

@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

Three-PR backport (bitcoin#28587, bitcoin#28056, bitcoin#27905) from Bitcoin Core. All agents converged that the merge resolutions and Dash-specific adaptations are correct, including the extension of dirty-blockindex insertion to Dash's BLOCK_CONFLICT_CHAINLOCK branch. Codex's two backport-prereq suggestions are informational notes that the dedicated backport-reviewer specialist already considered and classified as correct Dash adaptations rather than missing prerequisites, so they are dropped per the review skill's backport guidance.

@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

Re-reviewed the Bitcoin Core backport chain for prerequisite completeness. bitcoin#28587 is not prerequisite-complete on Dash: upstream modifies Miniscript descriptor key parsing added by bitcoin#24148, but Dash does not have that prerequisite, so this backport is too early rather than merely Dash-adapted. bitcoin#28056 and bitcoin#27905 still look clean/adapted, but bitcoin#28587 should not land before the missing descriptor prerequisite chain is resolved.

🔴 1 blocking

🤖 Prompt for all review comments with AI agents
These findings are from an automated code review. Verify each finding against the current code and only fix it if needed.

In `src/script/descriptor.cpp`:
- [BLOCKING] src/script/descriptor.cpp:872-875: Backport bitcoin#24148 before bitcoin#28587
  bitcoin#28587 modifies three descriptor parsing paths upstream: direct hex pubkey parsing, descriptor inference, and the Miniscript descriptor `KeyParser` path. This backport only applies the first two because Dash does not yet have `struct KeyParser` / Miniscript descriptor support in `src/script/descriptor.cpp`, which was introduced upstream by bitcoin#24148. That absence is a missing prerequisite, not a Dash-specific adaptation: upstream's pre-#28587 state already contained the parser and its descriptor tests, and #28587 changes it from `pubkey.IsValid()` to `pubkey.IsValidNonHybrid()` while adding corresponding `wsh(...)`/Miniscript coverage in `src/test/descriptor_tests.cpp`. Please backport the prerequisite descriptor/Miniscript chain first, or drop bitcoin#28587 from this PR until that chain is present.

Comment thread src/script/descriptor.cpp
Comment on lines +872 to +875
if (pubkey.IsValid() && !pubkey.IsValidNonHybrid()) {
error = "Hybrid public keys are not allowed";
return nullptr;
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔴 Blocking: Backport bitcoin#24148 before bitcoin#28587

bitcoin#28587 modifies three descriptor parsing paths upstream: direct hex pubkey parsing, descriptor inference, and the Miniscript descriptor KeyParser path. This backport only applies the first two because Dash does not yet have struct KeyParser / Miniscript descriptor support in src/script/descriptor.cpp, which was introduced upstream by bitcoin#24148. That absence is a missing prerequisite, not a Dash-specific adaptation: upstream's pre-bitcoin#28587 state already contained the parser and its descriptor tests, and bitcoin#28587 changes it from pubkey.IsValid() to pubkey.IsValidNonHybrid() while adding corresponding wsh(...)/Miniscript coverage in src/test/descriptor_tests.cpp. Please backport the prerequisite descriptor/Miniscript chain first, or drop bitcoin#28587 from this PR until that chain is present.

source: ['codex']

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Resolved in this update — Backport bitcoin#24148 before bitcoin#28587 no longer present.

Auto-resolved by the review system based on the latest commit diff. If you believe this was closed in error, reopen the thread.

@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

Re-run through the automated review pipeline with the new backport-prerequisite policy gate applied. The verifier originally dropped the codex backport-prereq finding, but the deterministic policy gate restored it and converted the review to REQUEST_CHANGES because this PR advertises a full backport of bitcoin#28587 while omitting an upstream hunk that depends on bitcoin#24148.

bitcoin#28056 and bitcoin#27905 still look clean/adapted. bitcoin#28587 should not land before the missing descriptor/Miniscript prerequisite chain is resolved, or it should be dropped from this PR until that chain is present.

🔴 1 blocking

Comment thread src/script/descriptor.cpp
Comment on lines 1101 to 1104
if (txntype == TxoutType::PUBKEY) {
CPubKey pubkey(data[0]);
if (pubkey.IsValid()) {
if (pubkey.IsValidNonHybrid()) {
return std::make_unique<PKDescriptor>(InferPubkey(pubkey, ctx, provider));

@thepastaclaw thepastaclaw Jun 15, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔴 Blocking: Missing prerequisite: bitcoin#24148

bitcoin#28587 changes all descriptor public-key inference/parsing paths from accepting CPubKey::IsValid() to rejecting hybrid encodings via IsValidNonHybrid(). Upstream also changes the Miniscript descriptor KeyParser::FromPKBytes path (CPubKey pubkey(begin, end); if (pubkey.IsValidNonHybrid()) ...). Dash's starting state has no KeyParser or Miniscript descriptor tests, so the local cherry-pick only applies the non-Miniscript ParsePubkeyInner and InferScript parts.

Tracing the missing struct KeyParser section with git log bitcoin/master -S "struct KeyParser" -- src/script/descriptor.cpp points to 85b601e043 Merge bitcoin/bitcoin#24148: Miniscript support in Output Descriptors. Because this PR claims to backport bitcoin#28587 as a whole, the omitted upstream hunk is a missing prerequisite rather than a harmless Dash adaptation. Please backport the prerequisite descriptor/Miniscript chain first, or drop bitcoin#28587 from this PR until that chain is present.

source: ['codex-backport-reviewer'], promoted to blocking by backport-prereq policy gate

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.

4 participants