Extend BesuConfiguration service (#6584)

Signed-off-by: Fabio Di Fabio <fabio.difabio@consensys.net>
pull/6088/merge
Fabio Di Fabio 9 months ago committed by GitHub
parent 8d25b24cd7
commit 1d2d0375cd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 1
      CHANGELOG.md
  2. 8
      acceptance-tests/dsl/src/main/java/org/hyperledger/besu/tests/acceptance/dsl/node/BesuNode.java
  3. 8
      acceptance-tests/dsl/src/main/java/org/hyperledger/besu/tests/acceptance/dsl/node/ThreadBesuNodeRunner.java
  4. 8
      acceptance-tests/dsl/src/main/java/org/hyperledger/besu/tests/acceptance/dsl/node/configuration/BesuNodeConfiguration.java
  5. 10
      acceptance-tests/dsl/src/main/java/org/hyperledger/besu/tests/acceptance/dsl/node/configuration/BesuNodeConfigurationBuilder.java
  6. 1
      acceptance-tests/dsl/src/main/java/org/hyperledger/besu/tests/acceptance/dsl/node/configuration/BesuNodeFactory.java
  7. 8
      acceptance-tests/dsl/src/main/java/org/hyperledger/besu/tests/acceptance/dsl/privacy/PrivacyNode.java
  8. 55
      besu/src/main/java/org/hyperledger/besu/cli/BesuCommand.java
  9. 1
      besu/src/main/java/org/hyperledger/besu/controller/BesuControllerBuilder.java
  10. 32
      besu/src/main/java/org/hyperledger/besu/services/BesuConfigurationImpl.java
  11. 19
      besu/src/test/java/org/hyperledger/besu/PrivacyTest.java
  12. 18
      besu/src/test/java/org/hyperledger/besu/RunnerTest.java
  13. 4
      besu/src/test/java/org/hyperledger/besu/cli/CommandTestAbstract.java
  14. 5
      ethereum/core/src/test/java/org/hyperledger/besu/ethereum/trie/bonsai/AbstractIsolationTests.java
  15. 6
      ethereum/eth/src/jmh/java/org/hyperledger/besu/ethereum/eth/sync/worldstate/WorldStateDownloaderBenchmark.java
  16. 4
      ethereum/evmtool/src/main/java/org/hyperledger/besu/evmtool/EvmToolCommandOptionsModule.java
  17. 2
      plugin-api/build.gradle
  18. 13
      plugin-api/src/main/java/org/hyperledger/besu/plugin/services/BesuConfiguration.java

@ -45,6 +45,7 @@
- Adds `storage rocksdb x-stats` subcommand [#6540](https://github.com/hyperledger/besu/pull/6540) - Adds `storage rocksdb x-stats` subcommand [#6540](https://github.com/hyperledger/besu/pull/6540)
- New `eth_blobBaseFee`JSON-RPC method [#6581](https://github.com/hyperledger/besu/pull/6581) - New `eth_blobBaseFee`JSON-RPC method [#6581](https://github.com/hyperledger/besu/pull/6581)
- Upgrade reference tests to version 13.1 [#6574](https://github.com/hyperledger/besu/pull/6574) - Upgrade reference tests to version 13.1 [#6574](https://github.com/hyperledger/besu/pull/6574)
- Extend `BesuConfiguration` service [#6584](https://github.com/hyperledger/besu/pull/6584)
### Bug fixes ### Bug fixes
- Fix the way an advertised host configured with `--p2p-host` is treated when communicating with the originator of a PING packet [#6225](https://github.com/hyperledger/besu/pull/6225) - Fix the way an advertised host configured with `--p2p-host` is treated when communicating with the originator of a PING packet [#6225](https://github.com/hyperledger/besu/pull/6225)

@ -33,6 +33,7 @@ import org.hyperledger.besu.ethereum.eth.transactions.TransactionPoolConfigurati
import org.hyperledger.besu.ethereum.p2p.config.NetworkingConfiguration; import org.hyperledger.besu.ethereum.p2p.config.NetworkingConfiguration;
import org.hyperledger.besu.ethereum.p2p.rlpx.connections.netty.TLSConfiguration; import org.hyperledger.besu.ethereum.p2p.rlpx.connections.netty.TLSConfiguration;
import org.hyperledger.besu.ethereum.permissioning.PermissioningConfiguration; import org.hyperledger.besu.ethereum.permissioning.PermissioningConfiguration;
import org.hyperledger.besu.ethereum.worldstate.DataStorageConfiguration;
import org.hyperledger.besu.metrics.prometheus.MetricsConfiguration; import org.hyperledger.besu.metrics.prometheus.MetricsConfiguration;
import org.hyperledger.besu.pki.config.PkiKeyStoreConfiguration; import org.hyperledger.besu.pki.config.PkiKeyStoreConfiguration;
import org.hyperledger.besu.tests.acceptance.dsl.condition.Condition; import org.hyperledger.besu.tests.acceptance.dsl.condition.Condition;
@ -109,6 +110,7 @@ public class BesuNode implements NodeConfiguration, RunnableNode, AutoCloseable
private final WebSocketConfiguration webSocketConfiguration; private final WebSocketConfiguration webSocketConfiguration;
private final JsonRpcIpcConfiguration jsonRpcIpcConfiguration; private final JsonRpcIpcConfiguration jsonRpcIpcConfiguration;
private final MetricsConfiguration metricsConfiguration; private final MetricsConfiguration metricsConfiguration;
private final DataStorageConfiguration dataStorageConfiguration;
private Optional<PermissioningConfiguration> permissioningConfiguration; private Optional<PermissioningConfiguration> permissioningConfiguration;
private final ApiConfiguration apiConfiguration; private final ApiConfiguration apiConfiguration;
private final GenesisConfigurationProvider genesisConfigProvider; private final GenesisConfigurationProvider genesisConfigProvider;
@ -145,6 +147,7 @@ public class BesuNode implements NodeConfiguration, RunnableNode, AutoCloseable
final MetricsConfiguration metricsConfiguration, final MetricsConfiguration metricsConfiguration,
final Optional<PermissioningConfiguration> permissioningConfiguration, final Optional<PermissioningConfiguration> permissioningConfiguration,
final ApiConfiguration apiConfiguration, final ApiConfiguration apiConfiguration,
final DataStorageConfiguration dataStorageConfiguration,
final Optional<String> keyfilePath, final Optional<String> keyfilePath,
final boolean devMode, final boolean devMode,
final NetworkName network, final NetworkName network,
@ -195,6 +198,7 @@ public class BesuNode implements NodeConfiguration, RunnableNode, AutoCloseable
this.metricsConfiguration = metricsConfiguration; this.metricsConfiguration = metricsConfiguration;
this.permissioningConfiguration = permissioningConfiguration; this.permissioningConfiguration = permissioningConfiguration;
this.apiConfiguration = apiConfiguration; this.apiConfiguration = apiConfiguration;
this.dataStorageConfiguration = dataStorageConfiguration;
this.genesisConfigProvider = genesisConfigProvider; this.genesisConfigProvider = genesisConfigProvider;
this.devMode = devMode; this.devMode = devMode;
this.network = network; this.network = network;
@ -690,6 +694,10 @@ public class BesuNode implements NodeConfiguration, RunnableNode, AutoCloseable
this.privacyParameters = privacyParameters; this.privacyParameters = privacyParameters;
} }
public DataStorageConfiguration getDataStorageConfiguration() {
return dataStorageConfiguration;
}
public boolean isDevMode() { public boolean isDevMode() {
return devMode; return devMode;
} }

@ -145,8 +145,12 @@ public class ThreadBesuNodeRunner implements BesuNodeRunner {
final StorageServiceImpl storageService = new StorageServiceImpl(); final StorageServiceImpl storageService = new StorageServiceImpl();
final SecurityModuleServiceImpl securityModuleService = new SecurityModuleServiceImpl(); final SecurityModuleServiceImpl securityModuleService = new SecurityModuleServiceImpl();
final Path dataDir = node.homeDirectory(); final Path dataDir = node.homeDirectory();
final BesuConfiguration commonPluginConfiguration = final BesuConfigurationImpl commonPluginConfiguration = new BesuConfigurationImpl();
new BesuConfigurationImpl(dataDir, dataDir.resolve(DATABASE_PATH)); commonPluginConfiguration.init(
dataDir,
dataDir.resolve(DATABASE_PATH),
node.getDataStorageConfiguration(),
node.getMiningParameters());
final BesuPluginContextImpl besuPluginContext = final BesuPluginContextImpl besuPluginContext =
besuPluginContextMap.computeIfAbsent( besuPluginContextMap.computeIfAbsent(
node, node,

@ -26,6 +26,7 @@ import org.hyperledger.besu.ethereum.eth.transactions.TransactionPoolConfigurati
import org.hyperledger.besu.ethereum.p2p.config.NetworkingConfiguration; import org.hyperledger.besu.ethereum.p2p.config.NetworkingConfiguration;
import org.hyperledger.besu.ethereum.p2p.rlpx.connections.netty.TLSConfiguration; import org.hyperledger.besu.ethereum.p2p.rlpx.connections.netty.TLSConfiguration;
import org.hyperledger.besu.ethereum.permissioning.PermissioningConfiguration; import org.hyperledger.besu.ethereum.permissioning.PermissioningConfiguration;
import org.hyperledger.besu.ethereum.worldstate.DataStorageConfiguration;
import org.hyperledger.besu.metrics.prometheus.MetricsConfiguration; import org.hyperledger.besu.metrics.prometheus.MetricsConfiguration;
import org.hyperledger.besu.pki.config.PkiKeyStoreConfiguration; import org.hyperledger.besu.pki.config.PkiKeyStoreConfiguration;
import org.hyperledger.besu.tests.acceptance.dsl.node.configuration.genesis.GenesisConfigurationProvider; import org.hyperledger.besu.tests.acceptance.dsl.node.configuration.genesis.GenesisConfigurationProvider;
@ -48,6 +49,7 @@ public class BesuNodeConfiguration {
private final MetricsConfiguration metricsConfiguration; private final MetricsConfiguration metricsConfiguration;
private final Optional<PermissioningConfiguration> permissioningConfiguration; private final Optional<PermissioningConfiguration> permissioningConfiguration;
private final ApiConfiguration apiConfiguration; private final ApiConfiguration apiConfiguration;
private final DataStorageConfiguration dataStorageConfiguration;
private final Optional<String> keyFilePath; private final Optional<String> keyFilePath;
private final boolean devMode; private final boolean devMode;
private final GenesisConfigurationProvider genesisConfigProvider; private final GenesisConfigurationProvider genesisConfigProvider;
@ -84,6 +86,7 @@ public class BesuNodeConfiguration {
final MetricsConfiguration metricsConfiguration, final MetricsConfiguration metricsConfiguration,
final Optional<PermissioningConfiguration> permissioningConfiguration, final Optional<PermissioningConfiguration> permissioningConfiguration,
final ApiConfiguration apiConfiguration, final ApiConfiguration apiConfiguration,
final DataStorageConfiguration dataStorageConfiguration,
final Optional<String> keyFilePath, final Optional<String> keyFilePath,
final boolean devMode, final boolean devMode,
final NetworkName network, final NetworkName network,
@ -117,6 +120,7 @@ public class BesuNodeConfiguration {
this.metricsConfiguration = metricsConfiguration; this.metricsConfiguration = metricsConfiguration;
this.permissioningConfiguration = permissioningConfiguration; this.permissioningConfiguration = permissioningConfiguration;
this.apiConfiguration = apiConfiguration; this.apiConfiguration = apiConfiguration;
this.dataStorageConfiguration = dataStorageConfiguration;
this.keyFilePath = keyFilePath; this.keyFilePath = keyFilePath;
this.dataPath = dataPath; this.dataPath = dataPath;
this.devMode = devMode; this.devMode = devMode;
@ -183,6 +187,10 @@ public class BesuNodeConfiguration {
return apiConfiguration; return apiConfiguration;
} }
public DataStorageConfiguration getDataStorageConfiguration() {
return dataStorageConfiguration;
}
public Optional<String> getKeyFilePath() { public Optional<String> getKeyFilePath() {
return keyFilePath; return keyFilePath;
} }

@ -39,6 +39,7 @@ import org.hyperledger.besu.ethereum.eth.transactions.TransactionPoolConfigurati
import org.hyperledger.besu.ethereum.p2p.config.NetworkingConfiguration; import org.hyperledger.besu.ethereum.p2p.config.NetworkingConfiguration;
import org.hyperledger.besu.ethereum.p2p.rlpx.connections.netty.TLSConfiguration; import org.hyperledger.besu.ethereum.p2p.rlpx.connections.netty.TLSConfiguration;
import org.hyperledger.besu.ethereum.permissioning.PermissioningConfiguration; import org.hyperledger.besu.ethereum.permissioning.PermissioningConfiguration;
import org.hyperledger.besu.ethereum.worldstate.DataStorageConfiguration;
import org.hyperledger.besu.metrics.prometheus.MetricsConfiguration; import org.hyperledger.besu.metrics.prometheus.MetricsConfiguration;
import org.hyperledger.besu.pki.config.PkiKeyStoreConfiguration; import org.hyperledger.besu.pki.config.PkiKeyStoreConfiguration;
import org.hyperledger.besu.tests.acceptance.dsl.node.configuration.genesis.GenesisConfigurationProvider; import org.hyperledger.besu.tests.acceptance.dsl.node.configuration.genesis.GenesisConfigurationProvider;
@ -73,6 +74,8 @@ public class BesuNodeConfigurationBuilder {
private MetricsConfiguration metricsConfiguration = MetricsConfiguration.builder().build(); private MetricsConfiguration metricsConfiguration = MetricsConfiguration.builder().build();
private Optional<PermissioningConfiguration> permissioningConfiguration = Optional.empty(); private Optional<PermissioningConfiguration> permissioningConfiguration = Optional.empty();
private ApiConfiguration apiConfiguration = ImmutableApiConfiguration.builder().build(); private ApiConfiguration apiConfiguration = ImmutableApiConfiguration.builder().build();
private DataStorageConfiguration dataStorageConfiguration =
DataStorageConfiguration.DEFAULT_FOREST_CONFIG;
private String keyFilePath = null; private String keyFilePath = null;
private boolean devMode = true; private boolean devMode = true;
private GenesisConfigurationProvider genesisConfigProvider = ignore -> Optional.empty(); private GenesisConfigurationProvider genesisConfigProvider = ignore -> Optional.empty();
@ -506,6 +509,12 @@ public class BesuNodeConfigurationBuilder {
return this; return this;
} }
public BesuNodeConfigurationBuilder dataStorageConfiguration(
final DataStorageConfiguration dataStorageConfiguration) {
this.dataStorageConfiguration = dataStorageConfiguration;
return this;
}
public BesuNodeConfiguration build() { public BesuNodeConfiguration build() {
return new BesuNodeConfiguration( return new BesuNodeConfiguration(
name, name,
@ -519,6 +528,7 @@ public class BesuNodeConfigurationBuilder {
metricsConfiguration, metricsConfiguration,
permissioningConfiguration, permissioningConfiguration,
apiConfiguration, apiConfiguration,
dataStorageConfiguration,
Optional.ofNullable(keyFilePath), Optional.ofNullable(keyFilePath),
devMode, devMode,
network, network,

@ -72,6 +72,7 @@ public class BesuNodeFactory {
config.getMetricsConfiguration(), config.getMetricsConfiguration(),
config.getPermissioningConfiguration(), config.getPermissioningConfiguration(),
config.getApiConfiguration(), config.getApiConfiguration(),
config.getDataStorageConfiguration(),
config.getKeyFilePath(), config.getKeyFilePath(),
config.isDevMode(), config.isDevMode(),
config.getNetwork(), config.getNetwork(),

@ -76,6 +76,7 @@ public class PrivacyNode implements AutoCloseable {
private final boolean isFlexiblePrivacyEnabled; private final boolean isFlexiblePrivacyEnabled;
private final boolean isMultitenancyEnabled; private final boolean isMultitenancyEnabled;
private final boolean isPrivacyPluginEnabled; private final boolean isPrivacyPluginEnabled;
private final BesuNodeConfiguration besuConfig;
public PrivacyNode( public PrivacyNode(
final PrivacyNodeConfiguration privacyConfiguration, final PrivacyNodeConfiguration privacyConfiguration,
@ -89,7 +90,7 @@ public class PrivacyNode implements AutoCloseable {
selectEnclave(enclaveType, enclaveDir, config, privacyConfiguration, containerNetwork); selectEnclave(enclaveType, enclaveDir, config, privacyConfiguration, containerNetwork);
this.vertx = vertx; this.vertx = vertx;
final BesuNodeConfiguration besuConfig = config; this.besuConfig = config;
isFlexiblePrivacyEnabled = privacyConfiguration.isFlexiblePrivacyGroupEnabled(); isFlexiblePrivacyEnabled = privacyConfiguration.isFlexiblePrivacyGroupEnabled();
isMultitenancyEnabled = privacyConfiguration.isMultitenancyEnabled(); isMultitenancyEnabled = privacyConfiguration.isMultitenancyEnabled();
@ -108,6 +109,7 @@ public class PrivacyNode implements AutoCloseable {
besuConfig.getMetricsConfiguration(), besuConfig.getMetricsConfiguration(),
besuConfig.getPermissioningConfiguration(), besuConfig.getPermissioningConfiguration(),
besuConfig.getApiConfiguration(), besuConfig.getApiConfiguration(),
besuConfig.getDataStorageConfiguration(),
besuConfig.getKeyFilePath(), besuConfig.getKeyFilePath(),
besuConfig.isDevMode(), besuConfig.isDevMode(),
besuConfig.getNetwork(), besuConfig.getNetwork(),
@ -272,6 +274,8 @@ public class PrivacyNode implements AutoCloseable {
private PrivacyStorageProvider createKeyValueStorageProvider( private PrivacyStorageProvider createKeyValueStorageProvider(
final Path dataLocation, final Path dbLocation) { final Path dataLocation, final Path dbLocation) {
final var besuConfiguration = new BesuConfigurationImpl();
besuConfiguration.init(dataLocation, dbLocation, null, besuConfig.getMiningParameters());
return new PrivacyKeyValueStorageProviderBuilder() return new PrivacyKeyValueStorageProviderBuilder()
.withStorageFactory( .withStorageFactory(
new RocksDBKeyValuePrivacyStorageFactory( new RocksDBKeyValuePrivacyStorageFactory(
@ -284,7 +288,7 @@ public class PrivacyNode implements AutoCloseable {
DEFAULT_IS_HIGH_SPEC), DEFAULT_IS_HIGH_SPEC),
Arrays.asList(KeyValueSegmentIdentifier.values()), Arrays.asList(KeyValueSegmentIdentifier.values()),
RocksDBMetricsFactory.PRIVATE_ROCKS_DB_METRICS))) RocksDBMetricsFactory.PRIVATE_ROCKS_DB_METRICS)))
.withCommonConfiguration(new BesuConfigurationImpl(dataLocation, dbLocation)) .withCommonConfiguration(besuConfiguration)
.withMetricsSystem(new NoOpMetricsSystem()) .withMetricsSystem(new NoOpMetricsSystem())
.build(); .build();
} }

@ -138,6 +138,7 @@ import org.hyperledger.besu.ethereum.storage.keyvalue.KeyValueSegmentIdentifier;
import org.hyperledger.besu.ethereum.storage.keyvalue.KeyValueStorageProvider; import org.hyperledger.besu.ethereum.storage.keyvalue.KeyValueStorageProvider;
import org.hyperledger.besu.ethereum.storage.keyvalue.KeyValueStorageProviderBuilder; import org.hyperledger.besu.ethereum.storage.keyvalue.KeyValueStorageProviderBuilder;
import org.hyperledger.besu.ethereum.trie.forest.pruner.PrunerConfiguration; import org.hyperledger.besu.ethereum.trie.forest.pruner.PrunerConfiguration;
import org.hyperledger.besu.ethereum.worldstate.DataStorageConfiguration;
import org.hyperledger.besu.ethereum.worldstate.DataStorageFormat; import org.hyperledger.besu.ethereum.worldstate.DataStorageFormat;
import org.hyperledger.besu.evm.precompile.AbstractAltBnPrecompiledContract; import org.hyperledger.besu.evm.precompile.AbstractAltBnPrecompiledContract;
import org.hyperledger.besu.evm.precompile.BigIntegerModularExponentiationPrecompiledContract; import org.hyperledger.besu.evm.precompile.BigIntegerModularExponentiationPrecompiledContract;
@ -173,6 +174,7 @@ import org.hyperledger.besu.plugin.services.storage.PrivacyKeyValueStorageFactor
import org.hyperledger.besu.plugin.services.storage.rocksdb.RocksDBPlugin; import org.hyperledger.besu.plugin.services.storage.rocksdb.RocksDBPlugin;
import org.hyperledger.besu.plugin.services.txselection.PluginTransactionSelectorFactory; import org.hyperledger.besu.plugin.services.txselection.PluginTransactionSelectorFactory;
import org.hyperledger.besu.plugin.services.txvalidator.PluginTransactionValidatorFactory; import org.hyperledger.besu.plugin.services.txvalidator.PluginTransactionValidatorFactory;
import org.hyperledger.besu.services.BesuConfigurationImpl;
import org.hyperledger.besu.services.BesuEventsImpl; import org.hyperledger.besu.services.BesuEventsImpl;
import org.hyperledger.besu.services.BesuPluginContextImpl; import org.hyperledger.besu.services.BesuPluginContextImpl;
import org.hyperledger.besu.services.BlockchainServiceImpl; import org.hyperledger.besu.services.BlockchainServiceImpl;
@ -893,9 +895,10 @@ public class BesuCommand implements DefaultCommandValues, Runnable {
private MetricsConfiguration metricsConfiguration; private MetricsConfiguration metricsConfiguration;
private Optional<PermissioningConfiguration> permissioningConfiguration; private Optional<PermissioningConfiguration> permissioningConfiguration;
private Optional<TLSConfiguration> p2pTLSConfiguration; private Optional<TLSConfiguration> p2pTLSConfiguration;
private DataStorageConfiguration dataStorageConfiguration;
private Collection<EnodeURL> staticNodes; private Collection<EnodeURL> staticNodes;
private BesuController besuController; private BesuController besuController;
private BesuConfiguration pluginCommonConfiguration; private BesuConfigurationImpl pluginCommonConfiguration;
private MiningParameters miningParameters; private MiningParameters miningParameters;
private BesuComponent besuComponent; private BesuComponent besuComponent;
@ -1000,7 +1003,7 @@ public class BesuCommand implements DefaultCommandValues, Runnable {
this.securityModuleService = securityModuleService; this.securityModuleService = securityModuleService;
this.permissioningService = permissioningService; this.permissioningService = permissioningService;
this.privacyPluginService = privacyPluginService; this.privacyPluginService = privacyPluginService;
pluginCommonConfiguration = new BesuCommandConfigurationService(); this.pluginCommonConfiguration = new BesuConfigurationImpl();
besuPluginContext.addService(BesuConfiguration.class, pluginCommonConfiguration); besuPluginContext.addService(BesuConfiguration.class, pluginCommonConfiguration);
this.pkiBlockCreationConfigProvider = pkiBlockCreationConfigProvider; this.pkiBlockCreationConfigProvider = pkiBlockCreationConfigProvider;
this.rpcEndpointServiceImpl = rpcEndpointServiceImpl; this.rpcEndpointServiceImpl = rpcEndpointServiceImpl;
@ -1076,7 +1079,7 @@ public class BesuCommand implements DefaultCommandValues, Runnable {
validateOptions(); validateOptions();
configure(); configure();
configureNativeLibs(); configureNativeLibs();
besuController = initController(); besuController = buildController();
besuPluginContext.beforeExternalServices(); besuPluginContext.beforeExternalServices();
@ -1098,7 +1101,7 @@ public class BesuCommand implements DefaultCommandValues, Runnable {
} }
@VisibleForTesting @VisibleForTesting
void setBesuConfiguration(final BesuConfiguration pluginCommonConfiguration) { void setBesuConfiguration(final BesuConfigurationImpl pluginCommonConfiguration) {
this.pluginCommonConfiguration = pluginCommonConfiguration; this.pluginCommonConfiguration = pluginCommonConfiguration;
} }
@ -1674,6 +1677,7 @@ public class BesuCommand implements DefaultCommandValues, Runnable {
unstableIpcOptions.getIpcPath(), unstableIpcOptions.getIpcPath(),
unstableIpcOptions.getRpcIpcApis()); unstableIpcOptions.getRpcIpcApis());
apiConfiguration = apiConfigurationOptions.apiConfiguration(getMiningParameters()); apiConfiguration = apiConfigurationOptions.apiConfiguration(getMiningParameters());
dataStorageConfiguration = getDataStorageConfiguration();
// hostsWhitelist is a hidden option. If it is specified, add the list to hostAllowlist // hostsWhitelist is a hidden option. If it is specified, add the list to hostAllowlist
if (!hostsWhitelist.isEmpty()) { if (!hostsWhitelist.isEmpty()) {
// if allowlist == default values, remove the default values // if allowlist == default values, remove the default values
@ -1736,10 +1740,6 @@ public class BesuCommand implements DefaultCommandValues, Runnable {
} }
} }
private BesuController initController() {
return buildController();
}
/** /**
* Builds BesuController * Builds BesuController
* *
@ -1761,6 +1761,11 @@ public class BesuCommand implements DefaultCommandValues, Runnable {
* @return instance of BesuControllerBuilder * @return instance of BesuControllerBuilder
*/ */
public BesuControllerBuilder getControllerBuilder() { public BesuControllerBuilder getControllerBuilder() {
pluginCommonConfiguration.init(
dataDir(),
dataDir().resolve(DATABASE_PATH),
getDataStorageConfiguration(),
getMiningParameters());
final KeyValueStorageProvider storageProvider = keyValueStorageProvider(keyValueStorageName); final KeyValueStorageProvider storageProvider = keyValueStorageProvider(keyValueStorageName);
return controllerBuilderFactory return controllerBuilderFactory
.fromEthNetworkConfig( .fromEthNetworkConfig(
@ -1771,6 +1776,7 @@ public class BesuCommand implements DefaultCommandValues, Runnable {
.transactionSelectorFactory(getTransactionSelectorFactory()) .transactionSelectorFactory(getTransactionSelectorFactory())
.pluginTransactionValidatorFactory(getPluginTransactionValidatorFactory()) .pluginTransactionValidatorFactory(getPluginTransactionValidatorFactory())
.dataDirectory(dataDir()) .dataDirectory(dataDir())
.dataStorageConfiguration(getDataStorageConfiguration())
.miningParameters(getMiningParameters()) .miningParameters(getMiningParameters())
.transactionPoolConfiguration(buildTransactionPoolConfiguration()) .transactionPoolConfiguration(buildTransactionPoolConfiguration())
.nodeKey(new NodeKey(securityModule())) .nodeKey(new NodeKey(securityModule()))
@ -1792,7 +1798,6 @@ public class BesuCommand implements DefaultCommandValues, Runnable {
.requiredBlocks(requiredBlocks) .requiredBlocks(requiredBlocks)
.reorgLoggingThreshold(reorgLoggingThreshold) .reorgLoggingThreshold(reorgLoggingThreshold)
.evmConfiguration(unstableEvmOptions.toDomainObject()) .evmConfiguration(unstableEvmOptions.toDomainObject())
.dataStorageConfiguration(dataStorageOptions.toDomainObject())
.maxPeers(p2PDiscoveryOptionGroup.maxPeers) .maxPeers(p2PDiscoveryOptionGroup.maxPeers)
.maxRemotelyInitiatedPeers(maxRemoteInitiatedPeers) .maxRemotelyInitiatedPeers(maxRemoteInitiatedPeers)
.randomPeerPriority(p2PDiscoveryOptionGroup.randomPeerPriority) .randomPeerPriority(p2PDiscoveryOptionGroup.randomPeerPriority)
@ -2127,6 +2132,13 @@ public class BesuCommand implements DefaultCommandValues, Runnable {
return miningParameters; return miningParameters;
} }
private DataStorageConfiguration getDataStorageConfiguration() {
if (dataStorageConfiguration == null) {
dataStorageConfiguration = dataStorageOptions.toDomainObject();
}
return dataStorageConfiguration;
}
private OptionalInt getGenesisBlockPeriodSeconds( private OptionalInt getGenesisBlockPeriodSeconds(
final GenesisConfigOptions genesisConfigOptions) { final GenesisConfigOptions genesisConfigOptions) {
if (genesisConfigOptions.isClique()) { if (genesisConfigOptions.isClique()) {
@ -2538,24 +2550,6 @@ public class BesuCommand implements DefaultCommandValues, Runnable {
return loggingLevelOption.getLogLevel(); return loggingLevelOption.getLogLevel();
} }
private class BesuCommandConfigurationService implements BesuConfiguration {
@Override
public Path getStoragePath() {
return dataDir().resolve(DATABASE_PATH);
}
@Override
public Path getDataPath() {
return dataDir();
}
@Override
public int getDatabaseVersion() {
return dataStorageOptions.toDomainObject().getDataStorageFormat().getDatabaseVersion();
}
}
private void instantiateSignatureAlgorithmFactory() { private void instantiateSignatureAlgorithmFactory() {
if (SignatureAlgorithmFactory.isInstanceSet()) { if (SignatureAlgorithmFactory.isInstanceSet()) {
return; return;
@ -2714,12 +2708,11 @@ public class BesuCommand implements DefaultCommandValues, Runnable {
builder.setHighSpecEnabled(); builder.setHighSpecEnabled();
} }
if (dataStorageOptions.toDomainObject().getUnstable().getBonsaiLimitTrieLogsEnabled()) { if (getDataStorageConfiguration().getUnstable().getBonsaiLimitTrieLogsEnabled()) {
builder.setLimitTrieLogsEnabled(); builder.setLimitTrieLogsEnabled();
builder.setTrieLogRetentionLimit( builder.setTrieLogRetentionLimit(getDataStorageConfiguration().getBonsaiMaxLayersToLoad());
dataStorageOptions.toDomainObject().getBonsaiMaxLayersToLoad());
builder.setTrieLogsPruningWindowSize( builder.setTrieLogsPruningWindowSize(
dataStorageOptions.toDomainObject().getUnstable().getBonsaiTrieLogPruningWindowSize()); getDataStorageConfiguration().getUnstable().getBonsaiTrieLogPruningWindowSize());
} }
builder.setTxPoolImplementation(buildTransactionPoolConfiguration().getTxPoolImplementation()); builder.setTxPoolImplementation(buildTransactionPoolConfiguration().getTxPoolImplementation());

@ -576,6 +576,7 @@ public abstract class BesuControllerBuilder implements MiningParameterOverrides
checkNotNull(gasLimitCalculator, "Missing gas limit calculator"); checkNotNull(gasLimitCalculator, "Missing gas limit calculator");
checkNotNull(evmConfiguration, "Missing evm config"); checkNotNull(evmConfiguration, "Missing evm config");
checkNotNull(networkingConfiguration, "Missing network configuration"); checkNotNull(networkingConfiguration, "Missing network configuration");
checkNotNull(dataStorageConfiguration, "Missing data storage configuration");
prepForBuild(); prepForBuild();
final ProtocolSchedule protocolSchedule = createProtocolSchedule(); final ProtocolSchedule protocolSchedule = createProtocolSchedule();

@ -14,25 +14,37 @@
*/ */
package org.hyperledger.besu.services; package org.hyperledger.besu.services;
import org.hyperledger.besu.datatypes.Wei;
import org.hyperledger.besu.ethereum.core.MiningParameters;
import org.hyperledger.besu.ethereum.worldstate.DataStorageConfiguration;
import org.hyperledger.besu.plugin.services.BesuConfiguration; import org.hyperledger.besu.plugin.services.BesuConfiguration;
import java.nio.file.Path; import java.nio.file.Path;
/** A concrete implementation of BesuConfiguration which is used in Besu plugin framework. */ /** A concrete implementation of BesuConfiguration which is used in Besu plugin framework. */
public class BesuConfigurationImpl implements BesuConfiguration { public class BesuConfigurationImpl implements BesuConfiguration {
private Path storagePath;
private final Path storagePath; private Path dataPath;
private final Path dataPath; private DataStorageConfiguration dataStorageConfiguration;
private MiningParameters miningParameters;
/** /**
* BesuConfigurationImpl Constructor. * Post creation initialization
* *
* @param dataPath The Path representing data folder * @param dataPath The Path representing data folder
* @param storagePath The path representing storage folder * @param storagePath The path representing storage folder
* @param dataStorageConfiguration The data storage configuration
* @param miningParameters The mining parameters
*/ */
public BesuConfigurationImpl(final Path dataPath, final Path storagePath) { public void init(
final Path dataPath,
final Path storagePath,
final DataStorageConfiguration dataStorageConfiguration,
final MiningParameters miningParameters) {
this.dataPath = dataPath; this.dataPath = dataPath;
this.storagePath = storagePath; this.storagePath = storagePath;
this.dataStorageConfiguration = dataStorageConfiguration;
this.miningParameters = miningParameters;
} }
@Override @Override
@ -44,4 +56,14 @@ public class BesuConfigurationImpl implements BesuConfiguration {
public Path getDataPath() { public Path getDataPath() {
return dataPath; return dataPath;
} }
@Override
public int getDatabaseVersion() {
return dataStorageConfiguration.getDataStorageFormat().getDatabaseVersion();
}
@Override
public Wei getMinGasPrice() {
return miningParameters.getMinTransactionGasPrice();
}
} }

@ -41,6 +41,7 @@ import org.hyperledger.besu.ethereum.p2p.config.NetworkingConfiguration;
import org.hyperledger.besu.ethereum.privacy.storage.PrivacyStorageProvider; import org.hyperledger.besu.ethereum.privacy.storage.PrivacyStorageProvider;
import org.hyperledger.besu.ethereum.privacy.storage.keyvalue.PrivacyKeyValueStorageProviderBuilder; import org.hyperledger.besu.ethereum.privacy.storage.keyvalue.PrivacyKeyValueStorageProviderBuilder;
import org.hyperledger.besu.ethereum.storage.keyvalue.KeyValueSegmentIdentifier; import org.hyperledger.besu.ethereum.storage.keyvalue.KeyValueSegmentIdentifier;
import org.hyperledger.besu.ethereum.worldstate.DataStorageConfiguration;
import org.hyperledger.besu.evm.internal.EvmConfiguration; import org.hyperledger.besu.evm.internal.EvmConfiguration;
import org.hyperledger.besu.evm.precompile.PrecompiledContract; import org.hyperledger.besu.evm.precompile.PrecompiledContract;
import org.hyperledger.besu.metrics.noop.NoOpMetricsSystem; import org.hyperledger.besu.metrics.noop.NoOpMetricsSystem;
@ -97,11 +98,15 @@ public class PrivacyTest {
private BesuController setUpControllerWithPrivacyEnabled(final boolean flexibleEnabled) private BesuController setUpControllerWithPrivacyEnabled(final boolean flexibleEnabled)
throws IOException, URISyntaxException { throws IOException, URISyntaxException {
final Path dbDir = Files.createTempDirectory(dataDir, "database"); final Path dbDir = Files.createTempDirectory(dataDir, "database");
final var miningParameters = MiningParameters.newDefault();
final var dataStorageConfiguration = DataStorageConfiguration.DEFAULT_FOREST_CONFIG;
final PrivacyParameters privacyParameters = final PrivacyParameters privacyParameters =
new PrivacyParameters.Builder() new PrivacyParameters.Builder()
.setEnabled(true) .setEnabled(true)
.setEnclaveUrl(new URI("http://127.0.0.1:8000")) .setEnclaveUrl(new URI("http://127.0.0.1:8000"))
.setStorageProvider(createKeyValueStorageProvider(dataDir, dbDir)) .setStorageProvider(
createKeyValueStorageProvider(
dataDir, dbDir, dataStorageConfiguration, miningParameters))
.setEnclaveFactory(new EnclaveFactory(vertx)) .setEnclaveFactory(new EnclaveFactory(vertx))
.setFlexiblePrivacyGroupsEnabled(flexibleEnabled) .setFlexiblePrivacyGroupsEnabled(flexibleEnabled)
.build(); .build();
@ -111,7 +116,8 @@ public class PrivacyTest {
.ethProtocolConfiguration(EthProtocolConfiguration.defaultConfig()) .ethProtocolConfiguration(EthProtocolConfiguration.defaultConfig())
.storageProvider(new InMemoryKeyValueStorageProvider()) .storageProvider(new InMemoryKeyValueStorageProvider())
.networkId(BigInteger.ONE) .networkId(BigInteger.ONE)
.miningParameters(MiningParameters.newDefault()) .miningParameters(miningParameters)
.dataStorageConfiguration(dataStorageConfiguration)
.nodeKey(NodeKeyUtils.generate()) .nodeKey(NodeKeyUtils.generate())
.metricsSystem(new NoOpMetricsSystem()) .metricsSystem(new NoOpMetricsSystem())
.dataDirectory(dataDir) .dataDirectory(dataDir)
@ -125,7 +131,12 @@ public class PrivacyTest {
} }
private PrivacyStorageProvider createKeyValueStorageProvider( private PrivacyStorageProvider createKeyValueStorageProvider(
final Path dataDir, final Path dbDir) { final Path dataDir,
final Path dbDir,
final DataStorageConfiguration dataStorageConfiguration,
final MiningParameters miningParameters) {
final var besuConfiguration = new BesuConfigurationImpl();
besuConfiguration.init(dataDir, dbDir, dataStorageConfiguration, miningParameters);
return new PrivacyKeyValueStorageProviderBuilder() return new PrivacyKeyValueStorageProviderBuilder()
.withStorageFactory( .withStorageFactory(
new RocksDBKeyValuePrivacyStorageFactory( new RocksDBKeyValuePrivacyStorageFactory(
@ -138,7 +149,7 @@ public class PrivacyTest {
DEFAULT_IS_HIGH_SPEC), DEFAULT_IS_HIGH_SPEC),
Arrays.asList(KeyValueSegmentIdentifier.values()), Arrays.asList(KeyValueSegmentIdentifier.values()),
RocksDBMetricsFactory.PRIVATE_ROCKS_DB_METRICS))) RocksDBMetricsFactory.PRIVATE_ROCKS_DB_METRICS)))
.withCommonConfiguration(new BesuConfigurationImpl(dataDir, dbDir)) .withCommonConfiguration(besuConfiguration)
.withMetricsSystem(new NoOpMetricsSystem()) .withMetricsSystem(new NoOpMetricsSystem())
.build(); .build();
} }

@ -164,12 +164,13 @@ public final class RunnerTest {
final Path dataDirAhead = Files.createTempDirectory(temp, "db-ahead"); final Path dataDirAhead = Files.createTempDirectory(temp, "db-ahead");
final Path dbAhead = dataDirAhead.resolve("database"); final Path dbAhead = dataDirAhead.resolve("database");
final int blockCount = 500; final int blockCount = 500;
final NodeKey aheadDbNodeKey = NodeKeyUtils.createFrom(KeyPairUtil.loadKeyPair(dbAhead)); final NodeKey aheadDbNodeKey = NodeKeyUtils.createFrom(KeyPairUtil.loadKeyPair(dataDirAhead));
final NodeKey behindDbNodeKey = NodeKeyUtils.generate(); final NodeKey behindDbNodeKey = NodeKeyUtils.generate();
final SynchronizerConfiguration syncConfigAhead = final SynchronizerConfiguration syncConfigAhead =
SynchronizerConfiguration.builder().syncMode(SyncMode.FULL).build(); SynchronizerConfiguration.builder().syncMode(SyncMode.FULL).build();
final ObservableMetricsSystem noOpMetricsSystem = new NoOpMetricsSystem(); final ObservableMetricsSystem noOpMetricsSystem = new NoOpMetricsSystem();
final var miningParameters = MiningParameters.newDefault();
final var dataStorageConfiguration = DataStorageConfiguration.DEFAULT_FOREST_CONFIG;
// Setup Runner with blocks // Setup Runner with blocks
final BesuController controllerAhead = final BesuController controllerAhead =
getController( getController(
@ -177,7 +178,8 @@ public final class RunnerTest {
syncConfigAhead, syncConfigAhead,
dataDirAhead, dataDirAhead,
aheadDbNodeKey, aheadDbNodeKey,
createKeyValueStorageProvider(dataDirAhead, dbAhead), createKeyValueStorageProvider(
dataDirAhead, dbAhead, dataStorageConfiguration, miningParameters),
noOpMetricsSystem); noOpMetricsSystem);
setupState( setupState(
blockCount, controllerAhead.getProtocolSchedule(), controllerAhead.getProtocolContext()); blockCount, controllerAhead.getProtocolSchedule(), controllerAhead.getProtocolContext());
@ -376,7 +378,13 @@ public final class RunnerTest {
return GenesisConfigFile.fromConfig(jsonNode); return GenesisConfigFile.fromConfig(jsonNode);
} }
private StorageProvider createKeyValueStorageProvider(final Path dataDir, final Path dbDir) { private StorageProvider createKeyValueStorageProvider(
final Path dataDir,
final Path dbDir,
final DataStorageConfiguration dataStorageConfiguration,
final MiningParameters miningParameters) {
final var besuConfiguration = new BesuConfigurationImpl();
besuConfiguration.init(dataDir, dbDir, dataStorageConfiguration, miningParameters);
return new KeyValueStorageProviderBuilder() return new KeyValueStorageProviderBuilder()
.withStorageFactory( .withStorageFactory(
new RocksDBKeyValueStorageFactory( new RocksDBKeyValueStorageFactory(
@ -388,7 +396,7 @@ public final class RunnerTest {
DEFAULT_IS_HIGH_SPEC), DEFAULT_IS_HIGH_SPEC),
Arrays.asList(KeyValueSegmentIdentifier.values()), Arrays.asList(KeyValueSegmentIdentifier.values()),
RocksDBMetricsFactory.PUBLIC_ROCKS_DB_METRICS)) RocksDBMetricsFactory.PUBLIC_ROCKS_DB_METRICS))
.withCommonConfiguration(new BesuConfigurationImpl(dataDir, dbDir)) .withCommonConfiguration(besuConfiguration)
.withMetricsSystem(new NoOpMetricsSystem()) .withMetricsSystem(new NoOpMetricsSystem())
.build(); .build();
} }

@ -75,13 +75,13 @@ import org.hyperledger.besu.ethereum.worldstate.DataStorageConfiguration;
import org.hyperledger.besu.ethereum.worldstate.WorldStateArchive; import org.hyperledger.besu.ethereum.worldstate.WorldStateArchive;
import org.hyperledger.besu.metrics.prometheus.MetricsConfiguration; import org.hyperledger.besu.metrics.prometheus.MetricsConfiguration;
import org.hyperledger.besu.pki.config.PkiKeyStoreConfiguration; import org.hyperledger.besu.pki.config.PkiKeyStoreConfiguration;
import org.hyperledger.besu.plugin.services.BesuConfiguration;
import org.hyperledger.besu.plugin.services.PicoCLIOptions; import org.hyperledger.besu.plugin.services.PicoCLIOptions;
import org.hyperledger.besu.plugin.services.StorageService; import org.hyperledger.besu.plugin.services.StorageService;
import org.hyperledger.besu.plugin.services.securitymodule.SecurityModule; import org.hyperledger.besu.plugin.services.securitymodule.SecurityModule;
import org.hyperledger.besu.plugin.services.storage.KeyValueStorageFactory; import org.hyperledger.besu.plugin.services.storage.KeyValueStorageFactory;
import org.hyperledger.besu.plugin.services.storage.PrivacyKeyValueStorageFactory; import org.hyperledger.besu.plugin.services.storage.PrivacyKeyValueStorageFactory;
import org.hyperledger.besu.plugin.services.storage.SegmentIdentifier; import org.hyperledger.besu.plugin.services.storage.SegmentIdentifier;
import org.hyperledger.besu.services.BesuConfigurationImpl;
import org.hyperledger.besu.services.BesuPluginContextImpl; import org.hyperledger.besu.services.BesuPluginContextImpl;
import org.hyperledger.besu.services.PermissioningServiceImpl; import org.hyperledger.besu.services.PermissioningServiceImpl;
import org.hyperledger.besu.services.PluginTransactionValidatorServiceImpl; import org.hyperledger.besu.services.PluginTransactionValidatorServiceImpl;
@ -207,7 +207,7 @@ public abstract class CommandTestAbstract {
@Mock protected StorageServiceImpl storageService; @Mock protected StorageServiceImpl storageService;
@Mock protected SecurityModuleServiceImpl securityModuleService; @Mock protected SecurityModuleServiceImpl securityModuleService;
@Mock protected SecurityModule securityModule; @Mock protected SecurityModule securityModule;
@Mock protected BesuConfiguration commonPluginConfiguration; @Mock protected BesuConfigurationImpl commonPluginConfiguration;
@Mock protected KeyValueStorageFactory rocksDBStorageFactory; @Mock protected KeyValueStorageFactory rocksDBStorageFactory;
@Mock protected PrivacyKeyValueStorageFactory rocksDBSPrivacyStorageFactory; @Mock protected PrivacyKeyValueStorageFactory rocksDBSPrivacyStorageFactory;
@Mock protected PicoCLIOptions cliOptions; @Mock protected PicoCLIOptions cliOptions;

@ -205,6 +205,11 @@ public abstract class AbstractIsolationTests {
public int getDatabaseVersion() { public int getDatabaseVersion() {
return 2; return 2;
} }
@Override
public Wei getMinGasPrice() {
return MiningParameters.newDefault().getMinTransactionGasPrice();
}
}) })
.withMetricsSystem(new NoOpMetricsSystem()) .withMetricsSystem(new NoOpMetricsSystem())
.build(); .build();

@ -24,6 +24,7 @@ import org.hyperledger.besu.datatypes.Hash;
import org.hyperledger.besu.ethereum.core.BlockDataGenerator; import org.hyperledger.besu.ethereum.core.BlockDataGenerator;
import org.hyperledger.besu.ethereum.core.BlockHeader; import org.hyperledger.besu.ethereum.core.BlockHeader;
import org.hyperledger.besu.ethereum.core.BlockHeaderTestFixture; import org.hyperledger.besu.ethereum.core.BlockHeaderTestFixture;
import org.hyperledger.besu.ethereum.core.MiningParameters;
import org.hyperledger.besu.ethereum.core.MutableWorldState; import org.hyperledger.besu.ethereum.core.MutableWorldState;
import org.hyperledger.besu.ethereum.eth.manager.EthContext; import org.hyperledger.besu.ethereum.eth.manager.EthContext;
import org.hyperledger.besu.ethereum.eth.manager.EthProtocolManager; import org.hyperledger.besu.ethereum.eth.manager.EthProtocolManager;
@ -160,6 +161,9 @@ public class WorldStateDownloaderBenchmark {
} }
private StorageProvider createKeyValueStorageProvider(final Path dataDir, final Path dbDir) { private StorageProvider createKeyValueStorageProvider(final Path dataDir, final Path dbDir) {
final var besuConfiguration = new BesuConfigurationImpl();
besuConfiguration.init(
dataDir, dbDir, DataStorageConfiguration.DEFAULT_CONFIG, MiningParameters.newDefault());
return new KeyValueStorageProviderBuilder() return new KeyValueStorageProviderBuilder()
.withStorageFactory( .withStorageFactory(
new RocksDBKeyValueStorageFactory( new RocksDBKeyValueStorageFactory(
@ -171,7 +175,7 @@ public class WorldStateDownloaderBenchmark {
DEFAULT_IS_HIGH_SPEC), DEFAULT_IS_HIGH_SPEC),
Arrays.asList(KeyValueSegmentIdentifier.values()), Arrays.asList(KeyValueSegmentIdentifier.values()),
RocksDBMetricsFactory.PUBLIC_ROCKS_DB_METRICS)) RocksDBMetricsFactory.PUBLIC_ROCKS_DB_METRICS))
.withCommonConfiguration(new BesuConfigurationImpl(dataDir, dbDir)) .withCommonConfiguration(besuConfiguration)
.withMetricsSystem(new NoOpMetricsSystem()) .withMetricsSystem(new NoOpMetricsSystem())
.build(); .build();
} }

@ -88,7 +88,9 @@ public class EvmToolCommandOptionsModule {
@Provides @Provides
@Singleton @Singleton
BesuConfiguration provideBesuConfiguration() { BesuConfiguration provideBesuConfiguration() {
return new BesuConfigurationImpl(dataPath, dataPath.resolve(BesuController.DATABASE_PATH)); final var besuConfiguration = new BesuConfigurationImpl();
besuConfiguration.init(dataPath, dataPath.resolve(BesuController.DATABASE_PATH), null, null);
return besuConfiguration;
} }
@Option( @Option(

@ -69,7 +69,7 @@ Calculated : ${currentHash}
tasks.register('checkAPIChanges', FileStateChecker) { tasks.register('checkAPIChanges', FileStateChecker) {
description = "Checks that the API for the Plugin-API project does not change without deliberate thought" description = "Checks that the API for the Plugin-API project does not change without deliberate thought"
files = sourceSets.main.allJava.files files = sourceSets.main.allJava.files
knownHash = '3+WNtdl1idY70N/MwVBbopU2ZWyWiu12YV1qaYXprZ8=' knownHash = 'f6P3+XG9GjPYEg7zrXHlujoE2/4axgd+EjKGDDJVVp8='
} }
check.dependsOn('checkAPIChanges') check.dependsOn('checkAPIChanges')

@ -14,6 +14,7 @@
*/ */
package org.hyperledger.besu.plugin.services; package org.hyperledger.besu.plugin.services;
import org.hyperledger.besu.datatypes.Wei;
import org.hyperledger.besu.plugin.Unstable; import org.hyperledger.besu.plugin.Unstable;
import java.nio.file.Path; import java.nio.file.Path;
@ -41,7 +42,13 @@ public interface BesuConfiguration extends BesuService {
* @return Database version. * @return Database version.
*/ */
@Unstable @Unstable
default int getDatabaseVersion() { int getDatabaseVersion();
return 1;
} /**
* The runtime value of the min gas price
*
* @return min gas price in wei
*/
@Unstable
Wei getMinGasPrice();
} }

Loading…
Cancel
Save