Author

Topic: How does Bitcoin Core estimate the time left until synced? (Read 106 times)

staff
Activity: 3458
Merit: 6793
Just writing some code
Bitcoin Core has a few hard coded values that are updated each release. The values relevant for this estimate is the number of transactions in the blockchain, the average number of transactions per second for a window of recent blocks (usually 4096), and the timestamp of the block for which this data was generated. Using these values, Bitcoin Core estimates the total number of txs in chain currently, then computes the progress by calculating the percentage of txs that have actually been processed so far.

When the hard coded tx count is passed, the progress estimator switches to using the current tx count and the current block's timestamp, rather than the hard coded tx count and timestamp. It does still use the hard coded tx rate though.
legendary
Activity: 1512
Merit: 7340
Farewell, Leo
Given the current block height, and given the announced chain tip from other nodes, how does it estimate when it will finish syncing? There is no known time that it takes to verify a block. It can be filled with lots of complicated scripts like this one and take up to even 12 minutes, or just by one transaction which is a 4 MB long message, and thus can be verified very quickly.

What's the optimal approach? Average verification time of the past x blocks?

Edit: I'm trying to sync the testnet3. I've reached the recent spam phase, and it went from 89 minutes remaining to 100.  Tongue
Jump to: