-
Notifications
You must be signed in to change notification settings - Fork 336
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bump MSRV 1.63.0 AND add deprecate TxBuilder::allow_shrinking() #1366
Bump MSRV 1.63.0 AND add deprecate TxBuilder::allow_shrinking() #1366
Conversation
Rather than try to figure out how to get this to build with MSRV 1.57 I'm bumping it to 1.63.0.
|
a24fd81
to
bf0845c
Compare
127b29c
to
3b09e26
Compare
I think the docs now correctly describe what the method is doing, but it feels like a bug to me, and the docs now simply describe the bug. The intended behaviour (as I imagine it at least) is what is described in the first line of the doc:
In other words, if you're bumping the fee on a transaction, you can tell the wallet to not apply default behaviour (use the change output to pay for the extra fees), but instead use one of your payees' output. If the extra fee required is 1000 sat, the output should simply shrink by 1000 sat, those sats go to the transaction fee, and nothing else about the transaction change. If the method ends up triggering a switcharoo of where change goes and now throws all change into that payees' output, it's so far off what I'd expect would happen from the name of the method that I'd consider it a bug. If the current behaviour is useful in some way (I can't think of a use case but maybe there are?) we could rename the method to better describe what it does. Otherwise I think it would be better to fix the method to match what users might expect from an |
|
21f9d69
to
9ee2ce6
Compare
9ee2ce6
to
2e679e6
Compare
I updated the test to confirm that given a wallet with 2 UTXOs, if the original TX only uses one UTXO then the new fee bumped TX with I think this function is doing what it says which is allow shrinking one output to pay for a new larger TX fee. The only scenario I can think of where this behavior would be unexpected is if you also manually add new inputs with your fee bump tx builder. Should I explicitly warn against this scenario? I'd hope that the warning would cover that scenario, I'd rather not change the function name for the 0.xx branch, I'd rather have that discussion for the 1.0 bdk wallet api. |
Yes it's a design bug IMO: #1374 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
utACK 5bc00e4 - looks good to me, I only have one comment regarding the clippy ci
1334d09
to
b03dca1
Compare
Fix related clippy errors
…te it test(wallet): add test_bump_fee_allow_shrinking test
ddbce5d
to
a70dcee
Compare
8837654
to
bb83bae
Compare
bb83bae
to
64d2b7c
Compare
I had to disable the code coverage and blockchain integration tests. They used to work but not are failing even though there haven't been any code changes since they last run successfully. I think time is better spent on 1.0 than trouble shooting these old flaky tests. |
378d023
to
f13335e
Compare
Description
fixes #1342
Notes to the reviewers
This is a quick fix, long term we should try to make this safer to use.
Checklists
All Submissions:
cargo fmt
andcargo clippy
before committing