Bitcoin Forum

Bitcoin => Development & Technical Discussion => Topic started by: jnano on May 03, 2018, 07:06:02 PM



Title: Stale files kept under "chainstate"?
Post by: jnano on May 03, 2018, 07:06:02 PM
Almost all of the files under chainstate are touched frequently, but I have a handful that are unchanged since the initial sync months ago. These files start with 0, unlike the recent ones that start with 6.

Are the 0 files still in use, or are they leftovers that weren't automatically deleted?


Title: Re: Stale files kept under "chainstate"?
Post by: cellard on May 04, 2018, 01:40:51 PM
Almost all of the files under chainstate are touched frequently, but I have a handful that are unchanged since the initial sync months ago. These files start with 0, unlike the recent ones that start with 6.

Are the 0 files still in use, or are they leftovers that weren't automatically deleted?


Is it a full node or a pruned node?

Weird in my opinion... it should all have a "last modified" date of the latest time you opened your client, or at least that seems to be the case with my folder.

The only 2 files that aren't "last modified" on the latest time I opened the client are "LOG" and "LOG.old" which are from last september.

In case of doubt, just delete the entire chainstate folder and get a new fresh one by just opening the client.


Title: Re: Stale files kept under "chainstate"?
Post by: jnano on May 04, 2018, 09:13:29 PM
It's pruned, so the chainstate can't be recreated.

The other files aren't always all dated to the last run date, but they're at most a few days off.

I could try temporarily moving these files out and see what happens, but I don't know if the effect would be immediately apparent or only when data from these files is needed.



Title: Re: Stale files kept under "chainstate"?
Post by: achow101 on May 05, 2018, 01:23:55 AM
Just because the files have not been modified does not necessarily mean they are unused. Those database files are likely still accessed as they contain data that Bitcoin Core needs. However that does not mean that those file need to be modified. The data stored there does not always need to change.


Title: Re: Stale files kept under "chainstate"?
Post by: jnano on May 05, 2018, 10:32:04 PM
Yes, that's one possibility I thought of. Maybe old TXOs that haven't been used in years.
But considering all the other files change at most every few days, and these haven't changed in months, it does seem odd.

cellard says all his chainstate files are with recent dates. Is it the same for you? And any 0-prefix files?


Title: Re: Stale files kept under "chainstate"?
Post by: achow101 on May 06, 2018, 06:06:32 AM
Yes, that's one possibility I thought of. Maybe old TXOs that haven't been used in years.
But considering all the other files change at most every few days, and these haven't changed in months, it does seem odd.

cellard says all his chainstate files are with recent dates. Is it the same for you? And any 0-prefix files?

All of my chainstate files are  fairly recent. No 0 prefix files.

Since the database format has changed in recent versions, it's possible that those are old database files from previous versions.

Are you able to check when those files were last accessed?


Title: Re: Stale files kept under "chainstate"?
Post by: jnano on May 06, 2018, 09:41:28 AM
The files are at least read on startup. I don't know if simply because they are there (verification?) or more than that.

It's not due to version changes because I haven't changed a version since initial install.

Anyway, it's not a big deal, just a small curiosity. I thought someone might know quickly.