log a different warning if pruning is enabled with BONSAI (#6401)

Signed-off-by: Sally MacFarlane <macfarla.github@gmail.com>
pull/6407/head
Sally MacFarlane 10 months ago committed by GitHub
parent 9fbe4fbbb2
commit 39d7042ca3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      CHANGELOG.md
  2. 12
      besu/src/main/java/org/hyperledger/besu/cli/BesuCommand.java
  3. 15
      besu/src/test/java/org/hyperledger/besu/cli/BesuCommandTest.java

@ -30,7 +30,7 @@
### Breaking Changes
### Deprecations
- Forest pruning (`pruning-enabled` options) is deprecated and will be removed soon. To save disk space consider switching to Bonsai data storage format [#6230](https://github.com/hyperledger/besu/pull/6230)
- Forest pruning (`pruning-enabled` option) is deprecated and will be removed soon. To save disk space consider switching to Bonsai data storage format [#6230](https://github.com/hyperledger/besu/pull/6230)
### Additions and Improvements
- Add error messages on authentication failures with username and password [#6212](https://github.com/hyperledger/besu/pull/6212)

@ -148,6 +148,7 @@ import org.hyperledger.besu.ethereum.storage.keyvalue.KeyValueSegmentIdentifier;
import org.hyperledger.besu.ethereum.storage.keyvalue.KeyValueStorageProvider;
import org.hyperledger.besu.ethereum.storage.keyvalue.KeyValueStorageProviderBuilder;
import org.hyperledger.besu.ethereum.trie.forest.pruner.PrunerConfiguration;
import org.hyperledger.besu.ethereum.worldstate.DataStorageFormat;
import org.hyperledger.besu.evm.precompile.AbstractAltBnPrecompiledContract;
import org.hyperledger.besu.evm.precompile.BigIntegerModularExponentiationPrecompiledContract;
import org.hyperledger.besu.evm.precompile.KZGPointEvalPrecompiledContract;
@ -2063,8 +2064,15 @@ public class BesuCommand implements DefaultCommandValues, Runnable {
}
if (isPruningEnabled()) {
logger.warn(
"Forest pruning is deprecated and will be removed soon. To save disk space consider switching to Bonsai data storage format.");
if (dataStorageOptions
.toDomainObject()
.getDataStorageFormat()
.equals(DataStorageFormat.BONSAI)) {
logger.warn("Forest pruning is ignored with Bonsai data storage format.");
} else {
logger.warn(
"Forest pruning is deprecated and will be removed soon. To save disk space consider switching to Bonsai data storage format.");
}
}
}

@ -3840,8 +3840,8 @@ public class BesuCommandTest extends CommandTestAbstract {
}
@Test
public void pruningLogsDeprecationWarning() {
parseCommand("--pruning-enabled");
public void pruningLogsDeprecationWarningWithForest() {
parseCommand("--pruning-enabled", "--data-storage-format=FOREST");
verify(mockControllerBuilder).isPruningEnabled(true);
@ -3854,6 +3854,17 @@ public class BesuCommandTest extends CommandTestAbstract {
+ " To save disk space consider switching to Bonsai data storage format."));
}
@Test
public void pruningLogsIgnoredWarningWithBonsai() {
parseCommand("--pruning-enabled", "--data-storage-format=BONSAI");
verify(mockControllerBuilder).isPruningEnabled(true);
assertThat(commandOutput.toString(UTF_8)).isEmpty();
assertThat(commandErrorOutput.toString(UTF_8)).isEmpty();
verify(mockLogger).warn(contains("Forest pruning is ignored with Bonsai data storage format."));
}
@Test
public void devModeOptionMustBeUsed() throws Exception {
parseCommand("--network", "dev");

Loading…
Cancel
Save