<oembed><type>rich</type><version>1.0</version><author_name>npub1f2nvlx49er5c7sqa43src6ssyp6snd4qwvtkwm5avc2l84cs84esecrwet</author_name><author_url>https://nostr.ae/npub1f2nvlx49er5c7sqa43src6ssyp6snd4qwvtkwm5avc2l84cs84esecrwet</author_url><provider_name>njump</provider_name><provider_url>https://nostr.ae</provider_url><html>📅 Original date posted:2016-05-09&#xA;📝 Original message:On Mon, May 9, 2016 at 9:35 AM, Tom Zander via bitcoin-dev&#xA;&lt;bitcoin-dev at lists.linuxfoundation.org&gt; wrote:&#xA;&gt; You misunderstand the networking effects.&#xA;&gt; The fact that your node is required to choose which one to set the announce&#xA;&gt; bit on implies that it needs to predict which node will have the best data in&#xA;&gt; the future.&#xA;&#xA;Not required. It may. If it chooses fortunately, latency is reduced--&#xA;to 0.5 RTT in many cases. If not-- nothing harmful happens.&#xA;&#xA;Testing on actual nodes in the actual network (not a &#34;lab&#34;) shows that&#xA;blocks are normally requested from one of the last three peers they&#xA;were requested from 70% of the time, with no special affordances or&#xA;skipping samples when peers disconnected.&#xA;&#xA;(77% for last 4, 88% for last 8)&#xA;&#xA;This also _increases_ robustness. Right now a single peer failing at&#xA;the wrong time will delay blocks with a long time out. In high&#xA;bandwidth mode the redundancy means that node will be much more likely&#xA;to make progress without timeout delays-- so long at least one of the&#xA;the selected opportunistic mode peers was successful.&#xA;&#xA;Because the decision is non-normative to the protocol, nodes can&#xA;decide based on better criteria if better criteria is discovered in&#xA;the future.&#xA;&#xA;&gt; Another problem with your solution is that nodes send a much larger amount of&#xA;&gt; unsolicited data to peers in the form of the thin-block compared to the normal&#xA;&gt; inv or header-first data.&#xA;&#xA;&#34;High bandwidth&#34; mode uses somewhat more bandwidth than low&#xA;bandwidth... but still &gt;&gt;10 times less than an ordinary getdata relay&#xA;which is used ubiquitously today.&#xA;&#xA;If a node is trying to minimize bandwidth usage, it can choose to not&#xA;request the &#34;high bandwidth&#34; mode.&#xA;&#xA;The latency bound cannot be achieved without unsolicited data. The&#xA;best we can while achieving 0.5 RTT is try to arrange things so that&#xA;the information received is maximally useful and as small as&#xA;reasonably possible.&#xA;&#xA;If receivers implemented joint decoding (combining multiple&#xA;comprblocks in the event of faild decoding) 4 byte IDs would be&#xA;completely reasonable, and were what I originally suggested (along&#xA;with forward error correction data, in that case).&#xA;&#xA;&gt; Am I to understand that you choose the solution based on the fact that service&#xA;&gt; bits are too expensive to extend? (if not, please respond to my previous&#xA;&gt; question actually answering the suggestion)&#xA;&gt;&#xA;&gt; That sounds like a rather bad way of doing design. Maybe you can add a second&#xA;&gt; service bits field of message instead and then do the compact blocks correctly.&#xA;&#xA;Service bits are not generally a good mechanism for negating optional&#xA;peer-local parameters.&#xA;&#xA;The settings for compactblocks can change at runtime, having to&#xA;reconnect to change them would be obnoxious.&#xA;&#xA;&gt; Wait, you didn&#39;t steal the variable length encoding from an existing standard&#xA;&gt; and you programmed a new one?&#xA;&#xA;This is one of the two variable length encodings used for years in&#xA;Bitcoin Core. This is just the first time it&#39;s shown up in a BIP.&#xA;&#xA;[It&#39;s a little disconcerting that you appear to be maintaining a fork&#xA;and are unaware of this.]&#xA;&#xA;&gt; Look at UTF-8 on wikipedia, you may have &#34;invented&#34; the same encoding that IBM&#xA;&gt; published in 1992.&#xA;&#xA;The similarity with UTF-8 is that both are variable length and some&#xA;control information is in the high bits. The similarity ends there.&#xA;&#xA;UTF-8 is more complex and less efficient for this application (coding&#xA;small numbers), as it has to handle things like resynchronization&#xA;which are critical in text but irrelevant in our framed, checksummed,&#xA;reliably transported binary protocol.&#xA;&#xA;&gt; Just the first (highest) 8 bytes of a sha256 hash.&#xA;&gt;&#xA;&gt; The amount of collisions will not be less if you start xoring the rest.&#xA;&gt; The whole reason for doing this extra work is also irrelevant as a spam&#xA;&gt; protection.&#xA;&#xA;Then you expose it to a trivial collision attack:  To find two 64 bit&#xA;hashes that collide I need perform only roughly 2^32 computation. Then&#xA;I can send them to the network.  You cannot reason about these systems&#xA;just by assuming that bad things happen only according to pure chance.&#xA;&#xA;This issue is eliminated by salting the hash.  Moreover, with&#xA;per-source randomization of the hash, when a rare chance collision&#xA;happens it only impacts a single node at a time, so the propagation&#xA;doesn&#39;t stall network wide on an unlucky block; it just goes slower on&#xA;a tiny number of links a tiny percent of the time (instead of breaking&#xA;everywhere an even tinyer amount of the time)-- in the non-attacker,&#xA;chance event case.</html></oembed>