<oembed><type>rich</type><version>1.0</version><author_name>npub1mju50kqcm07heu967fkq6h4kq666xgekc4yrldf7q52xx9vr8jnsrdxnq7</author_name><author_url>https://nostr.ae/npub1mju50kqcm07heu967fkq6h4kq666xgekc4yrldf7q52xx9vr8jnsrdxnq7</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 Sunday, May 08, 2016 03:24:22 AM Matt Corallo wrote:&#xA;&gt; &gt;&gt; ===Intended Protocol Flow===&#xA;&gt; &gt; &#xA;&gt; &gt; I&#39;m not a fan of the solution that a CNode should keep state and talk to&#xA;&gt; &gt; its remote nodes differently while announcing new blocks.&#xA;&gt; &gt; Its too complicated and ultimately counter-productive.&#xA;&gt; &gt; &#xA;&gt; &gt; The problem is that an individual node needs to predict network behaviour&#xA;&gt; &gt; in advance. With the downside that if it guesses wrong that both nodes&#xA;&gt; &gt; end up paying for the wrong guess.&#xA;&gt; &gt; This is not a good way to design a p2p layer.&#xA;&gt; &#xA;&gt; Nodes don&#39;t need to predict much in advance, and the cost for predicting&#xA;&gt; wrong is 0 if your peers receive blocks with a few hundred ms between&#xA;&gt; them (as we should expect) and you haven&#39;t set the announce bit on more&#xA;&gt; than a few peers (as the spec requires for this reason).&#xA;&#xA;You misunderstand the networking effects.&#xA;The fact that your node is required to choose which one to set the announce &#xA;bit on implies that it needs to predict which node will have the best data in &#xA;the future.&#xA;It needs to predict which nodes will not start being incommunicado and it &#xA;requires them to predict all the things that are not possible to predict in a &#xA;network.&#xA;In networking it is even more true than in stocks; results of the past are no &#xA;guarantee for the future.&#xA;&#xA;This means you are creating a fragile system. Your system will only work in &#xA;laboratory situations.  It will fail spectacularly when the network or the &#xA;internet is under stress or some parts fall away.&#xA;&#xA;&#xA;Another problem with your solution is that nodes send a much larger amount of &#xA;unsolicited data to peers in the form of the thin-block compared to the normal &#xA;inv or header-first data.&#xA;&#xA;Saying this is mitigated by only subscribing on this data from a small &#xA;subsection of nodes means you position yourself in a situation that I &#xA;displayed above. A tradeoff of fragile and fast.  With no possible way to make &#xA;a node automatically decide on a good equilibrium.&#xA;&#xA;&#xA;&gt; It seems I forgot to add a suggested peer-preforwarding-selection&#xA;&gt; algorithm in the text, but the intended use-case is to set the bit on&#xA;&gt; peers which recently provided you blocks faster than other peers, up to&#xA;&gt; only one or three peers. This is both simple and should be incredibly&#xA;&gt; effective.&#xA;&#xA;Network autorepair systems have been researched for decades, no real solution &#xA;has as of yet appeared. &#xA;PHDs are written on the subject and you want to make this a design for Bitcoin &#xA;based on &#34;[it] should be incredibly effective&#34;, I think you are underestimating &#xA;the subject matter you are dealing with.&#xA;&#xA;&#xA;&gt; &gt; I would suggest that a new block is announced to all nodes equally and&#xA;&gt; &gt; then&#xA;&gt; &gt; individual nodes can respond with a request of either a &#39;compact&#39; or a&#xA;&gt; &gt; normal block.&#xA;&gt; &gt; This is much more in line with the current design as well.&#xA;&gt; &gt; &#xA;&gt; &gt; Detection if remote nodes support compact blocks, for the purpose of&#xA;&gt; &gt; requesting a compact-block, can be done either via a network-bit or just a&#xA;&gt; &gt; protocol version. Or something else entirely, if you have better&#xA;&gt; &gt; suggestions.&#xA;&gt; &#xA;&gt; In line with recent trends, neither service bits nor protocol versions&#xA;&gt; are particularly well-suited for this purpose.&#xA;&#xA;Am I to understand that you choose the solution based on the fact that service &#xA;bits are too expensive to extend? (if not, please respond to my previous &#xA;question actually answering the suggestion)&#xA;&#xA;That sounds like a rather bad way of doing design. Maybe you can add a second &#xA;service bits field of message instead and then do the compact blocks correctly.&#xA;&#xA;&#xA;&gt; &gt;&gt; Variable-length integers: bytes are a MSB base-128 encoding of the&#xA;&gt; &gt;&gt; number.&#xA;&gt; &gt;&gt; The high bit in each byte signifies whether another digit follows.&#xA;&gt; &gt;&gt; [snip bitwise spec]&#xA;&gt; &gt; &#xA;&gt; &gt; I suggest just referring to UTF-8 which describes this just fine.&#xA;&gt; &gt; it is good practice to refer to existing specs when possible and not copy&#xA;&gt; &gt; the details.&#xA;&gt; &#xA;&gt; Hmm? There is no UTF anywhere in this protocol. Indeed this section&#xA;&gt; needs to be rewritten, as indicated. I&#39;d recommend you read the code&#xA;&gt; until I update the section with better text if you&#39;re confused.&#xA;&#xA;Wait, you didn&#39;t steal the variable length encoding from an existing standard &#xA;and you programmed a new one?&#xA;I strongly suggest you don&#39;t reinvent this kind of protocol level encodings &#xA;but instead steal from something like UTF8. Which has been around for decades.&#xA;&#xA;Please base your standard on other standards where possible.&#xA;&#xA;Look at UTF-8 on wikipedia, you may have &#34;invented&#34; the same encoding that IBM &#xA;published in 1992.&#xA;&#xA;&#xA;&gt; &gt;&gt; ====Short transaction IDs====&#xA;&gt; &gt;&gt; Short transaction IDs are used to represent a transaction without&#xA;&gt; &gt;&gt; sending a full 256-bit hash. They are calculated by:&#xA;&gt; &gt;&gt; # single-SHA256 hashing the block header with the nonce appended (in&#xA;&gt; &gt;&gt; little-endian)&#xA;&gt; &gt;&gt; # XORing each 8-byte chunk of the double-SHA256 transaction hash with&#xA;&gt; &gt;&gt; each corresponding 8-byte chunk of the hash from the previous step&#xA;&gt; &gt;&gt; # Adding each of the XORed 8-byte chunks together (in little-endian)&#xA;&gt; &gt;&gt; iteratively to find the short transaction ID&#xA;&gt; &gt; &#xA;&gt; &gt; I don&#39;t think this is needed. Just use the first 8 bytes.&#xA;&gt; &gt; The reason to do xor-ing doesn&#39;t hold up and extra complexity is unneeded.&#xA;&gt; &gt; Especially since you mention some lines down;&#xA;&gt; &gt; &#xA;&gt; &gt;&gt; The short transaction ID calculation is designed to take absolutely&#xA;&gt; &gt;&gt; minimal processing time during block compaction to avoid introducing&#xA;&gt; &gt;&gt; serious DoS vulnerabilities&#xA;&gt; &#xA;&gt; I&#39;m confused as to what, specifically, you&#39;re proposing this be changed&#xA;&gt; to.&#xA;&#xA;Just the first (highest) 8 bytes of a sha256 hash.&#xA;&#xA;The amount of collisions will not be less if you start xoring the rest.&#xA;The whole reason for doing this extra work is also irrelevant as a spam &#xA;protection. &#xA;&#xA;-- &#xA;Tom Zander</html></oembed>