-
Notifications
You must be signed in to change notification settings - Fork 38.7k
Sanitize fee options #22044
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
Sanitize fee options #22044
Conversation
|
Before undrafting: Are there any other fees that should be sanitized? Is this the right approach? |
promag
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.
a0cedcf to
b825098
Compare
|
I'd say all fee rates should be sanitized with this |
44ad311 to
0094b3e
Compare
|
|
The error should be printed even without the wallet |
0094b3e to
3eed6cb
Compare
|
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. |
|
Approach NACK. A 1 BTC/kvB limit may make sense given the current market price of BTC, but in the context of the codebase it's arbitrary and thus doesn't belong. Given that the purpose of this change is to avoid overflows, it might be more appropriate to sanitize the potential fee once it's ready to be calculated (e.g., check that |
When you sanitize it once it's calculated, it will become a run-time error, instead of InitError, as it is now. This forces the user to shutdown the node and adjust the fee when the node is already fully running. Also, the error might be intermittent, because it depends on the tx size. Also, we already have upper limits for the maximum tx fee for local transaction (maxtxfee), with a default of 0.1 BTC. So I don't see why it is so bad to add another constant. If 1 BTC/kvB is still too controversial, 46116 BTC/kvB can be picked as I explained in #21893. |
57227ec to
229b4a9
Compare
229b4a9 to
92d337f
Compare
Check if -blockmintxfee, -incrementalrelayfee, -dustrelayfee and -minrelaytxfee values are set higher than 1BTC/KvB, in which case reject such high values. This protects against potential overflow when fees are multiplied by the package size, as fees are parsed as int64_t.
92d337f to
cdee187
Compare
|
🐙 This pull request conflicts with the target branch and needs rebase. Want to unsubscribe from rebase notifications on this pull request? Just convert this pull request to a "draft". |
|
Closing this as it has not had any activity in a while. If you are interested in continuing work on this, please leave a comment so that it can be reopened. |
rpc: Sanitize fee option inputs. refs #21893
Checks -blockmintxfee, -incrementalrelayfee, -dustrelayfee and -minrelaytxfee values.
Fees are parsed as int64_t, and as a fee is being multiplied by the package size, too large a value might lead to an overflow.
Max value set to 1 BTC as @MarcoFalke states in #21893: