Skip to content

Preserve batched, parallel signing when a transaction spans P2MR descriptors #155

Closed

Description

@kiwidream

Is there an existing issue for this?
I searched open/closed work. #140/#145 concern PSBT threading and defer batching; #142/#146 concern fee-bump threading. None covers the existing transaction planner's provider boundary.

Current behaviour
At 70fea84f5becfb57463247af09790df5ddd424f8, wallet.cpp:2519 constructs a provider per manager but line 2576 passes each the full transaction. sign.cpp:928 abandons the parallel plan on a foreign unsigned input. The first provider then signs its inputs serially; later providers may batch once earlier inputs are complete.

Expected behaviour
Each provider batches the inputs it can complete, while overall completion, foreign-input errors and durable usage accounting remain correct.

Steps to reproduce
Trace the pinned provider loop and planner failure path for a transaction spanning receive/change descriptors. Static accounting for 25+25 single-signature inputs gives 25 individual reservation commits plus one batch, compared with two descriptor batches. No runtime timing was measured.

Acceptance
Through the real wallet entry point, verify batching for both descriptors, exact reserved ranges and a valid final transaction. Cover cancellation and failures before/after reservation, ensure no unreserved signing, preserve consumed counters and correct progress/error reporting. Do not require cross-manager atomic commits or identical witness bytes.

Consensus implications: None; witness validity and usage safety remain unchanged.

How did you obtain qbit? Other — source review. What version of qbit are you using? Source pin above. Operating system and version / Machine specifications: Not applicable; no runtime reproduction.

Activity

  1. added
    bug
    on Sep 15, 2026
  2. self-assigned this
    on Sep 15, 2026
  3. kiwidream commented on Sep 23, 2026

    @kiwidream
    MemberAuthor

    Fixed on 1.x.x by #163 (merge 787504bdfe). Closing by hand because merges into a non-default branch do not fire closing keywords. Acceptance at a6442d28f9:

    • Batching for both descriptors through the real wallet entry point, with exact reserved ranges and an independently verified final transaction: wallet_p2mr_parallel_signing_tests/MixedManagersUseTwoDurableBatches (one durable commit per descriptor, observed at the database boundary by descriptor id) and MixedManagersPreserveSighashContext.
    • Foreign inputs are never signed by the wrong provider and keep their errors, so a provider-local batch cannot report whole-transaction success: MixedManagersKeepForeignInputErrors, MixedManagersRecognizeSatisfiedForeignLeaf; the classification lives in src/script/sign.cpp (is_foreign_to_provider).
    • Cancellation and failure before and after each descriptor's reservation, no unreserved signing, consumed counters preserved, progress monotonic: MixedManagersHonorReservationBoundary, MixedManagersPreserveDurableCountersOnFailure, plus the existing P2MRWalletParallel* boundary cases.
    • Serial-versus-parallel comparison for the mixed case: P2MRWalletMixedManagerSerialParallelABBenchmark.

    Known and unchanged: a provider that does fall back to serial signing still re-signs already-complete P2MR inputs it owns; transactions mixing P2MR and non-P2MR inputs still sign serially. All three gates were green on the merge commit. Closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bug

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions