<div dir="ltr"><div style>(generic comment on the discussion that spawned off: ideas about how to allow additional protocols for block exchange are certainly interesting, and in the long term we should certainly consider that. For now I&#39;d like to keep this about the more immediate way forward with making the P2P protocol not break in the presence of pruning nodes)</div>
<div style><br></div>On Sun, Apr 28, 2013 at 6:57 PM, Mike Hearn <span dir="ltr">&lt;<a href="mailto:mike@plan99.net" target="_blank">mike@plan99.net</a>&gt;</span> wrote:<br><div class="gmail_extra"><div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div>That&#39;s true. It can be perhaps be represented as &quot;I keep the last N blocks&quot; and then most likely for any given node the policy doesn&#39;t change all that fast, so if you know the best chain height you can calculate which nodes have what.</div>
</div></div></div></blockquote><div><br></div><div style>Yes, I like that better than broadcasting the exact height starting at which you serve (though I would put that information immediately in the version announcement). I don&#39;t think we can rely on the addr broadcasting mechanism for fast information exchange anyway. One more problem with this: DNS seeds cannot convey this information (neither do they currently convey service bits, but at least those can be indexed separately, and served explicitly through asking for a specific subdomain or so).</div>
<div style><br></div><div style>So to summarize:</div><div style>* Add a field to addr messages (after protocol number increase) that maintains number of top blocks served)?</div><div style>* Add a field to version message to announce the actual first block served?</div>
<div style>* Add service bits to separately enable &quot;relaying/verifying node&quot; and &quot;serves (part of) the historic chain&quot;? My original reason for suggesting this was different, I think better compatibility with DNS seeds may be a good reason for this. You could ask the seed first for a subset that at least serves some part of the historic chain, until you hit a node that has enough, and once caught up, ask for nodes that relay.</div>
<div style><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div class="im"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div>
<div><span style="color:rgb(34,34,34)">Disconnecting in case something is requested that isn&#39;t served seems like an acceptable behaviour, yes. A specific message indicating data is pruned may be more flexible, but more complex to handle too. </span><span style="color:rgb(34,34,34)"> </span></div>
</div></div></div></div></blockquote></div></div></div></div></blockquote><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">
<div class="im"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div>
</div></div></div></div></blockquote><div><br></div></div><div>Well, old nodes would ignore it and new nodes wouldn&#39;t need it?</div></div></div></div></blockquote><div><br></div><div style>I&#39;m sure there will be cases where a new node connects based on outdated information. I&#39;m just stating that I agree with the generic policy of &quot;if a node requests something it should have known the peer doesn&#39;t serve, it is fair to be disconnected.&quot;</div>
<div style> <span style="color:rgb(80,0,80)"> </span></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">
<div class="im"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div>
<div><span style="color:rgb(34,34,34)">The reason for splitting them is that I think over time these may be handled by different implementations. You could have stupid storage/bandwidth nodes that just keep the blockchain around, and others that validate it. Even if that doesn&#39;t happen implementation-wise, I think these are sufficiently independent functions to start thinking about them as such.</span></div>

</div></div></div></div></blockquote><div><br></div></div><div>Maybe so, with a &quot;last N blocks&quot; in addr messages though such nodes could just set their advertised history to zero and not have to deal with serving blocks to nodes.</div>

<div><br></div><div>If you have a node that serves the chain but doesn&#39;t validate it, how does it know what the best chain is? Just whatever the hardest is?</div></div></div></div></blockquote><div><br></div><div style>
Maybe it validates, maybe it doesn&#39;t. What matters is that it doesn&#39;t guarantee relaying fresh blocks and transactions. Maybe it does validate, maybe it just stores any blocks, and uses a validating node to know what to announce as best chain, or it uses an SPV mechanism to determine that. Or it only validates and relays blocks, but not transactions. My point is that &quot;serving historic data&quot; and &quot;relaying fresh data&quot; are separate responsibilities, and there&#39;s no need to require them to be combined.</div>
<div style><br></div><div style>-- </div><div style>Pieter</div><div style><br></div></div></div></div>