- Transaction fees for children might help the parent transaction get confirmed
- Transaction fees can boost the priority of transactions included
Refactor CreateNewBlock transaction selection algorithm #1240
pull luke-jr wants to merge 6 commits into bitcoin:master from luke-jr:txn_prio changing 6 files +276 −73-
luke-jr commented at 1:39 PM on May 9, 2012: member
-
GetFloatArg utility function 05db8ecfdb
-
luke-jr commented at 1:40 PM on May 9, 2012: member
So far, I have done some minimal testing by analyzing the output of getmemorypool.
-
luke-jr commented at 1:31 PM on May 10, 2012: member
Eligius has found 2 valid blocks (and none invalid) with this code (plus #1246, for safety) so far, at its default settings. I am now testing with a huge weigh toward transaction fees, to increase the likelihood of dependent transactions paying for their parents (and therefore risking any potential child-before-parent problems).
-
luke-jr commented at 2:59 PM on May 10, 2012: member
Things I need to address:
- False "may be used uninitialized" warnings
- Config option names differ between actual code and -help
- Second-pass priorities should be printed with -printpriority
- Fee influence should be multiplied by total input value (input please: is this a good idea? should the total input be reduced by the fee amount first?)
- -printpriority shouldn't require fDebug (is this ok?)
-
luke-jr commented at 1:18 AM on May 12, 2012: member
Integrated my 5 "things to address".
-
luke-jr commented at 7:19 PM on May 19, 2012: member
Eligius has been running this from block 179513 (56 blocks found) and EclipseMC from 180573 (11 blocks), totalling 67 valid blocks with no problems found.
(EMC: 180788(1040); Eligius: …9DA7D49DC2539F9D299AF8E5A)
-
luke-jr commented at 11:56 AM on May 30, 2012: member
This seems to be be excessively slow, and possibly exploitable right now.
-
sipa commented at 4:25 PM on May 30, 2012: member
Define "this" ?
-
luke-jr commented at 5:18 PM on May 30, 2012: member
This pull request. Eligius is getting stuck in some huge dependency trees, it seems. Trying to figure it out, but don't have time just this second.
-
5bb1a1f58c
Bugfix: %-12I64d is not valid and causes the parameter to be skipped, use %12"PRI64d" instead
Conflicts: src/walletdb.cpp
-
fddbbe0a61
Refactor CreateNewBlock transaction selection algorithm
- Transaction fees for children might help the parent transaction get confirmed - Transaction fees can boost the priority of transactions included
-
Merge branch 'getfloatarg' into txn_prio_0.6.0 919e4442a8
-
Make transaction priority weights user-configurable 02077ee878
-
e7e7df1ae0
Merge branch 'txn_prio_0.6.0' into txn_prio
Conflicts: src/db.cpp src/init.cpp src/main.cpp src/main.h
-
luke-jr commented at 8:05 PM on June 12, 2012: member
Fixed the major performance hit from complex dependency trees. Still not as fast as the old algorithm, but not absurdly slow either. I'd say the ability to pay for "parent" transactions is worth it.
-
luke-jr commented at 8:05 PM on June 12, 2012: member
(Fix verified by about 10 days of testing on Eligius)
-
sipa commented at 3:33 PM on June 14, 2012: member
I certainly agree to the idea of this patch. I haven't checked the source yet though.
-
gavinandresen commented at 1:39 AM on June 19, 2012: contributor
Need to be very careful not to accidentally introduce a potential DoS attack by arranging transactions that require N^2 time or space to figure out fees/priority.
-
luke-jr commented at 1:52 AM on June 19, 2012: member
@gavinandresen I think SatoshiDice tested that for me (the fix from ~16 days ago)
-
gavinandresen commented at 12:20 AM on July 13, 2012: contributor
Could you write up a gist that explains what formula for priority you're using? And maybe talk about how it will handle transactions from old clients (who calculate priority the old way) ?
-
luke-jr commented at 1:28 AM on July 13, 2012: member
- DepthWeight = user configurable (default: 1.0)
- FeeWeight = user configurable (default: 1.0)
- DepthScore = sum(sum(value * depth) for each input)
- FeeScore = sum(value for each input) * fee
- WeighedScore = (DepthScore * DepthWeight) + (FeeScore * FeeWeight)
- EffectiveSize = datasize + sum(datasize for each (transaction this depends on that is not yet in a block))
- Priority = WeighedScore / EffectiveSize
Old clients don't take priority into consideration at all right now AFAIK, nor does this code (or the code it's replacing) completely exclude transactions based on their priority.
-
gavinandresen commented at 3:53 PM on July 13, 2012: contributor
NACK, the priority formula would make it easy for somebody with (say) 100,000 BTC to pay tiny fees and get priority over higher-fee-paying transactions. That's a bad incentive, it would encourage people to do dangerous things like keep more funds in their 'hot' wallet or add extra inputs to their transactions (and just have bigger change outputs) to get higher priority.
-
luke-jr commented at 3:56 PM on July 13, 2012: member
So, should I take the input value out of FeeScore?
-
jgarzik commented at 3:43 PM on August 1, 2012: contributor
Sadly, in addition to being NAK'd this conflicts heavily with @gavinandresen 's work redoing CreateNewBlock() You should work with @gavinandresen to coordinate changes in that area, before posting another pull request relating to CreateNewBlock() + TX selection/fees.
- jgarzik closed this on Aug 1, 2012
- suprnurd referenced this in commit 471365bf6c on Dec 5, 2017
- lateminer referenced this in commit 8ce95a8025 on Jan 22, 2019
- lateminer referenced this in commit 310deb9b0d on May 6, 2020
- DrahtBot locked this on Sep 8, 2021