Skip to content

wallet/feebumper: reject an original_change_index output without a destination - #36962

Open
Eunovo wants to merge 1 commit into
bitcoin:masterfrom
Eunovo:refactor-fee-bumper
Open

Eunovo wants to merge 1 commit into
bitcoin:masterfrom
Eunovo:refactor-fee-bumper

Conversation

@Eunovo

@Eunovo Eunovo commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

Moved from #35302 due to #35302 (comment).

This PR:
refactors CreateRateBumpTransaction to return a util::Expected of a Result and Error Struct instead of using out params. This change makes it easier for #35302 to add a sp_recipients field to the Result Struct instead of adding a new output parameter.

  • rejects an original_change_index that specifies an output without a destination. The pre-existing behaviour silently replaced the specified output if an OP_RETURN output was specified.

EDIT:
Scrapped the refactor of CreateRateBumpTransaction to return util::Expected in favour of #37017.

@DrahtBot DrahtBot changed the title wallet/feebumper: reject an original_change_index output without a destination wallet/feebumper: reject an original_change_index output without a destination Nov 24, 2026
@DrahtBot

DrahtBot commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

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

External sites

Reviews

See the guideline and AI policy for information on the review process.

Type Reviewers
ACK rustaceanrob
Concept ACK rkrux

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

Conflicts

Reviewers, this pull request conflicts with the following ones:

  • #35302 (Silent Payments: Sending (take 2) by Eunovo)

If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

@Eunovo Eunovo mentioned this pull request Nov 24, 2026
1 of 2 tasks

@rustaceanrob rustaceanrob left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Concept ACK

As I mentioned in #35302 (comment), this can replace an OP_RETURN which is posting a proof for a meta protocol or similar. I agree that this should throw an error explicitly as this a mistake on behalf of the user.

To be precise in what I mean for other reviewers:

TX A:
-----------------------
Input A |  Pay Bob
Input B |  OP_RETURN
Input C |  Change
-----------------------

Replacement of A, with original_change_index=1
------------------------------------
Input A | Pay Bob
Input B | Some new change address
Input C | Other change address
Input D |
------------------------------------

In the replacement the OP_RETURN is replaced with a new change address

Comment thread src/wallet/feebumper.cpp Resolved
@cyb3ralbert

Copy link
Copy Markdown
Contributor

Could you also cover psbtbumpfee in the regression test?

I ran wallet_bumpfee.py on Linux arm64 at d03bccefa15587e40a4a482bad774f168863ad56, and it passed. In a local variant of the test, psbtbumpfee also rejected an attempt to designate an OP_RETURN output as change via original_change_index. With the new guard removed, the bumpfee regression assertion failed as expected.

@Eunovo
Eunovo force-pushed the refactor-fee-bumper branch from d03bcce to d11db9b Compare November 26, 2026 09:57
@Eunovo

Eunovo commented Nov 26, 2026

Copy link
Copy Markdown
Contributor Author

re: @cyb3ralbert

Could you also cover psbtbumpfee in the regression test?

Done.

@rustaceanrob rustaceanrob left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

See #37017 for an approach to remove feebumper::Result entirely

@Eunovo
Eunovo force-pushed the refactor-fee-bumper branch from d11db9b to 1c0e898 Compare November 30, 2026 10:48
Such an output, like an OP_RETURN, was silently dropped from the
bumped transaction and change sent to a new address.
@Eunovo
Eunovo force-pushed the refactor-fee-bumper branch from 1c0e898 to b903c2b Compare November 30, 2026 10:54

@rustaceanrob rustaceanrob left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

ACK b903c2b

@rkrux

rkrux commented Dec 3, 2026

Copy link
Copy Markdown
Contributor

Concept ACK

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.

5 participants