Bitcoin Forum

Bitcoin => Bitcoin Discussion => Topic started by: Jan on October 27, 2011, 06:18:53 PM



Title: Time to download the block chain
Post by: Jan on October 27, 2011, 06:18:53 PM
I started downloading the block chain from scratch a few hours ago using the satoshi client. So far I have received 10,519 blocks (yes, my internet connection is fine, and I have 8 connections). At this speed it is going to take forever.
Did you recently download the block chain from scratch, and how long time did it roughly take?


Title: Re: Time to download the block chain
Post by: Remember remember the 5th of November on October 27, 2011, 06:20:09 PM
No i downloaded an archive and waited only 2-3 minutes.

http://bitcoin.bluematt.me/bitcoin-nightly/blockchain-nightly/


Title: Re: Time to download the block chain
Post by: Jan on October 27, 2011, 06:23:53 PM
No i downloaded an archive and waited only 2-3 minutes.

http://bitcoin.bluematt.me/bitcoin-nightly/blockchain-nightly/

I am not going to download the block chain from some random url.


Title: Re: Time to download the block chain
Post by: BTCurious on October 27, 2011, 06:26:47 PM
Reliable URL:
http://sourceforge.net/projects/bitcoin/files/Bitcoin/blockchain/

Be sure to read the warning though.


Title: Re: Time to download the block chain
Post by: Akemashite Omedetou on October 27, 2011, 06:31:12 PM
No i downloaded an archive and waited only 2-3 minutes.

http://bitcoin.bluematt.me/bitcoin-nightly/blockchain-nightly/

I am not going to download the block chain from some random url.


Your bitcoin client will check all the blocks and if they are nonvalid, it won't accept them. There is no good way to fake the block chain, the whole "hardcode-first-block-hash-and-then-include-hash-of-previous-block-in-each-next-block" thing is what makes bitcoin so secure. So unless there is some 0-day bug in the bitcoin client I wouldn't worry too much about downloading block chain from unknown source.


Title: Re: Time to download the block chain
Post by: Jan on October 27, 2011, 06:32:38 PM
Reliable URL:
http://sourceforge.net/projects/bitcoin/files/Bitcoin/blockchain/

Be sure to read the warning though.
If this is the solution then we need to bake this into the client, and use proper signatures and such. However, last time I did download the block chain using the client which is probably just a few months ago, it went much faster. Is this the result of a higher percentage of clients not accepting connections?


Title: Re: Time to download the block chain
Post by: BTCurious on October 27, 2011, 06:36:14 PM
Your bitcoin client will check all the blocks and if they are nonvalid, it won't accept them. There is no good way to fake the block chain, the whole "hardcode-first-block-hash-and-then-include-hash-of-previous-block-in-each-next-block" thing is what makes bitcoin so secure. So unless there is some 0-day bug in the bitcoin client I wouldn't worry too much about downloading block chain from unknown source.
That sounds like it makes sense. I can understand the position of being careful when one doesn't understand the entire technology/security involved though, and downloading from a more well-known url won't hurt.

If this is the solution then we need to bake this into the client, and use proper signatures and such. However, last time I did download the block chain using the client which is probably just a few months ago, it went much faster. Is this the result of a higher percentage of clients not accepting connections?
Hardcoding a download from a central source goes against the concept of bitcoin, and creates a weak point in the system. Downloading from peers is the only real thing to bake into the client.
Speed depends on connection speed, and number of connected peers and such. For me it took a few hours when I re-did it yesterday, IIRC.

Speed increasing is actually being worked on; the idea is to only download the block headers at first, making the client usable much faster. I believe the rest of the chain is then downloaded in the background, but don't hold me to that.


Title: Re: Time to download the block chain
Post by: Jan on October 27, 2011, 06:45:33 PM
No i downloaded an archive and waited only 2-3 minutes.

http://bitcoin.bluematt.me/bitcoin-nightly/blockchain-nightly/

I am not going to download the block chain from some random url.


Your bitcoin client will check all the blocks and if they are nonvalid, it won't accept them. There is no good way to fake the block chain, the whole "hardcode-first-block-hash-and-then-include-hash-of-previous-block-in-each-next-block" thing is what makes bitcoin so secure. So unless there is some 0-day bug in the bitcoin client I wouldn't worry too much about downloading block chain from unknown source.

Erhm... When you download the database as a bunch of files and start the client it is NOT validating it. This would mean that the client would have to validate all transactions whenever it is started.


Title: Re: Time to download the block chain
Post by: Steve on October 27, 2011, 06:57:26 PM
Downloading from the p2p network shouldn't be that slow compared with downloading from a website...verification will take time, but that should be done regardless of how the chain is first downloaded.  Maybe the client should try to connect to more peers when it's catching up, dropping slow peers and trying to latch on to faster ones.


Title: Re: Time to download the block chain
Post by: Gabi on October 27, 2011, 07:23:35 PM
Download speed of the blockchain is ridicolous and make no sense.

It's a P2P network where there is a 900MB file and pretty much everyone is a seeder. On bittorrent that mean FULL STEAM AHEAD! DOWNLOAD AT FULL SPEED!
It should take like 5 or 10 minutes.

Instead here it take 12+hours.......


Title: Re: Time to download the block chain
Post by: BTCurious on October 27, 2011, 07:25:14 PM
Download speed of the blockchain is ridicolous and make no sense.

It's a P2P network where there is a 900MB file and pretty much everyone is a seeder. On bittorrent that mean FULL STEAM AHEAD! DOWNLOAD AT FULL SPEED!
It should take like 5 or 10 minutes.

Instead here it take 12+hours.......
I think the client limits its connections to a few tens of peers. Given that these are random peers, their upload speeds are going to be horrible. (This is speculation though, I may be wrong about how this works.)


Title: Re: Time to download the block chain
Post by: Gabi on October 27, 2011, 07:27:56 PM
Maybe you are right



Title: Re: Time to download the block chain
Post by: DeathAndTaxes on October 27, 2011, 08:44:52 PM
No i downloaded an archive and waited only 2-3 minutes.

http://bitcoin.bluematt.me/bitcoin-nightly/blockchain-nightly/

I am not going to download the block chain from some random url.


Your bitcoin client will check all the blocks and if they are nonvalid, it won't accept them. There is no good way to fake the block chain, the whole "hardcode-first-block-hash-and-then-include-hash-of-previous-block-in-each-next-block" thing is what makes bitcoin so secure. So unless there is some 0-day bug in the bitcoin client I wouldn't worry too much about downloading block chain from unknown source.

Erhm... When you download the database as a bunch of files and start the client it is NOT validating it. This would mean that the client would have to validate all transactions whenever it is started.

Well it depends.  The db contains a record of last block verified.  The person uploading the db could modify it so that is block 0 and the client would rescan entire block chain.  Alternatively use the -rescan command line option to force a complete verification of downloaded block chain.  Hopefully in future client will have a "verify blockchain" option/menu/button.

I do agree this could be improved. 
Why not include 70% of the blockchain with the binary?
Why not give client an option to download entire block chain up to a week prior from a repository and then auto-rescan?


Title: Re: Time to download the block chain
Post by: FreeMoney on October 27, 2011, 08:47:11 PM
Download speed of the blockchain is ridicolous and make no sense.

It's a P2P network where there is a 900MB file and pretty much everyone is a seeder. On bittorrent that mean FULL STEAM AHEAD! DOWNLOAD AT FULL SPEED!
It should take like 5 or 10 minutes.

Instead here it take 12+hours.......
I think the client limits its connections to a few tens of peers. Given that these are random peers, their upload speeds are going to be horrible. (This is speculation though, I may be wrong about how this works.)

This seems right, but also there is a huge difference on a netbook compared to a desktop. I think this is because it validates as blocks come in and machine speed matters.


Title: Re: Time to download the block chain
Post by: byronbb on October 27, 2011, 09:16:11 PM
if you only get 8 connections you need to open some ports


Title: Re: Time to download the block chain
Post by: MysteryMiner on October 28, 2011, 01:47:35 AM
(yes, my internet connection is fine, and I have 8 connections).
No, Your connection is not fine. Open the necessary ports in router or enable UPnP. You will most likely get more speed. Also the power of computer and random acess times of harddrive is also important. I taken hour and a half to download blockchain on Core2Duo running on WD Raptor, but the same blocks taked whole day to download on aging Pentium4 running with old Maxtor drive.

In future there might be good idea to release the Bitcoin software with two installers - the standart and the Mega installer, that installs the blockchain files in Bitcoin directory.


Title: Re: Time to download the block chain
Post by: ctoon6 on October 28, 2011, 02:00:45 AM
DO NOT USE UPnP!!!!!!

in some routers, they can be completely reconfigured by sending only 1 packet. this can be solved by simply turning off UPnP. id also advise turning off all other remote and automatic configuration systems, they are only security holes.


Title: Re: Time to download the block chain
Post by: DeathAndTaxes on October 28, 2011, 02:03:54 AM
DO NOT USE UPnP!!!!!!

in some routers, they can be completely reconfigured by sending only 1 packet. this can be solved by simply turning off UPnP. id also advise turning off all other remote and automatic configuration systems, they are only security holes.

Um UPnP can only be enabled by an application on the LAN side.  If you have malicous software on the inside of your firewall/router then you have larger problems then UPnP.

Also is the number of packets suppose to be scary?  If it took 500 packets to enable UPnP would that somehow be safer than a single packet?


Title: Re: Time to download the block chain
Post by: slush on October 28, 2011, 02:11:06 AM
Yesterday I downloaded blockchain on 10Gbit line, few Xeon CPUs and SSD raid. It took only one hour to complete :-).

I followed iostat, iftop and htop and it definitely looks that the biggest issue is waiting on data from network. Sometimes it processed 500 blocks per second, but then suddently dropped connection to peer and it took long time (minutes?) to recover and continue downloading.


Title: Re: Time to download the block chain
Post by: ctoon6 on October 28, 2011, 02:11:33 AM
DO NOT USE UPnP!!!!!!

in some routers, they can be completely reconfigured by sending only 1 packet. this can be solved by simply turning off UPnP. id also advise turning off all other remote and automatic configuration systems, they are only security holes.

Um UPnP can only be enabled by an application on the LAN side.  If you have malicous software on the inside of your firewall/router then you have larger problems then UPnP.

Also is the number of packets suppose to be scary?  If it took 500 packets to enable UPnP would that somehow be safer than a single packet?

if you need UPnP then you probably have no idea what lan and wan is, and probably no idea what UPnP even is. if you know all of them terms then you should have no trouble at all forwarding the ports manually, it literally takes 2 minutes if you are familiar with your routers UI. also, it would not really matter the amount of packets required, the exploit still exists and is just as dangerous.

also, not all routers allow the user to just disable UPnP on wan or lan individually.


Title: Re: Time to download the block chain
Post by: MysteryMiner on October 28, 2011, 02:14:11 AM
DO NOT USE UPnP!!!!!!

in some routers, they can be completely reconfigured by sending only 1 packet. this can be solved by simply turning off UPnP. id also advise turning off all other remote and automatic configuration systems, they are only security holes.
In my systems I configure ports manually, and no UPnP. For most users who are clueless about networking, the router with UPnP is still more secure than going directly to internet. It's like going naked on street when gay pride is marching nearby.
Quote
If you have malicous software on the inside of your firewall/router then you have larger problems then UPnP.
Yes, the golden rule. It's either completely clean and safe, or you are owned. And Yes, most routers allow changing UPnP rules only from LAN side. Still there are routers with badly written firmware or running on default passwords and with WAN management acess enabled.


Title: Re: Time to download the block chain
Post by: DeathAndTaxes on October 28, 2011, 02:14:37 AM

also, not all routers allow the user to just disable UPnP on wan or lan individually.

Of course they don't because UPnP only works from LAN side.  I don't use it but I find the hysteria over UPnp to be amusing.  For it to present a risk you would already need malicous software inside the network.  If that is true you likely are fucked UPnP or not.  The very people who are the most likely to allow that to happen (look an exe from my friend... click) have no chance to configuring a router manually anyways.  So without UPnp they are likely going to turn off all firewalls, put their PC on DMZ, or plug directly into cable modem which are far worse than enabling UPnP.   Also it isn't like lack of UPnP makes the network invulnerable to attack.

  



Title: Re: Time to download the block chain
Post by: MysteryMiner on October 28, 2011, 02:18:29 AM
There is a lot of misguided sysadmins who think UPnP is malicius and vector of vulnerability. In reality UPnP can only be used to help attacker, when he got the payload already in the LAN side and the malware is run. It's game-over scenario anyway.

One more thing - with properly written UPnP software, the opened port rule is closed once the application using it is closed. With permanently forwarded port the port is forwarded at all times.


Title: Re: Time to download the block chain
Post by: jetmine on October 28, 2011, 04:23:12 PM
Of course they don't because UPnP only works from LAN side.  I don't use it but I find the hysteria over UPnp to be amusing.  For it to present a risk you would already need malicous software inside the network.

You should read the FAQ on the umap pentest tool: http://www.toor.do/


Title: Re: Time to download the block chain
Post by: Remember remember the 5th of November on October 31, 2011, 12:02:52 AM
No i downloaded an archive and waited only 2-3 minutes.

http://bitcoin.bluematt.me/bitcoin-nightly/blockchain-nightly/

I am not going to download the block chain from some random url.
Whatever...BlueMatt is a developer working on Bitcoin and this can be verified on freenode @ #bitcoin-dev


Title: Re: Time to download the block chain
Post by: payb.tc on October 31, 2011, 12:19:19 AM
Download speed of the blockchain is ridicolous and make no sense.

It's a P2P network where there is a 900MB file and pretty much everyone is a seeder. On bittorrent that mean FULL STEAM AHEAD! DOWNLOAD AT FULL SPEED!
It should take like 5 or 10 minutes.

Instead here it take 12+hours.......

a bittorrent download is done completely out of order and the client just continually fills in the blanks.

a blockchain download is done in order and only after block 123 is downloaded will it download block 124*

in addition, file compression would be far more efficient when compressing the entire chain as one big file (for possible deployment on bittorrent), whereas because bitcoin downloads each block separately, the compression over the whole chain is less efficient.

*could be wrong, please get a second opinion.


Title: Re: Time to download the block chain
Post by: notme on October 31, 2011, 12:24:16 AM
There's no reason each release couldn't come with a torrent file with a recent snapshot of the blockchain.