mirror of https://github.com/hyperledger/besu
Data storage option refactoring (#7807)
Renaming and refactoring the classes common to both Bonsai and Verkle to facilitate the future integration of Verkle. --------- Signed-off-by: Karim Taam <karim.t2am@gmail.com>pull/7800/head
parent
a27dccd675
commit
a3b886368f
@ -1,248 +0,0 @@ |
||||
/* |
||||
* Copyright ConsenSys AG. |
||||
* |
||||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with |
||||
* the License. You may obtain a copy of the License at |
||||
* |
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* |
||||
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on |
||||
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the |
||||
* specific language governing permissions and limitations under the License. |
||||
* |
||||
* SPDX-License-Identifier: Apache-2.0 |
||||
*/ |
||||
package org.hyperledger.besu.cli.options; |
||||
|
||||
import static org.hyperledger.besu.ethereum.worldstate.DataStorageConfiguration.DEFAULT_BONSAI_LIMIT_TRIE_LOGS_ENABLED; |
||||
import static org.hyperledger.besu.ethereum.worldstate.DataStorageConfiguration.DEFAULT_BONSAI_MAX_LAYERS_TO_LOAD; |
||||
import static org.hyperledger.besu.ethereum.worldstate.DataStorageConfiguration.DEFAULT_BONSAI_TRIE_LOG_PRUNING_WINDOW_SIZE; |
||||
import static org.hyperledger.besu.ethereum.worldstate.DataStorageConfiguration.DEFAULT_RECEIPT_COMPACTION_ENABLED; |
||||
import static org.hyperledger.besu.ethereum.worldstate.DataStorageConfiguration.MINIMUM_BONSAI_TRIE_LOG_RETENTION_LIMIT; |
||||
import static org.hyperledger.besu.ethereum.worldstate.DataStorageConfiguration.Unstable.DEFAULT_BONSAI_CODE_USING_CODE_HASH_ENABLED; |
||||
import static org.hyperledger.besu.ethereum.worldstate.DataStorageConfiguration.Unstable.DEFAULT_BONSAI_FULL_FLAT_DB_ENABLED; |
||||
|
||||
import org.hyperledger.besu.cli.util.CommandLineUtils; |
||||
import org.hyperledger.besu.ethereum.worldstate.DataStorageConfiguration; |
||||
import org.hyperledger.besu.ethereum.worldstate.ImmutableDataStorageConfiguration; |
||||
import org.hyperledger.besu.plugin.services.storage.DataStorageFormat; |
||||
|
||||
import java.util.List; |
||||
import java.util.Locale; |
||||
|
||||
import org.apache.commons.lang3.StringUtils; |
||||
import picocli.CommandLine; |
||||
import picocli.CommandLine.Option; |
||||
|
||||
/** The Data storage CLI options. */ |
||||
public class DataStorageOptions implements CLIOptions<DataStorageConfiguration> { |
||||
|
||||
private static final String DATA_STORAGE_FORMAT = "--data-storage-format"; |
||||
|
||||
/** The maximum number of historical layers to load. */ |
||||
public static final String BONSAI_STORAGE_FORMAT_MAX_LAYERS_TO_LOAD = |
||||
"--bonsai-historical-block-limit"; |
||||
|
||||
// Use Bonsai DB
|
||||
@Option( |
||||
names = {DATA_STORAGE_FORMAT}, |
||||
description = |
||||
"Format to store trie data in. Either FOREST or BONSAI (default: ${DEFAULT-VALUE}).", |
||||
arity = "1") |
||||
private DataStorageFormat dataStorageFormat = DataStorageFormat.BONSAI; |
||||
|
||||
@Option( |
||||
names = {BONSAI_STORAGE_FORMAT_MAX_LAYERS_TO_LOAD, "--bonsai-maximum-back-layers-to-load"}, |
||||
paramLabel = "<LONG>", |
||||
description = |
||||
"Limit of historical layers that can be loaded with BONSAI (default: ${DEFAULT-VALUE}). When using " |
||||
+ BONSAI_LIMIT_TRIE_LOGS_ENABLED |
||||
+ " it will also be used as the number of layers of trie logs to retain.", |
||||
arity = "1") |
||||
private Long bonsaiMaxLayersToLoad = DEFAULT_BONSAI_MAX_LAYERS_TO_LOAD; |
||||
|
||||
/** The bonsai limit trie logs enabled option name */ |
||||
public static final String BONSAI_LIMIT_TRIE_LOGS_ENABLED = "--bonsai-limit-trie-logs-enabled"; |
||||
|
||||
/** The bonsai trie logs pruning window size. */ |
||||
public static final String BONSAI_TRIE_LOG_PRUNING_WINDOW_SIZE = |
||||
"--bonsai-trie-logs-pruning-window-size"; |
||||
|
||||
// TODO --Xbonsai-limit-trie-logs-enabled and --Xbonsai-trie-log-pruning-enabled are deprecated,
|
||||
// remove in a future release
|
||||
@SuppressWarnings("ExperimentalCliOptionMustBeCorrectlyDisplayed") |
||||
@CommandLine.Option( |
||||
names = { |
||||
BONSAI_LIMIT_TRIE_LOGS_ENABLED, |
||||
"--Xbonsai-limit-trie-logs-enabled", // deprecated
|
||||
"--Xbonsai-trie-log-pruning-enabled" // deprecated
|
||||
}, |
||||
fallbackValue = "true", |
||||
description = "Limit the number of trie logs that are retained. (default: ${DEFAULT-VALUE})") |
||||
private Boolean bonsaiLimitTrieLogsEnabled = DEFAULT_BONSAI_LIMIT_TRIE_LOGS_ENABLED; |
||||
|
||||
// TODO --Xbonsai-trie-logs-pruning-window-size is deprecated, remove in a future release
|
||||
@SuppressWarnings("ExperimentalCliOptionMustBeCorrectlyDisplayed") |
||||
@CommandLine.Option( |
||||
names = { |
||||
BONSAI_TRIE_LOG_PRUNING_WINDOW_SIZE, |
||||
"--Xbonsai-trie-logs-pruning-window-size" // deprecated
|
||||
}, |
||||
description = |
||||
"The max number of blocks to load and prune trie logs for at startup. (default: ${DEFAULT-VALUE})") |
||||
private Integer bonsaiTrieLogPruningWindowSize = DEFAULT_BONSAI_TRIE_LOG_PRUNING_WINDOW_SIZE; |
||||
|
||||
@Option( |
||||
names = "--receipt-compaction-enabled", |
||||
description = "Enables compact storing of receipts (default: ${DEFAULT-VALUE})", |
||||
fallbackValue = "true") |
||||
private Boolean receiptCompactionEnabled = DEFAULT_RECEIPT_COMPACTION_ENABLED; |
||||
|
||||
@CommandLine.ArgGroup(validate = false) |
||||
private final DataStorageOptions.Unstable unstableOptions = new Unstable(); |
||||
|
||||
/** Default Constructor. */ |
||||
DataStorageOptions() {} |
||||
|
||||
/** The unstable options for data storage. */ |
||||
public static class Unstable { |
||||
|
||||
// TODO: --Xsnapsync-synchronizer-flat-db-healing-enabled is deprecated, remove it in a future
|
||||
// release
|
||||
@CommandLine.Option( |
||||
hidden = true, |
||||
names = { |
||||
"--Xbonsai-full-flat-db-enabled", |
||||
"--Xsnapsync-synchronizer-flat-db-healing-enabled" |
||||
}, |
||||
arity = "1", |
||||
description = "Enables bonsai full flat database strategy. (default: ${DEFAULT-VALUE})") |
||||
private Boolean bonsaiFullFlatDbEnabled = DEFAULT_BONSAI_FULL_FLAT_DB_ENABLED; |
||||
|
||||
@CommandLine.Option( |
||||
hidden = true, |
||||
names = {"--Xbonsai-code-using-code-hash-enabled"}, |
||||
arity = "1", |
||||
description = |
||||
"Enables code storage using code hash instead of by account hash. (default: ${DEFAULT-VALUE})") |
||||
private boolean bonsaiCodeUsingCodeHashEnabled = DEFAULT_BONSAI_CODE_USING_CODE_HASH_ENABLED; |
||||
|
||||
@CommandLine.Option( |
||||
hidden = true, |
||||
names = {"--Xbonsai-parallel-tx-processing-enabled"}, |
||||
arity = "1", |
||||
description = |
||||
"Enables parallelization of transactions to optimize processing speed by concurrently loading and executing necessary data in advance. (default: ${DEFAULT-VALUE})") |
||||
private Boolean isParallelTxProcessingEnabled = false; |
||||
|
||||
/** Default Constructor. */ |
||||
Unstable() {} |
||||
} |
||||
|
||||
/** |
||||
* Create data storage options. |
||||
* |
||||
* @return the data storage options |
||||
*/ |
||||
public static DataStorageOptions create() { |
||||
return new DataStorageOptions(); |
||||
} |
||||
|
||||
/** |
||||
* Validates the data storage options |
||||
* |
||||
* @param commandLine the full commandLine to check all the options specified by the user |
||||
*/ |
||||
public void validate(final CommandLine commandLine) { |
||||
if (DataStorageFormat.BONSAI == dataStorageFormat) { |
||||
if (bonsaiLimitTrieLogsEnabled) { |
||||
if (bonsaiMaxLayersToLoad < MINIMUM_BONSAI_TRIE_LOG_RETENTION_LIMIT) { |
||||
throw new CommandLine.ParameterException( |
||||
commandLine, |
||||
String.format( |
||||
BONSAI_STORAGE_FORMAT_MAX_LAYERS_TO_LOAD + " minimum value is %d", |
||||
MINIMUM_BONSAI_TRIE_LOG_RETENTION_LIMIT)); |
||||
} |
||||
if (bonsaiTrieLogPruningWindowSize <= 0) { |
||||
throw new CommandLine.ParameterException( |
||||
commandLine, |
||||
String.format( |
||||
BONSAI_TRIE_LOG_PRUNING_WINDOW_SIZE + "=%d must be greater than 0", |
||||
bonsaiTrieLogPruningWindowSize)); |
||||
} |
||||
if (bonsaiTrieLogPruningWindowSize <= bonsaiMaxLayersToLoad) { |
||||
throw new CommandLine.ParameterException( |
||||
commandLine, |
||||
String.format( |
||||
BONSAI_TRIE_LOG_PRUNING_WINDOW_SIZE |
||||
+ "=%d must be greater than " |
||||
+ BONSAI_STORAGE_FORMAT_MAX_LAYERS_TO_LOAD |
||||
+ "=%d", |
||||
bonsaiTrieLogPruningWindowSize, |
||||
bonsaiMaxLayersToLoad)); |
||||
} |
||||
} |
||||
} else { |
||||
if (unstableOptions.isParallelTxProcessingEnabled) { |
||||
throw new CommandLine.ParameterException( |
||||
commandLine, |
||||
"Transaction parallelization is not supported unless operating in a 'diffbased' mode, such as Bonsai."); |
||||
} |
||||
} |
||||
} |
||||
|
||||
/** |
||||
* Converts to options from the configuration |
||||
* |
||||
* @param domainObject to be reversed |
||||
* @return the options that correspond to the configuration |
||||
*/ |
||||
public static DataStorageOptions fromConfig(final DataStorageConfiguration domainObject) { |
||||
final DataStorageOptions dataStorageOptions = DataStorageOptions.create(); |
||||
dataStorageOptions.dataStorageFormat = domainObject.getDataStorageFormat(); |
||||
dataStorageOptions.bonsaiMaxLayersToLoad = domainObject.getBonsaiMaxLayersToLoad(); |
||||
dataStorageOptions.receiptCompactionEnabled = domainObject.getReceiptCompactionEnabled(); |
||||
dataStorageOptions.bonsaiLimitTrieLogsEnabled = domainObject.getBonsaiLimitTrieLogsEnabled(); |
||||
dataStorageOptions.bonsaiTrieLogPruningWindowSize = |
||||
domainObject.getBonsaiTrieLogPruningWindowSize(); |
||||
dataStorageOptions.unstableOptions.bonsaiFullFlatDbEnabled = |
||||
domainObject.getUnstable().getBonsaiFullFlatDbEnabled(); |
||||
dataStorageOptions.unstableOptions.bonsaiCodeUsingCodeHashEnabled = |
||||
domainObject.getUnstable().getBonsaiCodeStoredByCodeHashEnabled(); |
||||
dataStorageOptions.unstableOptions.isParallelTxProcessingEnabled = |
||||
domainObject.getUnstable().isParallelTxProcessingEnabled(); |
||||
|
||||
return dataStorageOptions; |
||||
} |
||||
|
||||
@Override |
||||
public DataStorageConfiguration toDomainObject() { |
||||
return ImmutableDataStorageConfiguration.builder() |
||||
.dataStorageFormat(dataStorageFormat) |
||||
.bonsaiMaxLayersToLoad(bonsaiMaxLayersToLoad) |
||||
.receiptCompactionEnabled(receiptCompactionEnabled) |
||||
.bonsaiLimitTrieLogsEnabled(bonsaiLimitTrieLogsEnabled) |
||||
.bonsaiTrieLogPruningWindowSize(bonsaiTrieLogPruningWindowSize) |
||||
.unstable( |
||||
ImmutableDataStorageConfiguration.Unstable.builder() |
||||
.bonsaiFullFlatDbEnabled(unstableOptions.bonsaiFullFlatDbEnabled) |
||||
.bonsaiCodeStoredByCodeHashEnabled(unstableOptions.bonsaiCodeUsingCodeHashEnabled) |
||||
.isParallelTxProcessingEnabled(unstableOptions.isParallelTxProcessingEnabled) |
||||
.build()) |
||||
.build(); |
||||
} |
||||
|
||||
@Override |
||||
public List<String> getCLIOptions() { |
||||
return CommandLineUtils.getCLIOptions(this, new DataStorageOptions()); |
||||
} |
||||
|
||||
/** |
||||
* Normalize data storage format string. |
||||
* |
||||
* @return the normalized string |
||||
*/ |
||||
public String normalizeDataStorageFormat() { |
||||
return StringUtils.capitalize(dataStorageFormat.toString().toLowerCase(Locale.ROOT)); |
||||
} |
||||
} |
@ -0,0 +1,121 @@ |
||||
/* |
||||
* Copyright ConsenSys AG. |
||||
* |
||||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with |
||||
* the License. You may obtain a copy of the License at |
||||
* |
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* |
||||
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on |
||||
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the |
||||
* specific language governing permissions and limitations under the License. |
||||
* |
||||
* SPDX-License-Identifier: Apache-2.0 |
||||
*/ |
||||
package org.hyperledger.besu.cli.options.storage; |
||||
|
||||
import static org.hyperledger.besu.ethereum.worldstate.DataStorageConfiguration.DEFAULT_RECEIPT_COMPACTION_ENABLED; |
||||
|
||||
import org.hyperledger.besu.cli.options.CLIOptions; |
||||
import org.hyperledger.besu.cli.util.CommandLineUtils; |
||||
import org.hyperledger.besu.ethereum.worldstate.DataStorageConfiguration; |
||||
import org.hyperledger.besu.ethereum.worldstate.ImmutableDataStorageConfiguration; |
||||
import org.hyperledger.besu.plugin.services.storage.DataStorageFormat; |
||||
|
||||
import java.util.List; |
||||
import java.util.Locale; |
||||
|
||||
import org.apache.commons.lang3.StringUtils; |
||||
import picocli.CommandLine; |
||||
import picocli.CommandLine.Mixin; |
||||
import picocli.CommandLine.Option; |
||||
|
||||
/** The Data storage CLI options. */ |
||||
public class DataStorageOptions implements CLIOptions<DataStorageConfiguration> { |
||||
|
||||
private static final String DATA_STORAGE_FORMAT = "--data-storage-format"; |
||||
|
||||
// Use Bonsai DB
|
||||
@Option( |
||||
names = {DATA_STORAGE_FORMAT}, |
||||
description = |
||||
"Format to store trie data in. Either FOREST or BONSAI (default: ${DEFAULT-VALUE}).", |
||||
arity = "1") |
||||
private DataStorageFormat dataStorageFormat = DataStorageFormat.BONSAI; |
||||
|
||||
@Option( |
||||
names = "--receipt-compaction-enabled", |
||||
description = "Enables compact storing of receipts (default: ${DEFAULT-VALUE})", |
||||
fallbackValue = "true") |
||||
private Boolean receiptCompactionEnabled = DEFAULT_RECEIPT_COMPACTION_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. |
||||
*/ |
||||
@Mixin |
||||
private DiffBasedSubStorageOptions diffBasedSubStorageOptions = |
||||
DiffBasedSubStorageOptions.create(); |
||||
|
||||
/** Default Constructor. */ |
||||
DataStorageOptions() {} |
||||
|
||||
/** |
||||
* Create data storage options. |
||||
* |
||||
* @return the data storage options |
||||
*/ |
||||
public static DataStorageOptions create() { |
||||
return new DataStorageOptions(); |
||||
} |
||||
|
||||
/** |
||||
* Validates the data storage options |
||||
* |
||||
* @param commandLine the full commandLine to check all the options specified by the user |
||||
*/ |
||||
public void validate(final CommandLine commandLine) { |
||||
diffBasedSubStorageOptions.validate(commandLine, dataStorageFormat); |
||||
} |
||||
|
||||
/** |
||||
* Converts to options from the configuration |
||||
* |
||||
* @param domainObject to be reversed |
||||
* @return the options that correspond to the configuration |
||||
*/ |
||||
public static DataStorageOptions fromConfig(final DataStorageConfiguration domainObject) { |
||||
final DataStorageOptions dataStorageOptions = DataStorageOptions.create(); |
||||
dataStorageOptions.dataStorageFormat = domainObject.getDataStorageFormat(); |
||||
dataStorageOptions.receiptCompactionEnabled = domainObject.getReceiptCompactionEnabled(); |
||||
dataStorageOptions.diffBasedSubStorageOptions = |
||||
DiffBasedSubStorageOptions.fromConfig(domainObject.getDiffBasedSubStorageConfiguration()); |
||||
return dataStorageOptions; |
||||
} |
||||
|
||||
@Override |
||||
public DataStorageConfiguration toDomainObject() { |
||||
final ImmutableDataStorageConfiguration.Builder builder = |
||||
ImmutableDataStorageConfiguration.builder() |
||||
.dataStorageFormat(dataStorageFormat) |
||||
.receiptCompactionEnabled(receiptCompactionEnabled) |
||||
.diffBasedSubStorageConfiguration(diffBasedSubStorageOptions.toDomainObject()); |
||||
return builder.build(); |
||||
} |
||||
|
||||
@Override |
||||
public List<String> getCLIOptions() { |
||||
final List<String> cliOptions = CommandLineUtils.getCLIOptions(this, new DataStorageOptions()); |
||||
cliOptions.addAll(diffBasedSubStorageOptions.getCLIOptions()); |
||||
return cliOptions; |
||||
} |
||||
|
||||
/** |
||||
* Normalize data storage format string. |
||||
* |
||||
* @return the normalized string |
||||
*/ |
||||
public String normalizeDataStorageFormat() { |
||||
return StringUtils.capitalize(dataStorageFormat.toString().toLowerCase(Locale.ROOT)); |
||||
} |
||||
} |
@ -0,0 +1,217 @@ |
||||
/* |
||||
* Copyright ConsenSys AG. |
||||
* |
||||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with |
||||
* the License. You may obtain a copy of the License at |
||||
* |
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* |
||||
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on |
||||
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the |
||||
* specific language governing permissions and limitations under the License. |
||||
* |
||||
* SPDX-License-Identifier: Apache-2.0 |
||||
*/ |
||||
package org.hyperledger.besu.cli.options.storage; |
||||
|
||||
import static org.hyperledger.besu.ethereum.worldstate.DiffBasedSubStorageConfiguration.DEFAULT_LIMIT_TRIE_LOGS_ENABLED; |
||||
import static org.hyperledger.besu.ethereum.worldstate.DiffBasedSubStorageConfiguration.DEFAULT_MAX_LAYERS_TO_LOAD; |
||||
import static org.hyperledger.besu.ethereum.worldstate.DiffBasedSubStorageConfiguration.DEFAULT_TRIE_LOG_PRUNING_WINDOW_SIZE; |
||||
import static org.hyperledger.besu.ethereum.worldstate.DiffBasedSubStorageConfiguration.DiffBasedUnstable.DEFAULT_CODE_USING_CODE_HASH_ENABLED; |
||||
import static org.hyperledger.besu.ethereum.worldstate.DiffBasedSubStorageConfiguration.DiffBasedUnstable.DEFAULT_FULL_FLAT_DB_ENABLED; |
||||
import static org.hyperledger.besu.ethereum.worldstate.DiffBasedSubStorageConfiguration.MINIMUM_TRIE_LOG_RETENTION_LIMIT; |
||||
|
||||
import org.hyperledger.besu.cli.options.CLIOptions; |
||||
import org.hyperledger.besu.cli.util.CommandLineUtils; |
||||
import org.hyperledger.besu.ethereum.worldstate.DiffBasedSubStorageConfiguration; |
||||
import org.hyperledger.besu.ethereum.worldstate.ImmutableDiffBasedSubStorageConfiguration; |
||||
import org.hyperledger.besu.plugin.services.storage.DataStorageFormat; |
||||
|
||||
import java.util.List; |
||||
|
||||
import picocli.CommandLine; |
||||
import picocli.CommandLine.Option; |
||||
|
||||
/** The Data storage CLI options. */ |
||||
public class DiffBasedSubStorageOptions implements CLIOptions<DiffBasedSubStorageConfiguration> { |
||||
|
||||
/** The maximum number of historical layers to load. */ |
||||
public static final String MAX_LAYERS_TO_LOAD = "--bonsai-historical-block-limit"; |
||||
|
||||
@Option( |
||||
names = {MAX_LAYERS_TO_LOAD, "--bonsai-maximum-back-layers-to-load"}, |
||||
paramLabel = "<LONG>", |
||||
description = |
||||
"Limit of historical layers that can be loaded with BONSAI (default: ${DEFAULT-VALUE}). When using " |
||||
+ LIMIT_TRIE_LOGS_ENABLED |
||||
+ " it will also be used as the number of layers of trie logs to retain.", |
||||
arity = "1") |
||||
private Long maxLayersToLoad = DEFAULT_MAX_LAYERS_TO_LOAD; |
||||
|
||||
/** The bonsai limit trie logs enabled option name */ |
||||
public static final String LIMIT_TRIE_LOGS_ENABLED = "--bonsai-limit-trie-logs-enabled"; |
||||
|
||||
/** The bonsai trie logs pruning window size. */ |
||||
public static final String TRIE_LOG_PRUNING_WINDOW_SIZE = |
||||
"--bonsai-trie-logs-pruning-window-size"; |
||||
|
||||
// TODO --Xbonsai-limit-trie-logs-enabled and --Xbonsai-trie-log-pruning-enabled are deprecated,
|
||||
// remove in a future release
|
||||
@SuppressWarnings("ExperimentalCliOptionMustBeCorrectlyDisplayed") |
||||
@Option( |
||||
names = { |
||||
LIMIT_TRIE_LOGS_ENABLED, |
||||
"--Xbonsai-limit-trie-logs-enabled", // deprecated
|
||||
"--Xbonsai-trie-log-pruning-enabled" // deprecated
|
||||
}, |
||||
fallbackValue = "true", |
||||
description = "Limit the number of trie logs that are retained. (default: ${DEFAULT-VALUE})") |
||||
private Boolean limitTrieLogsEnabled = DEFAULT_LIMIT_TRIE_LOGS_ENABLED; |
||||
|
||||
// TODO --Xbonsai-trie-logs-pruning-window-size is deprecated, remove in a future release
|
||||
@SuppressWarnings("ExperimentalCliOptionMustBeCorrectlyDisplayed") |
||||
@Option( |
||||
names = { |
||||
TRIE_LOG_PRUNING_WINDOW_SIZE, |
||||
"--Xbonsai-trie-logs-pruning-window-size" // deprecated
|
||||
}, |
||||
description = |
||||
"The max number of blocks to load and prune trie logs for at startup. (default: ${DEFAULT-VALUE})") |
||||
private Integer trieLogPruningWindowSize = DEFAULT_TRIE_LOG_PRUNING_WINDOW_SIZE; |
||||
|
||||
@CommandLine.ArgGroup(validate = false) |
||||
private final DiffBasedSubStorageOptions.Unstable unstableOptions = new Unstable(); |
||||
|
||||
/** Default Constructor. */ |
||||
DiffBasedSubStorageOptions() {} |
||||
|
||||
/** The unstable options for data storage. */ |
||||
public static class Unstable { |
||||
|
||||
// TODO: --Xsnapsync-synchronizer-flat-db-healing-enabled is deprecated, remove it in a future
|
||||
// release
|
||||
@Option( |
||||
hidden = true, |
||||
names = { |
||||
"--Xbonsai-full-flat-db-enabled", |
||||
"--Xsnapsync-synchronizer-flat-db-healing-enabled" |
||||
}, |
||||
arity = "1", |
||||
description = "Enables bonsai full flat database strategy. (default: ${DEFAULT-VALUE})") |
||||
private Boolean fullFlatDbEnabled = DEFAULT_FULL_FLAT_DB_ENABLED; |
||||
|
||||
@Option( |
||||
hidden = true, |
||||
names = {"--Xbonsai-code-using-code-hash-enabled"}, |
||||
arity = "1", |
||||
description = |
||||
"Enables code storage using code hash instead of by account hash. (default: ${DEFAULT-VALUE})") |
||||
private boolean codeUsingCodeHashEnabled = DEFAULT_CODE_USING_CODE_HASH_ENABLED; |
||||
|
||||
@Option( |
||||
hidden = true, |
||||
names = {"--Xbonsai-parallel-tx-processing-enabled"}, |
||||
arity = "1", |
||||
description = |
||||
"Enables parallelization of transactions to optimize processing speed by concurrently loading and executing necessary data in advance. (default: ${DEFAULT-VALUE})") |
||||
private Boolean isParallelTxProcessingEnabled = false; |
||||
|
||||
/** Default Constructor. */ |
||||
Unstable() {} |
||||
} |
||||
|
||||
/** |
||||
* Create data storage options. |
||||
* |
||||
* @return the data storage options |
||||
*/ |
||||
public static DiffBasedSubStorageOptions create() { |
||||
return new DiffBasedSubStorageOptions(); |
||||
} |
||||
|
||||
/** |
||||
* Validates the data storage options |
||||
* |
||||
* @param commandLine the full commandLine to check all the options specified by the user |
||||
* @param dataStorageFormat the selected data storage format which determines the validation rules |
||||
* to apply. |
||||
*/ |
||||
public void validate(final CommandLine commandLine, final DataStorageFormat dataStorageFormat) { |
||||
if (DataStorageFormat.BONSAI == dataStorageFormat) { |
||||
if (limitTrieLogsEnabled) { |
||||
if (maxLayersToLoad < MINIMUM_TRIE_LOG_RETENTION_LIMIT) { |
||||
throw new CommandLine.ParameterException( |
||||
commandLine, |
||||
String.format( |
||||
MAX_LAYERS_TO_LOAD + " minimum value is %d", MINIMUM_TRIE_LOG_RETENTION_LIMIT)); |
||||
} |
||||
if (trieLogPruningWindowSize <= 0) { |
||||
throw new CommandLine.ParameterException( |
||||
commandLine, |
||||
String.format( |
||||
TRIE_LOG_PRUNING_WINDOW_SIZE + "=%d must be greater than 0", |
||||
trieLogPruningWindowSize)); |
||||
} |
||||
if (trieLogPruningWindowSize <= maxLayersToLoad) { |
||||
throw new CommandLine.ParameterException( |
||||
commandLine, |
||||
String.format( |
||||
TRIE_LOG_PRUNING_WINDOW_SIZE |
||||
+ "=%d must be greater than " |
||||
+ MAX_LAYERS_TO_LOAD |
||||
+ "=%d", |
||||
trieLogPruningWindowSize, |
||||
maxLayersToLoad)); |
||||
} |
||||
} |
||||
} else { |
||||
if (unstableOptions.isParallelTxProcessingEnabled) { |
||||
throw new CommandLine.ParameterException( |
||||
commandLine, |
||||
"Transaction parallelization is not supported unless operating in a 'diffbased' mode, such as Bonsai."); |
||||
} |
||||
} |
||||
} |
||||
|
||||
/** |
||||
* Converts to options from the configuration |
||||
* |
||||
* @param domainObject to be reversed |
||||
* @return the options that correspond to the configuration |
||||
*/ |
||||
public static DiffBasedSubStorageOptions fromConfig( |
||||
final DiffBasedSubStorageConfiguration domainObject) { |
||||
final DiffBasedSubStorageOptions dataStorageOptions = DiffBasedSubStorageOptions.create(); |
||||
dataStorageOptions.maxLayersToLoad = domainObject.getMaxLayersToLoad(); |
||||
dataStorageOptions.limitTrieLogsEnabled = domainObject.getLimitTrieLogsEnabled(); |
||||
dataStorageOptions.trieLogPruningWindowSize = domainObject.getTrieLogPruningWindowSize(); |
||||
dataStorageOptions.unstableOptions.fullFlatDbEnabled = |
||||
domainObject.getUnstable().getFullFlatDbEnabled(); |
||||
dataStorageOptions.unstableOptions.codeUsingCodeHashEnabled = |
||||
domainObject.getUnstable().getCodeStoredByCodeHashEnabled(); |
||||
dataStorageOptions.unstableOptions.isParallelTxProcessingEnabled = |
||||
domainObject.getUnstable().isParallelTxProcessingEnabled(); |
||||
|
||||
return dataStorageOptions; |
||||
} |
||||
|
||||
@Override |
||||
public final DiffBasedSubStorageConfiguration toDomainObject() { |
||||
return ImmutableDiffBasedSubStorageConfiguration.builder() |
||||
.maxLayersToLoad(maxLayersToLoad) |
||||
.limitTrieLogsEnabled(limitTrieLogsEnabled) |
||||
.trieLogPruningWindowSize(trieLogPruningWindowSize) |
||||
.unstable( |
||||
ImmutableDiffBasedSubStorageConfiguration.DiffBasedUnstable.builder() |
||||
.fullFlatDbEnabled(unstableOptions.fullFlatDbEnabled) |
||||
.codeStoredByCodeHashEnabled(unstableOptions.codeUsingCodeHashEnabled) |
||||
.isParallelTxProcessingEnabled(unstableOptions.isParallelTxProcessingEnabled) |
||||
.build()) |
||||
.build(); |
||||
} |
||||
|
||||
@Override |
||||
public List<String> getCLIOptions() { |
||||
return CommandLineUtils.getCLIOptions(this, new DiffBasedSubStorageOptions()); |
||||
} |
||||
} |
@ -0,0 +1,173 @@ |
||||
/* |
||||
* Copyright contributors to Hyperledger Besu. |
||||
* |
||||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with |
||||
* the License. You may obtain a copy of the License at |
||||
* |
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* |
||||
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on |
||||
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the |
||||
* specific language governing permissions and limitations under the License. |
||||
* |
||||
* SPDX-License-Identifier: Apache-2.0 |
||||
*/ |
||||
package org.hyperledger.besu.ethereum.trie.diffbased.bonsai.storage.flat; |
||||
|
||||
import static org.hyperledger.besu.ethereum.storage.keyvalue.KeyValueSegmentIdentifier.ACCOUNT_INFO_STATE; |
||||
import static org.hyperledger.besu.ethereum.storage.keyvalue.KeyValueSegmentIdentifier.ACCOUNT_STORAGE_STORAGE; |
||||
import static org.hyperledger.besu.ethereum.storage.keyvalue.KeyValueSegmentIdentifier.CODE_STORAGE; |
||||
|
||||
import org.hyperledger.besu.datatypes.Hash; |
||||
import org.hyperledger.besu.datatypes.StorageSlotKey; |
||||
import org.hyperledger.besu.ethereum.trie.NodeLoader; |
||||
import org.hyperledger.besu.ethereum.trie.diffbased.common.storage.flat.CodeStorageStrategy; |
||||
import org.hyperledger.besu.ethereum.trie.diffbased.common.storage.flat.FlatDbStrategy; |
||||
import org.hyperledger.besu.plugin.services.MetricsSystem; |
||||
import org.hyperledger.besu.plugin.services.storage.SegmentedKeyValueStorage; |
||||
import org.hyperledger.besu.plugin.services.storage.SegmentedKeyValueStorageTransaction; |
||||
|
||||
import java.util.Optional; |
||||
import java.util.function.Function; |
||||
import java.util.function.Supplier; |
||||
import java.util.stream.Stream; |
||||
|
||||
import kotlin.Pair; |
||||
import org.apache.tuweni.bytes.Bytes; |
||||
import org.apache.tuweni.bytes.Bytes32; |
||||
|
||||
/** |
||||
* This class represents a FlatDbReaderStrategy, which is responsible for reading and writing data |
||||
* from flat databases. It implements various methods for storing and retrieving account data, code |
||||
* data, and storage data from the corresponding KeyValueStorage. |
||||
*/ |
||||
public abstract class BonsaiFlatDbStrategy extends FlatDbStrategy { |
||||
|
||||
public BonsaiFlatDbStrategy( |
||||
final MetricsSystem metricsSystem, final CodeStorageStrategy codeStorageStrategy) { |
||||
super(metricsSystem, codeStorageStrategy); |
||||
} |
||||
|
||||
/* |
||||
* Retrieves the account data for the given account hash, using the world state root hash supplier and node loader. |
||||
*/ |
||||
public abstract Optional<Bytes> getFlatAccount( |
||||
Supplier<Optional<Bytes>> worldStateRootHashSupplier, |
||||
NodeLoader nodeLoader, |
||||
Hash accountHash, |
||||
SegmentedKeyValueStorage storage); |
||||
|
||||
/* |
||||
* Retrieves the storage value for the given account hash and storage slot key, using the world state root hash supplier, storage root supplier, and node loader. |
||||
*/ |
||||
|
||||
public abstract Optional<Bytes> getFlatStorageValueByStorageSlotKey( |
||||
Supplier<Optional<Bytes>> worldStateRootHashSupplier, |
||||
Supplier<Optional<Hash>> storageRootSupplier, |
||||
NodeLoader nodeLoader, |
||||
Hash accountHash, |
||||
StorageSlotKey storageSlotKey, |
||||
SegmentedKeyValueStorage storageStorage); |
||||
|
||||
@Override |
||||
public void putFlatAccount( |
||||
final SegmentedKeyValueStorageTransaction transaction, |
||||
final Hash accountHash, |
||||
final Bytes accountValue) { |
||||
transaction.put(ACCOUNT_INFO_STATE, accountHash.toArrayUnsafe(), accountValue.toArrayUnsafe()); |
||||
} |
||||
|
||||
@Override |
||||
public void removeFlatAccount( |
||||
final SegmentedKeyValueStorageTransaction transaction, final Hash accountHash) { |
||||
transaction.remove(ACCOUNT_INFO_STATE, accountHash.toArrayUnsafe()); |
||||
} |
||||
|
||||
@Override |
||||
public void putFlatAccountStorageValueByStorageSlotHash( |
||||
final SegmentedKeyValueStorageTransaction transaction, |
||||
final Hash accountHash, |
||||
final Hash slotHash, |
||||
final Bytes storage) { |
||||
transaction.put( |
||||
ACCOUNT_STORAGE_STORAGE, |
||||
Bytes.concatenate(accountHash, slotHash).toArrayUnsafe(), |
||||
storage.toArrayUnsafe()); |
||||
} |
||||
|
||||
@Override |
||||
public void removeFlatAccountStorageValueByStorageSlotHash( |
||||
final SegmentedKeyValueStorageTransaction transaction, |
||||
final Hash accountHash, |
||||
final Hash slotHash) { |
||||
transaction.remove( |
||||
ACCOUNT_STORAGE_STORAGE, Bytes.concatenate(accountHash, slotHash).toArrayUnsafe()); |
||||
} |
||||
|
||||
@Override |
||||
public void clearAll(final SegmentedKeyValueStorage storage) { |
||||
storage.clear(ACCOUNT_INFO_STATE); |
||||
storage.clear(ACCOUNT_STORAGE_STORAGE); |
||||
storage.clear(CODE_STORAGE); |
||||
} |
||||
|
||||
@Override |
||||
public void resetOnResync(final SegmentedKeyValueStorage storage) { |
||||
storage.clear(ACCOUNT_INFO_STATE); |
||||
storage.clear(ACCOUNT_STORAGE_STORAGE); |
||||
} |
||||
|
||||
@Override |
||||
protected Stream<Pair<Bytes32, Bytes>> storageToPairStream( |
||||
final SegmentedKeyValueStorage storage, |
||||
final Hash accountHash, |
||||
final Bytes startKeyHash, |
||||
final Function<Bytes, Bytes> valueMapper) { |
||||
|
||||
return storage |
||||
.streamFromKey( |
||||
ACCOUNT_STORAGE_STORAGE, Bytes.concatenate(accountHash, startKeyHash).toArrayUnsafe()) |
||||
.takeWhile(pair -> Bytes.wrap(pair.getKey()).slice(0, Hash.SIZE).equals(accountHash)) |
||||
.map( |
||||
pair -> |
||||
new Pair<>( |
||||
Bytes32.wrap(Bytes.wrap(pair.getKey()).slice(Hash.SIZE)), |
||||
valueMapper.apply(Bytes.wrap(pair.getValue()).trimLeadingZeros()))); |
||||
} |
||||
|
||||
@Override |
||||
protected Stream<Pair<Bytes32, Bytes>> storageToPairStream( |
||||
final SegmentedKeyValueStorage storage, |
||||
final Hash accountHash, |
||||
final Bytes startKeyHash, |
||||
final Bytes32 endKeyHash, |
||||
final Function<Bytes, Bytes> valueMapper) { |
||||
|
||||
return storage |
||||
.streamFromKey( |
||||
ACCOUNT_STORAGE_STORAGE, |
||||
Bytes.concatenate(accountHash, startKeyHash).toArrayUnsafe(), |
||||
Bytes.concatenate(accountHash, endKeyHash).toArrayUnsafe()) |
||||
.map( |
||||
pair -> |
||||
new Pair<>( |
||||
Bytes32.wrap(Bytes.wrap(pair.getKey()).slice(Hash.SIZE)), |
||||
valueMapper.apply(Bytes.wrap(pair.getValue()).trimLeadingZeros()))); |
||||
} |
||||
|
||||
@Override |
||||
protected Stream<Pair<Bytes32, Bytes>> accountsToPairStream( |
||||
final SegmentedKeyValueStorage storage, final Bytes startKeyHash, final Bytes32 endKeyHash) { |
||||
return storage |
||||
.streamFromKey(ACCOUNT_INFO_STATE, startKeyHash.toArrayUnsafe(), endKeyHash.toArrayUnsafe()) |
||||
.map(pair -> new Pair<>(Bytes32.wrap(pair.getKey()), Bytes.wrap(pair.getValue()))); |
||||
} |
||||
|
||||
@Override |
||||
protected Stream<Pair<Bytes32, Bytes>> accountsToPairStream( |
||||
final SegmentedKeyValueStorage storage, final Bytes startKeyHash) { |
||||
return storage |
||||
.streamFromKey(ACCOUNT_INFO_STATE, startKeyHash.toArrayUnsafe()) |
||||
.map(pair -> new Pair<>(Bytes32.wrap(pair.getKey()), Bytes.wrap(pair.getValue()))); |
||||
} |
||||
} |
@ -0,0 +1,88 @@ |
||||
/* |
||||
* Copyright contributors to Hyperledger Besu. |
||||
* |
||||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with |
||||
* the License. You may obtain a copy of the License at |
||||
* |
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* |
||||
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on |
||||
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the |
||||
* specific language governing permissions and limitations under the License. |
||||
* |
||||
* SPDX-License-Identifier: Apache-2.0 |
||||
*/ |
||||
package org.hyperledger.besu.ethereum.trie.diffbased.bonsai.storage.flat; |
||||
|
||||
import static org.hyperledger.besu.ethereum.storage.keyvalue.KeyValueSegmentIdentifier.TRIE_BRANCH_STORAGE; |
||||
|
||||
import org.hyperledger.besu.ethereum.trie.diffbased.common.storage.flat.CodeStorageStrategy; |
||||
import org.hyperledger.besu.ethereum.trie.diffbased.common.storage.flat.FlatDbStrategy; |
||||
import org.hyperledger.besu.ethereum.trie.diffbased.common.storage.flat.FlatDbStrategyProvider; |
||||
import org.hyperledger.besu.ethereum.worldstate.DataStorageConfiguration; |
||||
import org.hyperledger.besu.ethereum.worldstate.FlatDbMode; |
||||
import org.hyperledger.besu.plugin.services.MetricsSystem; |
||||
import org.hyperledger.besu.plugin.services.storage.SegmentedKeyValueStorage; |
||||
import org.hyperledger.besu.plugin.services.storage.SegmentedKeyValueStorageTransaction; |
||||
|
||||
import org.slf4j.Logger; |
||||
import org.slf4j.LoggerFactory; |
||||
|
||||
public class BonsaiFlatDbStrategyProvider extends FlatDbStrategyProvider { |
||||
|
||||
private static final Logger LOG = LoggerFactory.getLogger(BonsaiFlatDbStrategyProvider.class); |
||||
|
||||
public BonsaiFlatDbStrategyProvider( |
||||
final MetricsSystem metricsSystem, final DataStorageConfiguration dataStorageConfiguration) { |
||||
super(metricsSystem, dataStorageConfiguration); |
||||
} |
||||
|
||||
@Override |
||||
protected FlatDbMode getRequestedFlatDbMode( |
||||
final DataStorageConfiguration dataStorageConfiguration) { |
||||
return dataStorageConfiguration |
||||
.getDiffBasedSubStorageConfiguration() |
||||
.getUnstable() |
||||
.getFullFlatDbEnabled() |
||||
? FlatDbMode.FULL |
||||
: FlatDbMode.PARTIAL; |
||||
} |
||||
|
||||
@Override |
||||
protected FlatDbMode alternativeFlatDbModeForExistingDatabase() { |
||||
return FlatDbMode.PARTIAL; |
||||
} |
||||
|
||||
public void upgradeToFullFlatDbMode(final SegmentedKeyValueStorage composedWorldStateStorage) { |
||||
final SegmentedKeyValueStorageTransaction transaction = |
||||
composedWorldStateStorage.startTransaction(); |
||||
LOG.info("setting FlatDbStrategy to FULL"); |
||||
transaction.put( |
||||
TRIE_BRANCH_STORAGE, FLAT_DB_MODE, FlatDbMode.FULL.getVersion().toArrayUnsafe()); |
||||
transaction.commit(); |
||||
loadFlatDbStrategy(composedWorldStateStorage); // force reload of flat db reader strategy
|
||||
} |
||||
|
||||
public void downgradeToPartialFlatDbMode( |
||||
final SegmentedKeyValueStorage composedWorldStateStorage) { |
||||
final SegmentedKeyValueStorageTransaction transaction = |
||||
composedWorldStateStorage.startTransaction(); |
||||
LOG.info("setting FlatDbStrategy to PARTIAL"); |
||||
transaction.put( |
||||
TRIE_BRANCH_STORAGE, FLAT_DB_MODE, FlatDbMode.PARTIAL.getVersion().toArrayUnsafe()); |
||||
transaction.commit(); |
||||
loadFlatDbStrategy(composedWorldStateStorage); // force reload of flat db reader strategy
|
||||
} |
||||
|
||||
@Override |
||||
protected FlatDbStrategy createFlatDbStrategy( |
||||
final FlatDbMode flatDbMode, |
||||
final MetricsSystem metricsSystem, |
||||
final CodeStorageStrategy codeStorageStrategy) { |
||||
if (flatDbMode == FlatDbMode.FULL) { |
||||
return new BonsaiFullFlatDbStrategy(metricsSystem, codeStorageStrategy); |
||||
} else { |
||||
return new BonsaiPartialFlatDbStrategy(metricsSystem, codeStorageStrategy); |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,95 @@ |
||||
/* |
||||
* Copyright ConsenSys AG. |
||||
* |
||||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with |
||||
* the License. You may obtain a copy of the License at |
||||
* |
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* |
||||
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on |
||||
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the |
||||
* specific language governing permissions and limitations under the License. |
||||
* |
||||
* SPDX-License-Identifier: Apache-2.0 |
||||
*/ |
||||
package org.hyperledger.besu.ethereum.worldstate; |
||||
|
||||
import org.immutables.value.Value; |
||||
|
||||
@Value.Immutable |
||||
@Value.Enclosing |
||||
public interface DiffBasedSubStorageConfiguration { |
||||
|
||||
DiffBasedSubStorageConfiguration DEFAULT = |
||||
ImmutableDiffBasedSubStorageConfiguration.builder().build(); |
||||
|
||||
DiffBasedSubStorageConfiguration DISABLED = |
||||
ImmutableDiffBasedSubStorageConfiguration.builder() |
||||
.limitTrieLogsEnabled(false) |
||||
.unstable(DiffBasedUnstable.DISABLED) |
||||
.build(); |
||||
|
||||
long DEFAULT_MAX_LAYERS_TO_LOAD = 512; |
||||
boolean DEFAULT_LIMIT_TRIE_LOGS_ENABLED = true; |
||||
long MINIMUM_TRIE_LOG_RETENTION_LIMIT = DEFAULT_MAX_LAYERS_TO_LOAD; |
||||
int DEFAULT_TRIE_LOG_PRUNING_WINDOW_SIZE = 5_000; |
||||
|
||||
@Value.Default |
||||
default Long getMaxLayersToLoad() { |
||||
return DEFAULT_MAX_LAYERS_TO_LOAD; |
||||
} |
||||
|
||||
@Value.Default |
||||
default boolean getLimitTrieLogsEnabled() { |
||||
return DEFAULT_LIMIT_TRIE_LOGS_ENABLED; |
||||
} |
||||
|
||||
@Value.Default |
||||
default int getTrieLogPruningWindowSize() { |
||||
return DEFAULT_TRIE_LOG_PRUNING_WINDOW_SIZE; |
||||
} |
||||
|
||||
@Value.Default |
||||
default DiffBasedUnstable getUnstable() { |
||||
return DiffBasedUnstable.DEFAULT; |
||||
} |
||||
|
||||
@Value.Immutable |
||||
interface DiffBasedUnstable { |
||||
|
||||
DiffBasedSubStorageConfiguration.DiffBasedUnstable DEFAULT = |
||||
ImmutableDiffBasedSubStorageConfiguration.DiffBasedUnstable.builder().build(); |
||||
|
||||
DiffBasedSubStorageConfiguration.DiffBasedUnstable PARTIAL_MODE = |
||||
ImmutableDiffBasedSubStorageConfiguration.DiffBasedUnstable.builder() |
||||
.fullFlatDbEnabled(false) |
||||
.build(); |
||||
|
||||
DiffBasedSubStorageConfiguration.DiffBasedUnstable DISABLED = |
||||
ImmutableDiffBasedSubStorageConfiguration.DiffBasedUnstable.builder() |
||||
.fullFlatDbEnabled(false) |
||||
.codeStoredByCodeHashEnabled(false) |
||||
.isParallelTxProcessingEnabled(false) |
||||
.build(); |
||||
|
||||
boolean DEFAULT_FULL_FLAT_DB_ENABLED = true; |
||||
boolean DEFAULT_CODE_USING_CODE_HASH_ENABLED = true; |
||||
|
||||
boolean DEFAULT_PARALLEL_TRX_ENABLED = false; |
||||
|
||||
@Value.Default |
||||
default boolean getFullFlatDbEnabled() { |
||||
return DEFAULT_FULL_FLAT_DB_ENABLED; |
||||
} |
||||
|
||||
@Value.Default |
||||
default boolean getCodeStoredByCodeHashEnabled() { |
||||
return DEFAULT_CODE_USING_CODE_HASH_ENABLED; |
||||
} |
||||
|
||||
@Value.Default |
||||
default boolean isParallelTxProcessingEnabled() { |
||||
return DEFAULT_PARALLEL_TRX_ENABLED; |
||||
} |
||||
} |
||||
} |
Loading…
Reference in new issue