diff --git a/CHANGELOG.md b/CHANGELOG.md index f862ed866fe..4dccf056f37 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,11 @@ - Added isLabelsObserved to LabelledGauge in plugin-api. Default implementation returns false. ### Breaking Changes +- Removed deprecated experimental feature names + - `--Xsnapsync-synchronizer-flat-db-healing-enabled` in favor of `--Xbonsai-full-flat-db-enabled` + - `--Xbonsai-limit-trie-logs-enabled` and `--Xbonsai-trie-log-pruning-enabled` in favor of `--bonsai-limit-trie-logs-enabled` + - `--Xbonsai-trie-logs-pruning-window-size` in favor of `--bonsai-trie-logs-pruning-window-size` + ### Upcoming Breaking Changes 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 886e3d68383..aa75c25c01b 100644 --- a/besu/src/main/java/org/hyperledger/besu/cli/BesuCommand.java +++ b/besu/src/main/java/org/hyperledger/besu/cli/BesuCommand.java @@ -2624,6 +2624,9 @@ public void setIgnorableStorageSegments() { if (!unstableChainPruningOptions.getChainDataPruningEnabled()) { rocksDBPlugin.addIgnorableSegmentIdentifier(KeyValueSegmentIdentifier.CHAIN_PRUNER_STATE); } + if (!dataStorageOptions.toDomainObject().getHashPreImageStorageEnabled()) { + rocksDBPlugin.addIgnorableSegmentIdentifier(KeyValueSegmentIdentifier.HASH_PREIMAGE_STORE); + } } private void validatePostMergeCheckpointBlockRequirements() { diff --git a/besu/src/main/java/org/hyperledger/besu/cli/options/storage/DataStorageOptions.java b/besu/src/main/java/org/hyperledger/besu/cli/options/storage/DataStorageOptions.java index fbc57f50def..e7cb1372377 100644 --- a/besu/src/main/java/org/hyperledger/besu/cli/options/storage/DataStorageOptions.java +++ b/besu/src/main/java/org/hyperledger/besu/cli/options/storage/DataStorageOptions.java @@ -14,6 +14,7 @@ */ package org.hyperledger.besu.cli.options.storage; +import static org.hyperledger.besu.ethereum.worldstate.DataStorageConfiguration.DEFAULT_HASH_PREIMAGE_STORAGE_ENABLED; import static org.hyperledger.besu.ethereum.worldstate.DataStorageConfiguration.DEFAULT_RECEIPT_COMPACTION_ENABLED; import org.hyperledger.besu.cli.options.CLIOptions; @@ -35,6 +36,9 @@ public class DataStorageOptions implements CLIOptions private static final String DATA_STORAGE_FORMAT = "--data-storage-format"; + /** Feature to store hash preimages as part of worldstate */ + public static final String HASH_STORE_PREIMAGE_ENABLED = "--hash-preimage-storage-enabled"; + // Use Bonsai DB @Option( names = {DATA_STORAGE_FORMAT}, @@ -49,6 +53,13 @@ public class DataStorageOptions implements CLIOptions fallbackValue = "true") private Boolean receiptCompactionEnabled = DEFAULT_RECEIPT_COMPACTION_ENABLED; + @CommandLine.Option( + names = {HASH_STORE_PREIMAGE_ENABLED}, + description = + "Format to store trie data in. Either FOREST or BONSAI (default: ${DEFAULT-VALUE}).", + arity = "1") + private Boolean hashStorePreimagesEnabled = DEFAULT_HASH_PREIMAGE_STORAGE_ENABLED; + /** * Options specific to diff-based storage modes. Holds the necessary parameters to configure * diff-based storage, such as the Bonsai mode or Verkle in the future. @@ -88,6 +99,7 @@ public static DataStorageOptions fromConfig(final DataStorageConfiguration domai final DataStorageOptions dataStorageOptions = DataStorageOptions.create(); dataStorageOptions.dataStorageFormat = domainObject.getDataStorageFormat(); dataStorageOptions.receiptCompactionEnabled = domainObject.getReceiptCompactionEnabled(); + dataStorageOptions.hashStorePreimagesEnabled = domainObject.getHashPreImageStorageEnabled(); dataStorageOptions.diffBasedSubStorageOptions = DiffBasedSubStorageOptions.fromConfig(domainObject.getDiffBasedSubStorageConfiguration()); return dataStorageOptions; @@ -99,6 +111,7 @@ public DataStorageConfiguration toDomainObject() { ImmutableDataStorageConfiguration.builder() .dataStorageFormat(dataStorageFormat) .receiptCompactionEnabled(receiptCompactionEnabled) + .hashPreImageStorageEnabled(hashStorePreimagesEnabled) .diffBasedSubStorageConfiguration(diffBasedSubStorageOptions.toDomainObject()); return builder.build(); } diff --git a/besu/src/main/java/org/hyperledger/besu/cli/options/storage/DiffBasedSubStorageOptions.java b/besu/src/main/java/org/hyperledger/besu/cli/options/storage/DiffBasedSubStorageOptions.java index c95a7668272..5717786b09b 100644 --- a/besu/src/main/java/org/hyperledger/besu/cli/options/storage/DiffBasedSubStorageOptions.java +++ b/besu/src/main/java/org/hyperledger/besu/cli/options/storage/DiffBasedSubStorageOptions.java @@ -55,26 +55,16 @@ public class DiffBasedSubStorageOptions implements CLIOptions