[Bitcoin-development] Bitcoind-in-background mode for SPV wallets

Gregory Maxwell gmaxwell at gmail.com
Thu Apr 10 11:50:55 UTC 2014


On Thu, Apr 10, 2014 at 4:32 AM, Pieter Wuille <pieter.wuille at gmail.com> 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)




More information about the bitcoin-dev mailing list