Bitcoin Forum
May 26, 2024, 05:35:56 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Why does Core rewrite the chainstate after startup?  (Read 133 times)
jnano (OP)
Member
**
Offline Offline

Activity: 301
Merit: 74


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).
LoyceV
Legendary
*
Offline Offline

Activity: 3318
Merit: 16713


Thick-Skinned Gang Leader and Golden Feather 2021


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 (OP)
Member
**
Offline Offline

Activity: 301
Merit: 74


View Profile
December 25, 2017, 10:19:40 AM
Last edit: December 25, 2017, 10:30:47 AM by jnano
 #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:  

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