Clarify the difference between cost and evictionWeight

This commit is contained in:
Eirik Ogilvie-Wigley 2019-10-17 16:50:44 -06:00
parent 64fc25ed6e
commit 898810213c
1 changed files with 13 additions and 9 deletions

View File

@ -10,15 +10,19 @@ DoS Mitigation: Mempool Size Limit and Random Drop
This release adds a mechanism for preventing nodes from running out of memory
in the situation where an attacker is trying to overwhelm the network with
transactions. This is achieved by keeping track of and limiting the total
`cost`, a function of a transaction's size in bytes and its fee, of the
mempool. The maximum total cost is configurable via the parameter
`mempool.tx_cost_limit` which defaults to 80,000,000 (up to 20,000 txs). If a
node's total mempool `cost` exceeds this limit the node will evict a random
transaction, preferentially picking larger transactions and ones with below
the standard fee. To prevent a node from re-accepting evicted transactions, it
keeps track of ones that it has evicted recently. By default, a transaction
will be considered recently evicted for 60 minutes, but this can be configured
with the parameter `mempool.eviction_memory_minutes`.
`cost` and `evictionWeight` of all transactions in the mempool. The `cost` of a
transaction is determined by its size in bytes, and its `evictionWeight` is a
function of the transaction's `cost` and its fee. The maximum total cost is
configurable via the parameter `mempool.tx_cost_limit` which defaults to
80,000,000 (up to 20,000 txs). If a node's total mempool `cost` exceeds this
limit the node will evict a random transaction, preferentially picking larger
transactions and ones with below the standard fee. To prevent a node from
re-accepting evicted transactions, it keeps track of ones that it has evicted
recently. By default, a transaction will be considered recently evicted for 60
minutes, but this can be configured with the parameter
`mempool.eviction_memory_minutes`.
For full details see ZIP 401.
Fake chain detection during initial block download
--------------------------------------------------