Bitcoin Forum
June 15, 2024, 05:29:08 AM *
News: Voting for pizza day contest
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Predicting Time to Finish Downloading Chain  (Read 762 times)
etotheipi (OP)
Legendary
*
expert
Offline Offline

Activity: 1428
Merit: 1093


Core Armory Developer


View Profile WWW
March 09, 2013, 01:30:23 AM
 #1

I want to put this in Armory, but maybe Bitcoin-Qt would do the same thing:  roughly predict the time to finish downloading and verifying the chain in Bitcoin-Qt.  It doesn't need to be exact by any means, but it shouldn't be like the Windows copy dialog.  

Anyone have any empirical data on this?  Sure, I could do some experiments myself, but why if someone else already has it?  I expect it would be some linear combination of the number of blocks remaining and the number MB remaining.  I expect to be able to approximate both, along with rates of download/verification, and come up with something accurate to within 15 minutes.  Perhaps only the MB-remaining-to-download is the important metric.  Or maybe as simple as a reverse-lookup table based on previous measurements, that says 'if you are up to block 178k that's 50%, 202k is 75%", etc.    I just want to set expectations appropriately for the first-time user.

Founder and CEO of Armory Technologies, Inc.
Armory Bitcoin Wallet: Bringing cold storage to the average user!
Only use Armory software signed by the Armory Offline Signing Key (0x98832223)

Please donate to the Armory project by clicking here!    (or donate directly via 1QBDLYTDFHHZAABYSKGKPWKLSXZWCCJQBX -- yes, it's a real address!)
etotheipi (OP)
Legendary
*
expert
Offline Offline

Activity: 1428
Merit: 1093


Core Armory Developer


View Profile WWW
March 10, 2013, 07:05:20 PM
 #2

Okay, well I just did an experiment with Bitcoin-Qt 0.8, and what I found is kind of scary...

Plotting percentage-of-blocks-downloaded vs percentage-of-total-download-time yielded a rather extreme relationship:



It can be linearized by plotting (% of blocks)8 vs (% of total time).  The linearity of the result is surprisingly... good.  



This is scary because I would like to think that no part of Bitcoin has an order of growth of O(N8).   Of course, that was probably the trajectory of the relationship before we hit the [artificial] block-size limits.

The moral of this story is that if you predict the current top block you are synchronizing to (say from asking peers, or just projecting out at 10min/blk from your last estimate), then you can create a fairly accurate "Percent Complete: ..." meter by simply computing (currentBlock/maxBlock)8.  This seems to be accurate for at least the first 225k blocks...

Founder and CEO of Armory Technologies, Inc.
Armory Bitcoin Wallet: Bringing cold storage to the average user!
Only use Armory software signed by the Armory Offline Signing Key (0x98832223)

Please donate to the Armory project by clicking here!    (or donate directly via 1QBDLYTDFHHZAABYSKGKPWKLSXZWCCJQBX -- yes, it's a real address!)
justusranvier
Legendary
*
Offline Offline

Activity: 1400
Merit: 1009



View Profile
March 10, 2013, 07:16:43 PM
 #3

This is scary because I would like to think that no part of Bitcoin has an order of growth of O(N8).
It won't last forever; just until we move past the inflection point of the S curve.
gmaxwell
Moderator
Legendary
*
expert
Offline Offline

Activity: 4200
Merit: 8440



View Profile WWW
March 10, 2013, 09:04:53 PM
 #4

The download time is linear in the number of transactions. 0.8.1 (current git) uses that for its progress indicator.
etotheipi (OP)
Legendary
*
expert
Offline Offline

Activity: 1428
Merit: 1093


Core Armory Developer


View Profile WWW
March 10, 2013, 09:08:06 PM
 #5

The download time is linear in the number of transactions ...

Imagine that...

Founder and CEO of Armory Technologies, Inc.
Armory Bitcoin Wallet: Bringing cold storage to the average user!
Only use Armory software signed by the Armory Offline Signing Key (0x98832223)

Please donate to the Armory project by clicking here!    (or donate directly via 1QBDLYTDFHHZAABYSKGKPWKLSXZWCCJQBX -- yes, it's a real address!)
etotheipi (OP)
Legendary
*
expert
Offline Offline

Activity: 1428
Merit: 1093


Core Armory Developer


View Profile WWW
March 10, 2013, 09:23:03 PM
Last edit: March 10, 2013, 10:00:00 PM by etotheipi
 #6

Actually, wouldn't it more directly be related to the number of signatures?  And if so, isn't the ratio of blockchain bytes to signature bytes fairly constant?   In other words, wouldn't it be even more accurate to measure/predict the number of TxIn's?  Or probably just total blockchain bytes...

Also, sipa just pointed out that verification is diabled for the initial download up to about blk 216,000.  This is because there's a hard-coded checkpoint there, so verification isn't necessary.  This would explain why it all slows down pretty dramatically at the very end.  

I guess it is just coincidence that it fits the N8 curve pretty cleanly...

Founder and CEO of Armory Technologies, Inc.
Armory Bitcoin Wallet: Bringing cold storage to the average user!
Only use Armory software signed by the Armory Offline Signing Key (0x98832223)

Please donate to the Armory project by clicking here!    (or donate directly via 1QBDLYTDFHHZAABYSKGKPWKLSXZWCCJQBX -- yes, it's a real address!)
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!