<oembed><type>rich</type><version>1.0</version><author_name>npub1zlxd3xlzjhq2ue03e5m5p2w6mp8v3dkhq5r39flsftjjsje04wvsdd2k4w</author_name><author_url>https://nostr.ae/npub1zlxd3xlzjhq2ue03e5m5p2w6mp8v3dkhq5r39flsftjjsje04wvsdd2k4w</author_url><provider_name>njump</provider_name><provider_url>https://nostr.ae</provider_url><html>📅 Original date posted:2022-03-14&#xA;📝 Original message:&#xA;Dear Carsten and fellow lightning developers,&#xA;&#xA;thanks for going into such detail and discovering some of the minor&#xA;inaccuracies of my very rough piecewise linearization!&#xA;&#xA;On Mon, Mar 14, 2022 at 1:53 PM Carsten Otto &lt;bitcoin at c-otto.de&gt; wrote:&#xA;&#xA;&gt; 1.2) The Mission Control information provided by lnd [...]&#xA;&gt; &gt; I think you talk a about a maximum available balance of a channel (and&#xA;&gt; not&#xA;&gt; &gt; min available balance)?&#xA;&gt;&#xA;&gt; Yes, although MC also has information about &#34;known&#34; amounts (due to&#xA;&gt; failures that only happened further down the road).&#xA;&gt;&#xA;&#xA;I am unsure how mission control stores and handles that data. In my&#xA;understanding they are mainly interested in a statistic of the ratio of&#xA;successfull payments over the past X attempts on a channel given a certain&#xA;time interval. But I assume they should have all the relevant data to&#xA;produce a proper conditional proability to utilize our learnt knowledge.&#xA;&#xA;In any case from the probabilistic model we can do it mathematically&#xA;precise by just looking at the conditional probabilities. As said I have&#xA;written hands on instructions in the rust repo&#xA;https://github.com/lightningdevkit/rust-lightning/issues/1170#issuecomment-972396747&#xA;and&#xA;they have been fully implemented in&#xA;https://github.com/lightningdevkit/rust-lightning/pull/1227. Also in our&#xA;mainnet test and simulations we have updated the priors according to those&#xA;rules and this revealed the full power of the approach.&#xA;&#xA;To summarize: Basically we need to know the effective uncertainty by only&#xA;looking at the effective amount that goes above the minimum certain&#xA;liquidity (that we might know from a prior attempt) and the effective&#xA;capacity (somebody recently suggested that conditional capacity might be a&#xA;better wording)&#xA;&#xA;&gt; Assuming that routing nodes indeed do so we would have learnt that neither&#xA;&gt; &gt; channel has an effective capacity of N. So the combined virtual channel&#xA;&gt; &gt; could be seen as 2N-1.&#xA;&gt;&#xA;&gt; You mean 2(N-1) = 2N-2?&#xA;&gt;&#xA;&#xA;Probably though the difference would be neglectable and if I understood you&#xA;correctly you will just keep parallel channels separate anyway.&#xA;&#xA;&gt; &gt; 4) Leftovers after Piecewise Linearization&#xA;&gt; &gt; I am not sure if I understand your question / issue here. The splitting&#xA;&gt; &gt; works by selecting N points on the domain of the function and splitting&#xA;&gt; the&#xA;&gt; &gt; domain into segments at those points. This should never leave sats over.&#xA;&gt;&#xA;&gt; With quantization of 10,000 a channel of size 123,456 ends up as an arc&#xA;&gt; with a capacity of 12 units. Cutting this into 5 pieces gives us&#xA;&gt; 5*2 with 2 units not ending up in any of those pieces. Or am I missing&#xA;&gt; something here, and we should split into 5 pieces of size 2.4 = 12/5?&#xA;&gt;&#xA;&#xA;Your observation is correct! Indeed I think my code rounds down the&#xA;capacity instead of going to the correct points and using all of the&#xA;capacity in the segmentation by making some channels 1 unit larger than&#xA;others which would happen if actually finding points on the domain to build&#xA;the segments. This could easily be fixed. However as always: Fully&#xA;saturated channels mean very low probabilities so even in my situation&#xA;where I may cut off a significant part of the channel I&#39;d say in the&#xA;extreme case where we would need to saturate even those sats the flow will&#xA;and should most likely fail as the min cust is probably just lower than the&#xA;amount we would attempt to send. Probably opening a new channel or doing an&#xA;on chain transaction will be more useful. Though of course we should build&#xA;the piecewise linearization correctly by the end of the day without&#xA;throughing away some capacity.&#xA;&#xA;&gt; If the quantization however makes a channel so small  that we cannot&#xA;&gt; &gt; even create 5 (or N) disjoint segments then I guess the likelihood for&#xA;&gt; &gt; being included into the final result is too small anyway.&#xA;&gt;&#xA;&gt; It may not be very likely, but flat-out ignoring 20k sat (in my&#xA;&gt; contrived example above) or up to 4*quantization sats (which is the case&#xA;&gt; you described) doesn&#39;t feel right.&#xA;&gt;&#xA;&#xA;See above. I agree it is not 100% accurate. but in practice I doubt it&#xA;would ever become a problem as this will only be an issue when the payment&#xA;amount is very close to the min cut which would make flows so unlikely to&#xA;begin with that we would use other ways to conduct the payment anyway.&#xA;&#xA;witch kind regards Rene&#xA;-------------- next part --------------&#xA;An HTML attachment was scrubbed...&#xA;URL: &lt;http://lists.linuxfoundation.org/pipermail/lightning-dev/attachments/20220314/0f59c122/attachment.html&gt;</html></oembed>