Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 0 additions & 13 deletions framework/src/main/resources/config.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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());
}
}
Loading