From bd3ec3290599d7561c80096aab5b91b7e39eab8b Mon Sep 17 00:00:00 2001 From: bladehan1 Date: Fri, 14 Aug 2026 12:13:29 +0800 Subject: [PATCH] fix(config): remove unverified RocksDB overrides Remove the shipped dbSettings overrides so config.conf inherits the documented reference defaults. Keep explicit user overrides available and cover the effective default values with a regression test. Closes bladehan1/java-tron#49 --- framework/src/main/resources/config.conf | 13 ------------- .../org/tron/core/config/ConfigurationTest.java | 12 ++++++++++++ 2 files changed, 12 insertions(+), 13 deletions(-) diff --git a/framework/src/main/resources/config.conf b/framework/src/main/resources/config.conf index 1176dd46311..66ce7be1ce6 100644 --- a/framework/src/main/resources/config.conf +++ b/framework/src/main/resources/config.conf @@ -22,19 +22,6 @@ storage { needToUpdateAsset = true - # RocksDB settings (only used when db.engine = "ROCKSDB"). See reference.conf for details. - dbSettings = { - levelNumber = 7 - # compactThreads = 32 - blocksize = 64 // n * KB - maxBytesForLevelBase = 256 // n * MB - maxBytesForLevelMultiplier = 10 - level0FileNumCompactionTrigger = 4 - targetFileSizeBase = 256 // n * MB - targetFileSizeMultiplier = 1 - maxOpenFiles = 5000 - } - balance.history.lookup = false # If true, transaction cache initialization will be faster. Default: false diff --git a/framework/src/test/java/org/tron/core/config/ConfigurationTest.java b/framework/src/test/java/org/tron/core/config/ConfigurationTest.java index b066bc1e6be..a94f167c5d2 100644 --- a/framework/src/test/java/org/tron/core/config/ConfigurationTest.java +++ b/framework/src/test/java/org/tron/core/config/ConfigurationTest.java @@ -35,6 +35,7 @@ import org.tron.common.crypto.ECKey; import org.tron.common.utils.ByteArray; import org.tron.core.Wallet; +import org.tron.core.config.args.StorageConfig; @Slf4j public class ConfigurationTest { @@ -91,4 +92,15 @@ public void getConfigurationWhenOnlyConfFileName() { assertTrue(config.hasPath("seed.node")); assertTrue(config.hasPath("genesis.block")); } + + @Test + public void defaultConfigShouldUseReferenceRocksDbSettings() { + StorageConfig.DbSettingsConfig settings = StorageConfig + .fromConfig(Configuration.getByFileName("config.conf")) + .getDbSettings(); + + assertEquals(16, settings.getBlocksize()); + assertEquals(2, settings.getLevel0FileNumCompactionTrigger()); + assertEquals(64, settings.getTargetFileSizeBase()); + } }