rpc: preserve global xpubs and proprietary fields in joinpsbts #35516

pull thomasbuilds wants to merge 2 commits into bitcoin:master from thomasbuilds:fix-joinpsbts-drop-globals changing 2 files +27 −20
  1. thomasbuilds commented at 7:12 PM on June 11, 2026: contributor

    joinpsbts collects the global xpubs of all the joined PSBTs into merged_psbt, but returns a separately constructed shuffled_psbt into which only the inputs, outputs, and unknown fields are copied. The collected PSBT_GLOBAL_XPUB records are silently dropped, and PSBT_GLOBAL_PROPRIETARY records are not collected at all.

    The xpub collection was added in #17034, which was written against a joinpsbts that still returned merged_psbt, but was merged after #16512 had introduced the shuffled_psbt rebuild, so the collected xpubs have never reached the result.

    Shuffle the inputs and outputs of merged_psbt in place instead of rebuilding a new PSBT, so that all global data is preserved, and union the global proprietary records in the merge loop, matching the combinepsbt behavior from #34893.

  2. rpc: preserve global xpubs and proprietary fields in joinpsbts
    joinpsbts collects the global xpubs of all the joined PSBTs into
    merged_psbt, but returns a separately constructed shuffled_psbt into
    which only the inputs, outputs, and unknown fields are copied. The
    collected PSBT_GLOBAL_XPUB records are silently dropped, and
    PSBT_GLOBAL_PROPRIETARY records are not collected at all.
    
    The xpub collection was added in #17034, which was written against a
    joinpsbts that still returned merged_psbt, but was merged after #16512
    had introduced the shuffled_psbt rebuild, so the collected xpubs have
    never reached the result.
    
    Shuffle the inputs and outputs of merged_psbt in place instead of
    rebuilding a new PSBT, so that all global data is preserved, and union
    the global proprietary records in the merge loop, matching the
    combinepsbt behavior from #34893.
    31f23167b3
  3. test: check joinpsbts preserves global xpubs and proprietary fields faa2500a88
  4. DrahtBot added the label RPC/REST/ZMQ on Jun 11, 2026
  5. DrahtBot commented at 7:12 PM on June 11, 2026: contributor

    <!--e57a25ab6845829454e8d69fc972939a-->

    The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

    <!--006a51241073e994b41acfe9ec718e94-->

    Code Coverage & Benchmarks

    For details see: https://corecheck.dev/bitcoin/bitcoin/pulls/35516.

    <!--021abf342d371248e50ceaed478a90ca-->

    Reviews

    See the guideline for information on the review process.

    Type Reviewers
    ACK g-maxxx
    Concept ACK achow101

    If your review is incorrectly listed, please copy-paste <code>&lt;!--meta-tag:bot-skip--&gt;</code> into the comment that the bot should ignore.

    <!--174a7506f384e20aa4161008e828411d-->

    Conflicts

    No conflicts as of last run.

    <!--5faf32d7da4f0f540f40219e4f7537a3-->

  6. fanquake commented at 12:35 PM on June 12, 2026: member
  7. achow101 commented at 9:49 PM on June 12, 2026: member

    Concept ACK

  8. g-maxxx commented at 7:15 PM on July 4, 2026: none

    ACK faa2500

  9. DrahtBot requested review from achow101 on Jul 4, 2026
  10. thomasbuilds commented at 7:57 PM on July 6, 2026: contributor

    #35665 should land first. Merged alone, this PR would make the duplicate global xpub issue fixed there reachable through joinpsbts: the xpubs are still merged origin-by-origin, so joining PSBTs that provide different origins for the same xpub would serialize duplicate PSBT_GLOBAL_XPUB keys that no RPC can parse. I will rebase on top once it's in.


github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-07-07 07:51 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me