<oembed><type>rich</type><version>1.0</version><title>darosior [ARCHIVE] wrote</title><author_name>darosior [ARCHIVE] (npub1pj…x22xp)</author_name><author_url>https://yabu.me/npub1pj9022f74rzq7d5x7gnxje6wpsgk4r5jgeck8y5awd423ydhan3q7x22xp</author_url><provider_name>njump</provider_name><provider_url>https://yabu.me</provider_url><html>📅 Original date posted:2022-02-18&#xA;📝 Original message:James,&#xA;&#xA;You seem to imply that the scenario described isn&#39;t prevented today. It is. The mempool acceptance for a replacement not only&#xA;depend on the transaction feerate but also the transaction fee [0]. That&#39;s why i raised it in the first place...&#xA;&#xA;Antoine&#xA;&#xA;[0] https://github.com/bitcoin/bitcoin/blob/66636ca438cb65fb18bcaa4540856cef0cee2029/src/validation.cpp#L944-L947&#xA;&#xA;Of course if you are evicting transactions then you don&#39;t have the issue i mentioned, so it&#39;s fine doing so.&#xA;-------- Original Message --------&#xA;On Feb 17, 2022, 19:18, James O&#39;Beirne &lt; james.obeirne at gmail.com&gt; wrote:&#xA;&#xA;&gt;&gt; Is it really true that miners do/should care about that?&#xA;&gt;&#xA;&gt; De facto, any miner running an unmodified version of bitcoind doesn&#39;t&#xA;&gt; care about anything aside from ancestor fee rate, given that the&#xA;&gt; BlockAssembler as-written orders transactions for inclusion by&#xA;&gt; descending ancestor fee-rate and then greedily adds them to the block&#xA;&gt; template. [0]&#xA;&gt;&#xA;&gt; If anyone has any indication that there are miners running forks of&#xA;&gt; bitcoind that change this behavior, I&#39;d be curious to know it.&#xA;&gt;&#xA;&gt; Along the lines of what AJ wrote, optimal transaction selection is&#xA;&gt; NP-hard (knapsack problem). Any time that a miner spends deciding how&#xA;&gt; to assemble the next block is time not spent grinding on the nonce, and&#xA;&gt; so I&#39;m skeptical that miners in practice are currently doing anything&#xA;&gt; that isn&#39;t fast and simple like the default implementation: sorting&#xA;&gt; fee-rate in descending order and then greedily packing.&#xA;&gt;&#xA;&gt; But it would be interesting to hear evidence to the contrary.&#xA;&gt;&#xA;&gt; ---&#xA;&gt;&#xA;&gt; You can make the argument that transaction selection is just a function&#xA;&gt; of mempool contents, and so mempool maintenance criteria might be the&#xA;&gt; thing to look at. Mempool acceptance is gated based on a minimum&#xA;&gt; feerate[1]. Mempool eviction (when running low on space) happens on&#xA;&gt; the basis of max(self_feerate, descendant_feerate) [2]. So even in the&#xA;&gt; mempool we&#39;re still talking in terms of fee rates, not absolute fees.&#xA;&gt;&#xA;&gt; That presents us with the &#34;is/ought&#34; problem: just because the mempool&#xA;&gt; *is* currently gating only on fee rate doesn&#39;t mean that&#39;s optimal. But&#xA;&gt; if the whole point of the mempool is to hold transactions that will be&#xA;&gt; mined, and if there&#39;s good reason that txns are chosen for mining based&#xA;&gt; on fee rate (it&#39;s quick and good enough), then it seems like fee rate&#xA;&gt; is the approximation that should ultimately prevail for txn&#xA;&gt; replacement.&#xA;&gt;&#xA;&gt; [0]:&#xA;&gt; https://github.com/bitcoin/bitcoin/blob/master/src/node/miner.cpp#L310-L320&#xA;&gt; [1]:&#xA;&gt; https://github.com/bitcoin/bitcoin/blob/master/src/txmempool.cpp#L1106&#xA;&gt; [2]:&#xA;&gt; https://github.com/bitcoin/bitcoin/blob/master/src/txmempool.cpp#L1138-L1144&#xA;-------------- next part --------------&#xA;An HTML attachment was scrubbed...&#xA;URL: &lt;http://lists.linuxfoundation.org/pipermail/bitcoin-dev/attachments/20220218/1da83193/attachment.html&gt;</html></oembed>