dcrd/internal/mining
Sef Boukenken 15c3817777
mempool/mining: Implement aggregate fee sorting.
This modifies the mining prioritization logic to sort transactions by an aggregate fee based on a transaction’s ancestors in the mempool.

This modifies the mining prioritization logic to sort transactions by an
aggregate fee based on a transaction’s ancestors in the mempool.

Currently, the mining code prioritizes transactions by fee and only
includes them in the block template if they have no dependencies.  When
a transaction is included in the block template, it is removed as a
dependency from transactions that depend on it, making those dependent
transactions eligible for block template inclusion.

Aggregating ancestor statistics for large graphs of transactions in the
mempool may have high computational costs.  Performing this aggregation
in the block template generator would delay miners requesting a block
template since all of the aggregation would need to occur for each
transaction, at once.  To solve this problem, the complexity is spread
over time such that the transaction statistics are updated with mempool
event hooks.  Since the mempool is not locked during the entirety of
template generation, a mining view interface is exposed to safely
interact with a snapshot of the mempool.

The biggest risk in terms of performance are reorgs where transactions
with many descendants are added back to the mempool.  The number of
transactions added to the mempool in this way is limited by the block
size and proof of work, but the mempool has no restrictions on the
number of ancestors tracked for a given transaction.

A potential - and not implemented - solution to this reorg problem would
be to establish a limit on the number of ancestors a transaction may
have in the mempool.
2020-10-14 23:11:12 -05:00
..
cpuminer multi: update blockchain and mempool error types. 2020-10-14 20:42:41 -05:00
doc.go cpuminer: Refactor code to its own package. 2020-07-22 20:06:28 -05:00
error.go mining: Add ticket exhaustion check. 2020-10-05 19:29:28 -05:00
log.go mining: Move to internal. 2020-07-20 18:07:59 -05:00
mining_test.go mempool/mining: Implement aggregate fee sorting. 2020-10-14 23:11:12 -05:00
mining.go mempool/mining: Implement aggregate fee sorting. 2020-10-14 23:11:12 -05:00
policy_test.go mining: Move to internal. 2020-07-20 18:07:59 -05:00
policy.go mining: Move to internal. 2020-07-20 18:07:59 -05:00
README.md mining: Move to internal. 2020-07-20 18:07:59 -05:00

mining

Build Status ISC License Doc

Overview

This package is currently a work in progress.

License

Package mining is licensed under the copyfree ISC License.