After setting up Bitcoin Core v22.0, I'm diving into the Settings < Options section. I got a couple of questions. First, what's the database cache for in a non-pruned node? If I have enough memory, what should I set it to? Also, what's up with the number of verification threads for scripts?
You mean dbcache? Default is 100MB but really depends on your RAM. Higher dbcache helps speed up syncing, whether pruned or non-pruned. Also, why're you on v22.0? That’s outdated, v27.1 is the latest. You might run into syncing problems using older versions.
When you first download blocks, Bitcoin Core checks each block and builds the chainstate. The dbcache speeds up this process since it keeps the chainstate in memory for quicker access. Just remember, the ideal size should be under your total RAM minus what the OS needs. I typically set it to around 4GB on an 8GB system.
That setting is actually called 'Script Verification Parallelization.' It’s essential for script verification, especially when new blocks get added. Default settings work fine for most users, but if your machine starts lagging during the initial block download, you can lower it or set a negative value to free up threads.
In simple terms, a bigger dbcache cuts down on disk reads and writes. Sure, the OS manages read-cache, but Bitcoin Core handles write-cache effectively with larger dbcache values. Your comment about non-volatile memory is totally off, though.
Yeah, I'm just focusing on dbcache. I put mine at 8GB, which sounds like overkill but my RAM can handle it. Thanks for pointing out the version issue! I was on Core 24/7 for two years without checking details, but now I’m looking deeper into settings.
Two questions here. 1. Any idea why there’s a ‘minus one’ for script threads? Seems like it’s just to be cautious. 2. I’m making a glossary for Full Node terms. I just defined 'chainstate.' Can you confirm this? It’s the state of all unspent transaction outputs at any time.
What range should dbcache cover in terms of RAM? I get it now, dbcache is volatile, but once a block is written, it goes to non-volatile memory. I'm just a bit confused sometimes at my age!
Your Core instance uses the main thread, so 'minus one' helps avoid issues. The count is based on cores to make sure you don’t overload your CPU. The chainstate gets flushed while syncing, making it faster since caching in RAM reduces I/O speed dependency.