-
Notifications
You must be signed in to change notification settings - Fork 38.7k
rpc: Add feeRate argument to bumpFee RPC #16492
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
Conversation
|
concept ACK |
src/wallet/feebumper.cpp
Outdated
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.
is this block of code cribbed from somewhere to compare with?
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.
Yeah, this code is from the CreateTotalBumpTransaction method https://github.com/bitcoin/bitcoin/blob/b89249e0de8ad1848d487dd3e7a85a0d6d456de8/src/wallet/feebumper.cpp#L199-L247
src/wallet/feebumper.cpp
Outdated
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.
totalFee isn't a thing
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.
I'll rewrite these error messages.
|
Concept ACK. Some notes:
|
@promag Thanks for your feedback. |
|
Could rebase on master and modify the release notes in the section "removed or deprecated rpcs"? |
5e564f6 to
9bc7a55
Compare
Sjors
left a comment
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.
Concept ACK.
In the description, if you replace "Draft commit for issue" with "Fixes" then Github will automatically close that issue when this PR is merged, which saves maintainers some effort.
Regarding the organization, what do you feel is not organized?
You should use git interactive rebase to reduce the number of commits, for example:
- commit
linter: fix whitespace: add this into the commit that added the incorrect whitespace (fixup) - commits
rpc: test bumpfee feeRate argument: squash these together - commit
doc: Add release note...: drop this commit, because #16504
This makes it easier to review a pull request one commit at a time.
- commit
Changes the verbosity of msbuild: move to separate pull request
test/functional/wallet_bumpfee.py
Outdated
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.
Nit: avoid dropping or adding whitespace in code that you're not touching.
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.
fixed
27fb2f1 to
e1fd79a
Compare
|
Thanks @Sjors, |
48d3691 to
002dbde
Compare
Sjors
left a comment
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.
Thanks for condensing the commits.
You can probably remove the WIP and Draft status; those are meant to prevent too detailed review, but it's too late for that :-)
There's still quite a bit of duplicate code between CheckFeeRate and CreateTotalBumpTransaction. Can you add an additional commit, similar to rpc: bumpfee move feeRate estimation logic into sepparate method, where you move this to a helper function? I'll review the actual functionality in more detail after that.
There's a couple of places where you or your editor fixed stuff in code that you're not otherwise touching. This increases review burden, because it's harder to see what changes are relevant, so is best avoided. I left a bunch of inline comments for that.
Couple more nits:
- commit
rpc: test bumpfee feeRate argumentshould be named[test] rpc bumpfee feeRate argument
doc/release-notes.md
Outdated
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.
Nit: bumped
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.
I initially wrote it as 'bumped' but went with 'bump'. My thought was that the bumped transaction is the one we are replacing, and the bump transaction is the new one?
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.
the fee for the new transaction.
See
bitcoin/src/wallet/rpcwallet.cpp
Line 3274 in 3a3d8b8
| "\nBumps the fee of an opt-in-RBF transaction T, replacing it with a new transaction B.\n" |
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.
thats better, fixed.
src/wallet/rpcwallet.cpp
Outdated
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.
Nit: move whitespace fix to commit where the whitespace mistake was made
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.
fixed
src/wallet/rpcwallet.cpp
Outdated
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.
Nit: don't remove whitespace here
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.
fixed
src/wallet/feebumper.cpp
Outdated
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.
Nit: you're not touching this function, so don't fix the brackets please
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.
fixed :)
src/wallet/feebumper.cpp
Outdated
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.
nit: don't fix the include order; that's best done when you add a new include
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.
fixed
src/wallet/feebumper.cpp
Outdated
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.
nit: don't fix things you're not otherwise touching
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.
fixed this too
src/wallet/feebumper.cpp
Outdated
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.
nit: don't fix this
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.
done
|
@Sjors I should be done with your comments, let me know if there is anything missing. Only thing missing is to get rid of the code re-use on CreateTotalTransaction. |
|
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. ConflictsReviewers, this pull request conflicts with the following ones:
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. |
| if (options.exists("confTarget") && (options.exists("totalFee") || options.exists("feeRate"))) { | ||
| throw JSONRPCError(RPC_INVALID_PARAMETER, "confTarget can't be set with totalFee or feeRate. Please provide either a conftarget for fee estimation, or an explicit total fee or fee rate for the transaction."); | ||
| } else if (options.exists("feeRate") && options.exists("totalFee")) { | ||
| throw JSONRPCError(RPC_INVALID_PARAMETER, "feeRate can't be set along with totalFee. Please provide either a total fee or a fee rate (in satoshis per K) for the transaction."); |
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.
Where else are we using satoshis per Kb? Seems like we're using BTC/kB everywhere else unless I'm missing a use?
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.
You are correct, I used Satoshis per kB on my first iteration of this feature and forgot to change the error message. nice catch
|
(couldn't reach you on IRC) still working on this? |
| Needs rebase |
|
Taken over in #16727. |
c812aba test bumpfee fee_rate argument (ezegom) 9f25de3 rpc bumpfee check fee_rate argument (ezegom) 88e5f99 rpc bumpfee: add fee_rate argument (ezegom) 1a4c791 rpc bumpfee: move feerate estimation logic into separate method (ezegom) Pull request description: Taking over for #16492 which seems to have gone inactive. Only minor commit cleanups, rebase, and some help text fixes on top of previous PR. Renamed `feeRate` to `fee_rate` to reflect updated guidelines. ACKs for top commit: Sjors: Code review ACK c812aba laanwj: ACK c812aba Tree-SHA512: 5f7f51bd780a573ccef1ccd72b0faf3e5d143f6551060a667560c5163f7d9480e17e73775d1d7bcac0463f3b6b4328f0cff7b27e39483bddc42a530f4583ce30
Fixes #16203.
On PR #15996, the totalfee argument in
bumpfeegets deprecated. The feeRate argument inbumpfeeserves as a replacement to totalFee.Small changes to
CreateRateBumpTransaction