sign: Remove FillableSigningProvider

bitcoin/bitcoin: PR #35733

6 suggestions

Earlier concerns neither republished nor resolved: 1 suggestion. See the Run archive for their assessments.

Optional improvements

Link

[suggestion] · The bitcoin-tx conversion changes oversized-script handling without documentation or tests

Source inspection shows an undocumented bitcoin-tx change: externally constructed, unspendable oversized-P2SH inputs can now return success unsigned, while valid large P2WSH scripts become signable; utility vectors cover neither case.

Location: src/bitcoin-tx.cpp:669 (head).

Details and suggested fix

AddCScript previously rejected scripts above 520 bytes, causing MutateTxSign to throw Error adding redeemscript=<hex>. Unconditional insertion removes that failure. The new P2SH guard stops signing, but the CLI's existing best-effort path ignores ProduceSignature's result and prints the transaction with status 0. Native P2WSH scripts above 520 bytes can instead be signed with suitable keys and an explicit amount. Document both changes in the PR description and add utility vectors checking output and exit status. If retaining the former P2SH error, reject only an oversized supplied script that actually hashes to the P2SH prevout. Rejecting every large script supplied for a P2SH prevout would also restrict valid P2SH-P2WSH signing.


Link

[suggestion] · The P2SH size guard lacks an early-refusal regression assertion

A test that only checks ProduceSignature returns false would miss removal of this guard, because final script verification already rejects the oversized push.

Location: src/script/sign.cpp:684 (head).

Details and suggested fix

Without this guard, MULTISIG calls CreateSig and populates sigdata.signatures before VerifyScript rejects the oversized redeem-script push. Add a unit case with fresh SignatureData, a FlatSigningProvider holding compressed keys, and a 16-key multisig script (547 bytes) wrapped directly in P2SH. Assert both signing failure and an empty signature map. A 15-key version (513 bytes) that signs successfully provides a positive control. Existing rpc_createmultisig.py cases cover large native and nested witness scripts, but not this no-new-signatures invariant.


Link

[suggestion] · The P2SH size guard hides the RPC's size-limit diagnostic

For externally constructed, unspendable P2SH inputs, signrawtransactionwithkey now suggests missing keys instead of reporting the size limit; no current in-tree producer of this input was found.

Location: src/script/sign.cpp:685 (head).

Details and suggested fix

For an initially unsigned input with a matching oversized multisig redeemScript in prevtxs, ParsePrevouts accepts the script even when all keys are supplied. This early return leaves no satisfaction or specific failure reason. ProduceSignature writes an empty scriptSig, so SignTransaction maps the ensuing OP_HASH160 empty-stack failure to Unable to sign input, invalid stack size (possibly missing key). Base instead constructed the oversized push and reported Push value size limit exceeded. Reject oversized scripts in ParsePrevouts' traditional-P2SH match branch with RPC_INVALID_PARAMETER and a size-limit message, leaving witness scripts unaffected by this 520-byte check.


Link

[suggestion] · Utility signing vectors miss the learned P2SH-P2WPKH script

The existing native-P2WPKH vector bypasses GetCScript, so removing this replacement for ImplicitlyLearnRelatedKeyScripts would not be detected by the utility signing tests.

Location: src/bitcoin-tx.cpp:609 (head).

Details and suggested fix

For a fresh P2SH-P2WPKH input without a supplied redeemScript, outer SCRIPTHASH signing needs the 22-byte witness program inserted here. Native P2WPKH starts in WITNESS_V0_KEYHASH and needs no script lookup. Add a utility vector using the existing txcreatesignsegwit1.hex key and a P2SH prevout wrapping 0014751e76e8199196d454941c45d1b3a323f1433bd6. Supply an amount, omit redeemScript, and compare expected bytes containing a scriptSig that pushes the program and a witness containing the signature and public key.


Link

[suggestion] · The moved script-store comments describe removed interfaces

The moved code retains a nonexistent AddCScript override and drops the map-level explanation distinguishing solving scripts from setWatchOnly ownership.

Location: src/wallet/scriptpubkeyman.cpp:492 (head).

Details and suggested fix

ImplicitlyLearnRelatedKeyScripts now inserts directly into m_scripts, but still says it avoids an overridable AddCScript; that method no longer exists. GetCandidateScriptPubKeys also still calls the map mapScripts. Remove the obsolete override note, update the member reference, and attach a trimmed migration-only explanation to m_scripts. Preserve what the map contains, its implicitly derived in-memory entries, and why script availability does not itself confer watch-only ownership as membership in setWatchOnly does. The old persistence-method history need not move with it.


Link

[suggestion] · The dummy input-size fixture supplies an unnecessary signing key

The converted CalculateNestedKeyhashInputSize fixture still supplies private-key data even though it only needs solving data, so it does not exercise the watch-only setup described by its comment.

Location: src/wallet/test/wallet_tests.cpp:631 (head).

Details and suggested fix

With FillableSigningProvider, the stored private key was needed because GetPubKey derived the public key from it. FlatSigningProvider::GetPubKey instead reads pubkeys, and both dummy signature creators fabricate signatures without looking up keys. Remove keystore.keys.emplace(...), retaining the scripts and pubkeys entries. The existing size assertions will then exercise a keyless solving provider, matching the adjacent watch-only comment.


Coverage details

Earlier concerns

Earlier reports raised these, with the titles and severities shown there. This review neither republished nor resolved them.