diff --git a/besu/src/main/java/org/hyperledger/besu/cli/options/stable/DataStorageOptions.java b/besu/src/main/java/org/hyperledger/besu/cli/options/stable/DataStorageOptions.java index a785eedbefc..e0b19735683 100644 --- a/besu/src/main/java/org/hyperledger/besu/cli/options/stable/DataStorageOptions.java +++ b/besu/src/main/java/org/hyperledger/besu/cli/options/stable/DataStorageOptions.java @@ -17,8 +17,8 @@ package org.hyperledger.besu.cli.options.stable; import static org.hyperledger.besu.ethereum.worldstate.DataStorageConfiguration.DEFAULT_BONSAI_MAX_LAYERS_TO_LOAD; -import static org.hyperledger.besu.ethereum.worldstate.DataStorageConfiguration.Unstable.DEFAULT_BONSAI_TRIE_LOG_PRUNE_LIMIT; import static org.hyperledger.besu.ethereum.worldstate.DataStorageConfiguration.Unstable.DEFAULT_BONSAI_TRIE_LOG_PRUNING_ENABLED; +import static org.hyperledger.besu.ethereum.worldstate.DataStorageConfiguration.Unstable.DEFAULT_BONSAI_TRIE_LOG_PRUNING_LIMIT; import static org.hyperledger.besu.ethereum.worldstate.DataStorageConfiguration.Unstable.DEFAULT_BONSAI_TRIE_LOG_RETENTION_THRESHOLD; import static org.hyperledger.besu.ethereum.worldstate.DataStorageConfiguration.Unstable.MINIMUM_BONSAI_TRIE_LOG_RETENTION_THRESHOLD; @@ -78,10 +78,10 @@ static class Unstable { @CommandLine.Option( hidden = true, - names = {"--Xbonsai-trie-log-prune-limit"}, + names = {"--Xbonsai-trie-log-pruning-limit"}, description = "The max number of blocks to load and prune trie logs for at startup. (default: ${DEFAULT-VALUE})") - private int bonsaiTrieLogPruneLimit = DEFAULT_BONSAI_TRIE_LOG_PRUNE_LIMIT; + private int bonsaiTrieLogPruningLimit = DEFAULT_BONSAI_TRIE_LOG_PRUNING_LIMIT; } /** * Create data storage options. @@ -107,12 +107,12 @@ public void validate(final CommandLine commandLine) { "--Xbonsai-trie-log-retention-threshold minimum value is %d", MINIMUM_BONSAI_TRIE_LOG_RETENTION_THRESHOLD)); } - if (unstableOptions.bonsaiTrieLogPruneLimit <= 0) { + if (unstableOptions.bonsaiTrieLogPruningLimit <= 0) { throw new CommandLine.ParameterException( commandLine, String.format( - "--Xbonsai-trie-log-prune-limit=%d must be greater than 0", - unstableOptions.bonsaiTrieLogPruneLimit)); + "--Xbonsai-trie-log-pruning-limit=%d must be greater than 0", + unstableOptions.bonsaiTrieLogPruningLimit)); } } } @@ -125,7 +125,7 @@ static DataStorageOptions fromConfig(final DataStorageConfiguration domainObject domainObject.getUnstable().getBonsaiTrieLogPruningEnabled(); dataStorageOptions.unstableOptions.bonsaiTrieLogRetentionThreshold = domainObject.getUnstable().getBonsaiTrieLogRetentionThreshold(); - dataStorageOptions.unstableOptions.bonsaiTrieLogPruneLimit = + dataStorageOptions.unstableOptions.bonsaiTrieLogPruningLimit = domainObject.getUnstable().getBonsaiTrieLogPruningLimit(); return dataStorageOptions; @@ -140,7 +140,7 @@ public DataStorageConfiguration toDomainObject() { ImmutableDataStorageConfiguration.Unstable.builder() .bonsaiTrieLogPruningEnabled(unstableOptions.bonsaiTrieLogPruningEnabled) .bonsaiTrieLogRetentionThreshold(unstableOptions.bonsaiTrieLogRetentionThreshold) - .bonsaiTrieLogPruningLimit(unstableOptions.bonsaiTrieLogPruneLimit) + .bonsaiTrieLogPruningLimit(unstableOptions.bonsaiTrieLogPruningLimit) .build()) .build(); } diff --git a/besu/src/test/java/org/hyperledger/besu/cli/options/stable/DataStorageOptionsTest.java b/besu/src/test/java/org/hyperledger/besu/cli/options/stable/DataStorageOptionsTest.java index bb8c8da62af..5b4e0228550 100644 --- a/besu/src/test/java/org/hyperledger/besu/cli/options/stable/DataStorageOptionsTest.java +++ b/besu/src/test/java/org/hyperledger/besu/cli/options/stable/DataStorageOptionsTest.java @@ -29,22 +29,22 @@ public class DataStorageOptionsTest extends AbstractCLIOptionsTest { @Test - public void bonsaiTrieLogPruneLimitOption() { + public void bonsaiTrieLogPruningLimitOption() { internalTestSuccess( dataStorageConfiguration -> assertThat(dataStorageConfiguration.getUnstable().getBonsaiTrieLogPruningLimit()) .isEqualTo(1), "--Xbonsai-trie-log-pruning-enabled", - "--Xbonsai-trie-log-prune-limit", + "--Xbonsai-trie-log-pruning-limit", "1"); } @Test - public void bonsaiTrieLogPruneLimitShouldBePositive() { + public void bonsaiTrieLogPruningLimitShouldBePositive() { internalTestFailure( - "--Xbonsai-trie-log-prune-limit=0 must be greater than 0", + "--Xbonsai-trie-log-pruning-limit=0 must be greater than 0", "--Xbonsai-trie-log-pruning-enabled", - "--Xbonsai-trie-log-prune-limit", + "--Xbonsai-trie-log-pruning-limit", "0"); } diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/worldstate/DataStorageConfiguration.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/worldstate/DataStorageConfiguration.java index 9fb00c4703f..fce79ea17aa 100644 --- a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/worldstate/DataStorageConfiguration.java +++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/worldstate/DataStorageConfiguration.java @@ -48,7 +48,7 @@ interface Unstable { boolean DEFAULT_BONSAI_TRIE_LOG_PRUNING_ENABLED = false; long DEFAULT_BONSAI_TRIE_LOG_RETENTION_THRESHOLD = TrieLogPruner.DEFAULT_RETENTION_THRESHOLD; long MINIMUM_BONSAI_TRIE_LOG_RETENTION_THRESHOLD = TrieLogPruner.MINIMUM_RETENTION_THRESHOLD; - int DEFAULT_BONSAI_TRIE_LOG_PRUNE_LIMIT = TrieLogPruner.DEFAULT_PRUNING_LIMIT; + int DEFAULT_BONSAI_TRIE_LOG_PRUNING_LIMIT = TrieLogPruner.DEFAULT_PRUNING_LIMIT; DataStorageConfiguration.Unstable DEFAULT = ImmutableDataStorageConfiguration.Unstable.builder().build(); @@ -65,7 +65,7 @@ default long getBonsaiTrieLogRetentionThreshold() { @Value.Default default int getBonsaiTrieLogPruningLimit() { - return DEFAULT_BONSAI_TRIE_LOG_PRUNE_LIMIT; + return DEFAULT_BONSAI_TRIE_LOG_PRUNING_LIMIT; } } }