Skip to content

Commit d201d64

Browse files
committed
use arity to solve surprising toggle behavior for picocli boolean
Signed-off-by: garyschulte <garyschulte@gmail.com>
1 parent 6772031 commit d201d64

File tree

3 files changed

+4
-0
lines changed

3 files changed

+4
-0
lines changed

besu/src/main/java/org/hyperledger/besu/cli/options/unstable/SynchronizerOptions.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -291,6 +291,7 @@ public void parseBlockPropagationRange(final String arg) {
291291
names = SNAP_SERVER_ENABLED_FLAG,
292292
hidden = true,
293293
paramLabel = "<Boolean>",
294+
arity = "0..1",
294295
description = "Snap sync server enabled (default: ${DEFAULT-VALUE})")
295296
private Boolean snapsyncServerEnabled = SnapSyncConfiguration.DEFAULT_SNAP_SERVER_ENABLED;
296297

@@ -362,6 +363,7 @@ public static SynchronizerOptions fromConfig(final SynchronizerConfiguration con
362363
options.snapsyncFlatStorageHealedCountPerRequest =
363364
config.getSnapSyncConfiguration().getLocalFlatStorageCountToHealPerRequest();
364365
options.checkpointPostMergeSyncEnabled = config.isCheckpointPostMergeEnabled();
366+
options.snapsyncServerEnabled = config.getSnapSyncConfiguration().isSnapServerEnabled();
365367
return options;
366368
}
367369

besu/src/test/java/org/hyperledger/besu/cli/options/SynchronizerOptionsTest.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ protected SynchronizerConfiguration.Builder createCustomizedDomainObject() {
7878
.storageCountPerRequest(SnapSyncConfiguration.DEFAULT_STORAGE_COUNT_PER_REQUEST + 2)
7979
.bytecodeCountPerRequest(
8080
SnapSyncConfiguration.DEFAULT_BYTECODE_COUNT_PER_REQUEST + 2)
81+
.isSnapServerEnabled(Boolean.TRUE)
8182
.build());
8283
}
8384

besu/src/test/resources/everything_config.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,7 @@ receipt-compaction-enabled=true
217217
# feature flags
218218
Xsecp256k1-native-enabled=false
219219
Xaltbn128-native-enabled=false
220+
Xsnapsync-server-enabled=true
220221

221222
# compatibility flags
222223
compatibility-eth64-forkid-enabled=false

0 commit comments

Comments
 (0)