From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from sog-mx-3.v43.ch3.sourceforge.com ([172.29.43.193] helo=mx.sourceforge.net) by sfs-ml-4.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1WYDVX-0004b8-E9 for bitcoin-development@lists.sourceforge.net; Thu, 10 Apr 2014 11:51:03 +0000 Received-SPF: pass (sog-mx-3.v43.ch3.sourceforge.com: domain of gmail.com designates 209.85.217.171 as permitted sender) client-ip=209.85.217.171; envelope-from=gmaxwell@gmail.com; helo=mail-lb0-f171.google.com; Received: from mail-lb0-f171.google.com ([209.85.217.171]) by sog-mx-3.v43.ch3.sourceforge.com with esmtps (TLSv1:RC4-SHA:128) (Exim 4.76) id 1WYDVW-0000xB-9j for bitcoin-development@lists.sourceforge.net; Thu, 10 Apr 2014 11:51:03 +0000 Received: by mail-lb0-f171.google.com with SMTP id w7so2200725lbi.2 for ; Thu, 10 Apr 2014 04:50:55 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.112.131.65 with SMTP id ok1mr981627lbb.51.1397130655627; Thu, 10 Apr 2014 04:50:55 -0700 (PDT) Received: by 10.112.89.68 with HTTP; Thu, 10 Apr 2014 04:50:55 -0700 (PDT) In-Reply-To: References: <534570A2.9090502@gmx.de> <0B038624-8861-438E-B7B1-566B4A8E126B@bitsofproof.com> Date: Thu, 10 Apr 2014 04:50:55 -0700 Message-ID: From: Gregory Maxwell To: Pieter Wuille Content-Type: text/plain; charset=UTF-8 X-Spam-Score: -1.6 (-) X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. -1.5 SPF_CHECK_PASS SPF reports sender host as permitted sender for sender-domain 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (gmaxwell[at]gmail.com) -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-Headers-End: 1WYDVW-0000xB-9j Cc: Bitcoin Dev Subject: Re: [Bitcoin-development] Bitcoind-in-background mode for SPV wallets X-BeenThere: bitcoin-development@lists.sourceforge.net X-Mailman-Version: 2.1.9 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Apr 2014 11:51:03 -0000 On Thu, Apr 10, 2014 at 4:32 AM, Pieter Wuille wrote: > There were earlier discussions. On this list. > The two ideas were either using one or a few service bits to indicate > availability of blocks, or to extend addr messages with some flags to > indicate this information. > > I wonder whether we can't have a hybrid: bits to indicate general > degree of availability of blocks (none, only recent, everything), but > indicate actual availability only upon actually connecting (through a > "version" extension, or - preferably - a separate message). Reason is > that the actual blocks available are likely to change frequently (if > you keep the last week of blocks, a 3-day old addr entry will have > quite outdated information), and not that important to actual peer > selection - only to drive the decision which blocks to ask after > connection. I think you actually do need the kept ranges to be circulated, otherwise you might need to hunt for a very long time to find the right nodes with the blocks you need. Alternatively, you give up and don't hunt and pick some node that has them all and we get poor load distribution. I'd rather be in a case where the nodes that have the full history are only hit as a last resort. WRT the changing values, I think that is pretty uniquely related to the most recent blocks, and so instead I think that should be handled symbolically (e.g. the hybrid approach... a flag for the "I keep the most recent 2000 blocks", I say 2000 because thats about where the request offset historgrams flattened out) or as a single offset range "I keep the last N=200", and the flag or the offset would be in addition to whatever additional range was signaled. The latter could be infrequently changing. Signaling _more_ and more current range data on connect seems fine to me, I just don't think it replaces something that gets relayed. Based on the safety against reorgs and the block request access patterns we observed I'm pretty sure we'd want any node serving blocks at all to be at least the last N (for some number between 144 and 2000 or so). Based on the request patterns if just the recent blocks use up all the space you're willing to spend, then I think thats probably still the optimal contribution... (Just be glad I'm not suggesting coding the entire blockchain with an error correcting code so that it doesn't matter which subset you're holding)