Pages:
Author

Topic: P2P block download - use bit torrent like method - page 2. (Read 4730 times)

legendary
Activity: 1232
Merit: 1094
I too think the speed of block chain downloading is an issue.
Even you want to verify all blocks in the chain, can this be a two step process -- download all blocks concurrently first, and then verify the chain afterward? Just wondering.

Exactly.  300MB takes a few hours, no matter how fast your connection because it is p2p, but not torrent like.

However, if you download just the headers first (80 *130k = 10MB), you can at least verify that the blocks you get are real.

All nodes, including client nodes, would likely have the headers so you could p2p them too.

The main point is to download the chain itself from the last block and work backwards.  For most people, they will only need blocks from the last few weeks anyway.
legendary
Activity: 1441
Merit: 1000
Live and enjoy experiments
I too think the speed of block chain downloading is an issue.
Even you want to verify all blocks in the chain, can this be a two step process -- download all blocks concurrently first, and then verify the chain afterward? Just wondering.
staff
Activity: 4284
Merit: 8808
Also, the main proposal was to improve download speed and reduce strain on the seed nodes/miners.

Since the overwhelming majority of all the nodes already have all the blocks, it doesn't matter which blocks you fetch... except: making it sparse would add the  overhead of having to communicate what blocks you do/don't have.

The reasons that it's slow right now doesn't appear have anything to do with the downloading external to bitcoin.  One reason its slow, for example, is that downloading a run of 500 blocks is frequently enough to trigger a flood protection disconnect now. So a new node spends a lot of time being disconnected over and over again from its neighbors, and when it reconnects it wastes a lot of time doing addr.dat exchange.  It also may get itself flooded off all the competent neighbors...





legendary
Activity: 1232
Merit: 1094
If you are downloading the headers with the intention of downloading all the full blocks then you might as well just download the full blocks since you are going to do the same work twice.

That isn't entirely true.  You could download the chain and then download the last 2 weeks worth of blocks.  If anyone sent you money the last 2 weeks, you could verify the transaction directly.

By verify the block, I just meant confirm that the block is in the chain.

Also, the main proposal was to improve download speed and reduce strain on the seed nodes/miners.

Like in bittorrent, if one client downloads blocks 1-1000 and the other downloads 1001-2000, they can then swap blocks with each other and not download from the seed.  This means that the seed only has to send the chain once.

In fact, it would be equivalent to just using bit-torrent to download the chain and then rescanning it.  I am not sure if -rescan checks all the transactions though.
full member
Activity: 125
Merit: 100
Quote
Mostly, it is the block chain itself that needs to be verified.  Once you have that, you can distinguish fake blocks from real blocks.

Unless you are doing simple payment verification you can't verify a block until you have all previous blocks.

You can't know if anything in the block you are examining is a double spend unless you possess the data where those double spends would exist.
If you are downloading the headers with the intention of downloading all the full blocks then you might as well just download the full blocks since you are going to do the same work twice.


legendary
Activity: 1232
Merit: 1094
Isn't the reason that the blocks have to verified linear anyway? As in part of the hash is the result of the previous hash?

Mostly, it is the block chain itself that needs to be verified.  Once you have that, you can distinguish fake blocks from real blocks.

Blocks that have inputs connected to blocks that you haven't downloaded could be tagged as pending until the corresponding input block is downloaded.

However, any block that is more than 100-200 blocks away from the last block in the chain is almost certain to be valid and doesn't really need to be checked.
XIU
member
Activity: 84
Merit: 10
Isn't the reason that the blocks have to verified linear anyway? As in part of the hash is the result of the previous hash?
legendary
Activity: 1232
Merit: 1094
At the moment, the block chain is downloaded linearly.  This places a large load on the other node and it isn't possible for the downloader to pay back the other node.

A better method would be to download the blocks like in bittorrent.

Download all the headers. 

This should be fast, since it is 80 bytes per block. 

80 bytes every 10 minutes is around 4MB per year.

Download missing blocks

Since you have all the headers, you can ask for any 500 blocks that you want.

You could download blocks 1000-1500 from a seed and another peer could download 500-1000 from a seed.  You could then share the blocks with each other.  This greatly reduces the load on the seeding computers.

Blocks near the end of the chain are more valuable, since they are more likely to have active transactions.  The random selection could be biased towards trying to get those first.
Pages:
Jump to: