How does Bitcoin Core calculate the sync time remaining?

1 reply 326 views
paul.stakeHero Member
Posts: 651 · Reputation: 3798
#1May 1, 2020, 01:51 PM
So, considering the current block height and the latest chain tip shared by other nodes, how does it figure out when it'll finish syncing? There’s no set time for block verification. Some blocks have complex scripts that could take ages, like up to 12 minutes, while others with simpler transactions can get verified super fast, even if they’re huge like 4 MB. What’s the best way to estimate this? Maybe use the average verification time of, like, the last x blocks? By the way, I’m trying to sync testnet3, but I hit the recent spam wave and saw my remaining time jump from 89 minutes to 100.
5 Reply Quote Share
ryan_nodeSenior Member
Posts: 204 · Reputation: 859
#2May 1, 2020, 06:51 PM
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.
5 Reply Quote Share

Related topics