Skip to content

Commit

Permalink
Deprecation warning if Forest pruning is enabled (hyperledger#6230)
Browse files Browse the repository at this point in the history
Signed-off-by: Fabio Di Fabio <fabio.difabio@consensys.net>
Signed-off-by: jflo <justin+github@florentine.us>
  • Loading branch information
fab-10 authored and jflo committed Dec 18, 2023
1 parent fbe644a commit e257659
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 0 deletions.
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
# Changelog

## 23.10.4

### 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)

### Additions and Improvements
- Add error messages on authentication failures with username and password [#6212](https://github.com/hyperledger/besu/pull/6212)

### Bug fixes


## 23.10.3

### Breaking Changes
Expand Down
5 changes: 5 additions & 0 deletions besu/src/main/java/org/hyperledger/besu/cli/BesuCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -2059,6 +2059,11 @@ private void issueOptionWarnings() {
"--privacy-onchain-groups-enabled",
"--privacy-flexible-groups-enabled");
}

if (isPruningEnabled()) {
logger.warn(
"Forest pruning is deprecated and will be removed soon. To save disk space consider switching to Bonsai data storage format.");
}
}

private void configure() throws Exception {
Expand Down
15 changes: 15 additions & 0 deletions besu/src/test/java/org/hyperledger/besu/cli/BesuCommandTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -3815,6 +3815,21 @@ public void pruningParametersAreCaptured() throws Exception {
assertThat(pruningArg.getValue().getBlockConfirmations()).isEqualTo(4);
}

@Test
public void pruningLogsDeprecationWarning() {
parseCommand("--pruning-enabled");

verify(mockControllerBuilder).isPruningEnabled(true);

assertThat(commandOutput.toString(UTF_8)).isEmpty();
assertThat(commandErrorOutput.toString(UTF_8)).isEmpty();
verify(mockLogger)
.warn(
contains(
"Forest pruning is deprecated and will be removed soon."
+ " To save disk space consider switching to Bonsai data storage format."));
}

@Test
public void devModeOptionMustBeUsed() throws Exception {
parseCommand("--network", "dev");
Expand Down

0 comments on commit e257659

Please sign in to comment.