backport: Merge bitcoin#28587, 28056, 27905#7356
Conversation
|
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
eb78da1 to
d833080
Compare
…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
|
✅ Review complete (commit 7e8d383) |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (5)
WalkthroughThe PR makes three independent changes. First, Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Suggested reviewers
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
thepastaclaw
left a comment
There was a problem hiding this comment.
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
left a comment
There was a problem hiding this comment.
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.
| if (pubkey.IsValid() && !pubkey.IsValidNonHybrid()) { | ||
| error = "Hybrid public keys are not allowed"; | ||
| return nullptr; | ||
| } |
There was a problem hiding this comment.
🔴 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']
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
| if (txntype == TxoutType::PUBKEY) { | ||
| CPubKey pubkey(data[0]); | ||
| if (pubkey.IsValid()) { | ||
| if (pubkey.IsValidNonHybrid()) { | ||
| return std::make_unique<PKDescriptor>(InferPubkey(pubkey, ctx, provider)); |
There was a problem hiding this comment.
🔴 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
Bitcoin back ports