Bitcoin Forum
November 12, 2018, 09:23:58 PM *
News: Latest Bitcoin Core release: 0.17.0 [Torrent].
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: What exactly happens during Blockchain Synchronization?  (Read 400 times)
NeonFlash
Full Member
***
Offline Offline

Activity: 202
Merit: 100



View Profile
August 28, 2017, 06:14:17 AM
 #1

Hi All,

I am trying to get back into the technical aspects of Bitcoin. I was quite active several years ago however now I would like to understand the ins and outs of Bitcoin and Blockchain technology much better. Also, trying to refresh my knowledge.

So, when we start the Bitcoin Core client (full node), it tries to download the Blocks. I saw it mentioned in several places that the speed at which you synchronize depends not only on your Internet connection speed but also on your Processor speed. I would like to understand what role does the processor speed play here?

Besides downloading the blocks, is the full node client also performing a Digital Signature verification for each transaction included in that block?

Also, I noticed that the newer blocks in the blockchain take longer time to synchronize than the older blocks. Is it because the newer blocks include more number of transactions and so the full node client needs to perform more number of verification per block?

Is there any way to speed up the process of synchronizing the blockchain? Of course, besides buying the latest and fastest processor Cheesy

Thanks.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
1542057838
Hero Member
*
Offline Offline

Posts: 1542057838

View Profile Personal Message (Offline)

Ignore
1542057838
Reply with quote  #2

1542057838
Report to moderator
aleksej996
Sr. Member
****
Offline Offline

Activity: 462
Merit: 311


Do not trust the government


View Profile WWW
August 28, 2017, 09:41:07 AM
 #2

Yes, Bitcoin Core checks if downloaded blocks are valid and that takes CPU power for checking all those transactions.
Yes, newer blocks have more transactions, so more CPU power is needed.
I am pretty sure that there is a command line option for Bitcoin Core to not verify downloaded blocks, but that is not advisable.
achow101
Moderator
Legendary
*
expert
Offline Offline

Activity: 1582
Merit: 1739


bc1qshxkrpe4arppq89fpzm6c0tpdvx5cfkve2c8kl


View Profile WWW
August 28, 2017, 01:47:12 PM
 #3

So, when we start the Bitcoin Core client (full node), it tries to download the Blocks. I saw it mentioned in several places that the speed at which you synchronize depends not only on your Internet connection speed but also on your Processor speed. I would like to understand what role does the processor speed play here?
The CPU has to do all of the work to verify the blocks as they are downloaded. It must hash the blocks and check the proof of work, hash the transactions in the block and compare that with the merkle root, lookup in a database to make sure that transactions are not spending previously spent inputs, etc. A lot of it is calculating hashes, which, given a large number of hashes, can be fairly computationally intensive.

Besides downloading the blocks, is the full node client also performing a Digital Signature verification for each transaction included in that block?
It depends on the block. Bitcoin Core has checkpoints which mean that the block at a certain height must have a certain hash. Blocks prior to that will not have signatures validated. The recent checkpoint was block 250000 which means that for older nodes, they will begin checking signatures after block 250000. However for newer nodes, we introduced a thing called assumevalid which supersedes checkpoints (although checkpoints still exist). Assumevalid has a block hash specified. It is similar to checkpoints; any block in the chain prior to the assumevalid block (we have a best headers chain which has the assumevalid block in it) will have signature validation skipped. Blocks after the assumevalid block will have all signatures verified. The assumevalid block can be set with the -assumevalid=<hash> startup option. The default assumevalid block is updated every release.

Also, I noticed that the newer blocks in the blockchain take longer time to synchronize than the older blocks. Is it because the newer blocks include more number of transactions and so the full node client needs to perform more number of verification per block?
Yes. There are more transactions in newer blocks which requires more hashing, and after the assumevalid block, all signature validation is done.

Is there any way to speed up the process of synchronizing the blockchain? Of course, besides buying the latest and fastest processor Cheesy
One of the bottlenecks is database flushing. To make syncing faster, you can increase the -dbcache=>n> parameter so more of the database is held in memory and does not need to be flushed to disk as often. You can also check the current block hash, and if you trust the block explorer you used, you can set the -assumevalid=<hash> option so that you will skip all signature validation up to the most recent block.

Pages: [1]
  Print  
 
Jump to:  

Sponsored by , a Bitcoin-accepting VPN.
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!