-
Notifications
You must be signed in to change notification settings - Fork 38.6k
wallet: Make fee settings to be non-static members #12909
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
|
For testing you can checkout this commit and run |
fa62e3b to
5a08c94
Compare
1643a7c to
fad3bc5
Compare
src/wallet/init.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 there a reason not to make options like -discardfee and -mintxfee wallet members, the same way this is doing for -fallbackfee and -paytxfee options? It doesn't seem like a good thing to create a distinction here when moving the options together is possible.
Making more options members also seems nice in case we want to add a wallet RPC for changing preferences dynamically without affecting other wallets.
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.
mintxfee et al are already members (static, though). I agree that those should be changed to be non-static members, but I'd rather do this in a follow up pr. Otherwise this one will explode in scope, scare away revierers and will gracelessly end up in rebase hell.
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.
Making more options members also seems nice in case we want to add a wallet RPC for changing preferences dynamically without affecting other wallets.
Please see the included test case: We are already doing it wrong.
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.
mintxfee et al are already members (static, though). I agree that those should be changed to be non-static members, but I'd rather do this in a follow up pr. Otherwise this one will explode in scope, scare away revierers and will gracelessly end up in rebase hell.
I think "wallet-specific fee options" would be an appropriate scope for this PR and not too broad. The -mintxfee, -fallbackfee, -discardfee, and -paytxfee options are literally initialized one after another here, so it's strange to me that you want to move the second and fourth initializations but not the first and third based them on being global variables instead of static class member variables (since all the variables function identically).
|
Concept ACK |
ryanofsky
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.
utACK fad3bc5cef786049f70ff485001e9e11791ef350
src/interfaces/node.h
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.
Maybe revert this formatting change (this is what caused me to open #12982).
src/wallet/init.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.
mintxfee et al are already members (static, though). I agree that those should be changed to be non-static members, but I'd rather do this in a follow up pr. Otherwise this one will explode in scope, scare away revierers and will gracelessly end up in rebase hell.
I think "wallet-specific fee options" would be an appropriate scope for this PR and not too broad. The -mintxfee, -fallbackfee, -discardfee, and -paytxfee options are literally initialized one after another here, so it's strange to me that you want to move the second and fourth initializations but not the first and third based them on being global variables instead of static class member variables (since all the variables function identically).
faac0e6 to
fa04752
Compare
fae9a4b to
fa66188
Compare
|
Removed |
|
|
|
@jnewbery Travis seems to fetch from |
ryanofsky
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.
utACK fa66188a5c8b862695dd8d730f7c900bfd303dcf. This is great cleanup! It's really nice to see these settings start to get consolidated and handled in a consistent way.
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.
Comment is kind of misleading. I think it would be more accurate to say "overrides" instead of "overwrites" now.
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.
TIL those words mean different things. Thx and done. Should be trivial to re-ACK if you still have the previous commit.
fa66188 to
fafdeca
Compare
ryanofsky
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.
utACK fafdeca1ec5d32291fe7b0313e123ad22d8e284b. Only change since the previous review is the updated RPC documentation string.
b79c4d0 to
eeeea3c
Compare
|
Clean rebase to reduce the diff (getting rid of deleted node-interface methods) |
ryanofsky
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.
utACK eeeea3c066f8b1351b911593aac7b062f48f1976, only change since last review is rebase
jnewbery
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.
utACK eeeea3c066f8b1351b911593aac7b062f48f1976 with request for follow-up commit.
src/wallet/wallet.h
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.
Seems a little weird to change this to constexpr and leave all the other default constants as static const. It's fine, but can we have a follow-up PR to change the remaining constants to constexprs?
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.
Sure. There is a bit of refactoring going on in the wallet, so I will wait until the dust settled a bit.
|
Sorry, needs rebase again |
|
Concept ACK (utACK on eeeea3c066f8b1351b911593aac7b062f48f1976 which though requires rebase). |
eeeea3c to
bcf4e8c
Compare
bcf4e8c to
fac0db0
Compare
|
Rebased |
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.
This commit is hopefully only refactoring, apart from a multiwallet bugfix
Probably not that problematic, it's very unlikely someone depends on the current behavior, but I think this could have release note.
utACK fac0db0.
| class RPCTimerInterface; | ||
| class UniValue; | ||
| class proxyType; | ||
| enum class FeeReason; |
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.
Also remove CCoinControl forward declaration?
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.
Will leave it in for now, because I don't want to go through another rebase-reACK iteration just for this. Also, there are redundant forward declarations in other parts of the code, so this is not making the overall problem worse.
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, don't mind that, just noted in case you have to push again.
I don't think it's necessary. We don't add notes for every bugfix, and this seems very trivial. |
|
tested ACK fac0db0 |
fac0db0 wallet: Make fee settings non-static members (MarcoFalke) Pull request description: The wallet header defined some globals (they were called "settings"), that should be class members instead. This commit is hopefully only refactoring, apart from a multiwallet bugfix: Calling the rpc `settxfee` for one wallet, would set (and change) the fee rate for all loaded wallets. (See added test case) Tree-SHA512: 4ab6ec2f5c714742396ded5e451ec3b1ceb771e3696492de29889d866de4365b3fbe4a2784d085c8b8bd11b1ebb8a1fec99ab2c62eee716791cfc67c0cf29e1b
fac0db0 wallet: Make fee settings non-static members (MarcoFalke) Pull request description: The wallet header defined some globals (they were called "settings"), that should be class members instead. This commit is hopefully only refactoring, apart from a multiwallet bugfix: Calling the rpc `settxfee` for one wallet, would set (and change) the fee rate for all loaded wallets. (See added test case) Tree-SHA512: 4ab6ec2f5c714742396ded5e451ec3b1ceb771e3696492de29889d866de4365b3fbe4a2784d085c8b8bd11b1ebb8a1fec99ab2c62eee716791cfc67c0cf29e1b
The wallet header defined some globals (they were called "settings"), that should be class members instead.
This commit is hopefully only refactoring, apart from a multiwallet bugfix: Calling the rpc
settxfeefor one wallet, would set (and change) the fee rate for all loaded wallets. (See added test case)