|
|
|
@ -587,9 +587,10 @@ public class BesuCommand implements DefaultCommandValues, Runnable { |
|
|
|
|
|
|
|
|
|
@Option( |
|
|
|
|
names = {"--pruning-enabled"}, |
|
|
|
|
hidden = true, |
|
|
|
|
description = |
|
|
|
|
"Enable pruning of world state of blocks older than the retention period (default: true if fast sync is enabled, false otherwise)") |
|
|
|
|
private Boolean pruningOverride; |
|
|
|
|
"Enable pruning of world state of blocks older than the retention period (default: ${DEFAULT-VALUE})") |
|
|
|
|
private final Boolean isPruningEnabled = false; |
|
|
|
|
|
|
|
|
|
@Option( |
|
|
|
|
names = {"--pruning-blocks-retained"}, |
|
|
|
@ -1011,7 +1012,7 @@ public class BesuCommand implements DefaultCommandValues, Runnable { |
|
|
|
|
logger, |
|
|
|
|
commandLine, |
|
|
|
|
"--pruning-enabled", |
|
|
|
|
!isPruningEnabled(), |
|
|
|
|
!isPruningEnabled, |
|
|
|
|
asList("--pruning-block-confirmations", "--pruning-blocks-retained")); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -1087,7 +1088,7 @@ public class BesuCommand implements DefaultCommandValues, Runnable { |
|
|
|
|
.clock(Clock.systemUTC()) |
|
|
|
|
.isRevertReasonEnabled(isRevertReasonEnabled) |
|
|
|
|
.storageProvider(keyStorageProvider(keyValueStorageName)) |
|
|
|
|
.isPruningEnabled(isPruningEnabled()) |
|
|
|
|
.isPruningEnabled(isPruningEnabled) |
|
|
|
|
.pruningConfiguration(buildPruningConfiguration()) |
|
|
|
|
.genesisConfigOverrides(genesisConfigOverrides) |
|
|
|
|
.targetGasLimit(targetGasLimit == null ? Optional.empty() : Optional.of(targetGasLimit)) |
|
|
|
@ -1374,10 +1375,6 @@ public class BesuCommand implements DefaultCommandValues, Runnable { |
|
|
|
|
return new PruningConfiguration(pruningBlockConfirmations, pruningBlocksRetained); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private boolean isPruningEnabled() { |
|
|
|
|
return Optional.ofNullable(pruningOverride).orElse(syncMode == SyncMode.FAST); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// Blockchain synchronisation from peers.
|
|
|
|
|
private void synchronize( |
|
|
|
|
final BesuController<?> controller, |
|
|
|
|