<div dir="ltr"><div dir="ltr"><div>Reviving this old thread now that the recently released RC for bitcoind 0.19 includes the above mentioned carve-out rule.</div><div><br></div><div>In an attempt to pave the way for more robust CPFP of on-chain contracts (Lightning commitment transactions), the carve-out rule was added in <a href="https://github.com/bitcoin/bitcoin/pull/15681">https://github.com/bitcoin/bitcoin/pull/15681</a>. However, having worked on an implementation of a new commitment format for utilizing the Bring Your Own Fees strategy using CPFP, I’m wondering if the special case rule should have been relaxed a bit, to avoid the need for adding a 1 CSV to all outputs (in case of Lightning this means HTLC scripts would need to be changed to add the CSV delay).</div><div><br></div><div>Instead, what about letting the rule be</div><div><br></div><div>The last transaction which is added to a package of dependent</div><div>transactions in the mempool must:</div><div>  * Have no more than one unconfirmed parent.</div><div><br></div><div>This would of course allow adding a large transaction to each output of the unconfirmed parent, which in effect would allow an attacker to exceed the MAX_PACKAGE_VIRTUAL_SIZE limit in some cases. However, is this a problem with the current mempool acceptance code in bitcoind? I would imagine evicting transactions based on feerate when the max mempool size is met handles this, but I’m asking since it seems like there has been several changes to the acceptance code and eviction policy since the limit was first introduced.</div><div><br></div><div>- Johan</div><div><br></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Feb 13, 2019 at 6:57 AM Rusty Russell &lt;<a href="mailto:rusty@rustcorp.com.au">rusty@rustcorp.com.au</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Matt Corallo &lt;<a href="mailto:lf-lists@mattcorallo.com" target="_blank">lf-lists@mattcorallo.com</a>&gt; writes:<br>
&gt;&gt;&gt; Thus, even if you imagine a steady-state mempool growth, unless the <br>
&gt;&gt;&gt; &quot;near the top of the mempool&quot; criteria is &quot;near the top of the next <br>
&gt;&gt;&gt; block&quot; (which is obviously *not* incentive-compatible)<br>
&gt;&gt; <br>
&gt;&gt; I was defining &quot;top of mempool&quot; as &quot;in the first 4 MSipa&quot;, ie. next<br>
&gt;&gt; block, and assumed you&#39;d only allow RBF if the old package wasn&#39;t in the<br>
&gt;&gt; top and the replacement would be.  That seems incentive compatible; more<br>
&gt;&gt; than the current scheme?<br>
&gt;<br>
&gt; My point was, because of block time variance, even that criteria doesn&#39;t hold up. If you assume a steady flow of new transactions and one or two blocks come in &quot;late&quot;, suddenly &quot;top 4MWeight&quot; isn&#39;t likely to get confirmed until a few blocks come in &quot;early&quot;. Given block variance within a 12 block window, this is a relatively likely scenario.<br>
<br>
[ Digging through old mail. ]<br>
<br>
Doesn&#39;t really matter.  Lightning close algorithm would be:<br>
<br>
1.  Give bitcoind unileratal close.<br>
2.  Ask bitcoind what current expidited fee is (or survey your mempool).<br>
3.  Give bitcoind child &quot;push&quot; tx at that total feerate.<br>
4.  If next block doesn&#39;t contain unilateral close tx, goto 2.<br>
<br>
In this case, if you allow a simpified RBF where &#39;you can replace if<br>
1. feerate is higher, 2. new tx is in first 4Msipa of mempool, 3. old tx isnt&#39;,<br>
it works.<br>
<br>
It allows someone 100k of free tx spam, sure.  But it&#39;s simple.<br>
<br>
We could further restrict it by marking the unilateral close somehow to<br>
say &quot;gonna be pushed&quot; and further limiting the child tx weight (say,<br>
5kSipa?) in that case.<br>
<br>
Cheers,<br>
Rusty.<br>
_______________________________________________<br>
Lightning-dev mailing list<br>
<a href="mailto:Lightning-dev@lists.linuxfoundation.org" target="_blank">Lightning-dev@lists.linuxfoundation.org</a><br>
<a href="https://lists.linuxfoundation.org/mailman/listinfo/lightning-dev" rel="noreferrer" target="_blank">https://lists.linuxfoundation.org/mailman/listinfo/lightning-dev</a><br>
</blockquote></div>