Bitcoin Forum
October 17, 2018, 12:15:34 AM *
News: Make sure you are not using versions of Bitcoin Core other than 0.17.0 [Torrent], 0.16.3, 0.15.2, or 0.14.3. More info.
 
   Home   Help Search Donate Login Register  
Pages: [1]
  Print  
Author Topic: Why does Core rewrite the chainstate after startup?  (Read 25 times)
jnano
Member
**
Offline Offline

Activity: 237
Merit: 13


View Profile
December 25, 2017, 09:23:47 AM
 #1

Why does Bitcoin Core rewrite large parts of the chainstate after startup?
It happens even when very few new blocks were downloaded, and it takes a long while, sometimes 30 minutes (on HDD).
1539735334
Hero Member
*
Offline Offline

Posts: 1539735334

View Profile Personal Message (Offline)

Ignore
1539735334
Reply with quote  #2

1539735334
Report to moderator
1539735334
Hero Member
*
Offline Offline

Posts: 1539735334

View Profile Personal Message (Offline)

Ignore
1539735334
Reply with quote  #2

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

Posts: 1539735334

View Profile Personal Message (Offline)

Ignore
1539735334
Reply with quote  #2

1539735334
Report to moderator
LoyceV
Legendary
*
Offline Offline

Activity: 1274
Merit: 2112


Self-made Legendary!


View Profile WWW
December 25, 2017, 09:39:21 AM
 #2

Why does Bitcoin Core rewrite large parts of the chainstate after startup?
It checks some older blocks, without knowing all technical details I can tell it's to ensure it's on the right chain.

Quote
It happens even when very few new blocks were downloaded, and it takes a long while, sometimes 30 minutes (on HDD).
Is your computer very limited on RAM? It used to take about 1 minute with chainstate on my hdd, and it's reduced to just seconds with chainstate on my SSD.

Your nickname looks familiar, haven't we discussed Bitcoin Core's performance before?
Edit: we did. I still think your performance problems must be related to your computer (hardware or operating system).

jnano
Member
**
Offline Offline

Activity: 237
Merit: 13


View Profile
December 25, 2017, 10:19:40 AM
 #3

Yes, we've talked about similar I/O issues before. It's another one related to the bad/no caching behavior of Core.
I'm not talking about syncing here, just a chainstate rewrite even when it's fully synced, or at worst a handful of blocks away (the UI doesn't show the syncing progress overlay).

So I wonder why it needs to do a lengthy rewrite on startup, considering that after it's settled, when downloading blocks later on there isn't such a lengthy process. There's something unique about what it does on startup. Maybe insight into that could allow me to optimize Core's settings, or find another way to dodge the issue. Maybe it'll get bugfixed.

As before, there's nothing special with my computer. It's perfectly fine, everything besides Core works as it should. It's just running Core that's always such a chore. Smiley

Your RAM drive idea helped with syncing (though it requires manual work), but after syncing and copying the files back to HDD, I still need to run it from the HDD. And then, in many cases, also the chainstate rewrite gets real tedious. Now, if the the caching code is improved it would surely help, but I'm still curious why there's a need for that major rewrite, unrelated to syncing, on every startup.

BTW, Litecoin Core behaves better, at least partially. Though there I'm on an older version, 0.14.2. Also the different/smaller blockchain might affect the behavior.
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!