Smart fees for wallet CreateTransaction#4250
Conversation
|
ACK |
|
Rebased just to get pull-tester to re-test. |
src/init.cpp
Outdated
There was a problem hiding this comment.
AFAIK we ordered the commands here alphabetically.
There was a problem hiding this comment.
@Diapolo If that's the goal at least add a comment at the top of HelpMessage() that they're meant to be sorted alphabetically per category. Otherwise, it will not stay sorted very long.
There was a problem hiding this comment.
If we can get to that consensus I'm going to add a short hint yes.
There was a problem hiding this comment.
No need for "consensus", this is way too unimportant to vote about, just do it
|
This would be extremely dangerous to implement right now as there is no ceiling on the estimated fee. A sybil attacker could easily skew your idea of what fees to pay upwards arbitrarily high, or for that matter, a fluke high estimate at startup. fRejectInsaneFee isn't even set when AcceptToMemoryPool() is called in the CWallet::CommitTransaction() codepath so the fee could be essentially anything. Needs a -maxfee option with a sane default. |
|
Not vulnerable to Sybil attacks-- attacker would have to produce bogus blocks with valid POW to affect estimates.
|
|
Steps to reproduce:
You can do the above with a second node -connect'ed to the first if you really want to see what a sybil attack would look like. |
|
In my experience talking to people the uncertainty they suffer around fees causes them a lot more problems than the fees themselves... people basically clawing their eyes out in panic when fees are non-zero because they just don't know what they are. We'd probably save a lot of stress for users by supporting a setting of a hard maximum fee per transaction and a setting for a hard maximum fee per KB, ... and avoid the kind of trouble petertodd is pointing to above by setting them to some prudent values like the sendrawtransaction sanity check. |
src/qt/coincontroldialog.cpp
Outdated
|
Code changes look good to me. Haven't tested. |
|
BTW:
|
|
I think all fee related code (CFeeRate, CTransaction::minTxFee, ...) can move out of core. |
|
Moving the minrelayfee would involve more work though, as it's used in many functions in main still. |
|
Yes, to main. There's no need for it to be in core. |
There was a problem hiding this comment.
May I suggest to add a DEFAULT_TX_CONFIRMTARGET and use that where currently 1 is used. It's also nice to use this in the help string, because when changing a default we don't need to change the help string.
See e.g. -blockmaxsize=<n> in init.cpp.
The wallet now uses the mempool fee estimator with a new command-line option: -txconfirmtarget (default: 1) instead of using hard-coded fees or priorities. A new bitcoind that hasn't seen enough transactions to estimate will fall back to the old hard-coded minimum priority or transaction fee. -paytxfee option overrides -txconfirmtarget. Relaying and mining code isn't changed. For Qt, the coin control dialog now uses priority estimates to label transaction priority (instead of hard-coded constants); unspent outputs were consistently labeled with a much higher priority than is justified by the free transactions actually being accepted into blocks. I did not implement any GUI for setting -txconfirmtarget; I would suggest getting rid of the "Pay transaction fee" GUI and replace it with either "target number of confirmations" or maybe a "faster confirmation <--> lower fee" slider or select box.
Require at least 11 samples before giving fee/priority estimates. And have wallet-created transactions go throught the fee-sanity-check code path.
|
Rebased, and nits picked (fee variables moved from core to wallet/main). If pull-tester is happy I'm going to pull. @Diapolo: I didn't bother with DEFAULT_TX_CONFIRMTARGET because one is the obvious choice for a default, and I doubt we'll ever decide that two or three or eleven makes more sense than one. |
|
lightly tested ACK |
|
Automatic sanity-testing: PASSED, see http://jenkins.bluematt.me/pull-tester/p4250_13fc83c77bb9108c00dd7709ce17719edb763273/ for binaries and test log. |
|
Posthumous ACK. |
The wallet now uses the mempool fee estimator with a new
command-line option: -txconfirmtarget (default: 1) instead
of using hard-coded fees or priorities.
A new bitcoind that hasn't seen enough transactions to estimate
will fall back to the old hard-coded minimum priority or
transaction fee.
-paytxfee option overrides -txconfirmtarget.
Relaying and mining code isn't changed.
For Qt, the coin control dialog now uses priority estimates to
label transaction priority (instead of hard-coded constants);
unspent outputs were consistently labeled with a much higher
priority than is justified by the free transactions actually
being accepted into blocks.
I did not implement any GUI for setting -txconfirmtarget; I would
suggest getting rid of the "Pay transaction fee" GUI and replace
it with either "target number of confirmations" or maybe
a "faster confirmation <--> lower fee" slider or select box.
Built on #3959 ; only the last commit is new.