diff --git a/CHANGELOG.md b/CHANGELOG.md index e4486dfbfb2..2b18aae3365 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -53,7 +53,7 @@ - Smart-contract-based (onchain) permissioning - Proof of Work consensus - Fast Sync - +- Option `--Xsnapsync-bft-enabled` is deprecated and will be removed in a future release. SNAP sync is supported for BFT networks ### Additions and Improvements - Fine tune already seen txs tracker when a tx is removed from the pool [#7755](https://github.com/hyperledger/besu/pull/7755) - Support for enabling and configuring TLS/mTLS in WebSocket service. [#7854](https://github.com/hyperledger/besu/pull/7854) diff --git a/besu/src/main/java/org/hyperledger/besu/cli/BesuCommand.java b/besu/src/main/java/org/hyperledger/besu/cli/BesuCommand.java index b5bfa9182fc..9a3367d579e 100644 --- a/besu/src/main/java/org/hyperledger/besu/cli/BesuCommand.java +++ b/besu/src/main/java/org/hyperledger/besu/cli/BesuCommand.java @@ -1443,27 +1443,9 @@ private void validateOptions() { validateTransactionPoolOptions(); validateDataStorageOptions(); validateGraphQlOptions(); - validateConsensusSyncCompatibilityOptions(); validatePluginOptions(); } - private void validateConsensusSyncCompatibilityOptions() { - // snap and checkpoint are experimental for BFT - if ((genesisConfigOptionsSupplier.get().isIbftLegacy() - || genesisConfigOptionsSupplier.get().isIbft2() - || genesisConfigOptionsSupplier.get().isQbft()) - && !unstableSynchronizerOptions.isSnapSyncBftEnabled()) { - final String errorSuffix = "can't be used with BFT networks"; - if (SyncMode.CHECKPOINT.equals(syncMode)) { - throw new ParameterException( - commandLine, String.format("%s %s", "Checkpoint sync", errorSuffix)); - } - if (syncMode == SyncMode.SNAP) { - throw new ParameterException(commandLine, String.format("%s %s", "Snap sync", errorSuffix)); - } - } - } - private void validatePluginOptions() { pluginsConfigurationOptions.validate(commandLine); } @@ -2761,7 +2743,6 @@ private String generateConfigurationOverview() { } builder.setSnapServerEnabled(this.unstableSynchronizerOptions.isSnapsyncServerEnabled()); - builder.setSnapSyncBftEnabled(this.unstableSynchronizerOptions.isSnapSyncBftEnabled()); builder.setTxPoolImplementation(buildTransactionPoolConfiguration().getTxPoolImplementation()); builder.setWorldStateUpdateMode(unstableEvmOptions.toDomainObject().worldUpdaterMode()); diff --git a/besu/src/main/java/org/hyperledger/besu/cli/ConfigurationOverviewBuilder.java b/besu/src/main/java/org/hyperledger/besu/cli/ConfigurationOverviewBuilder.java index 9e69cb608c8..f6f31edbe94 100644 --- a/besu/src/main/java/org/hyperledger/besu/cli/ConfigurationOverviewBuilder.java +++ b/besu/src/main/java/org/hyperledger/besu/cli/ConfigurationOverviewBuilder.java @@ -57,7 +57,6 @@ public class ConfigurationOverviewBuilder { private long trieLogRetentionLimit = 0; private Integer trieLogsPruningWindowSize = null; private boolean isSnapServerEnabled = false; - private boolean isSnapSyncBftEnabled = false; private TransactionPoolConfiguration.Implementation txPoolImplementation; private EvmConfiguration.WorldUpdaterMode worldStateUpdateMode; private Map environment; @@ -246,17 +245,6 @@ public ConfigurationOverviewBuilder setSnapServerEnabled(final boolean snapServe return this; } - /** - * Sets snap sync BFT enabled/disabled - * - * @param snapSyncBftEnabled bool to indicate if snap sync for BFT is enabled - * @return the builder - */ - public ConfigurationOverviewBuilder setSnapSyncBftEnabled(final boolean snapSyncBftEnabled) { - isSnapSyncBftEnabled = snapSyncBftEnabled; - return this; - } - /** * Sets trie logs pruning window size * @@ -386,10 +374,6 @@ public String build() { lines.add("Experimental Snap Sync server enabled"); } - if (isSnapSyncBftEnabled) { - lines.add("Experimental Snap Sync for BFT enabled"); - } - if (isLimitTrieLogsEnabled) { final StringBuilder trieLogPruningString = new StringBuilder(); trieLogPruningString diff --git a/besu/src/main/java/org/hyperledger/besu/cli/options/SynchronizerOptions.java b/besu/src/main/java/org/hyperledger/besu/cli/options/SynchronizerOptions.java index c7d20c17fb6..cbad09a3b30 100644 --- a/besu/src/main/java/org/hyperledger/besu/cli/options/SynchronizerOptions.java +++ b/besu/src/main/java/org/hyperledger/besu/cli/options/SynchronizerOptions.java @@ -304,12 +304,15 @@ public void parseBlockPropagationRange(final String arg) { private Boolean checkpointPostMergeSyncEnabled = SynchronizerConfiguration.DEFAULT_CHECKPOINT_POST_MERGE_ENABLED; + // TODO --Xsnapsync-bft-enabled is deprecated, + // remove in a future release @CommandLine.Option( - names = SNAP_SYNC_BFT_ENABLED_FLAG, + names = SNAP_SYNC_BFT_ENABLED_FLAG, // deprecated hidden = true, paramLabel = "", arity = "0..1", - description = "Snap sync enabled for BFT chains (default: ${DEFAULT-VALUE})") + description = + "This option is now deprecated, will be removed in future release. Snap sync for BFT is supported by default.") private Boolean snapsyncBftEnabled = SnapSyncConfiguration.DEFAULT_SNAP_SYNC_BFT_ENABLED; @CommandLine.Option( @@ -398,7 +401,6 @@ public static SynchronizerOptions fromConfig(final SynchronizerConfiguration con config.getSnapSyncConfiguration().getLocalFlatStorageCountToHealPerRequest(); options.checkpointPostMergeSyncEnabled = config.isCheckpointPostMergeEnabled(); options.snapsyncServerEnabled = config.getSnapSyncConfiguration().isSnapServerEnabled(); - options.snapsyncBftEnabled = config.getSnapSyncConfiguration().isSnapSyncBftEnabled(); return options; } @@ -431,7 +433,6 @@ public SynchronizerConfiguration.Builder toDomainObject() { .localFlatAccountCountToHealPerRequest(snapsyncFlatAccountHealedCountPerRequest) .localFlatStorageCountToHealPerRequest(snapsyncFlatStorageHealedCountPerRequest) .isSnapServerEnabled(snapsyncServerEnabled) - .isSnapSyncBftEnabled(snapsyncBftEnabled) .build()); builder.checkpointPostMergeEnabled(checkpointPostMergeSyncEnabled); builder.isPeerTaskSystemEnabled(isPeerTaskSystemEnabled); @@ -489,9 +490,7 @@ public List getCLIOptions() { SNAP_FLAT_STORAGE_HEALED_COUNT_PER_REQUEST_FLAG, OptionParser.format(snapsyncFlatStorageHealedCountPerRequest), SNAP_SERVER_ENABLED_FLAG, - OptionParser.format(snapsyncServerEnabled), - SNAP_SYNC_BFT_ENABLED_FLAG, - OptionParser.format(snapsyncBftEnabled)); + OptionParser.format(snapsyncServerEnabled)); return value; } } diff --git a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/snapsync/SnapSyncConfiguration.java b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/snapsync/SnapSyncConfiguration.java index dbe043b92a0..6322ac4c034 100644 --- a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/snapsync/SnapSyncConfiguration.java +++ b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/snapsync/SnapSyncConfiguration.java @@ -83,9 +83,4 @@ public int getLocalFlatStorageCountToHealPerRequest() { public Boolean isSnapServerEnabled() { return DEFAULT_SNAP_SERVER_ENABLED; } - - @Value.Default - public Boolean isSnapSyncBftEnabled() { - return DEFAULT_SNAP_SYNC_BFT_ENABLED; - } }