diff options
author | Sjors Provoost <sjors@sprovoost.nl> | 2024-05-28 08:36:27 +0200 |
---|---|---|
committer | Sjors Provoost <sjors@sprovoost.nl> | 2024-05-28 08:36:28 +0200 |
commit | bb3b980dfd96d9a89e6b04aef2859ce0555c6807 (patch) | |
tree | b080282d915729aa2c83a8475e6ed49054f9ec82 /src | |
parent | 327f08bb0cd91a22249395adeb34549e3c86ca76 (diff) |
validation: drop maximum -dbcache
Fixes #28249
Diffstat (limited to 'src')
-rw-r--r-- | src/init.cpp | 2 | ||||
-rw-r--r-- | src/node/caches.cpp | 1 | ||||
-rw-r--r-- | src/qt/forms/optionsdialog.ui | 2 | ||||
-rw-r--r-- | src/qt/optionsdialog.cpp | 3 | ||||
-rw-r--r-- | src/txdb.h | 2 |
5 files changed, 3 insertions, 7 deletions
diff --git a/src/init.cpp b/src/init.cpp index 0aac2ac65f..05f53aa1fa 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -474,7 +474,7 @@ void SetupServerArgs(ArgsManager& argsman) argsman.AddArg("-conf=<file>", strprintf("Specify path to read-only configuration file. Relative paths will be prefixed by datadir location (only useable from command line, not configuration file) (default: %s)", BITCOIN_CONF_FILENAME), ArgsManager::ALLOW_ANY, OptionsCategory::OPTIONS); argsman.AddArg("-datadir=<dir>", "Specify data directory", ArgsManager::ALLOW_ANY, OptionsCategory::OPTIONS); argsman.AddArg("-dbbatchsize", strprintf("Maximum database write batch size in bytes (default: %u)", nDefaultDbBatchSize), ArgsManager::ALLOW_ANY | ArgsManager::DEBUG_ONLY, OptionsCategory::OPTIONS); - argsman.AddArg("-dbcache=<n>", strprintf("Maximum database cache size <n> MiB (%d to %d, default: %d). In addition, unused mempool memory is shared for this cache (see -maxmempool).", nMinDbCache, nMaxDbCache, nDefaultDbCache), ArgsManager::ALLOW_ANY, OptionsCategory::OPTIONS); + argsman.AddArg("-dbcache=<n>", strprintf("Maximum database cache size <n> MiB (minimum %d, default: %d). Make sure you have enough RAM. In addition, unused memory allocated to the mempool is shared with this cache (see -maxmempool).", nMinDbCache, nDefaultDbCache), ArgsManager::ALLOW_ANY, OptionsCategory::OPTIONS); argsman.AddArg("-includeconf=<file>", "Specify additional configuration file, relative to the -datadir path (only useable from configuration file, not command line)", ArgsManager::ALLOW_ANY, OptionsCategory::OPTIONS); argsman.AddArg("-allowignoredconf", strprintf("For backwards compatibility, treat an unused %s file in the datadir as a warning, not an error.", BITCOIN_CONF_FILENAME), ArgsManager::ALLOW_ANY, OptionsCategory::OPTIONS); argsman.AddArg("-loadblock=<file>", "Imports blocks from external file on startup", ArgsManager::ALLOW_ANY, OptionsCategory::OPTIONS); diff --git a/src/node/caches.cpp b/src/node/caches.cpp index 7403f7ddea..dc4d98f592 100644 --- a/src/node/caches.cpp +++ b/src/node/caches.cpp @@ -13,7 +13,6 @@ CacheSizes CalculateCacheSizes(const ArgsManager& args, size_t n_indexes) { int64_t nTotalCache = (args.GetIntArg("-dbcache", nDefaultDbCache) << 20); nTotalCache = std::max(nTotalCache, nMinDbCache << 20); // total cache cannot be less than nMinDbCache - nTotalCache = std::min(nTotalCache, nMaxDbCache << 20); // total cache cannot be greater than nMaxDbcache CacheSizes sizes; sizes.block_tree_db = std::min(nTotalCache / 8, nMaxBlockDBCache << 20); nTotalCache -= sizes.block_tree_db; diff --git a/src/qt/forms/optionsdialog.ui b/src/qt/forms/optionsdialog.ui index 99fb238772..1ce23c72bb 100644 --- a/src/qt/forms/optionsdialog.ui +++ b/src/qt/forms/optionsdialog.ui @@ -105,7 +105,7 @@ <item> <widget class="QLabel" name="databaseCacheLabel"> <property name="toolTip"> - <string extracomment="Tooltip text for Options window setting that sets the size of the database cache. Explains the corresponding effects of increasing/decreasing this value.">Maximum database cache size. A larger cache can contribute to faster sync, after which the benefit is less pronounced for most use cases. Lowering the cache size will reduce memory usage. Unused mempool memory is shared for this cache.</string> + <string extracomment="Tooltip text for Options window setting that sets the size of the database cache. Explains the corresponding effects of increasing/decreasing this value.">Maximum database cache size. Make sure you have enough RAM. A larger cache can contribute to faster sync, after which the benefit is less pronounced for most use cases. Lowering the cache size will reduce memory usage. Unused mempool memory is shared for this cache.</string> </property> <property name="text"> <string>Size of &database cache</string> diff --git a/src/qt/optionsdialog.cpp b/src/qt/optionsdialog.cpp index ee53a59bb5..4df6dce953 100644 --- a/src/qt/optionsdialog.cpp +++ b/src/qt/optionsdialog.cpp @@ -93,8 +93,7 @@ OptionsDialog::OptionsDialog(QWidget* parent, bool enableWallet) ui->setupUi(this); /* Main elements init */ - ui->databaseCache->setMinimum(nMinDbCache); - ui->databaseCache->setMaximum(nMaxDbCache); + ui->databaseCache->setRange(nMinDbCache, std::numeric_limits<int>::max()); ui->threadsScriptVerif->setMinimum(-GetNumCores()); ui->threadsScriptVerif->setMaximum(MAX_SCRIPTCHECK_THREADS); ui->pruneWarning->setVisible(false); diff --git a/src/txdb.h b/src/txdb.h index c9af0a091e..1966991ceb 100644 --- a/src/txdb.h +++ b/src/txdb.h @@ -25,8 +25,6 @@ class uint256; static const int64_t nDefaultDbCache = 450; //! -dbbatchsize default (bytes) static const int64_t nDefaultDbBatchSize = 16 << 20; -//! max. -dbcache (MiB) -static const int64_t nMaxDbCache = sizeof(void*) > 4 ? 16384 : 1024; //! min. -dbcache (MiB) static const int64_t nMinDbCache = 4; //! Max memory allocated to block tree DB specific cache, if no -txindex (MiB) |