From d2b42d56d84e41e2be0b77c0ba4c842fba027455 Mon Sep 17 00:00:00 2001 From: Simon Dudley Date: Thu, 4 Jul 2024 21:10:44 +1000 Subject: [PATCH] Update limit trie logs validation message for sync-mode=FULL (#7279) Signed-off-by: Simon Dudley Co-authored-by: Sally MacFarlane --- .../besu/cli/options/stable/DataStorageOptions.java | 6 ++++-- .../besu/cli/options/stable/DataStorageOptionsTest.java | 8 ++++++++ 2 files changed, 12 insertions(+), 2 deletions(-) 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 d1cb4f721b2..69cf819cb4b 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 @@ -147,8 +147,10 @@ public void validate(final CommandLine commandLine, final SyncMode syncMode) { throw new CommandLine.ParameterException( commandLine, String.format( - "Cannot enable " + BONSAI_LIMIT_TRIE_LOGS_ENABLED + " with sync-mode %s", - syncMode)); + "Cannot enable %s with sync-mode %s. You must set %s or use a different sync-mode", + BONSAI_LIMIT_TRIE_LOGS_ENABLED, + SyncMode.FULL, + BONSAI_LIMIT_TRIE_LOGS_ENABLED + "=false")); } if (bonsaiMaxLayersToLoad < MINIMUM_BONSAI_TRIE_LOG_RETENTION_LIMIT) { throw new CommandLine.ParameterException( 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 2086381825f..5ab2757f888 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 @@ -55,6 +55,14 @@ public void bonsaiTrieLogsEnabled_explicitlySetToFalse() { "--bonsai-limit-trie-logs-enabled=false"); } + @Test + public void bonsaiTrieLogPruningWindowSizeShouldBePositive2() { + internalTestFailure( + "Cannot enable --bonsai-limit-trie-logs-enabled with sync-mode FULL. You must set --bonsai-limit-trie-logs-enabled=false or use a different sync-mode", + "--sync-mode", + "FULL"); + } + @Test public void bonsaiTrieLogPruningWindowSizeShouldBePositive() { internalTestFailure(