Skip to content

Commit

Permalink
use arity to solve surprising toggle behavior for picocli boolean
Browse files Browse the repository at this point in the history
Signed-off-by: garyschulte <garyschulte@gmail.com>
  • Loading branch information
garyschulte committed Apr 22, 2024
1 parent 6772031 commit d201d64
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 0 deletions.
Expand Up @@ -291,6 +291,7 @@ public void parseBlockPropagationRange(final String arg) {
names = SNAP_SERVER_ENABLED_FLAG,
hidden = true,
paramLabel = "<Boolean>",
arity = "0..1",
description = "Snap sync server enabled (default: ${DEFAULT-VALUE})")
private Boolean snapsyncServerEnabled = SnapSyncConfiguration.DEFAULT_SNAP_SERVER_ENABLED;

Expand Down Expand Up @@ -362,6 +363,7 @@ public static SynchronizerOptions fromConfig(final SynchronizerConfiguration con
options.snapsyncFlatStorageHealedCountPerRequest =
config.getSnapSyncConfiguration().getLocalFlatStorageCountToHealPerRequest();
options.checkpointPostMergeSyncEnabled = config.isCheckpointPostMergeEnabled();
options.snapsyncServerEnabled = config.getSnapSyncConfiguration().isSnapServerEnabled();
return options;
}

Expand Down
Expand Up @@ -78,6 +78,7 @@ protected SynchronizerConfiguration.Builder createCustomizedDomainObject() {
.storageCountPerRequest(SnapSyncConfiguration.DEFAULT_STORAGE_COUNT_PER_REQUEST + 2)
.bytecodeCountPerRequest(
SnapSyncConfiguration.DEFAULT_BYTECODE_COUNT_PER_REQUEST + 2)
.isSnapServerEnabled(Boolean.TRUE)
.build());
}

Expand Down
1 change: 1 addition & 0 deletions besu/src/test/resources/everything_config.toml
Expand Up @@ -217,6 +217,7 @@ receipt-compaction-enabled=true
# feature flags
Xsecp256k1-native-enabled=false
Xaltbn128-native-enabled=false
Xsnapsync-server-enabled=true

# compatibility flags
compatibility-eth64-forkid-enabled=false
Expand Down

0 comments on commit d201d64

Please sign in to comment.