IntelliJ do not fail me (#7846)

Signed-off-by: jflo <justin+github@florentine.us>
pull/7855/head
Justin Florentine 3 weeks ago committed by GitHub
parent 7eb7b870c3
commit 8fce5aa6ff
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 16
      acceptance-tests/dsl/src/main/java/org/hyperledger/besu/tests/acceptance/dsl/node/BesuNode.java
  2. 16
      acceptance-tests/dsl/src/main/java/org/hyperledger/besu/tests/acceptance/dsl/node/ThreadBesuNodeRunner.java
  3. 12
      acceptance-tests/dsl/src/main/java/org/hyperledger/besu/tests/acceptance/dsl/node/configuration/BesuNodeConfiguration.java
  4. 19
      acceptance-tests/dsl/src/main/java/org/hyperledger/besu/tests/acceptance/dsl/node/configuration/BesuNodeConfigurationBuilder.java
  5. 10
      acceptance-tests/tests/src/test/java/org/hyperledger/besu/tests/acceptance/bft/BftMiningAcceptanceTest.java
  6. 28
      besu/src/main/java/org/hyperledger/besu/RunnerBuilder.java
  7. 10
      besu/src/main/java/org/hyperledger/besu/cli/BesuCommand.java
  8. 82
      besu/src/main/java/org/hyperledger/besu/cli/options/MiningOptions.java
  9. 12
      besu/src/main/java/org/hyperledger/besu/cli/subcommands/blocks/BlocksSubCommand.java
  10. 14
      besu/src/main/java/org/hyperledger/besu/controller/BesuController.java
  11. 29
      besu/src/main/java/org/hyperledger/besu/controller/BesuControllerBuilder.java
  12. 16
      besu/src/main/java/org/hyperledger/besu/controller/CliqueBesuControllerBuilder.java
  13. 17
      besu/src/main/java/org/hyperledger/besu/controller/ConsensusScheduleBesuControllerBuilder.java
  14. 14
      besu/src/main/java/org/hyperledger/besu/controller/IbftBesuControllerBuilder.java
  15. 16
      besu/src/main/java/org/hyperledger/besu/controller/MainnetBesuControllerBuilder.java
  16. 14
      besu/src/main/java/org/hyperledger/besu/controller/MergeBesuControllerBuilder.java
  17. 4
      besu/src/main/java/org/hyperledger/besu/controller/MiningParameterOverrides.java
  18. 16
      besu/src/main/java/org/hyperledger/besu/controller/QbftBesuControllerBuilder.java
  19. 24
      besu/src/main/java/org/hyperledger/besu/controller/TransitionBesuControllerBuilder.java
  20. 12
      besu/src/main/java/org/hyperledger/besu/services/BesuConfigurationImpl.java
  21. 4
      besu/src/test/java/org/hyperledger/besu/FlexGroupPrivacyTest.java
  22. 6
      besu/src/test/java/org/hyperledger/besu/ForkIdsNetworkConfigTest.java
  23. 4
      besu/src/test/java/org/hyperledger/besu/PrivacyReorgTest.java
  24. 4
      besu/src/test/java/org/hyperledger/besu/PrivacyTest.java
  25. 4
      besu/src/test/java/org/hyperledger/besu/RunnerBuilderTest.java
  26. 12
      besu/src/test/java/org/hyperledger/besu/RunnerTest.java
  27. 4
      besu/src/test/java/org/hyperledger/besu/chainexport/RlpBlockExporterTest.java
  28. 6
      besu/src/test/java/org/hyperledger/besu/chainimport/JsonBlockImporterTest.java
  29. 8
      besu/src/test/java/org/hyperledger/besu/chainimport/RlpBlockImporterTest.java
  30. 6
      besu/src/test/java/org/hyperledger/besu/cli/BesuCommandTest.java
  31. 6
      besu/src/test/java/org/hyperledger/besu/cli/CascadingDefaultProviderTest.java
  32. 34
      besu/src/test/java/org/hyperledger/besu/cli/options/MiningOptionsTest.java
  33. 10
      besu/src/test/java/org/hyperledger/besu/controller/AbstractBftBesuControllerBuilderTest.java
  34. 10
      besu/src/test/java/org/hyperledger/besu/controller/CliqueBesuControllerBuilderTest.java
  35. 4
      besu/src/test/java/org/hyperledger/besu/controller/ConsensusScheduleBesuControllerBuilderTest.java
  36. 8
      besu/src/test/java/org/hyperledger/besu/controller/MergeBesuControllerBuilderTest.java
  37. 4
      besu/src/test/java/org/hyperledger/besu/controller/QbftBesuControllerBuilderTest.java
  38. 20
      besu/src/test/java/org/hyperledger/besu/controller/TransitionControllerBuilderTest.java
  39. 4
      besu/src/test/java/org/hyperledger/besu/services/BesuEventsImplTest.java
  40. 4
      besu/src/test/java/org/hyperledger/besu/services/TraceServiceImplTest.java
  41. 14
      consensus/clique/src/main/java/org/hyperledger/besu/consensus/clique/CliqueProtocolSchedule.java
  42. 8
      consensus/clique/src/main/java/org/hyperledger/besu/consensus/clique/blockcreation/CliqueBlockCreator.java
  43. 10
      consensus/clique/src/main/java/org/hyperledger/besu/consensus/clique/blockcreation/CliqueMinerExecutor.java
  44. 12
      consensus/clique/src/main/java/org/hyperledger/besu/consensus/clique/jsonrpc/CliqueJsonRpcMethods.java
  45. 12
      consensus/clique/src/test/java/org/hyperledger/besu/consensus/clique/CliqueProtocolScheduleTest.java
  46. 28
      consensus/clique/src/test/java/org/hyperledger/besu/consensus/clique/blockcreation/CliqueBlockCreatorTest.java
  47. 26
      consensus/clique/src/test/java/org/hyperledger/besu/consensus/clique/blockcreation/CliqueMinerExecutorTest.java
  48. 8
      consensus/common/src/main/java/org/hyperledger/besu/consensus/common/bft/BaseBftProtocolScheduleBuilder.java
  49. 8
      consensus/common/src/main/java/org/hyperledger/besu/consensus/common/bft/blockcreation/BftBlockCreator.java
  50. 20
      consensus/common/src/main/java/org/hyperledger/besu/consensus/common/bft/blockcreation/BftBlockCreatorFactory.java
  51. 4
      consensus/common/src/test/java/org/hyperledger/besu/consensus/common/CombinedProtocolScheduleFactoryTest.java
  52. 4
      consensus/common/src/test/java/org/hyperledger/besu/consensus/common/bft/BaseBftProtocolScheduleBuilderTest.java
  53. 12
      consensus/ibft/src/integration-test/java/org/hyperledger/besu/consensus/ibft/support/TestContextBuilder.java
  54. 14
      consensus/ibft/src/main/java/org/hyperledger/besu/consensus/ibft/IbftProtocolScheduleBuilder.java
  55. 12
      consensus/ibft/src/main/java/org/hyperledger/besu/consensus/ibft/jsonrpc/IbftJsonRpcMethods.java
  56. 8
      consensus/ibft/src/test/java/org/hyperledger/besu/consensus/ibft/IbftProtocolScheduleTest.java
  57. 14
      consensus/ibft/src/test/java/org/hyperledger/besu/consensus/ibft/blockcreation/BftBlockCreatorTest.java
  58. 4
      consensus/ibft/src/test/java/org/hyperledger/besu/consensus/ibft/statemachine/IbftBlockHeightManagerTest.java
  59. 14
      consensus/merge/src/main/java/org/hyperledger/besu/consensus/merge/MergeProtocolSchedule.java
  60. 10
      consensus/merge/src/main/java/org/hyperledger/besu/consensus/merge/TransitionProtocolSchedule.java
  61. 10
      consensus/merge/src/main/java/org/hyperledger/besu/consensus/merge/blockcreation/MergeBlockCreator.java
  62. 32
      consensus/merge/src/main/java/org/hyperledger/besu/consensus/merge/blockcreation/MergeCoordinator.java
  63. 12
      consensus/merge/src/test/java/org/hyperledger/besu/consensus/merge/MergeProtocolScheduleTest.java
  64. 30
      consensus/merge/src/test/java/org/hyperledger/besu/consensus/merge/blockcreation/MergeCoordinatorTest.java
  65. 4
      consensus/merge/src/test/java/org/hyperledger/besu/consensus/merge/blockcreation/MergeGenesisConfigHelper.java
  66. 6
      consensus/merge/src/test/java/org/hyperledger/besu/consensus/merge/blockcreation/MergeReorgTest.java
  67. 12
      consensus/qbft/src/integration-test/java/org/hyperledger/besu/consensus/qbft/support/TestContextBuilder.java
  68. 20
      consensus/qbft/src/main/java/org/hyperledger/besu/consensus/qbft/QbftProtocolScheduleBuilder.java
  69. 6
      consensus/qbft/src/main/java/org/hyperledger/besu/consensus/qbft/blockcreation/QbftBlockCreatorFactory.java
  70. 12
      consensus/qbft/src/main/java/org/hyperledger/besu/consensus/qbft/jsonrpc/QbftJsonRpcMethods.java
  71. 4
      consensus/qbft/src/test/java/org/hyperledger/besu/consensus/qbft/QbftProtocolScheduleTest.java
  72. 10
      consensus/qbft/src/test/java/org/hyperledger/besu/consensus/qbft/blockcreation/QbftBlockCreatorFactoryTest.java
  73. 4
      consensus/qbft/src/test/java/org/hyperledger/besu/consensus/qbft/statemachine/QbftBlockHeightManagerTest.java
  74. 4
      ethereum/api/src/integration-test/java/org/hyperledger/besu/ethereum/api/jsonrpc/BlockchainImporter.java
  75. 12
      ethereum/api/src/integration-test/java/org/hyperledger/besu/ethereum/api/jsonrpc/JsonRpcTestMethodsFactory.java
  76. 4
      ethereum/api/src/integration-test/java/org/hyperledger/besu/ethereum/api/jsonrpc/methods/fork/frontier/EthGetFilterChangesIntegrationTest.java
  77. 4
      ethereum/api/src/integration-test/java/org/hyperledger/besu/ethereum/api/jsonrpc/methods/fork/london/EthGetFilterChangesIntegrationTest.java
  78. 10
      ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/miner/MinerGetExtraData.java
  79. 10
      ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/miner/MinerGetMinGasPrice.java
  80. 10
      ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/miner/MinerGetMinPriorityFee.java
  81. 10
      ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/miner/MinerSetExtraData.java
  82. 10
      ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/miner/MinerSetMinGasPrice.java
  83. 10
      ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/miner/MinerSetMinPriorityFee.java
  84. 6
      ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/methods/JsonRpcMethodsFactory.java
  85. 20
      ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/methods/MinerJsonRpcMethods.java
  86. 26
      ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/query/BlockchainQueries.java
  87. 4
      ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/graphql/AbstractEthGraphQLHttpServiceTest.java
  88. 8
      ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/AbstractJsonRpcHttpServiceTest.java
  89. 6
      ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/JsonRpcHttpServiceHostAllowlistTest.java
  90. 6
      ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/JsonRpcHttpServiceLoginTest.java
  91. 6
      ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/JsonRpcHttpServiceRpcApisTest.java
  92. 6
      ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/JsonRpcHttpServiceTestBase.java
  93. 6
      ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/JsonRpcHttpServiceTlsClientAuthTest.java
  94. 6
      ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/JsonRpcHttpServiceTlsMisconfigurationTest.java
  95. 6
      ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/JsonRpcHttpServiceTlsTest.java
  96. 18
      ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/EthGasPriceTest.java
  97. 4
      ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/EthGetBlockByNumberTest.java
  98. 4
      ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/EthGetBlockReceiptsTest.java
  99. 4
      ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/EthGetProofTest.java
  100. 4
      ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/EthGetTransactionReceiptTest.java
  101. Some files were not shown because too many files have changed in this diff Show More

@ -27,7 +27,7 @@ import org.hyperledger.besu.ethereum.api.jsonrpc.InProcessRpcConfiguration;
import org.hyperledger.besu.ethereum.api.jsonrpc.JsonRpcConfiguration; import org.hyperledger.besu.ethereum.api.jsonrpc.JsonRpcConfiguration;
import org.hyperledger.besu.ethereum.api.jsonrpc.ipc.JsonRpcIpcConfiguration; import org.hyperledger.besu.ethereum.api.jsonrpc.ipc.JsonRpcIpcConfiguration;
import org.hyperledger.besu.ethereum.api.jsonrpc.websocket.WebSocketConfiguration; import org.hyperledger.besu.ethereum.api.jsonrpc.websocket.WebSocketConfiguration;
import org.hyperledger.besu.ethereum.core.MiningParameters; import org.hyperledger.besu.ethereum.core.MiningConfiguration;
import org.hyperledger.besu.ethereum.core.PrivacyParameters; import org.hyperledger.besu.ethereum.core.PrivacyParameters;
import org.hyperledger.besu.ethereum.core.Util; import org.hyperledger.besu.ethereum.core.Util;
import org.hyperledger.besu.ethereum.eth.transactions.TransactionPoolConfiguration; import org.hyperledger.besu.ethereum.eth.transactions.TransactionPoolConfiguration;
@ -101,7 +101,7 @@ public class BesuNode implements NodeConfiguration, RunnableNode, AutoCloseable
private final boolean revertReasonEnabled; private final boolean revertReasonEnabled;
private final String name; private final String name;
private MiningParameters miningParameters; private MiningConfiguration miningConfiguration;
private TransactionPoolConfiguration txPoolConfiguration; private TransactionPoolConfiguration txPoolConfiguration;
private final List<String> runCommand; private final List<String> runCommand;
private PrivacyParameters privacyParameters = PrivacyParameters.DEFAULT; private PrivacyParameters privacyParameters = PrivacyParameters.DEFAULT;
@ -139,7 +139,7 @@ public class BesuNode implements NodeConfiguration, RunnableNode, AutoCloseable
public BesuNode( public BesuNode(
final String name, final String name,
final Optional<Path> dataPath, final Optional<Path> dataPath,
final MiningParameters miningParameters, final MiningConfiguration miningConfiguration,
final TransactionPoolConfiguration txPoolConfiguration, final TransactionPoolConfiguration txPoolConfiguration,
final JsonRpcConfiguration jsonRpcConfiguration, final JsonRpcConfiguration jsonRpcConfiguration,
final Optional<JsonRpcConfiguration> engineRpcConfiguration, final Optional<JsonRpcConfiguration> engineRpcConfiguration,
@ -191,7 +191,7 @@ public class BesuNode implements NodeConfiguration, RunnableNode, AutoCloseable
}, },
() -> this.keyPair = KeyPairUtil.loadKeyPair(homeDirectory)); () -> this.keyPair = KeyPairUtil.loadKeyPair(homeDirectory));
this.name = name; this.name = name;
this.miningParameters = miningParameters; this.miningConfiguration = miningConfiguration;
this.txPoolConfiguration = txPoolConfiguration; this.txPoolConfiguration = txPoolConfiguration;
this.jsonRpcConfiguration = jsonRpcConfiguration; this.jsonRpcConfiguration = jsonRpcConfiguration;
this.engineRpcConfiguration = engineRpcConfiguration; this.engineRpcConfiguration = engineRpcConfiguration;
@ -678,12 +678,12 @@ public class BesuNode implements NodeConfiguration, RunnableNode, AutoCloseable
this.bootnodes.addAll(bootnodes); this.bootnodes.addAll(bootnodes);
} }
public MiningParameters getMiningParameters() { public MiningConfiguration getMiningParameters() {
return miningParameters; return miningConfiguration;
} }
public void setMiningParameters(final MiningParameters miningParameters) { public void setMiningParameters(final MiningConfiguration miningConfiguration) {
this.miningParameters = miningParameters; this.miningConfiguration = miningConfiguration;
} }
public TransactionPoolConfiguration getTransactionPoolConfiguration() { public TransactionPoolConfiguration getTransactionPoolConfiguration() {

@ -36,8 +36,8 @@ import org.hyperledger.besu.ethereum.api.ApiConfiguration;
import org.hyperledger.besu.ethereum.api.graphql.GraphQLConfiguration; import org.hyperledger.besu.ethereum.api.graphql.GraphQLConfiguration;
import org.hyperledger.besu.ethereum.api.jsonrpc.InProcessRpcConfiguration; import org.hyperledger.besu.ethereum.api.jsonrpc.InProcessRpcConfiguration;
import org.hyperledger.besu.ethereum.chain.Blockchain; import org.hyperledger.besu.ethereum.chain.Blockchain;
import org.hyperledger.besu.ethereum.core.ImmutableMiningParameters; import org.hyperledger.besu.ethereum.core.ImmutableMiningConfiguration;
import org.hyperledger.besu.ethereum.core.MiningParameters; import org.hyperledger.besu.ethereum.core.MiningConfiguration;
import org.hyperledger.besu.ethereum.core.plugins.PluginConfiguration; import org.hyperledger.besu.ethereum.core.plugins.PluginConfiguration;
import org.hyperledger.besu.ethereum.core.plugins.PluginInfo; import org.hyperledger.besu.ethereum.core.plugins.PluginInfo;
import org.hyperledger.besu.ethereum.eth.EthProtocolConfiguration; import org.hyperledger.besu.ethereum.eth.EthProtocolConfiguration;
@ -448,7 +448,7 @@ public class ThreadBesuNodeRunner implements BesuNodeRunner {
final BesuControllerBuilder builder, final BesuControllerBuilder builder,
final MetricsSystem metricsSystem, final MetricsSystem metricsSystem,
final KeyValueStorageProvider storageProvider, final KeyValueStorageProvider storageProvider,
final MiningParameters miningParameters) { final MiningConfiguration miningConfiguration) {
builder builder
.synchronizerConfiguration(synchronizerConfiguration) .synchronizerConfiguration(synchronizerConfiguration)
@ -461,7 +461,7 @@ public class ThreadBesuNodeRunner implements BesuNodeRunner {
.evmConfiguration(EvmConfiguration.DEFAULT) .evmConfiguration(EvmConfiguration.DEFAULT)
.maxPeers(25) .maxPeers(25)
.maxRemotelyInitiatedPeers(15) .maxRemotelyInitiatedPeers(15)
.miningParameters(miningParameters) .miningParameters(miningConfiguration)
.randomPeerPriority(false) .randomPeerPriority(false)
.besuComponent(null); .besuComponent(null);
return builder.build(); return builder.build();
@ -564,11 +564,11 @@ public class ThreadBesuNodeRunner implements BesuNodeRunner {
} }
@Provides @Provides
public MiningParameters provideMiningParameters( public MiningConfiguration provideMiningParameters(
final TransactionSelectionServiceImpl transactionSelectionServiceImpl, final TransactionSelectionServiceImpl transactionSelectionServiceImpl,
final BesuNode node) { final BesuNode node) {
final var miningParameters = final var miningParameters =
ImmutableMiningParameters.builder() ImmutableMiningConfiguration.builder()
.from(node.getMiningParameters()) .from(node.getMiningParameters())
.transactionSelectionService(transactionSelectionServiceImpl) .transactionSelectionService(transactionSelectionServiceImpl)
.build(); .build();
@ -579,11 +579,11 @@ public class ThreadBesuNodeRunner implements BesuNodeRunner {
@Provides @Provides
@Inject @Inject
BesuConfiguration provideBesuConfiguration( BesuConfiguration provideBesuConfiguration(
final Path dataDir, final MiningParameters miningParameters, final BesuNode node) { final Path dataDir, final MiningConfiguration miningConfiguration, final BesuNode node) {
final BesuConfigurationImpl commonPluginConfiguration = new BesuConfigurationImpl(); final BesuConfigurationImpl commonPluginConfiguration = new BesuConfigurationImpl();
commonPluginConfiguration.init( commonPluginConfiguration.init(
dataDir, dataDir.resolve(DATABASE_PATH), node.getDataStorageConfiguration()); dataDir, dataDir.resolve(DATABASE_PATH), node.getDataStorageConfiguration());
commonPluginConfiguration.withMiningParameters(miningParameters); commonPluginConfiguration.withMiningParameters(miningConfiguration);
return commonPluginConfiguration; return commonPluginConfiguration;
} }
} }

@ -21,7 +21,7 @@ import org.hyperledger.besu.ethereum.api.jsonrpc.InProcessRpcConfiguration;
import org.hyperledger.besu.ethereum.api.jsonrpc.JsonRpcConfiguration; import org.hyperledger.besu.ethereum.api.jsonrpc.JsonRpcConfiguration;
import org.hyperledger.besu.ethereum.api.jsonrpc.ipc.JsonRpcIpcConfiguration; import org.hyperledger.besu.ethereum.api.jsonrpc.ipc.JsonRpcIpcConfiguration;
import org.hyperledger.besu.ethereum.api.jsonrpc.websocket.WebSocketConfiguration; import org.hyperledger.besu.ethereum.api.jsonrpc.websocket.WebSocketConfiguration;
import org.hyperledger.besu.ethereum.core.MiningParameters; import org.hyperledger.besu.ethereum.core.MiningConfiguration;
import org.hyperledger.besu.ethereum.core.PrivacyParameters; import org.hyperledger.besu.ethereum.core.PrivacyParameters;
import org.hyperledger.besu.ethereum.eth.transactions.TransactionPoolConfiguration; import org.hyperledger.besu.ethereum.eth.transactions.TransactionPoolConfiguration;
import org.hyperledger.besu.ethereum.p2p.config.NetworkingConfiguration; import org.hyperledger.besu.ethereum.p2p.config.NetworkingConfiguration;
@ -40,7 +40,7 @@ public class BesuNodeConfiguration {
private final String name; private final String name;
private final Optional<Path> dataPath; private final Optional<Path> dataPath;
private final MiningParameters miningParameters; private final MiningConfiguration miningConfiguration;
private final TransactionPoolConfiguration transactionPoolConfiguration; private final TransactionPoolConfiguration transactionPoolConfiguration;
private final JsonRpcConfiguration jsonRpcConfiguration; private final JsonRpcConfiguration jsonRpcConfiguration;
private final Optional<JsonRpcConfiguration> engineRpcConfiguration; private final Optional<JsonRpcConfiguration> engineRpcConfiguration;
@ -78,7 +78,7 @@ public class BesuNodeConfiguration {
BesuNodeConfiguration( BesuNodeConfiguration(
final String name, final String name,
final Optional<Path> dataPath, final Optional<Path> dataPath,
final MiningParameters miningParameters, final MiningConfiguration miningConfiguration,
final TransactionPoolConfiguration transactionPoolConfiguration, final TransactionPoolConfiguration transactionPoolConfiguration,
final JsonRpcConfiguration jsonRpcConfiguration, final JsonRpcConfiguration jsonRpcConfiguration,
final Optional<JsonRpcConfiguration> engineRpcConfiguration, final Optional<JsonRpcConfiguration> engineRpcConfiguration,
@ -113,7 +113,7 @@ public class BesuNodeConfiguration {
final boolean strictTxReplayProtectionEnabled, final boolean strictTxReplayProtectionEnabled,
final Map<String, String> environment) { final Map<String, String> environment) {
this.name = name; this.name = name;
this.miningParameters = miningParameters; this.miningConfiguration = miningConfiguration;
this.transactionPoolConfiguration = transactionPoolConfiguration; this.transactionPoolConfiguration = transactionPoolConfiguration;
this.jsonRpcConfiguration = jsonRpcConfiguration; this.jsonRpcConfiguration = jsonRpcConfiguration;
this.engineRpcConfiguration = engineRpcConfiguration; this.engineRpcConfiguration = engineRpcConfiguration;
@ -154,8 +154,8 @@ public class BesuNodeConfiguration {
return name; return name;
} }
public MiningParameters getMiningParameters() { public MiningConfiguration getMiningParameters() {
return miningParameters; return miningConfiguration;
} }
public TransactionPoolConfiguration getTransactionPoolConfiguration() { public TransactionPoolConfiguration getTransactionPoolConfiguration() {

@ -33,9 +33,9 @@ import org.hyperledger.besu.ethereum.api.jsonrpc.ipc.JsonRpcIpcConfiguration;
import org.hyperledger.besu.ethereum.api.jsonrpc.websocket.WebSocketConfiguration; import org.hyperledger.besu.ethereum.api.jsonrpc.websocket.WebSocketConfiguration;
import org.hyperledger.besu.ethereum.api.tls.FileBasedPasswordProvider; import org.hyperledger.besu.ethereum.api.tls.FileBasedPasswordProvider;
import org.hyperledger.besu.ethereum.core.AddressHelpers; import org.hyperledger.besu.ethereum.core.AddressHelpers;
import org.hyperledger.besu.ethereum.core.ImmutableMiningParameters; import org.hyperledger.besu.ethereum.core.ImmutableMiningConfiguration;
import org.hyperledger.besu.ethereum.core.ImmutableMiningParameters.MutableInitValues; import org.hyperledger.besu.ethereum.core.ImmutableMiningConfiguration.MutableInitValues;
import org.hyperledger.besu.ethereum.core.MiningParameters; import org.hyperledger.besu.ethereum.core.MiningConfiguration;
import org.hyperledger.besu.ethereum.core.PrivacyParameters; import org.hyperledger.besu.ethereum.core.PrivacyParameters;
import org.hyperledger.besu.ethereum.eth.transactions.TransactionPoolConfiguration; import org.hyperledger.besu.ethereum.eth.transactions.TransactionPoolConfiguration;
import org.hyperledger.besu.ethereum.p2p.config.NetworkingConfiguration; import org.hyperledger.besu.ethereum.p2p.config.NetworkingConfiguration;
@ -61,8 +61,8 @@ public class BesuNodeConfigurationBuilder {
private String name; private String name;
private Optional<Path> dataPath = Optional.empty(); private Optional<Path> dataPath = Optional.empty();
private MiningParameters miningParameters = private MiningConfiguration miningConfiguration =
ImmutableMiningParameters.builder() ImmutableMiningConfiguration.builder()
.mutableInitValues( .mutableInitValues(
MutableInitValues.builder().coinbase(AddressHelpers.ofValue(1)).build()) MutableInitValues.builder().coinbase(AddressHelpers.ofValue(1)).build())
.build(); .build();
@ -125,13 +125,14 @@ public class BesuNodeConfigurationBuilder {
} }
public BesuNodeConfigurationBuilder miningEnabled(final boolean enabled) { public BesuNodeConfigurationBuilder miningEnabled(final boolean enabled) {
this.miningParameters = miningParameters.setMiningEnabled(enabled); this.miningConfiguration = miningConfiguration.setMiningEnabled(enabled);
this.jsonRpcConfiguration.addRpcApi(RpcApis.MINER.name()); this.jsonRpcConfiguration.addRpcApi(RpcApis.MINER.name());
return this; return this;
} }
public BesuNodeConfigurationBuilder miningConfiguration(final MiningParameters miningParameters) { public BesuNodeConfigurationBuilder miningConfiguration(
this.miningParameters = miningParameters; final MiningConfiguration miningConfiguration) {
this.miningConfiguration = miningConfiguration;
this.jsonRpcConfiguration.addRpcApi(RpcApis.MINER.name()); this.jsonRpcConfiguration.addRpcApi(RpcApis.MINER.name());
return this; return this;
} }
@ -527,7 +528,7 @@ public class BesuNodeConfigurationBuilder {
return new BesuNodeConfiguration( return new BesuNodeConfiguration(
name, name,
dataPath, dataPath,
miningParameters, miningConfiguration,
transactionPoolConfiguration, transactionPoolConfiguration,
jsonRpcConfiguration, jsonRpcConfiguration,
Optional.of(engineRpcConfiguration), Optional.of(engineRpcConfiguration),

@ -17,9 +17,9 @@ package org.hyperledger.besu.tests.acceptance.bft;
import org.hyperledger.besu.config.JsonUtil; import org.hyperledger.besu.config.JsonUtil;
import org.hyperledger.besu.datatypes.Wei; import org.hyperledger.besu.datatypes.Wei;
import org.hyperledger.besu.ethereum.core.AddressHelpers; import org.hyperledger.besu.ethereum.core.AddressHelpers;
import org.hyperledger.besu.ethereum.core.ImmutableMiningParameters; import org.hyperledger.besu.ethereum.core.ImmutableMiningConfiguration;
import org.hyperledger.besu.ethereum.core.ImmutableMiningParameters.MutableInitValues; import org.hyperledger.besu.ethereum.core.ImmutableMiningConfiguration.MutableInitValues;
import org.hyperledger.besu.ethereum.core.MiningParameters; import org.hyperledger.besu.ethereum.core.MiningConfiguration;
import org.hyperledger.besu.tests.acceptance.dsl.account.Account; import org.hyperledger.besu.tests.acceptance.dsl.account.Account;
import org.hyperledger.besu.tests.acceptance.dsl.blockchain.Amount; import org.hyperledger.besu.tests.acceptance.dsl.blockchain.Amount;
import org.hyperledger.besu.tests.acceptance.dsl.node.BesuNode; import org.hyperledger.besu.tests.acceptance.dsl.node.BesuNode;
@ -62,8 +62,8 @@ public class BftMiningAcceptanceTest extends ParameterizedBftTestBase {
final String testName, final BftAcceptanceTestParameterization nodeFactory) throws Exception { final String testName, final BftAcceptanceTestParameterization nodeFactory) throws Exception {
setUp(testName, nodeFactory); setUp(testName, nodeFactory);
final BesuNode minerNode = nodeFactory.createNode(besu, "miner1"); final BesuNode minerNode = nodeFactory.createNode(besu, "miner1");
final MiningParameters zeroGasMiningParams = final MiningConfiguration zeroGasMiningParams =
ImmutableMiningParameters.builder() ImmutableMiningConfiguration.builder()
.mutableInitValues( .mutableInitValues(
MutableInitValues.builder() MutableInitValues.builder()
.isMiningEnabled(true) .isMiningEnabled(true)

@ -70,7 +70,7 @@ import org.hyperledger.besu.ethereum.blockcreation.MiningCoordinator;
import org.hyperledger.besu.ethereum.blockcreation.PoWMiningCoordinator; import org.hyperledger.besu.ethereum.blockcreation.PoWMiningCoordinator;
import org.hyperledger.besu.ethereum.chain.Blockchain; import org.hyperledger.besu.ethereum.chain.Blockchain;
import org.hyperledger.besu.ethereum.core.BlockHeader; import org.hyperledger.besu.ethereum.core.BlockHeader;
import org.hyperledger.besu.ethereum.core.MiningParameters; import org.hyperledger.besu.ethereum.core.MiningConfiguration;
import org.hyperledger.besu.ethereum.core.PrivacyParameters; import org.hyperledger.besu.ethereum.core.PrivacyParameters;
import org.hyperledger.besu.ethereum.core.Synchronizer; import org.hyperledger.besu.ethereum.core.Synchronizer;
import org.hyperledger.besu.ethereum.eth.manager.EthPeers; import org.hyperledger.besu.ethereum.eth.manager.EthPeers;
@ -773,7 +773,7 @@ public class RunnerBuilder {
final TransactionPool transactionPool = besuController.getTransactionPool(); final TransactionPool transactionPool = besuController.getTransactionPool();
final MiningCoordinator miningCoordinator = besuController.getMiningCoordinator(); final MiningCoordinator miningCoordinator = besuController.getMiningCoordinator();
final MiningParameters miningParameters = besuController.getMiningParameters(); final MiningConfiguration miningConfiguration = besuController.getMiningParameters();
final BlockchainQueries blockchainQueries = final BlockchainQueries blockchainQueries =
new BlockchainQueries( new BlockchainQueries(
@ -783,7 +783,7 @@ public class RunnerBuilder {
Optional.of(dataDir.resolve(CACHE_PATH)), Optional.of(dataDir.resolve(CACHE_PATH)),
Optional.of(besuController.getProtocolManager().ethContext().getScheduler()), Optional.of(besuController.getProtocolManager().ethContext().getScheduler()),
apiConfiguration, apiConfiguration,
miningParameters); miningConfiguration);
final PrivacyParameters privacyParameters = besuController.getPrivacyParameters(); final PrivacyParameters privacyParameters = besuController.getPrivacyParameters();
@ -802,7 +802,7 @@ public class RunnerBuilder {
Optional<StratumServer> stratumServer = Optional.empty(); Optional<StratumServer> stratumServer = Optional.empty();
if (miningParameters.isStratumMiningEnabled()) { if (miningConfiguration.isStratumMiningEnabled()) {
if (!(miningCoordinator instanceof PoWMiningCoordinator powMiningCoordinator)) { if (!(miningCoordinator instanceof PoWMiningCoordinator powMiningCoordinator)) {
throw new IllegalArgumentException( throw new IllegalArgumentException(
"Stratum mining requires the network option(--network) to be set to CLASSIC. Stratum server requires a PoWMiningCoordinator not " "Stratum mining requires the network option(--network) to be set to CLASSIC. Stratum server requires a PoWMiningCoordinator not "
@ -813,9 +813,9 @@ public class RunnerBuilder {
new StratumServer( new StratumServer(
vertx, vertx,
powMiningCoordinator, powMiningCoordinator,
miningParameters.getStratumPort(), miningConfiguration.getStratumPort(),
miningParameters.getStratumNetworkInterface(), miningConfiguration.getStratumNetworkInterface(),
miningParameters.getUnstable().getStratumExtranonce(), miningConfiguration.getUnstable().getStratumExtranonce(),
metricsSystem)); metricsSystem));
miningCoordinator.addEthHashObserver(stratumServer.get()); miningCoordinator.addEthHashObserver(stratumServer.get());
LOG.debug("added ethash observer: {}", stratumServer.get()); LOG.debug("added ethash observer: {}", stratumServer.get());
@ -849,7 +849,7 @@ public class RunnerBuilder {
blockchainQueries, blockchainQueries,
synchronizer, synchronizer,
transactionPool, transactionPool,
miningParameters, miningConfiguration,
miningCoordinator, miningCoordinator,
metricsSystem, metricsSystem,
supportedCapabilities, supportedCapabilities,
@ -896,7 +896,7 @@ public class RunnerBuilder {
blockchainQueries, blockchainQueries,
synchronizer, synchronizer,
transactionPool, transactionPool,
miningParameters, miningConfiguration,
miningCoordinator, miningCoordinator,
metricsSystem, metricsSystem,
supportedCapabilities, supportedCapabilities,
@ -989,7 +989,7 @@ public class RunnerBuilder {
blockchainQueries, blockchainQueries,
synchronizer, synchronizer,
transactionPool, transactionPool,
miningParameters, miningConfiguration,
miningCoordinator, miningCoordinator,
metricsSystem, metricsSystem,
supportedCapabilities, supportedCapabilities,
@ -1070,7 +1070,7 @@ public class RunnerBuilder {
blockchainQueries, blockchainQueries,
synchronizer, synchronizer,
transactionPool, transactionPool,
miningParameters, miningConfiguration,
miningCoordinator, miningCoordinator,
metricsSystem, metricsSystem,
supportedCapabilities, supportedCapabilities,
@ -1111,7 +1111,7 @@ public class RunnerBuilder {
blockchainQueries, blockchainQueries,
synchronizer, synchronizer,
transactionPool, transactionPool,
miningParameters, miningConfiguration,
miningCoordinator, miningCoordinator,
metricsSystem, metricsSystem,
supportedCapabilities, supportedCapabilities,
@ -1273,7 +1273,7 @@ public class RunnerBuilder {
final BlockchainQueries blockchainQueries, final BlockchainQueries blockchainQueries,
final Synchronizer synchronizer, final Synchronizer synchronizer,
final TransactionPool transactionPool, final TransactionPool transactionPool,
final MiningParameters miningParameters, final MiningConfiguration miningConfiguration,
final MiningCoordinator miningCoordinator, final MiningCoordinator miningCoordinator,
final ObservableMetricsSystem metricsSystem, final ObservableMetricsSystem metricsSystem,
final Set<Capability> supportedCapabilities, final Set<Capability> supportedCapabilities,
@ -1308,7 +1308,7 @@ public class RunnerBuilder {
protocolContext, protocolContext,
filterManager, filterManager,
transactionPool, transactionPool,
miningParameters, miningConfiguration,
miningCoordinator, miningCoordinator,
metricsSystem, metricsSystem,
supportedCapabilities, supportedCapabilities,

@ -113,7 +113,7 @@ import org.hyperledger.besu.ethereum.api.jsonrpc.ipc.JsonRpcIpcConfiguration;
import org.hyperledger.besu.ethereum.api.jsonrpc.websocket.WebSocketConfiguration; import org.hyperledger.besu.ethereum.api.jsonrpc.websocket.WebSocketConfiguration;
import org.hyperledger.besu.ethereum.api.query.BlockchainQueries; import org.hyperledger.besu.ethereum.api.query.BlockchainQueries;
import org.hyperledger.besu.ethereum.chain.Blockchain; import org.hyperledger.besu.ethereum.chain.Blockchain;
import org.hyperledger.besu.ethereum.core.MiningParameters; import org.hyperledger.besu.ethereum.core.MiningConfiguration;
import org.hyperledger.besu.ethereum.core.MiningParametersMetrics; import org.hyperledger.besu.ethereum.core.MiningParametersMetrics;
import org.hyperledger.besu.ethereum.core.PrivacyParameters; import org.hyperledger.besu.ethereum.core.PrivacyParameters;
import org.hyperledger.besu.ethereum.core.VersionMetadata; import org.hyperledger.besu.ethereum.core.VersionMetadata;
@ -338,7 +338,7 @@ public class BesuCommand implements DefaultCommandValues, Runnable {
Suppliers.memoize(this::readGenesisConfigFile); Suppliers.memoize(this::readGenesisConfigFile);
private final Supplier<GenesisConfigOptions> genesisConfigOptionsSupplier = private final Supplier<GenesisConfigOptions> genesisConfigOptionsSupplier =
Suppliers.memoize(this::readGenesisConfigOptions); Suppliers.memoize(this::readGenesisConfigOptions);
private final Supplier<MiningParameters> miningParametersSupplier = private final Supplier<MiningConfiguration> miningParametersSupplier =
Suppliers.memoize(this::getMiningParameters); Suppliers.memoize(this::getMiningParameters);
private RocksDBPlugin rocksDBPlugin; private RocksDBPlugin rocksDBPlugin;
@ -2117,7 +2117,7 @@ public class BesuCommand implements DefaultCommandValues, Runnable {
return txPoolConfBuilder.build(); return txPoolConfBuilder.build();
} }
private MiningParameters getMiningParameters() { private MiningConfiguration getMiningParameters() {
miningOptions.setTransactionSelectionService(transactionSelectionServiceImpl); miningOptions.setTransactionSelectionService(transactionSelectionServiceImpl);
final var miningParameters = miningOptions.toDomainObject(); final var miningParameters = miningOptions.toDomainObject();
getGenesisBlockPeriodSeconds(genesisConfigOptionsSupplier.get()) getGenesisBlockPeriodSeconds(genesisConfigOptionsSupplier.get())
@ -2169,8 +2169,8 @@ public class BesuCommand implements DefaultCommandValues, Runnable {
return dataStorageConfiguration; return dataStorageConfiguration;
} }
private void initMiningParametersMetrics(final MiningParameters miningParameters) { private void initMiningParametersMetrics(final MiningConfiguration miningConfiguration) {
new MiningParametersMetrics(getMetricsSystem(), miningParameters); new MiningParametersMetrics(getMetricsSystem(), miningConfiguration);
} }
private OptionalInt getGenesisBlockPeriodSeconds( private OptionalInt getGenesisBlockPeriodSeconds(

@ -17,27 +17,27 @@ package org.hyperledger.besu.cli.options;
import static com.google.common.base.Preconditions.checkNotNull; import static com.google.common.base.Preconditions.checkNotNull;
import static java.util.Arrays.asList; import static java.util.Arrays.asList;
import static java.util.Collections.singletonList; import static java.util.Collections.singletonList;
import static org.hyperledger.besu.ethereum.core.MiningParameters.DEFAULT_NON_POA_BLOCK_TXS_SELECTION_MAX_TIME; import static org.hyperledger.besu.ethereum.core.MiningConfiguration.DEFAULT_NON_POA_BLOCK_TXS_SELECTION_MAX_TIME;
import static org.hyperledger.besu.ethereum.core.MiningParameters.DEFAULT_POA_BLOCK_TXS_SELECTION_MAX_TIME; import static org.hyperledger.besu.ethereum.core.MiningConfiguration.DEFAULT_POA_BLOCK_TXS_SELECTION_MAX_TIME;
import static org.hyperledger.besu.ethereum.core.MiningParameters.MutableInitValues.DEFAULT_EXTRA_DATA; import static org.hyperledger.besu.ethereum.core.MiningConfiguration.MutableInitValues.DEFAULT_EXTRA_DATA;
import static org.hyperledger.besu.ethereum.core.MiningParameters.MutableInitValues.DEFAULT_MIN_BLOCK_OCCUPANCY_RATIO; import static org.hyperledger.besu.ethereum.core.MiningConfiguration.MutableInitValues.DEFAULT_MIN_BLOCK_OCCUPANCY_RATIO;
import static org.hyperledger.besu.ethereum.core.MiningParameters.MutableInitValues.DEFAULT_MIN_PRIORITY_FEE_PER_GAS; import static org.hyperledger.besu.ethereum.core.MiningConfiguration.MutableInitValues.DEFAULT_MIN_PRIORITY_FEE_PER_GAS;
import static org.hyperledger.besu.ethereum.core.MiningParameters.MutableInitValues.DEFAULT_MIN_TRANSACTION_GAS_PRICE; import static org.hyperledger.besu.ethereum.core.MiningConfiguration.MutableInitValues.DEFAULT_MIN_TRANSACTION_GAS_PRICE;
import static org.hyperledger.besu.ethereum.core.MiningParameters.Unstable.DEFAULT_MAX_OMMERS_DEPTH; import static org.hyperledger.besu.ethereum.core.MiningConfiguration.Unstable.DEFAULT_MAX_OMMERS_DEPTH;
import static org.hyperledger.besu.ethereum.core.MiningParameters.Unstable.DEFAULT_POS_BLOCK_CREATION_MAX_TIME; import static org.hyperledger.besu.ethereum.core.MiningConfiguration.Unstable.DEFAULT_POS_BLOCK_CREATION_MAX_TIME;
import static org.hyperledger.besu.ethereum.core.MiningParameters.Unstable.DEFAULT_POS_BLOCK_CREATION_REPETITION_MIN_DURATION; import static org.hyperledger.besu.ethereum.core.MiningConfiguration.Unstable.DEFAULT_POS_BLOCK_CREATION_REPETITION_MIN_DURATION;
import static org.hyperledger.besu.ethereum.core.MiningParameters.Unstable.DEFAULT_POW_JOB_TTL; import static org.hyperledger.besu.ethereum.core.MiningConfiguration.Unstable.DEFAULT_POW_JOB_TTL;
import static org.hyperledger.besu.ethereum.core.MiningParameters.Unstable.DEFAULT_REMOTE_SEALERS_LIMIT; import static org.hyperledger.besu.ethereum.core.MiningConfiguration.Unstable.DEFAULT_REMOTE_SEALERS_LIMIT;
import static org.hyperledger.besu.ethereum.core.MiningParameters.Unstable.DEFAULT_REMOTE_SEALERS_TTL; import static org.hyperledger.besu.ethereum.core.MiningConfiguration.Unstable.DEFAULT_REMOTE_SEALERS_TTL;
import org.hyperledger.besu.cli.converter.PositiveNumberConverter; import org.hyperledger.besu.cli.converter.PositiveNumberConverter;
import org.hyperledger.besu.cli.util.CommandLineUtils; import org.hyperledger.besu.cli.util.CommandLineUtils;
import org.hyperledger.besu.config.GenesisConfigOptions; import org.hyperledger.besu.config.GenesisConfigOptions;
import org.hyperledger.besu.datatypes.Address; import org.hyperledger.besu.datatypes.Address;
import org.hyperledger.besu.datatypes.Wei; import org.hyperledger.besu.datatypes.Wei;
import org.hyperledger.besu.ethereum.core.ImmutableMiningParameters; import org.hyperledger.besu.ethereum.core.ImmutableMiningConfiguration;
import org.hyperledger.besu.ethereum.core.ImmutableMiningParameters.MutableInitValues; import org.hyperledger.besu.ethereum.core.ImmutableMiningConfiguration.MutableInitValues;
import org.hyperledger.besu.ethereum.core.MiningParameters; import org.hyperledger.besu.ethereum.core.MiningConfiguration;
import org.hyperledger.besu.plugin.services.TransactionSelectionService; import org.hyperledger.besu.plugin.services.TransactionSelectionService;
import org.hyperledger.besu.util.number.PositiveNumber; import org.hyperledger.besu.util.number.PositiveNumber;
@ -50,7 +50,7 @@ import picocli.CommandLine.Option;
import picocli.CommandLine.ParameterException; import picocli.CommandLine.ParameterException;
/** The Mining CLI options. */ /** The Mining CLI options. */
public class MiningOptions implements CLIOptions<MiningParameters> { public class MiningOptions implements CLIOptions<MiningConfiguration> {
@Option( @Option(
names = {"--miner-enabled"}, names = {"--miner-enabled"},
@ -300,43 +300,45 @@ public class MiningOptions implements CLIOptions<MiningParameters> {
} }
} }
static MiningOptions fromConfig(final MiningParameters miningParameters) { static MiningOptions fromConfig(final MiningConfiguration miningConfiguration) {
final MiningOptions miningOptions = MiningOptions.create(); final MiningOptions miningOptions = MiningOptions.create();
miningOptions.setTransactionSelectionService(miningParameters.getTransactionSelectionService()); miningOptions.setTransactionSelectionService(
miningOptions.isMiningEnabled = miningParameters.isMiningEnabled(); miningConfiguration.getTransactionSelectionService());
miningOptions.iStratumMiningEnabled = miningParameters.isStratumMiningEnabled(); miningOptions.isMiningEnabled = miningConfiguration.isMiningEnabled();
miningOptions.stratumNetworkInterface = miningParameters.getStratumNetworkInterface(); miningOptions.iStratumMiningEnabled = miningConfiguration.isStratumMiningEnabled();
miningOptions.stratumPort = miningParameters.getStratumPort(); miningOptions.stratumNetworkInterface = miningConfiguration.getStratumNetworkInterface();
miningOptions.extraData = miningParameters.getExtraData(); miningOptions.stratumPort = miningConfiguration.getStratumPort();
miningOptions.minTransactionGasPrice = miningParameters.getMinTransactionGasPrice(); miningOptions.extraData = miningConfiguration.getExtraData();
miningOptions.minPriorityFeePerGas = miningParameters.getMinPriorityFeePerGas(); miningOptions.minTransactionGasPrice = miningConfiguration.getMinTransactionGasPrice();
miningOptions.minBlockOccupancyRatio = miningParameters.getMinBlockOccupancyRatio(); miningOptions.minPriorityFeePerGas = miningConfiguration.getMinPriorityFeePerGas();
miningOptions.minBlockOccupancyRatio = miningConfiguration.getMinBlockOccupancyRatio();
miningOptions.nonPoaBlockTxsSelectionMaxTime = miningOptions.nonPoaBlockTxsSelectionMaxTime =
miningParameters.getNonPoaBlockTxsSelectionMaxTime(); miningConfiguration.getNonPoaBlockTxsSelectionMaxTime();
miningOptions.poaBlockTxsSelectionMaxTime = miningParameters.getPoaBlockTxsSelectionMaxTime(); miningOptions.poaBlockTxsSelectionMaxTime =
miningConfiguration.getPoaBlockTxsSelectionMaxTime();
miningOptions.unstableOptions.remoteSealersLimit = miningOptions.unstableOptions.remoteSealersLimit =
miningParameters.getUnstable().getRemoteSealersLimit(); miningConfiguration.getUnstable().getRemoteSealersLimit();
miningOptions.unstableOptions.remoteSealersTimeToLive = miningOptions.unstableOptions.remoteSealersTimeToLive =
miningParameters.getUnstable().getRemoteSealersTimeToLive(); miningConfiguration.getUnstable().getRemoteSealersTimeToLive();
miningOptions.unstableOptions.powJobTimeToLive = miningOptions.unstableOptions.powJobTimeToLive =
miningParameters.getUnstable().getPowJobTimeToLive(); miningConfiguration.getUnstable().getPowJobTimeToLive();
miningOptions.unstableOptions.maxOmmersDepth = miningOptions.unstableOptions.maxOmmersDepth =
miningParameters.getUnstable().getMaxOmmerDepth(); miningConfiguration.getUnstable().getMaxOmmerDepth();
miningOptions.unstableOptions.stratumExtranonce = miningOptions.unstableOptions.stratumExtranonce =
miningParameters.getUnstable().getStratumExtranonce(); miningConfiguration.getUnstable().getStratumExtranonce();
miningOptions.unstableOptions.posBlockCreationMaxTime = miningOptions.unstableOptions.posBlockCreationMaxTime =
miningParameters.getUnstable().getPosBlockCreationMaxTime(); miningConfiguration.getUnstable().getPosBlockCreationMaxTime();
miningOptions.unstableOptions.posBlockCreationRepetitionMinDuration = miningOptions.unstableOptions.posBlockCreationRepetitionMinDuration =
miningParameters.getUnstable().getPosBlockCreationRepetitionMinDuration(); miningConfiguration.getUnstable().getPosBlockCreationRepetitionMinDuration();
miningParameters.getCoinbase().ifPresent(coinbase -> miningOptions.coinbase = coinbase); miningConfiguration.getCoinbase().ifPresent(coinbase -> miningOptions.coinbase = coinbase);
miningParameters.getTargetGasLimit().ifPresent(tgl -> miningOptions.targetGasLimit = tgl); miningConfiguration.getTargetGasLimit().ifPresent(tgl -> miningOptions.targetGasLimit = tgl);
return miningOptions; return miningOptions;
} }
@Override @Override
public MiningParameters toDomainObject() { public MiningConfiguration toDomainObject() {
checkNotNull( checkNotNull(
transactionSelectionService, transactionSelectionService,
"transactionSelectionService must be set before using this object"); "transactionSelectionService must be set before using this object");
@ -356,7 +358,7 @@ public class MiningOptions implements CLIOptions<MiningParameters> {
updatableInitValuesBuilder.coinbase(coinbase); updatableInitValuesBuilder.coinbase(coinbase);
} }
return ImmutableMiningParameters.builder() return ImmutableMiningConfiguration.builder()
.transactionSelectionService(transactionSelectionService) .transactionSelectionService(transactionSelectionService)
.mutableInitValues(updatableInitValuesBuilder.build()) .mutableInitValues(updatableInitValuesBuilder.build())
.isStratumMiningEnabled(iStratumMiningEnabled) .isStratumMiningEnabled(iStratumMiningEnabled)
@ -365,7 +367,7 @@ public class MiningOptions implements CLIOptions<MiningParameters> {
.nonPoaBlockTxsSelectionMaxTime(nonPoaBlockTxsSelectionMaxTime) .nonPoaBlockTxsSelectionMaxTime(nonPoaBlockTxsSelectionMaxTime)
.poaBlockTxsSelectionMaxTime(poaBlockTxsSelectionMaxTime) .poaBlockTxsSelectionMaxTime(poaBlockTxsSelectionMaxTime)
.unstable( .unstable(
ImmutableMiningParameters.Unstable.builder() ImmutableMiningConfiguration.Unstable.builder()
.remoteSealersLimit(unstableOptions.remoteSealersLimit) .remoteSealersLimit(unstableOptions.remoteSealersLimit)
.remoteSealersTimeToLive(unstableOptions.remoteSealersTimeToLive) .remoteSealersTimeToLive(unstableOptions.remoteSealersTimeToLive)
.powJobTimeToLive(unstableOptions.powJobTimeToLive) .powJobTimeToLive(unstableOptions.powJobTimeToLive)

@ -31,9 +31,9 @@ import org.hyperledger.besu.datatypes.Wei;
import org.hyperledger.besu.ethereum.ProtocolContext; import org.hyperledger.besu.ethereum.ProtocolContext;
import org.hyperledger.besu.ethereum.blockcreation.IncrementingNonceGenerator; import org.hyperledger.besu.ethereum.blockcreation.IncrementingNonceGenerator;
import org.hyperledger.besu.ethereum.chain.Blockchain; import org.hyperledger.besu.ethereum.chain.Blockchain;
import org.hyperledger.besu.ethereum.core.ImmutableMiningParameters; import org.hyperledger.besu.ethereum.core.ImmutableMiningConfiguration;
import org.hyperledger.besu.ethereum.core.ImmutableMiningParameters.MutableInitValues; import org.hyperledger.besu.ethereum.core.ImmutableMiningConfiguration.MutableInitValues;
import org.hyperledger.besu.ethereum.core.MiningParameters; import org.hyperledger.besu.ethereum.core.MiningConfiguration;
import org.hyperledger.besu.metrics.MetricsService; import org.hyperledger.besu.metrics.MetricsService;
import org.hyperledger.besu.metrics.prometheus.MetricsConfiguration; import org.hyperledger.besu.metrics.prometheus.MetricsConfiguration;
@ -265,12 +265,12 @@ public class BlocksSubCommand implements Runnable {
} }
} }
private MiningParameters getMiningParameters() { private MiningConfiguration getMiningParameters() {
final Wei minTransactionGasPrice = Wei.ZERO; final Wei minTransactionGasPrice = Wei.ZERO;
// Extradata and coinbase can be configured on a per-block level via the json file // Extradata and coinbase can be configured on a per-block level via the json file
final Address coinbase = Address.ZERO; final Address coinbase = Address.ZERO;
final Bytes extraData = Bytes.EMPTY; final Bytes extraData = Bytes.EMPTY;
return ImmutableMiningParameters.builder() return ImmutableMiningConfiguration.builder()
.mutableInitValues( .mutableInitValues(
MutableInitValues.builder() MutableInitValues.builder()
.nonceGenerator(new IncrementingNonceGenerator(0)) .nonceGenerator(new IncrementingNonceGenerator(0))
@ -377,7 +377,7 @@ public class BlocksSubCommand implements Runnable {
return parentCommand return parentCommand
.parentCommand .parentCommand
.setupControllerBuilder() .setupControllerBuilder()
.miningParameters(MiningParameters.newDefault()) .miningParameters(MiningConfiguration.newDefault())
.build(); .build();
} }

@ -24,7 +24,7 @@ import org.hyperledger.besu.ethereum.ProtocolContext;
import org.hyperledger.besu.ethereum.api.jsonrpc.internal.methods.JsonRpcMethod; import org.hyperledger.besu.ethereum.api.jsonrpc.internal.methods.JsonRpcMethod;
import org.hyperledger.besu.ethereum.api.jsonrpc.methods.JsonRpcMethods; import org.hyperledger.besu.ethereum.api.jsonrpc.methods.JsonRpcMethods;
import org.hyperledger.besu.ethereum.blockcreation.MiningCoordinator; import org.hyperledger.besu.ethereum.blockcreation.MiningCoordinator;
import org.hyperledger.besu.ethereum.core.MiningParameters; import org.hyperledger.besu.ethereum.core.MiningConfiguration;
import org.hyperledger.besu.ethereum.core.PrivacyParameters; import org.hyperledger.besu.ethereum.core.PrivacyParameters;
import org.hyperledger.besu.ethereum.core.Synchronizer; import org.hyperledger.besu.ethereum.core.Synchronizer;
import org.hyperledger.besu.ethereum.eth.manager.EthPeers; import org.hyperledger.besu.ethereum.eth.manager.EthPeers;
@ -71,7 +71,7 @@ public class BesuController implements java.io.Closeable {
private final MiningCoordinator miningCoordinator; private final MiningCoordinator miningCoordinator;
private final PrivacyParameters privacyParameters; private final PrivacyParameters privacyParameters;
private final List<Closeable> closeables; private final List<Closeable> closeables;
private final MiningParameters miningParameters; private final MiningConfiguration miningConfiguration;
private final PluginServiceFactory additionalPluginServices; private final PluginServiceFactory additionalPluginServices;
private final SyncState syncState; private final SyncState syncState;
private final EthPeers ethPeers; private final EthPeers ethPeers;
@ -91,7 +91,7 @@ public class BesuController implements java.io.Closeable {
* @param transactionPool the transaction pool * @param transactionPool the transaction pool
* @param miningCoordinator the mining coordinator * @param miningCoordinator the mining coordinator
* @param privacyParameters the privacy parameters * @param privacyParameters the privacy parameters
* @param miningParameters the mining parameters * @param miningConfiguration the mining parameters
* @param additionalJsonRpcMethodsFactory the additional json rpc methods factory * @param additionalJsonRpcMethodsFactory the additional json rpc methods factory
* @param nodeKey the node key * @param nodeKey the node key
* @param closeables the closeables * @param closeables the closeables
@ -111,7 +111,7 @@ public class BesuController implements java.io.Closeable {
final TransactionPool transactionPool, final TransactionPool transactionPool,
final MiningCoordinator miningCoordinator, final MiningCoordinator miningCoordinator,
final PrivacyParameters privacyParameters, final PrivacyParameters privacyParameters,
final MiningParameters miningParameters, final MiningConfiguration miningConfiguration,
final JsonRpcMethods additionalJsonRpcMethodsFactory, final JsonRpcMethods additionalJsonRpcMethodsFactory,
final NodeKey nodeKey, final NodeKey nodeKey,
final List<Closeable> closeables, final List<Closeable> closeables,
@ -132,7 +132,7 @@ public class BesuController implements java.io.Closeable {
this.miningCoordinator = miningCoordinator; this.miningCoordinator = miningCoordinator;
this.privacyParameters = privacyParameters; this.privacyParameters = privacyParameters;
this.closeables = closeables; this.closeables = closeables;
this.miningParameters = miningParameters; this.miningConfiguration = miningConfiguration;
this.additionalPluginServices = additionalPluginServices; this.additionalPluginServices = additionalPluginServices;
this.ethPeers = ethPeers; this.ethPeers = ethPeers;
this.storageProvider = storageProvider; this.storageProvider = storageProvider;
@ -265,8 +265,8 @@ public class BesuController implements java.io.Closeable {
* *
* @return the mining parameters * @return the mining parameters
*/ */
public MiningParameters getMiningParameters() { public MiningConfiguration getMiningParameters() {
return miningParameters; return miningConfiguration;
} }
/** /**

@ -43,7 +43,7 @@ import org.hyperledger.besu.ethereum.chain.MutableBlockchain;
import org.hyperledger.besu.ethereum.chain.VariablesStorage; import org.hyperledger.besu.ethereum.chain.VariablesStorage;
import org.hyperledger.besu.ethereum.core.BlockHeader; import org.hyperledger.besu.ethereum.core.BlockHeader;
import org.hyperledger.besu.ethereum.core.Difficulty; import org.hyperledger.besu.ethereum.core.Difficulty;
import org.hyperledger.besu.ethereum.core.MiningParameters; import org.hyperledger.besu.ethereum.core.MiningConfiguration;
import org.hyperledger.besu.ethereum.core.PrivacyParameters; import org.hyperledger.besu.ethereum.core.PrivacyParameters;
import org.hyperledger.besu.ethereum.eth.EthProtocol; import org.hyperledger.besu.ethereum.eth.EthProtocol;
import org.hyperledger.besu.ethereum.eth.EthProtocolConfiguration; import org.hyperledger.besu.ethereum.eth.EthProtocolConfiguration;
@ -144,7 +144,7 @@ public abstract class BesuControllerBuilder implements MiningParameterOverrides
protected BigInteger networkId; protected BigInteger networkId;
/** The Mining parameters. */ /** The Mining parameters. */
protected MiningParameters miningParameters; protected MiningConfiguration miningConfiguration;
/** The Metrics system. */ /** The Metrics system. */
protected ObservableMetricsSystem metricsSystem; protected ObservableMetricsSystem metricsSystem;
@ -296,11 +296,11 @@ public abstract class BesuControllerBuilder implements MiningParameterOverrides
/** /**
* Mining parameters besu controller builder. * Mining parameters besu controller builder.
* *
* @param miningParameters the mining parameters * @param miningConfiguration the mining parameters
* @return the besu controller builder * @return the besu controller builder
*/ */
public BesuControllerBuilder miningParameters(final MiningParameters miningParameters) { public BesuControllerBuilder miningParameters(final MiningConfiguration miningConfiguration) {
this.miningParameters = miningParameters; this.miningConfiguration = miningConfiguration;
return this; return this;
} }
@ -543,7 +543,7 @@ public abstract class BesuControllerBuilder implements MiningParameterOverrides
checkNotNull(syncConfig, "Missing sync config"); checkNotNull(syncConfig, "Missing sync config");
checkNotNull(ethereumWireProtocolConfiguration, "Missing ethereum protocol configuration"); checkNotNull(ethereumWireProtocolConfiguration, "Missing ethereum protocol configuration");
checkNotNull(networkId, "Missing network ID"); checkNotNull(networkId, "Missing network ID");
checkNotNull(miningParameters, "Missing mining parameters"); checkNotNull(miningConfiguration, "Missing mining parameters");
checkNotNull(metricsSystem, "Missing metrics system"); checkNotNull(metricsSystem, "Missing metrics system");
checkNotNull(privacyParameters, "Missing privacy parameters"); checkNotNull(privacyParameters, "Missing privacy parameters");
checkNotNull(dataDirectory, "Missing data directory"); // Why do we need this? checkNotNull(dataDirectory, "Missing data directory"); // Why do we need this?
@ -680,7 +680,7 @@ public abstract class BesuControllerBuilder implements MiningParameterOverrides
syncState, syncState,
transactionPoolConfiguration, transactionPoolConfiguration,
besuComponent.map(BesuComponent::getBlobCache).orElse(new BlobCache()), besuComponent.map(BesuComponent::getBlobCache).orElse(new BlobCache()),
miningParameters); miningConfiguration);
final List<PeerValidator> peerValidators = createPeerValidators(protocolSchedule); final List<PeerValidator> peerValidators = createPeerValidators(protocolSchedule);
@ -734,7 +734,7 @@ public abstract class BesuControllerBuilder implements MiningParameterOverrides
protocolSchedule, protocolSchedule,
protocolContext, protocolContext,
transactionPool, transactionPool,
miningParameters, miningConfiguration,
syncState, syncState,
ethProtocolManager); ethProtocolManager);
@ -745,7 +745,8 @@ public abstract class BesuControllerBuilder implements MiningParameterOverrides
createSubProtocolConfiguration(ethProtocolManager, maybeSnapProtocolManager); createSubProtocolConfiguration(ethProtocolManager, maybeSnapProtocolManager);
final JsonRpcMethods additionalJsonRpcMethodFactory = final JsonRpcMethods additionalJsonRpcMethodFactory =
createAdditionalJsonRpcMethodFactory(protocolContext, protocolSchedule, miningParameters); createAdditionalJsonRpcMethodFactory(
protocolContext, protocolSchedule, miningConfiguration);
if (DataStorageFormat.BONSAI.equals(dataStorageConfiguration.getDataStorageFormat())) { if (DataStorageFormat.BONSAI.equals(dataStorageConfiguration.getDataStorageFormat())) {
final DiffBasedSubStorageConfiguration subStorageConfiguration = final DiffBasedSubStorageConfiguration subStorageConfiguration =
@ -779,7 +780,7 @@ public abstract class BesuControllerBuilder implements MiningParameterOverrides
transactionPool, transactionPool,
miningCoordinator, miningCoordinator,
privacyParameters, privacyParameters,
miningParameters, miningConfiguration,
additionalJsonRpcMethodFactory, additionalJsonRpcMethodFactory,
nodeKey, nodeKey,
closeables, closeables,
@ -938,13 +939,13 @@ public abstract class BesuControllerBuilder implements MiningParameterOverrides
* *
* @param protocolContext the protocol context * @param protocolContext the protocol context
* @param protocolSchedule the protocol schedule * @param protocolSchedule the protocol schedule
* @param miningParameters the mining parameters * @param miningConfiguration the mining parameters
* @return the json rpc methods * @return the json rpc methods
*/ */
protected JsonRpcMethods createAdditionalJsonRpcMethodFactory( protected JsonRpcMethods createAdditionalJsonRpcMethodFactory(
final ProtocolContext protocolContext, final ProtocolContext protocolContext,
final ProtocolSchedule protocolSchedule, final ProtocolSchedule protocolSchedule,
final MiningParameters miningParameters) { final MiningConfiguration miningConfiguration) {
return apis -> Collections.emptyMap(); return apis -> Collections.emptyMap();
} }
@ -972,7 +973,7 @@ public abstract class BesuControllerBuilder implements MiningParameterOverrides
* @param protocolSchedule the protocol schedule * @param protocolSchedule the protocol schedule
* @param protocolContext the protocol context * @param protocolContext the protocol context
* @param transactionPool the transaction pool * @param transactionPool the transaction pool
* @param miningParameters the mining parameters * @param miningConfiguration the mining parameters
* @param syncState the sync state * @param syncState the sync state
* @param ethProtocolManager the eth protocol manager * @param ethProtocolManager the eth protocol manager
* @return the mining coordinator * @return the mining coordinator
@ -981,7 +982,7 @@ public abstract class BesuControllerBuilder implements MiningParameterOverrides
ProtocolSchedule protocolSchedule, ProtocolSchedule protocolSchedule,
ProtocolContext protocolContext, ProtocolContext protocolContext,
TransactionPool transactionPool, TransactionPool transactionPool,
MiningParameters miningParameters, MiningConfiguration miningConfiguration,
SyncState syncState, SyncState syncState,
EthProtocolManager ethProtocolManager); EthProtocolManager ethProtocolManager);

@ -36,7 +36,7 @@ import org.hyperledger.besu.ethereum.api.jsonrpc.methods.JsonRpcMethods;
import org.hyperledger.besu.ethereum.blockcreation.MiningCoordinator; import org.hyperledger.besu.ethereum.blockcreation.MiningCoordinator;
import org.hyperledger.besu.ethereum.chain.Blockchain; import org.hyperledger.besu.ethereum.chain.Blockchain;
import org.hyperledger.besu.ethereum.core.BlockHeader; import org.hyperledger.besu.ethereum.core.BlockHeader;
import org.hyperledger.besu.ethereum.core.MiningParameters; import org.hyperledger.besu.ethereum.core.MiningConfiguration;
import org.hyperledger.besu.ethereum.core.Util; import org.hyperledger.besu.ethereum.core.Util;
import org.hyperledger.besu.ethereum.eth.manager.EthProtocolManager; import org.hyperledger.besu.ethereum.eth.manager.EthProtocolManager;
import org.hyperledger.besu.ethereum.eth.sync.state.SyncState; import org.hyperledger.besu.ethereum.eth.sync.state.SyncState;
@ -74,8 +74,8 @@ public class CliqueBesuControllerBuilder extends BesuControllerBuilder {
protected JsonRpcMethods createAdditionalJsonRpcMethodFactory( protected JsonRpcMethods createAdditionalJsonRpcMethodFactory(
final ProtocolContext protocolContext, final ProtocolContext protocolContext,
final ProtocolSchedule protocolSchedule, final ProtocolSchedule protocolSchedule,
final MiningParameters miningParameters) { final MiningConfiguration miningConfiguration) {
return new CliqueJsonRpcMethods(protocolContext, protocolSchedule, miningParameters); return new CliqueJsonRpcMethods(protocolContext, protocolSchedule, miningConfiguration);
} }
@Override @Override
@ -83,7 +83,7 @@ public class CliqueBesuControllerBuilder extends BesuControllerBuilder {
final ProtocolSchedule protocolSchedule, final ProtocolSchedule protocolSchedule,
final ProtocolContext protocolContext, final ProtocolContext protocolContext,
final TransactionPool transactionPool, final TransactionPool transactionPool,
final MiningParameters miningParameters, final MiningConfiguration miningConfiguration,
final SyncState syncState, final SyncState syncState,
final EthProtocolManager ethProtocolManager) { final EthProtocolManager ethProtocolManager) {
final CliqueMinerExecutor miningExecutor = final CliqueMinerExecutor miningExecutor =
@ -92,7 +92,7 @@ public class CliqueBesuControllerBuilder extends BesuControllerBuilder {
protocolSchedule, protocolSchedule,
transactionPool, transactionPool,
nodeKey, nodeKey,
miningParameters, miningConfiguration,
new CliqueBlockScheduler( new CliqueBlockScheduler(
clock, clock,
protocolContext.getConsensusContext(CliqueContext.class).getValidatorProvider(), protocolContext.getConsensusContext(CliqueContext.class).getValidatorProvider(),
@ -113,7 +113,7 @@ public class CliqueBesuControllerBuilder extends BesuControllerBuilder {
.getBlockchain() .getBlockchain()
.observeBlockAdded( .observeBlockAdded(
o -> o ->
miningParameters.setBlockPeriodSeconds( miningConfiguration.setBlockPeriodSeconds(
forksSchedule forksSchedule
.getFork(o.getBlock().getHeader().getNumber() + 1) .getFork(o.getBlock().getHeader().getNumber() + 1)
.getValue() .getValue()
@ -134,7 +134,7 @@ public class CliqueBesuControllerBuilder extends BesuControllerBuilder {
nodeKey, nodeKey,
isRevertReasonEnabled, isRevertReasonEnabled,
evmConfiguration, evmConfiguration,
miningParameters, miningConfiguration,
badBlockManager, badBlockManager,
isParallelTxProcessingEnabled, isParallelTxProcessingEnabled,
metricsSystem); metricsSystem);
@ -171,7 +171,7 @@ public class CliqueBesuControllerBuilder extends BesuControllerBuilder {
} }
@Override @Override
public MiningParameters getMiningParameterOverrides(final MiningParameters fromCli) { public MiningConfiguration getMiningParameterOverrides(final MiningConfiguration fromCli) {
// Clique mines by default, reflect that with in the mining parameters: // Clique mines by default, reflect that with in the mining parameters:
return fromCli.setMiningEnabled(true); return fromCli.setMiningEnabled(true);
} }

@ -33,7 +33,7 @@ import org.hyperledger.besu.ethereum.api.jsonrpc.methods.JsonRpcMethods;
import org.hyperledger.besu.ethereum.blockcreation.MiningCoordinator; import org.hyperledger.besu.ethereum.blockcreation.MiningCoordinator;
import org.hyperledger.besu.ethereum.chain.Blockchain; import org.hyperledger.besu.ethereum.chain.Blockchain;
import org.hyperledger.besu.ethereum.chain.MutableBlockchain; import org.hyperledger.besu.ethereum.chain.MutableBlockchain;
import org.hyperledger.besu.ethereum.core.MiningParameters; import org.hyperledger.besu.ethereum.core.MiningConfiguration;
import org.hyperledger.besu.ethereum.core.PrivacyParameters; import org.hyperledger.besu.ethereum.core.PrivacyParameters;
import org.hyperledger.besu.ethereum.eth.EthProtocolConfiguration; import org.hyperledger.besu.ethereum.eth.EthProtocolConfiguration;
import org.hyperledger.besu.ethereum.eth.manager.EthContext; import org.hyperledger.besu.ethereum.eth.manager.EthContext;
@ -128,7 +128,7 @@ public class ConsensusScheduleBesuControllerBuilder extends BesuControllerBuilde
final ProtocolSchedule protocolSchedule, final ProtocolSchedule protocolSchedule,
final ProtocolContext protocolContext, final ProtocolContext protocolContext,
final TransactionPool transactionPool, final TransactionPool transactionPool,
final MiningParameters miningParameters, final MiningConfiguration miningConfiguration,
final SyncState syncState, final SyncState syncState,
final EthProtocolManager ethProtocolManager) { final EthProtocolManager ethProtocolManager) {
@ -143,7 +143,7 @@ public class ConsensusScheduleBesuControllerBuilder extends BesuControllerBuilde
protocolSchedule, protocolSchedule,
protocolContext, protocolContext,
transactionPool, transactionPool,
miningParameters, miningConfiguration,
syncState, syncState,
ethProtocolManager))) ethProtocolManager)))
.collect(Collectors.toList()); .collect(Collectors.toList());
@ -206,10 +206,11 @@ public class ConsensusScheduleBesuControllerBuilder extends BesuControllerBuilde
protected JsonRpcMethods createAdditionalJsonRpcMethodFactory( protected JsonRpcMethods createAdditionalJsonRpcMethodFactory(
final ProtocolContext protocolContext, final ProtocolContext protocolContext,
final ProtocolSchedule protocolSchedule, final ProtocolSchedule protocolSchedule,
final MiningParameters miningParameters) { final MiningConfiguration miningConfiguration) {
return besuControllerBuilderSchedule return besuControllerBuilderSchedule
.get(0L) .get(0L)
.createAdditionalJsonRpcMethodFactory(protocolContext, protocolSchedule, miningParameters); .createAdditionalJsonRpcMethodFactory(
protocolContext, protocolSchedule, miningConfiguration);
} }
@Override @Override
@ -297,9 +298,9 @@ public class ConsensusScheduleBesuControllerBuilder extends BesuControllerBuilde
} }
@Override @Override
public BesuControllerBuilder miningParameters(final MiningParameters miningParameters) { public BesuControllerBuilder miningParameters(final MiningConfiguration miningConfiguration) {
besuControllerBuilderSchedule.values().forEach(b -> b.miningParameters(miningParameters)); besuControllerBuilderSchedule.values().forEach(b -> b.miningParameters(miningConfiguration));
return super.miningParameters(miningParameters); return super.miningParameters(miningConfiguration);
} }
@Override @Override

@ -60,7 +60,7 @@ import org.hyperledger.besu.ethereum.chain.Blockchain;
import org.hyperledger.besu.ethereum.chain.MinedBlockObserver; import org.hyperledger.besu.ethereum.chain.MinedBlockObserver;
import org.hyperledger.besu.ethereum.chain.MutableBlockchain; import org.hyperledger.besu.ethereum.chain.MutableBlockchain;
import org.hyperledger.besu.ethereum.core.BlockHeader; import org.hyperledger.besu.ethereum.core.BlockHeader;
import org.hyperledger.besu.ethereum.core.MiningParameters; import org.hyperledger.besu.ethereum.core.MiningConfiguration;
import org.hyperledger.besu.ethereum.core.Util; import org.hyperledger.besu.ethereum.core.Util;
import org.hyperledger.besu.ethereum.eth.EthProtocol; import org.hyperledger.besu.ethereum.eth.EthProtocol;
import org.hyperledger.besu.ethereum.eth.SnapProtocol; import org.hyperledger.besu.ethereum.eth.SnapProtocol;
@ -114,8 +114,8 @@ public class IbftBesuControllerBuilder extends BftBesuControllerBuilder {
protected JsonRpcMethods createAdditionalJsonRpcMethodFactory( protected JsonRpcMethods createAdditionalJsonRpcMethodFactory(
final ProtocolContext protocolContext, final ProtocolContext protocolContext,
final ProtocolSchedule protocolSchedule, final ProtocolSchedule protocolSchedule,
final MiningParameters miningParameters) { final MiningConfiguration miningConfiguration) {
return new IbftJsonRpcMethods(protocolContext, protocolSchedule, miningParameters); return new IbftJsonRpcMethods(protocolContext, protocolSchedule, miningConfiguration);
} }
@Override @Override
@ -141,7 +141,7 @@ public class IbftBesuControllerBuilder extends BftBesuControllerBuilder {
final ProtocolSchedule protocolSchedule, final ProtocolSchedule protocolSchedule,
final ProtocolContext protocolContext, final ProtocolContext protocolContext,
final TransactionPool transactionPool, final TransactionPool transactionPool,
final MiningParameters miningParameters, final MiningConfiguration miningConfiguration,
final SyncState syncState, final SyncState syncState,
final EthProtocolManager ethProtocolManager) { final EthProtocolManager ethProtocolManager) {
final MutableBlockchain blockchain = protocolContext.getBlockchain(); final MutableBlockchain blockchain = protocolContext.getBlockchain();
@ -156,7 +156,7 @@ public class IbftBesuControllerBuilder extends BftBesuControllerBuilder {
protocolContext, protocolContext,
bftProtocolSchedule, bftProtocolSchedule,
forksSchedule, forksSchedule,
miningParameters, miningConfiguration,
localAddress, localAddress,
bftExtraDataCodec().get(), bftExtraDataCodec().get(),
ethProtocolManager.ethContext().getScheduler()); ethProtocolManager.ethContext().getScheduler());
@ -247,7 +247,7 @@ public class IbftBesuControllerBuilder extends BftBesuControllerBuilder {
.getBlockchain() .getBlockchain()
.observeBlockAdded( .observeBlockAdded(
o -> o ->
miningParameters.setBlockPeriodSeconds( miningConfiguration.setBlockPeriodSeconds(
forksSchedule forksSchedule
.getFork(o.getBlock().getHeader().getNumber() + 1) .getFork(o.getBlock().getHeader().getNumber() + 1)
.getValue() .getValue()
@ -303,7 +303,7 @@ public class IbftBesuControllerBuilder extends BftBesuControllerBuilder {
isRevertReasonEnabled, isRevertReasonEnabled,
bftExtraDataCodec().get(), bftExtraDataCodec().get(),
evmConfiguration, evmConfiguration,
miningParameters, miningConfiguration,
badBlockManager, badBlockManager,
isParallelTxProcessingEnabled, isParallelTxProcessingEnabled,
metricsSystem); metricsSystem);

@ -21,7 +21,7 @@ import org.hyperledger.besu.ethereum.blockcreation.MiningCoordinator;
import org.hyperledger.besu.ethereum.blockcreation.PoWMinerExecutor; import org.hyperledger.besu.ethereum.blockcreation.PoWMinerExecutor;
import org.hyperledger.besu.ethereum.blockcreation.PoWMiningCoordinator; import org.hyperledger.besu.ethereum.blockcreation.PoWMiningCoordinator;
import org.hyperledger.besu.ethereum.chain.Blockchain; import org.hyperledger.besu.ethereum.chain.Blockchain;
import org.hyperledger.besu.ethereum.core.MiningParameters; import org.hyperledger.besu.ethereum.core.MiningConfiguration;
import org.hyperledger.besu.ethereum.eth.manager.EthProtocolManager; import org.hyperledger.besu.ethereum.eth.manager.EthProtocolManager;
import org.hyperledger.besu.ethereum.eth.sync.state.SyncState; import org.hyperledger.besu.ethereum.eth.sync.state.SyncState;
import org.hyperledger.besu.ethereum.eth.transactions.TransactionPool; import org.hyperledger.besu.ethereum.eth.transactions.TransactionPool;
@ -46,7 +46,7 @@ public class MainnetBesuControllerBuilder extends BesuControllerBuilder {
final ProtocolSchedule protocolSchedule, final ProtocolSchedule protocolSchedule,
final ProtocolContext protocolContext, final ProtocolContext protocolContext,
final TransactionPool transactionPool, final TransactionPool transactionPool,
final MiningParameters miningParameters, final MiningConfiguration miningConfiguration,
final SyncState syncState, final SyncState syncState,
final EthProtocolManager ethProtocolManager) { final EthProtocolManager ethProtocolManager) {
@ -55,7 +55,7 @@ public class MainnetBesuControllerBuilder extends BesuControllerBuilder {
protocolContext, protocolContext,
protocolSchedule, protocolSchedule,
transactionPool, transactionPool,
miningParameters, miningConfiguration,
new DefaultBlockScheduler( new DefaultBlockScheduler(
MainnetBlockHeaderValidator.MINIMUM_SECONDS_SINCE_PARENT, MainnetBlockHeaderValidator.MINIMUM_SECONDS_SINCE_PARENT,
MainnetBlockHeaderValidator.TIMESTAMP_TOLERANCE_S, MainnetBlockHeaderValidator.TIMESTAMP_TOLERANCE_S,
@ -68,11 +68,11 @@ public class MainnetBesuControllerBuilder extends BesuControllerBuilder {
protocolContext.getBlockchain(), protocolContext.getBlockchain(),
executor, executor,
syncState, syncState,
miningParameters.getUnstable().getRemoteSealersLimit(), miningConfiguration.getUnstable().getRemoteSealersLimit(),
miningParameters.getUnstable().getRemoteSealersTimeToLive()); miningConfiguration.getUnstable().getRemoteSealersTimeToLive());
miningCoordinator.addMinedBlockObserver(ethProtocolManager); miningCoordinator.addMinedBlockObserver(ethProtocolManager);
miningCoordinator.setStratumMiningEnabled(miningParameters.isStratumMiningEnabled()); miningCoordinator.setStratumMiningEnabled(miningConfiguration.isStratumMiningEnabled());
if (miningParameters.isMiningEnabled()) { if (miningConfiguration.isMiningEnabled()) {
miningCoordinator.enable(); miningCoordinator.enable();
} }
@ -100,7 +100,7 @@ public class MainnetBesuControllerBuilder extends BesuControllerBuilder {
Optional.of(privacyParameters), Optional.of(privacyParameters),
Optional.of(isRevertReasonEnabled), Optional.of(isRevertReasonEnabled),
Optional.of(evmConfiguration), Optional.of(evmConfiguration),
super.miningParameters, super.miningConfiguration,
badBlockManager, badBlockManager,
isParallelTxProcessingEnabled, isParallelTxProcessingEnabled,
metricsSystem); metricsSystem);

@ -26,7 +26,7 @@ import org.hyperledger.besu.ethereum.blockcreation.MiningCoordinator;
import org.hyperledger.besu.ethereum.chain.Blockchain; import org.hyperledger.besu.ethereum.chain.Blockchain;
import org.hyperledger.besu.ethereum.core.BlockHeader; import org.hyperledger.besu.ethereum.core.BlockHeader;
import org.hyperledger.besu.ethereum.core.Difficulty; import org.hyperledger.besu.ethereum.core.Difficulty;
import org.hyperledger.besu.ethereum.core.MiningParameters; import org.hyperledger.besu.ethereum.core.MiningConfiguration;
import org.hyperledger.besu.ethereum.eth.EthProtocolConfiguration; import org.hyperledger.besu.ethereum.eth.EthProtocolConfiguration;
import org.hyperledger.besu.ethereum.eth.manager.EthContext; import org.hyperledger.besu.ethereum.eth.manager.EthContext;
import org.hyperledger.besu.ethereum.eth.manager.EthMessages; import org.hyperledger.besu.ethereum.eth.manager.EthMessages;
@ -67,14 +67,14 @@ public class MergeBesuControllerBuilder extends BesuControllerBuilder {
final ProtocolSchedule protocolSchedule, final ProtocolSchedule protocolSchedule,
final ProtocolContext protocolContext, final ProtocolContext protocolContext,
final TransactionPool transactionPool, final TransactionPool transactionPool,
final MiningParameters miningParameters, final MiningConfiguration miningConfiguration,
final SyncState syncState, final SyncState syncState,
final EthProtocolManager ethProtocolManager) { final EthProtocolManager ethProtocolManager) {
return createTransitionMiningCoordinator( return createTransitionMiningCoordinator(
protocolSchedule, protocolSchedule,
protocolContext, protocolContext,
transactionPool, transactionPool,
miningParameters, miningConfiguration,
syncState, syncState,
new BackwardSyncContext( new BackwardSyncContext(
protocolContext, protocolContext,
@ -140,7 +140,7 @@ public class MergeBesuControllerBuilder extends BesuControllerBuilder {
* @param protocolSchedule the protocol schedule * @param protocolSchedule the protocol schedule
* @param protocolContext the protocol context * @param protocolContext the protocol context
* @param transactionPool the transaction pool * @param transactionPool the transaction pool
* @param miningParameters the mining parameters * @param miningConfiguration the mining parameters
* @param syncState the sync state * @param syncState the sync state
* @param backwardSyncContext the backward sync context * @param backwardSyncContext the backward sync context
* @param ethScheduler the scheduler * @param ethScheduler the scheduler
@ -150,7 +150,7 @@ public class MergeBesuControllerBuilder extends BesuControllerBuilder {
final ProtocolSchedule protocolSchedule, final ProtocolSchedule protocolSchedule,
final ProtocolContext protocolContext, final ProtocolContext protocolContext,
final TransactionPool transactionPool, final TransactionPool transactionPool,
final MiningParameters miningParameters, final MiningConfiguration miningConfiguration,
final SyncState syncState, final SyncState syncState,
final BackwardSyncContext backwardSyncContext, final BackwardSyncContext backwardSyncContext,
final EthScheduler ethScheduler) { final EthScheduler ethScheduler) {
@ -165,7 +165,7 @@ public class MergeBesuControllerBuilder extends BesuControllerBuilder {
protocolSchedule, protocolSchedule,
ethScheduler, ethScheduler,
transactionPool, transactionPool,
miningParameters, miningConfiguration,
backwardSyncContext, backwardSyncContext,
depositContractAddress); depositContractAddress);
} }
@ -176,7 +176,7 @@ public class MergeBesuControllerBuilder extends BesuControllerBuilder {
genesisConfigOptions, genesisConfigOptions,
privacyParameters, privacyParameters,
isRevertReasonEnabled, isRevertReasonEnabled,
miningParameters, miningConfiguration,
badBlockManager, badBlockManager,
isParallelTxProcessingEnabled, isParallelTxProcessingEnabled,
metricsSystem); metricsSystem);

@ -14,7 +14,7 @@
*/ */
package org.hyperledger.besu.controller; package org.hyperledger.besu.controller;
import org.hyperledger.besu.ethereum.core.MiningParameters; import org.hyperledger.besu.ethereum.core.MiningConfiguration;
/** /**
* This interface wraps the provided MiningParameters to enable controller-specific parameter * This interface wraps the provided MiningParameters to enable controller-specific parameter
@ -27,7 +27,7 @@ public interface MiningParameterOverrides {
* @param fromCli The mining parameters that contains original values. * @param fromCli The mining parameters that contains original values.
* @return MiningParameters constructed from provided param with additional overridden parameters. * @return MiningParameters constructed from provided param with additional overridden parameters.
*/ */
default MiningParameters getMiningParameterOverrides(final MiningParameters fromCli) { default MiningConfiguration getMiningParameterOverrides(final MiningConfiguration fromCli) {
return fromCli; return fromCli;
} }
} }

@ -69,7 +69,7 @@ import org.hyperledger.besu.ethereum.chain.Blockchain;
import org.hyperledger.besu.ethereum.chain.MinedBlockObserver; import org.hyperledger.besu.ethereum.chain.MinedBlockObserver;
import org.hyperledger.besu.ethereum.chain.MutableBlockchain; import org.hyperledger.besu.ethereum.chain.MutableBlockchain;
import org.hyperledger.besu.ethereum.core.BlockHeader; import org.hyperledger.besu.ethereum.core.BlockHeader;
import org.hyperledger.besu.ethereum.core.MiningParameters; import org.hyperledger.besu.ethereum.core.MiningConfiguration;
import org.hyperledger.besu.ethereum.core.Util; import org.hyperledger.besu.ethereum.core.Util;
import org.hyperledger.besu.ethereum.eth.EthProtocol; import org.hyperledger.besu.ethereum.eth.EthProtocol;
import org.hyperledger.besu.ethereum.eth.SnapProtocol; import org.hyperledger.besu.ethereum.eth.SnapProtocol;
@ -130,12 +130,12 @@ public class QbftBesuControllerBuilder extends BftBesuControllerBuilder {
protected JsonRpcMethods createAdditionalJsonRpcMethodFactory( protected JsonRpcMethods createAdditionalJsonRpcMethodFactory(
final ProtocolContext protocolContext, final ProtocolContext protocolContext,
final ProtocolSchedule protocolSchedule, final ProtocolSchedule protocolSchedule,
final MiningParameters miningParameters) { final MiningConfiguration miningConfiguration) {
return new QbftJsonRpcMethods( return new QbftJsonRpcMethods(
protocolContext, protocolContext,
protocolSchedule, protocolSchedule,
miningParameters, miningConfiguration,
createReadOnlyValidatorProvider(protocolContext.getBlockchain()), createReadOnlyValidatorProvider(protocolContext.getBlockchain()),
bftConfigOptions); bftConfigOptions);
} }
@ -181,7 +181,7 @@ public class QbftBesuControllerBuilder extends BftBesuControllerBuilder {
final ProtocolSchedule protocolSchedule, final ProtocolSchedule protocolSchedule,
final ProtocolContext protocolContext, final ProtocolContext protocolContext,
final TransactionPool transactionPool, final TransactionPool transactionPool,
final MiningParameters miningParameters, final MiningConfiguration miningConfiguration,
final SyncState syncState, final SyncState syncState,
final EthProtocolManager ethProtocolManager) { final EthProtocolManager ethProtocolManager) {
final MutableBlockchain blockchain = protocolContext.getBlockchain(); final MutableBlockchain blockchain = protocolContext.getBlockchain();
@ -196,7 +196,7 @@ public class QbftBesuControllerBuilder extends BftBesuControllerBuilder {
protocolContext, protocolContext,
bftProtocolSchedule, bftProtocolSchedule,
qbftForksSchedule, qbftForksSchedule,
miningParameters, miningConfiguration,
localAddress, localAddress,
bftExtraDataCodec().get(), bftExtraDataCodec().get(),
ethProtocolManager.ethContext().getScheduler()); ethProtocolManager.ethContext().getScheduler());
@ -289,12 +289,12 @@ public class QbftBesuControllerBuilder extends BftBesuControllerBuilder {
.getBlockchain() .getBlockchain()
.observeBlockAdded( .observeBlockAdded(
o -> { o -> {
miningParameters.setBlockPeriodSeconds( miningConfiguration.setBlockPeriodSeconds(
qbftForksSchedule qbftForksSchedule
.getFork(o.getBlock().getHeader().getNumber() + 1) .getFork(o.getBlock().getHeader().getNumber() + 1)
.getValue() .getValue()
.getBlockPeriodSeconds()); .getBlockPeriodSeconds());
miningParameters.setEmptyBlockPeriodSeconds( miningConfiguration.setEmptyBlockPeriodSeconds(
qbftForksSchedule qbftForksSchedule
.getFork(o.getBlock().getHeader().getNumber() + 1) .getFork(o.getBlock().getHeader().getNumber() + 1)
.getValue() .getValue()
@ -351,7 +351,7 @@ public class QbftBesuControllerBuilder extends BftBesuControllerBuilder {
isRevertReasonEnabled, isRevertReasonEnabled,
bftExtraDataCodec().get(), bftExtraDataCodec().get(),
evmConfiguration, evmConfiguration,
miningParameters, miningConfiguration,
badBlockManager, badBlockManager,
isParallelTxProcessingEnabled, isParallelTxProcessingEnabled,
metricsSystem); metricsSystem);

@ -30,8 +30,8 @@ import org.hyperledger.besu.ethereum.ProtocolContext;
import org.hyperledger.besu.ethereum.blockcreation.MiningCoordinator; import org.hyperledger.besu.ethereum.blockcreation.MiningCoordinator;
import org.hyperledger.besu.ethereum.chain.Blockchain; import org.hyperledger.besu.ethereum.chain.Blockchain;
import org.hyperledger.besu.ethereum.chain.MutableBlockchain; import org.hyperledger.besu.ethereum.chain.MutableBlockchain;
import org.hyperledger.besu.ethereum.core.ImmutableMiningParameters; import org.hyperledger.besu.ethereum.core.ImmutableMiningConfiguration;
import org.hyperledger.besu.ethereum.core.MiningParameters; import org.hyperledger.besu.ethereum.core.MiningConfiguration;
import org.hyperledger.besu.ethereum.core.PrivacyParameters; import org.hyperledger.besu.ethereum.core.PrivacyParameters;
import org.hyperledger.besu.ethereum.eth.EthProtocolConfiguration; import org.hyperledger.besu.ethereum.eth.EthProtocolConfiguration;
import org.hyperledger.besu.ethereum.eth.manager.EthContext; import org.hyperledger.besu.ethereum.eth.manager.EthContext;
@ -102,7 +102,7 @@ public class TransitionBesuControllerBuilder extends BesuControllerBuilder {
final ProtocolSchedule protocolSchedule, final ProtocolSchedule protocolSchedule,
final ProtocolContext protocolContext, final ProtocolContext protocolContext,
final TransactionPool transactionPool, final TransactionPool transactionPool,
final MiningParameters miningParameters, final MiningConfiguration miningConfiguration,
final SyncState syncState, final SyncState syncState,
final EthProtocolManager ethProtocolManager) { final EthProtocolManager ethProtocolManager) {
@ -112,8 +112,8 @@ public class TransitionBesuControllerBuilder extends BesuControllerBuilder {
// PoA consensus mines by default, get consensus-specific mining parameters for // PoA consensus mines by default, get consensus-specific mining parameters for
// TransitionCoordinator: // TransitionCoordinator:
MiningParameters transitionMiningParameters = MiningConfiguration transitionMiningConfiguration =
preMergeBesuControllerBuilder.getMiningParameterOverrides(miningParameters); preMergeBesuControllerBuilder.getMiningParameterOverrides(miningConfiguration);
// construct a transition backward sync context // construct a transition backward sync context
BackwardSyncContext transitionBackwardsSyncContext = BackwardSyncContext transitionBackwardsSyncContext =
@ -131,10 +131,10 @@ public class TransitionBesuControllerBuilder extends BesuControllerBuilder {
transitionProtocolSchedule.getPreMergeSchedule(), transitionProtocolSchedule.getPreMergeSchedule(),
protocolContext, protocolContext,
transactionPool, transactionPool,
ImmutableMiningParameters.builder() ImmutableMiningConfiguration.builder()
.from(miningParameters) .from(miningConfiguration)
.mutableInitValues( .mutableInitValues(
ImmutableMiningParameters.MutableInitValues.builder() ImmutableMiningConfiguration.MutableInitValues.builder()
.isMiningEnabled(false) .isMiningEnabled(false)
.build()) .build())
.build(), .build(),
@ -144,7 +144,7 @@ public class TransitionBesuControllerBuilder extends BesuControllerBuilder {
transitionProtocolSchedule, transitionProtocolSchedule,
protocolContext, protocolContext,
transactionPool, transactionPool,
transitionMiningParameters, transitionMiningConfiguration,
syncState, syncState,
transitionBackwardsSyncContext, transitionBackwardsSyncContext,
ethProtocolManager.ethContext().getScheduler())); ethProtocolManager.ethContext().getScheduler()));
@ -329,9 +329,9 @@ public class TransitionBesuControllerBuilder extends BesuControllerBuilder {
} }
@Override @Override
public BesuControllerBuilder miningParameters(final MiningParameters miningParameters) { public BesuControllerBuilder miningParameters(final MiningConfiguration miningConfiguration) {
super.miningParameters(miningParameters); super.miningParameters(miningConfiguration);
return propagateConfig(z -> z.miningParameters(miningParameters)); return propagateConfig(z -> z.miningParameters(miningConfiguration));
} }
@Override @Override

@ -16,7 +16,7 @@ package org.hyperledger.besu.services;
import org.hyperledger.besu.cli.options.stable.JsonRpcHttpOptions; import org.hyperledger.besu.cli.options.stable.JsonRpcHttpOptions;
import org.hyperledger.besu.datatypes.Wei; import org.hyperledger.besu.datatypes.Wei;
import org.hyperledger.besu.ethereum.core.MiningParameters; import org.hyperledger.besu.ethereum.core.MiningConfiguration;
import org.hyperledger.besu.ethereum.worldstate.DataStorageConfiguration; import org.hyperledger.besu.ethereum.worldstate.DataStorageConfiguration;
import org.hyperledger.besu.plugin.services.BesuConfiguration; import org.hyperledger.besu.plugin.services.BesuConfiguration;
import org.hyperledger.besu.plugin.services.storage.DataStorageFormat; import org.hyperledger.besu.plugin.services.storage.DataStorageFormat;
@ -31,7 +31,7 @@ public class BesuConfigurationImpl implements BesuConfiguration {
private DataStorageConfiguration dataStorageConfiguration; private DataStorageConfiguration dataStorageConfiguration;
// defaults // defaults
private MiningParameters miningParameters; private MiningConfiguration miningConfiguration;
private Optional<String> rpcHttpHost = Optional.of("http://localhost"); private Optional<String> rpcHttpHost = Optional.of("http://localhost");
private Optional<Integer> rpcHttpPort = Optional.of(8545); private Optional<Integer> rpcHttpPort = Optional.of(8545);
@ -59,11 +59,11 @@ public class BesuConfigurationImpl implements BesuConfiguration {
/** /**
* Set the mining parameters * Set the mining parameters
* *
* @param miningParameters configured mining parameters * @param miningConfiguration configured mining parameters
* @return BesuConfigurationImpl instance * @return BesuConfigurationImpl instance
*/ */
public BesuConfigurationImpl withMiningParameters(final MiningParameters miningParameters) { public BesuConfigurationImpl withMiningParameters(final MiningConfiguration miningConfiguration) {
this.miningParameters = miningParameters; this.miningConfiguration = miningConfiguration;
return this; return this;
} }
@ -106,7 +106,7 @@ public class BesuConfigurationImpl implements BesuConfiguration {
@Override @Override
public Wei getMinGasPrice() { public Wei getMinGasPrice() {
return miningParameters.getMinTransactionGasPrice(); return miningConfiguration.getMinTransactionGasPrice();
} }
@Override @Override

@ -31,7 +31,7 @@ import org.hyperledger.besu.ethereum.GasLimitCalculator;
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.InMemoryKeyValueStorageProvider; import org.hyperledger.besu.ethereum.core.InMemoryKeyValueStorageProvider;
import org.hyperledger.besu.ethereum.core.MiningParameters; import org.hyperledger.besu.ethereum.core.MiningConfiguration;
import org.hyperledger.besu.ethereum.core.PrivacyParameters; import org.hyperledger.besu.ethereum.core.PrivacyParameters;
import org.hyperledger.besu.ethereum.eth.EthProtocolConfiguration; import org.hyperledger.besu.ethereum.eth.EthProtocolConfiguration;
import org.hyperledger.besu.ethereum.eth.sync.SyncMode; import org.hyperledger.besu.ethereum.eth.sync.SyncMode;
@ -150,7 +150,7 @@ class FlexGroupPrivacyTest {
.ethProtocolConfiguration(EthProtocolConfiguration.defaultConfig()) .ethProtocolConfiguration(EthProtocolConfiguration.defaultConfig())
.storageProvider(new InMemoryKeyValueStorageProvider()) .storageProvider(new InMemoryKeyValueStorageProvider())
.networkId(BigInteger.ONE) .networkId(BigInteger.ONE)
.miningParameters(MiningParameters.newDefault()) .miningParameters(MiningConfiguration.newDefault())
.dataStorageConfiguration(dataStorageConfiguration) .dataStorageConfiguration(dataStorageConfiguration)
.nodeKey(NodeKeyUtils.generate()) .nodeKey(NodeKeyUtils.generate())
.metricsSystem(new NoOpMetricsSystem()) .metricsSystem(new NoOpMetricsSystem())

@ -31,7 +31,7 @@ import org.hyperledger.besu.ethereum.chain.Blockchain;
import org.hyperledger.besu.ethereum.chain.GenesisState; import org.hyperledger.besu.ethereum.chain.GenesisState;
import org.hyperledger.besu.ethereum.core.BlockHeader; import org.hyperledger.besu.ethereum.core.BlockHeader;
import org.hyperledger.besu.ethereum.core.MilestoneStreamingProtocolSchedule; import org.hyperledger.besu.ethereum.core.MilestoneStreamingProtocolSchedule;
import org.hyperledger.besu.ethereum.core.MiningParameters; import org.hyperledger.besu.ethereum.core.MiningConfiguration;
import org.hyperledger.besu.ethereum.forkid.ForkId; import org.hyperledger.besu.ethereum.forkid.ForkId;
import org.hyperledger.besu.ethereum.forkid.ForkIdManager; import org.hyperledger.besu.ethereum.forkid.ForkIdManager;
import org.hyperledger.besu.ethereum.mainnet.DefaultProtocolSchedule; import org.hyperledger.besu.ethereum.mainnet.DefaultProtocolSchedule;
@ -174,7 +174,7 @@ public class ForkIdsNetworkConfigTest {
(DefaultProtocolSchedule) (DefaultProtocolSchedule)
MainnetProtocolSchedule.fromConfig( MainnetProtocolSchedule.fromConfig(
configOptions, configOptions,
MiningParameters.MINING_DISABLED, MiningConfiguration.MINING_DISABLED,
new BadBlockManager(), new BadBlockManager(),
false, false,
new NoOpMetricsSystem())); new NoOpMetricsSystem()));
@ -184,7 +184,7 @@ public class ForkIdsNetworkConfigTest {
MergeProtocolSchedule.create( MergeProtocolSchedule.create(
configOptions, configOptions,
false, false,
MiningParameters.MINING_DISABLED, MiningConfiguration.MINING_DISABLED,
new BadBlockManager(), new BadBlockManager(),
false, false,
new NoOpMetricsSystem())); new NoOpMetricsSystem()));

@ -47,7 +47,7 @@ import org.hyperledger.besu.ethereum.core.BlockDataGenerator;
import org.hyperledger.besu.ethereum.core.Difficulty; import org.hyperledger.besu.ethereum.core.Difficulty;
import org.hyperledger.besu.ethereum.core.InMemoryKeyValueStorageProvider; import org.hyperledger.besu.ethereum.core.InMemoryKeyValueStorageProvider;
import org.hyperledger.besu.ethereum.core.InMemoryPrivacyStorageProvider; import org.hyperledger.besu.ethereum.core.InMemoryPrivacyStorageProvider;
import org.hyperledger.besu.ethereum.core.MiningParameters; import org.hyperledger.besu.ethereum.core.MiningConfiguration;
import org.hyperledger.besu.ethereum.core.PrivacyParameters; import org.hyperledger.besu.ethereum.core.PrivacyParameters;
import org.hyperledger.besu.ethereum.core.Transaction; import org.hyperledger.besu.ethereum.core.Transaction;
import org.hyperledger.besu.ethereum.eth.EthProtocolConfiguration; import org.hyperledger.besu.ethereum.eth.EthProtocolConfiguration;
@ -547,7 +547,7 @@ public class PrivacyReorgTest {
.ethProtocolConfiguration(EthProtocolConfiguration.defaultConfig()) .ethProtocolConfiguration(EthProtocolConfiguration.defaultConfig())
.storageProvider(new InMemoryKeyValueStorageProvider()) .storageProvider(new InMemoryKeyValueStorageProvider())
.networkId(BigInteger.ONE) .networkId(BigInteger.ONE)
.miningParameters(MiningParameters.newDefault()) .miningParameters(MiningConfiguration.newDefault())
.nodeKey(NodeKeyUtils.generate()) .nodeKey(NodeKeyUtils.generate())
.metricsSystem(new NoOpMetricsSystem()) .metricsSystem(new NoOpMetricsSystem())
.dataDirectory(dataDir) .dataDirectory(dataDir)

@ -31,7 +31,7 @@ import org.hyperledger.besu.ethereum.GasLimitCalculator;
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.InMemoryKeyValueStorageProvider; import org.hyperledger.besu.ethereum.core.InMemoryKeyValueStorageProvider;
import org.hyperledger.besu.ethereum.core.MiningParameters; import org.hyperledger.besu.ethereum.core.MiningConfiguration;
import org.hyperledger.besu.ethereum.core.PrivacyParameters; import org.hyperledger.besu.ethereum.core.PrivacyParameters;
import org.hyperledger.besu.ethereum.eth.EthProtocolConfiguration; import org.hyperledger.besu.ethereum.eth.EthProtocolConfiguration;
import org.hyperledger.besu.ethereum.eth.sync.SyncMode; import org.hyperledger.besu.ethereum.eth.sync.SyncMode;
@ -125,7 +125,7 @@ class PrivacyTest {
.ethProtocolConfiguration(EthProtocolConfiguration.defaultConfig()) .ethProtocolConfiguration(EthProtocolConfiguration.defaultConfig())
.storageProvider(new InMemoryKeyValueStorageProvider()) .storageProvider(new InMemoryKeyValueStorageProvider())
.networkId(BigInteger.ONE) .networkId(BigInteger.ONE)
.miningParameters(MiningParameters.newDefault()) .miningParameters(MiningConfiguration.newDefault())
.dataStorageConfiguration(dataStorageConfiguration) .dataStorageConfiguration(dataStorageConfiguration)
.nodeKey(NodeKeyUtils.generate()) .nodeKey(NodeKeyUtils.generate())
.metricsSystem(new NoOpMetricsSystem()) .metricsSystem(new NoOpMetricsSystem())

@ -49,7 +49,7 @@ import org.hyperledger.besu.ethereum.core.Block;
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.InMemoryKeyValueStorageProvider; import org.hyperledger.besu.ethereum.core.InMemoryKeyValueStorageProvider;
import org.hyperledger.besu.ethereum.core.MiningParameters; import org.hyperledger.besu.ethereum.core.MiningConfiguration;
import org.hyperledger.besu.ethereum.core.PrivacyParameters; import org.hyperledger.besu.ethereum.core.PrivacyParameters;
import org.hyperledger.besu.ethereum.core.Synchronizer; import org.hyperledger.besu.ethereum.core.Synchronizer;
import org.hyperledger.besu.ethereum.eth.manager.EthContext; import org.hyperledger.besu.ethereum.eth.manager.EthContext;
@ -128,7 +128,7 @@ public final class RunnerBuilderTest {
when(besuController.getProtocolContext()).thenReturn(protocolContext); when(besuController.getProtocolContext()).thenReturn(protocolContext);
when(besuController.getProtocolSchedule()).thenReturn(protocolSchedule); when(besuController.getProtocolSchedule()).thenReturn(protocolSchedule);
when(besuController.getNodeKey()).thenReturn(nodeKey); when(besuController.getNodeKey()).thenReturn(nodeKey);
when(besuController.getMiningParameters()).thenReturn(mock(MiningParameters.class)); when(besuController.getMiningParameters()).thenReturn(mock(MiningConfiguration.class));
when(besuController.getPrivacyParameters()).thenReturn(mock(PrivacyParameters.class)); when(besuController.getPrivacyParameters()).thenReturn(mock(PrivacyParameters.class));
when(besuController.getTransactionPool()) when(besuController.getTransactionPool())
.thenReturn(mock(TransactionPool.class, RETURNS_DEEP_STUBS)); .thenReturn(mock(TransactionPool.class, RETURNS_DEEP_STUBS));

@ -46,7 +46,7 @@ import org.hyperledger.besu.ethereum.core.Block;
import org.hyperledger.besu.ethereum.core.BlockImporter; import org.hyperledger.besu.ethereum.core.BlockImporter;
import org.hyperledger.besu.ethereum.core.BlockSyncTestUtils; import org.hyperledger.besu.ethereum.core.BlockSyncTestUtils;
import org.hyperledger.besu.ethereum.core.InMemoryKeyValueStorageProvider; import org.hyperledger.besu.ethereum.core.InMemoryKeyValueStorageProvider;
import org.hyperledger.besu.ethereum.core.MiningParameters; import org.hyperledger.besu.ethereum.core.MiningConfiguration;
import org.hyperledger.besu.ethereum.core.PrivacyParameters; import org.hyperledger.besu.ethereum.core.PrivacyParameters;
import org.hyperledger.besu.ethereum.eth.EthProtocolConfiguration; import org.hyperledger.besu.ethereum.eth.EthProtocolConfiguration;
import org.hyperledger.besu.ethereum.eth.sync.SyncMode; import org.hyperledger.besu.ethereum.eth.sync.SyncMode;
@ -196,7 +196,7 @@ public final class RunnerTest {
.isPeerTaskSystemEnabled(isPeerTaskSystemEnabled) .isPeerTaskSystemEnabled(isPeerTaskSystemEnabled)
.build(); .build();
final ObservableMetricsSystem noOpMetricsSystem = new NoOpMetricsSystem(); final ObservableMetricsSystem noOpMetricsSystem = new NoOpMetricsSystem();
final var miningParameters = MiningParameters.newDefault(); final var miningParameters = MiningConfiguration.newDefault();
final var dataStorageConfiguration = DataStorageConfiguration.DEFAULT_FOREST_CONFIG; final var dataStorageConfiguration = DataStorageConfiguration.DEFAULT_FOREST_CONFIG;
// Setup Runner with blocks // Setup Runner with blocks
final BesuController controllerAhead = final BesuController controllerAhead =
@ -415,11 +415,11 @@ public final class RunnerTest {
final Path dataDir, final Path dataDir,
final Path dbDir, final Path dbDir,
final DataStorageConfiguration dataStorageConfiguration, final DataStorageConfiguration dataStorageConfiguration,
final MiningParameters miningParameters) { final MiningConfiguration miningConfiguration) {
final var besuConfiguration = new BesuConfigurationImpl(); final var besuConfiguration = new BesuConfigurationImpl();
besuConfiguration besuConfiguration
.init(dataDir, dbDir, dataStorageConfiguration) .init(dataDir, dbDir, dataStorageConfiguration)
.withMiningParameters(miningParameters); .withMiningParameters(miningConfiguration);
return new KeyValueStorageProviderBuilder() return new KeyValueStorageProviderBuilder()
.withStorageFactory( .withStorageFactory(
new RocksDBKeyValueStorageFactory( new RocksDBKeyValueStorageFactory(
@ -488,14 +488,14 @@ public final class RunnerTest {
final NodeKey nodeKey, final NodeKey nodeKey,
final StorageProvider storageProvider, final StorageProvider storageProvider,
final ObservableMetricsSystem metricsSystem, final ObservableMetricsSystem metricsSystem,
final MiningParameters miningParameters) { final MiningConfiguration miningConfiguration) {
return new MainnetBesuControllerBuilder() return new MainnetBesuControllerBuilder()
.genesisConfigFile(genesisConfig) .genesisConfigFile(genesisConfig)
.synchronizerConfiguration(syncConfig) .synchronizerConfiguration(syncConfig)
.ethProtocolConfiguration(EthProtocolConfiguration.defaultConfig()) .ethProtocolConfiguration(EthProtocolConfiguration.defaultConfig())
.dataDirectory(dataDir) .dataDirectory(dataDir)
.networkId(NETWORK_ID) .networkId(NETWORK_ID)
.miningParameters(miningParameters) .miningParameters(miningConfiguration)
.nodeKey(nodeKey) .nodeKey(nodeKey)
.storageProvider(storageProvider) .storageProvider(storageProvider)
.metricsSystem(metricsSystem) .metricsSystem(metricsSystem)

@ -31,7 +31,7 @@ import org.hyperledger.besu.ethereum.core.BlockBody;
import org.hyperledger.besu.ethereum.core.BlockHeader; import org.hyperledger.besu.ethereum.core.BlockHeader;
import org.hyperledger.besu.ethereum.core.BlockHeaderFunctions; import org.hyperledger.besu.ethereum.core.BlockHeaderFunctions;
import org.hyperledger.besu.ethereum.core.InMemoryKeyValueStorageProvider; import org.hyperledger.besu.ethereum.core.InMemoryKeyValueStorageProvider;
import org.hyperledger.besu.ethereum.core.MiningParameters; import org.hyperledger.besu.ethereum.core.MiningConfiguration;
import org.hyperledger.besu.ethereum.core.PrivacyParameters; import org.hyperledger.besu.ethereum.core.PrivacyParameters;
import org.hyperledger.besu.ethereum.eth.EthProtocolConfiguration; import org.hyperledger.besu.ethereum.eth.EthProtocolConfiguration;
import org.hyperledger.besu.ethereum.eth.sync.SyncMode; import org.hyperledger.besu.ethereum.eth.sync.SyncMode;
@ -94,7 +94,7 @@ public final class RlpBlockExporterTest {
.ethProtocolConfiguration(EthProtocolConfiguration.defaultConfig()) .ethProtocolConfiguration(EthProtocolConfiguration.defaultConfig())
.storageProvider(new InMemoryKeyValueStorageProvider()) .storageProvider(new InMemoryKeyValueStorageProvider())
.networkId(BigInteger.ONE) .networkId(BigInteger.ONE)
.miningParameters(MiningParameters.newDefault()) .miningParameters(MiningConfiguration.newDefault())
.nodeKey(NodeKeyUtils.generate()) .nodeKey(NodeKeyUtils.generate())
.metricsSystem(new NoOpMetricsSystem()) .metricsSystem(new NoOpMetricsSystem())
.privacyParameters(PrivacyParameters.DEFAULT) .privacyParameters(PrivacyParameters.DEFAULT)

@ -32,8 +32,8 @@ import org.hyperledger.besu.ethereum.chain.Blockchain;
import org.hyperledger.besu.ethereum.core.Block; import org.hyperledger.besu.ethereum.core.Block;
import org.hyperledger.besu.ethereum.core.BlockBody; import org.hyperledger.besu.ethereum.core.BlockBody;
import org.hyperledger.besu.ethereum.core.BlockHeader; import org.hyperledger.besu.ethereum.core.BlockHeader;
import org.hyperledger.besu.ethereum.core.ImmutableMiningParameters; import org.hyperledger.besu.ethereum.core.ImmutableMiningConfiguration;
import org.hyperledger.besu.ethereum.core.ImmutableMiningParameters.MutableInitValues; import org.hyperledger.besu.ethereum.core.ImmutableMiningConfiguration.MutableInitValues;
import org.hyperledger.besu.ethereum.core.InMemoryKeyValueStorageProvider; import org.hyperledger.besu.ethereum.core.InMemoryKeyValueStorageProvider;
import org.hyperledger.besu.ethereum.core.PrivacyParameters; import org.hyperledger.besu.ethereum.core.PrivacyParameters;
import org.hyperledger.besu.ethereum.core.Transaction; import org.hyperledger.besu.ethereum.core.Transaction;
@ -458,7 +458,7 @@ public abstract class JsonBlockImporterTest {
.storageProvider(new InMemoryKeyValueStorageProvider()) .storageProvider(new InMemoryKeyValueStorageProvider())
.networkId(BigInteger.valueOf(10)) .networkId(BigInteger.valueOf(10))
.miningParameters( .miningParameters(
ImmutableMiningParameters.builder() ImmutableMiningConfiguration.builder()
.mutableInitValues( .mutableInitValues(
MutableInitValues.builder() MutableInitValues.builder()
.isMiningEnabled(true) .isMiningEnabled(true)

@ -26,7 +26,7 @@ import org.hyperledger.besu.controller.BesuController;
import org.hyperledger.besu.cryptoservices.NodeKeyUtils; import org.hyperledger.besu.cryptoservices.NodeKeyUtils;
import org.hyperledger.besu.ethereum.GasLimitCalculator; import org.hyperledger.besu.ethereum.GasLimitCalculator;
import org.hyperledger.besu.ethereum.core.InMemoryKeyValueStorageProvider; import org.hyperledger.besu.ethereum.core.InMemoryKeyValueStorageProvider;
import org.hyperledger.besu.ethereum.core.MiningParameters; import org.hyperledger.besu.ethereum.core.MiningConfiguration;
import org.hyperledger.besu.ethereum.core.PrivacyParameters; import org.hyperledger.besu.ethereum.core.PrivacyParameters;
import org.hyperledger.besu.ethereum.eth.EthProtocolConfiguration; import org.hyperledger.besu.ethereum.eth.EthProtocolConfiguration;
import org.hyperledger.besu.ethereum.eth.sync.SyncMode; import org.hyperledger.besu.ethereum.eth.sync.SyncMode;
@ -69,7 +69,7 @@ public final class RlpBlockImporterTest {
.ethProtocolConfiguration(EthProtocolConfiguration.defaultConfig()) .ethProtocolConfiguration(EthProtocolConfiguration.defaultConfig())
.storageProvider(new InMemoryKeyValueStorageProvider()) .storageProvider(new InMemoryKeyValueStorageProvider())
.networkId(BigInteger.ONE) .networkId(BigInteger.ONE)
.miningParameters(MiningParameters.newDefault()) .miningParameters(MiningConfiguration.newDefault())
.nodeKey(NodeKeyUtils.generate()) .nodeKey(NodeKeyUtils.generate())
.metricsSystem(new NoOpMetricsSystem()) .metricsSystem(new NoOpMetricsSystem())
.privacyParameters(PrivacyParameters.DEFAULT) .privacyParameters(PrivacyParameters.DEFAULT)
@ -103,7 +103,7 @@ public final class RlpBlockImporterTest {
.ethProtocolConfiguration(EthProtocolConfiguration.defaultConfig()) .ethProtocolConfiguration(EthProtocolConfiguration.defaultConfig())
.storageProvider(new InMemoryKeyValueStorageProvider()) .storageProvider(new InMemoryKeyValueStorageProvider())
.networkId(BigInteger.ONE) .networkId(BigInteger.ONE)
.miningParameters(MiningParameters.newDefault()) .miningParameters(MiningConfiguration.newDefault())
.nodeKey(NodeKeyUtils.generate()) .nodeKey(NodeKeyUtils.generate())
.metricsSystem(new NoOpMetricsSystem()) .metricsSystem(new NoOpMetricsSystem())
.privacyParameters(PrivacyParameters.DEFAULT) .privacyParameters(PrivacyParameters.DEFAULT)
@ -134,7 +134,7 @@ public final class RlpBlockImporterTest {
.ethProtocolConfiguration(EthProtocolConfiguration.defaultConfig()) .ethProtocolConfiguration(EthProtocolConfiguration.defaultConfig())
.storageProvider(new InMemoryKeyValueStorageProvider()) .storageProvider(new InMemoryKeyValueStorageProvider())
.networkId(BigInteger.ONE) .networkId(BigInteger.ONE)
.miningParameters(MiningParameters.newDefault()) .miningParameters(MiningConfiguration.newDefault())
.nodeKey(NodeKeyUtils.generate()) .nodeKey(NodeKeyUtils.generate())
.metricsSystem(new NoOpMetricsSystem()) .metricsSystem(new NoOpMetricsSystem())
.privacyParameters(PrivacyParameters.DEFAULT) .privacyParameters(PrivacyParameters.DEFAULT)

@ -57,7 +57,7 @@ import org.hyperledger.besu.ethereum.api.graphql.GraphQLConfiguration;
import org.hyperledger.besu.ethereum.api.handlers.TimeoutOptions; import org.hyperledger.besu.ethereum.api.handlers.TimeoutOptions;
import org.hyperledger.besu.ethereum.api.jsonrpc.JsonRpcConfiguration; import org.hyperledger.besu.ethereum.api.jsonrpc.JsonRpcConfiguration;
import org.hyperledger.besu.ethereum.api.jsonrpc.websocket.WebSocketConfiguration; import org.hyperledger.besu.ethereum.api.jsonrpc.websocket.WebSocketConfiguration;
import org.hyperledger.besu.ethereum.core.MiningParameters; import org.hyperledger.besu.ethereum.core.MiningConfiguration;
import org.hyperledger.besu.ethereum.eth.sync.SyncMode; import org.hyperledger.besu.ethereum.eth.sync.SyncMode;
import org.hyperledger.besu.ethereum.eth.sync.SynchronizerConfiguration; import org.hyperledger.besu.ethereum.eth.sync.SynchronizerConfiguration;
import org.hyperledger.besu.ethereum.p2p.peers.EnodeURLImpl; import org.hyperledger.besu.ethereum.p2p.peers.EnodeURLImpl;
@ -277,8 +277,8 @@ public class BesuCommandTest extends CommandTestAbstract {
verify(mockRunnerBuilder).build(); verify(mockRunnerBuilder).build();
verify(mockControllerBuilderFactory).fromEthNetworkConfig(ethNetworkArg.capture(), any()); verify(mockControllerBuilderFactory).fromEthNetworkConfig(ethNetworkArg.capture(), any());
final ArgumentCaptor<MiningParameters> miningArg = final ArgumentCaptor<MiningConfiguration> miningArg =
ArgumentCaptor.forClass(MiningParameters.class); ArgumentCaptor.forClass(MiningConfiguration.class);
verify(mockControllerBuilder).synchronizerConfiguration(syncConfigurationCaptor.capture()); verify(mockControllerBuilder).synchronizerConfiguration(syncConfigurationCaptor.capture());
verify(mockControllerBuilder).dataDirectory(isNotNull()); verify(mockControllerBuilder).dataDirectory(isNotNull());
verify(mockControllerBuilder).miningParameters(miningArg.capture()); verify(mockControllerBuilder).miningParameters(miningArg.capture());

@ -33,7 +33,7 @@ import org.hyperledger.besu.datatypes.Address;
import org.hyperledger.besu.ethereum.api.graphql.GraphQLConfiguration; import org.hyperledger.besu.ethereum.api.graphql.GraphQLConfiguration;
import org.hyperledger.besu.ethereum.api.jsonrpc.JsonRpcConfiguration; import org.hyperledger.besu.ethereum.api.jsonrpc.JsonRpcConfiguration;
import org.hyperledger.besu.ethereum.api.jsonrpc.websocket.WebSocketConfiguration; import org.hyperledger.besu.ethereum.api.jsonrpc.websocket.WebSocketConfiguration;
import org.hyperledger.besu.ethereum.core.MiningParameters; import org.hyperledger.besu.ethereum.core.MiningConfiguration;
import org.hyperledger.besu.ethereum.eth.sync.SyncMode; import org.hyperledger.besu.ethereum.eth.sync.SyncMode;
import org.hyperledger.besu.ethereum.eth.sync.SynchronizerConfiguration; import org.hyperledger.besu.ethereum.eth.sync.SynchronizerConfiguration;
import org.hyperledger.besu.ethereum.p2p.peers.EnodeURLImpl; import org.hyperledger.besu.ethereum.p2p.peers.EnodeURLImpl;
@ -200,7 +200,7 @@ public class CascadingDefaultProviderTest extends CommandTestAbstract {
setEnvironmentVariable("BESU_MINER_COINBASE", expectedCoinbase); setEnvironmentVariable("BESU_MINER_COINBASE", expectedCoinbase);
parseCommand("--config-file", configFile); parseCommand("--config-file", configFile);
final var captMiningParameters = ArgumentCaptor.forClass(MiningParameters.class); final var captMiningParameters = ArgumentCaptor.forClass(MiningConfiguration.class);
verify(mockControllerBuilder).miningParameters(captMiningParameters.capture()); verify(mockControllerBuilder).miningParameters(captMiningParameters.capture());
assertThat(captMiningParameters.getValue().getCoinbase()) assertThat(captMiningParameters.getValue().getCoinbase())
@ -219,7 +219,7 @@ public class CascadingDefaultProviderTest extends CommandTestAbstract {
setEnvironmentVariable("BESU_MINER_COINBASE", "0x0000000000000000000000000000000000000004"); setEnvironmentVariable("BESU_MINER_COINBASE", "0x0000000000000000000000000000000000000004");
parseCommand("--config-file", configFile, "--miner-coinbase", expectedCoinbase); parseCommand("--config-file", configFile, "--miner-coinbase", expectedCoinbase);
final var captMiningParameters = ArgumentCaptor.forClass(MiningParameters.class); final var captMiningParameters = ArgumentCaptor.forClass(MiningConfiguration.class);
verify(mockControllerBuilder).miningParameters(captMiningParameters.capture()); verify(mockControllerBuilder).miningParameters(captMiningParameters.capture());
assertThat(captMiningParameters.getValue().getCoinbase()) assertThat(captMiningParameters.getValue().getCoinbase())

@ -15,19 +15,19 @@
package org.hyperledger.besu.cli.options; package org.hyperledger.besu.cli.options;
import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThat;
import static org.hyperledger.besu.ethereum.core.MiningParameters.DEFAULT_NON_POA_BLOCK_TXS_SELECTION_MAX_TIME; import static org.hyperledger.besu.ethereum.core.MiningConfiguration.DEFAULT_NON_POA_BLOCK_TXS_SELECTION_MAX_TIME;
import static org.hyperledger.besu.ethereum.core.MiningParameters.DEFAULT_POA_BLOCK_TXS_SELECTION_MAX_TIME; import static org.hyperledger.besu.ethereum.core.MiningConfiguration.DEFAULT_POA_BLOCK_TXS_SELECTION_MAX_TIME;
import static org.hyperledger.besu.ethereum.core.MiningParameters.Unstable.DEFAULT_POS_BLOCK_CREATION_MAX_TIME; import static org.hyperledger.besu.ethereum.core.MiningConfiguration.Unstable.DEFAULT_POS_BLOCK_CREATION_MAX_TIME;
import static org.mockito.Mockito.atMost; import static org.mockito.Mockito.atMost;
import static org.mockito.Mockito.verify; import static org.mockito.Mockito.verify;
import org.hyperledger.besu.datatypes.Address; import org.hyperledger.besu.datatypes.Address;
import org.hyperledger.besu.datatypes.Wei; import org.hyperledger.besu.datatypes.Wei;
import org.hyperledger.besu.ethereum.GasLimitCalculator; import org.hyperledger.besu.ethereum.GasLimitCalculator;
import org.hyperledger.besu.ethereum.core.ImmutableMiningParameters; import org.hyperledger.besu.ethereum.core.ImmutableMiningConfiguration;
import org.hyperledger.besu.ethereum.core.ImmutableMiningParameters.MutableInitValues; import org.hyperledger.besu.ethereum.core.ImmutableMiningConfiguration.MutableInitValues;
import org.hyperledger.besu.ethereum.core.ImmutableMiningParameters.Unstable; import org.hyperledger.besu.ethereum.core.ImmutableMiningConfiguration.Unstable;
import org.hyperledger.besu.ethereum.core.MiningParameters; import org.hyperledger.besu.ethereum.core.MiningConfiguration;
import org.hyperledger.besu.util.number.PositiveNumber; import org.hyperledger.besu.util.number.PositiveNumber;
import java.io.IOException; import java.io.IOException;
@ -42,7 +42,7 @@ import org.mockito.ArgumentCaptor;
import org.mockito.junit.jupiter.MockitoExtension; import org.mockito.junit.jupiter.MockitoExtension;
@ExtendWith(MockitoExtension.class) @ExtendWith(MockitoExtension.class)
public class MiningOptionsTest extends AbstractCLIOptionsTest<MiningParameters, MiningOptions> { public class MiningOptionsTest extends AbstractCLIOptionsTest<MiningConfiguration, MiningOptions> {
@Test @Test
public void besuDoesNotStartInMiningModeIfCoinbaseNotSet() { public void besuDoesNotStartInMiningModeIfCoinbaseNotSet() {
@ -390,13 +390,13 @@ public class MiningOptionsTest extends AbstractCLIOptionsTest<MiningParameters,
} }
@Override @Override
protected MiningParameters createDefaultDomainObject() { protected MiningConfiguration createDefaultDomainObject() {
return MiningParameters.newDefault(); return MiningConfiguration.newDefault();
} }
@Override @Override
protected MiningParameters createCustomizedDomainObject() { protected MiningConfiguration createCustomizedDomainObject() {
return ImmutableMiningParameters.builder() return ImmutableMiningConfiguration.builder()
.mutableInitValues( .mutableInitValues(
MutableInitValues.builder() MutableInitValues.builder()
.isMiningEnabled(true) .isMiningEnabled(true)
@ -410,7 +410,7 @@ public class MiningOptionsTest extends AbstractCLIOptionsTest<MiningParameters,
} }
@Override @Override
protected MiningOptions optionsFromDomainObject(final MiningParameters domainObject) { protected MiningOptions optionsFromDomainObject(final MiningConfiguration domainObject) {
return MiningOptions.fromConfig(domainObject); return MiningOptions.fromConfig(domainObject);
} }
@ -424,11 +424,11 @@ public class MiningOptionsTest extends AbstractCLIOptionsTest<MiningParameters,
return new String[] {"transactionSelectionService"}; return new String[] {"transactionSelectionService"};
} }
private MiningParameters runtimeConfiguration( private MiningConfiguration runtimeConfiguration(
final TestBesuCommand besuCommand, final MiningParameters miningParameters) { final TestBesuCommand besuCommand, final MiningConfiguration miningConfiguration) {
if (besuCommand.getGenesisConfigOptions().isPoa()) { if (besuCommand.getGenesisConfigOptions().isPoa()) {
miningParameters.setBlockPeriodSeconds(POA_BLOCK_PERIOD_SECONDS); miningConfiguration.setBlockPeriodSeconds(POA_BLOCK_PERIOD_SECONDS);
} }
return miningParameters; return miningConfiguration;
} }
} }

@ -34,7 +34,7 @@ import org.hyperledger.besu.ethereum.core.BlockBody;
import org.hyperledger.besu.ethereum.core.BlockHeader; import org.hyperledger.besu.ethereum.core.BlockHeader;
import org.hyperledger.besu.ethereum.core.BlockHeaderFunctions; import org.hyperledger.besu.ethereum.core.BlockHeaderFunctions;
import org.hyperledger.besu.ethereum.core.Difficulty; import org.hyperledger.besu.ethereum.core.Difficulty;
import org.hyperledger.besu.ethereum.core.MiningParameters; import org.hyperledger.besu.ethereum.core.MiningConfiguration;
import org.hyperledger.besu.ethereum.core.PrivacyParameters; import org.hyperledger.besu.ethereum.core.PrivacyParameters;
import org.hyperledger.besu.ethereum.eth.EthProtocolConfiguration; import org.hyperledger.besu.ethereum.eth.EthProtocolConfiguration;
import org.hyperledger.besu.ethereum.eth.sync.SynchronizerConfiguration; import org.hyperledger.besu.ethereum.eth.sync.SynchronizerConfiguration;
@ -90,7 +90,7 @@ public abstract class AbstractBftBesuControllerBuilderTest {
TransactionPoolConfiguration.DEFAULT; TransactionPoolConfiguration.DEFAULT;
private final ObservableMetricsSystem observableMetricsSystem = new NoOpMetricsSystem(); private final ObservableMetricsSystem observableMetricsSystem = new NoOpMetricsSystem();
protected final ObjectMapper objectMapper = new ObjectMapper(); protected final ObjectMapper objectMapper = new ObjectMapper();
private final MiningParameters miningParameters = MiningParameters.newDefault(); private final MiningConfiguration miningConfiguration = MiningConfiguration.newDefault();
@TempDir Path tempDir; @TempDir Path tempDir;
@BeforeEach @BeforeEach
@ -146,7 +146,7 @@ public abstract class AbstractBftBesuControllerBuilderTest {
.synchronizerConfiguration(synchronizerConfiguration) .synchronizerConfiguration(synchronizerConfiguration)
.ethProtocolConfiguration(ethProtocolConfiguration) .ethProtocolConfiguration(ethProtocolConfiguration)
.networkId(networkId) .networkId(networkId)
.miningParameters(miningParameters) .miningParameters(miningConfiguration)
.metricsSystem(observableMetricsSystem) .metricsSystem(observableMetricsSystem)
.privacyParameters(privacyParameters) .privacyParameters(privacyParameters)
.dataDirectory(tempDir) .dataDirectory(tempDir)
@ -199,8 +199,8 @@ public abstract class AbstractBftBesuControllerBuilderTest {
protocolContext.getBlockchain().appendBlock(block1, List.of()); protocolContext.getBlockchain().appendBlock(block1, List.of());
assertThat(miningParameters.getBlockPeriodSeconds()).isNotEmpty().hasValue(2); assertThat(miningConfiguration.getBlockPeriodSeconds()).isNotEmpty().hasValue(2);
assertThat(miningParameters.getBlockTxsSelectionMaxTime()).isEqualTo(2000 * 75 / 100); assertThat(miningConfiguration.getBlockTxsSelectionMaxTime()).isEqualTo(2000 * 75 / 100);
} }
protected abstract BlockHeaderFunctions getBlockHeaderFunctions(); protected abstract BlockHeaderFunctions getBlockHeaderFunctions();

@ -37,7 +37,7 @@ import org.hyperledger.besu.ethereum.core.Block;
import org.hyperledger.besu.ethereum.core.BlockBody; import org.hyperledger.besu.ethereum.core.BlockBody;
import org.hyperledger.besu.ethereum.core.BlockHeader; import org.hyperledger.besu.ethereum.core.BlockHeader;
import org.hyperledger.besu.ethereum.core.Difficulty; import org.hyperledger.besu.ethereum.core.Difficulty;
import org.hyperledger.besu.ethereum.core.MiningParameters; import org.hyperledger.besu.ethereum.core.MiningConfiguration;
import org.hyperledger.besu.ethereum.core.PrivacyParameters; import org.hyperledger.besu.ethereum.core.PrivacyParameters;
import org.hyperledger.besu.ethereum.eth.EthProtocolConfiguration; import org.hyperledger.besu.ethereum.eth.EthProtocolConfiguration;
import org.hyperledger.besu.ethereum.eth.sync.SynchronizerConfiguration; import org.hyperledger.besu.ethereum.eth.sync.SynchronizerConfiguration;
@ -95,7 +95,7 @@ public class CliqueBesuControllerBuilderTest {
TransactionPoolConfiguration.DEFAULT; TransactionPoolConfiguration.DEFAULT;
private final ObservableMetricsSystem observableMetricsSystem = new NoOpMetricsSystem(); private final ObservableMetricsSystem observableMetricsSystem = new NoOpMetricsSystem();
private final ObjectMapper objectMapper = new ObjectMapper(); private final ObjectMapper objectMapper = new ObjectMapper();
private final MiningParameters miningParameters = MiningParameters.newDefault(); private final MiningConfiguration miningConfiguration = MiningConfiguration.newDefault();
@TempDir Path tempDir; @TempDir Path tempDir;
@ -179,7 +179,7 @@ public class CliqueBesuControllerBuilderTest {
.synchronizerConfiguration(synchronizerConfiguration) .synchronizerConfiguration(synchronizerConfiguration)
.ethProtocolConfiguration(ethProtocolConfiguration) .ethProtocolConfiguration(ethProtocolConfiguration)
.networkId(networkId) .networkId(networkId)
.miningParameters(miningParameters) .miningParameters(miningConfiguration)
.metricsSystem(observableMetricsSystem) .metricsSystem(observableMetricsSystem)
.privacyParameters(privacyParameters) .privacyParameters(privacyParameters)
.dataDirectory(tempDir) .dataDirectory(tempDir)
@ -228,7 +228,7 @@ public class CliqueBesuControllerBuilderTest {
protocolContext.getBlockchain().appendBlock(block1, List.of()); protocolContext.getBlockchain().appendBlock(block1, List.of());
assertThat(miningParameters.getBlockPeriodSeconds()).isNotEmpty().hasValue(2); assertThat(miningConfiguration.getBlockPeriodSeconds()).isNotEmpty().hasValue(2);
assertThat(miningParameters.getBlockTxsSelectionMaxTime()).isEqualTo(2000 * 75 / 100); assertThat(miningConfiguration.getBlockTxsSelectionMaxTime()).isEqualTo(2000 * 75 / 100);
} }
} }

@ -32,7 +32,7 @@ import org.hyperledger.besu.ethereum.ProtocolContext;
import org.hyperledger.besu.ethereum.blockcreation.MiningCoordinator; import org.hyperledger.besu.ethereum.blockcreation.MiningCoordinator;
import org.hyperledger.besu.ethereum.chain.Blockchain; import org.hyperledger.besu.ethereum.chain.Blockchain;
import org.hyperledger.besu.ethereum.chain.MutableBlockchain; import org.hyperledger.besu.ethereum.chain.MutableBlockchain;
import org.hyperledger.besu.ethereum.core.MiningParameters; import org.hyperledger.besu.ethereum.core.MiningConfiguration;
import org.hyperledger.besu.ethereum.eth.manager.EthProtocolManager; import org.hyperledger.besu.ethereum.eth.manager.EthProtocolManager;
import org.hyperledger.besu.ethereum.eth.sync.state.SyncState; import org.hyperledger.besu.ethereum.eth.sync.state.SyncState;
import org.hyperledger.besu.ethereum.eth.transactions.TransactionPool; import org.hyperledger.besu.ethereum.eth.transactions.TransactionPool;
@ -135,7 +135,7 @@ public class ConsensusScheduleBesuControllerBuilderTest {
protocolSchedule1, protocolSchedule1,
mockProtocolContext, mockProtocolContext,
mock(TransactionPool.class), mock(TransactionPool.class),
mock(MiningParameters.class), mock(MiningConfiguration.class),
mock(SyncState.class), mock(SyncState.class),
mock(EthProtocolManager.class)); mock(EthProtocolManager.class));

@ -41,7 +41,7 @@ import org.hyperledger.besu.ethereum.core.BlockBody;
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.Difficulty; import org.hyperledger.besu.ethereum.core.Difficulty;
import org.hyperledger.besu.ethereum.core.MiningParameters; import org.hyperledger.besu.ethereum.core.MiningConfiguration;
import org.hyperledger.besu.ethereum.core.PrivacyParameters; import org.hyperledger.besu.ethereum.core.PrivacyParameters;
import org.hyperledger.besu.ethereum.eth.EthProtocolConfiguration; import org.hyperledger.besu.ethereum.eth.EthProtocolConfiguration;
import org.hyperledger.besu.ethereum.eth.sync.SynchronizerConfiguration; import org.hyperledger.besu.ethereum.eth.sync.SynchronizerConfiguration;
@ -95,7 +95,7 @@ public class MergeBesuControllerBuilderTest {
@Mock CheckpointConfigOptions checkpointConfigOptions; @Mock CheckpointConfigOptions checkpointConfigOptions;
@Mock(answer = Answers.RETURNS_DEEP_STUBS) @Mock(answer = Answers.RETURNS_DEEP_STUBS)
MiningParameters miningParameters; MiningConfiguration miningConfiguration;
@Mock PrivacyParameters privacyParameters; @Mock PrivacyParameters privacyParameters;
@Mock Clock clock; @Mock Clock clock;
@ -167,7 +167,7 @@ public class MergeBesuControllerBuilderTest {
lenient() lenient()
.when(worldStateKeyValueStorage.updater()) .when(worldStateKeyValueStorage.updater())
.thenReturn(mock(ForestWorldStateKeyValueStorage.Updater.class)); .thenReturn(mock(ForestWorldStateKeyValueStorage.Updater.class));
lenient().when(miningParameters.getTargetGasLimit()).thenReturn(OptionalLong.empty()); lenient().when(miningConfiguration.getTargetGasLimit()).thenReturn(OptionalLong.empty());
besuControllerBuilder = visitWithMockConfigs(new MergeBesuControllerBuilder()); besuControllerBuilder = visitWithMockConfigs(new MergeBesuControllerBuilder());
} }
@ -179,7 +179,7 @@ public class MergeBesuControllerBuilderTest {
.genesisConfigFile(genesisConfigFile) .genesisConfigFile(genesisConfigFile)
.synchronizerConfiguration(synchronizerConfiguration) .synchronizerConfiguration(synchronizerConfiguration)
.ethProtocolConfiguration(ethProtocolConfiguration) .ethProtocolConfiguration(ethProtocolConfiguration)
.miningParameters(miningParameters) .miningParameters(miningConfiguration)
.metricsSystem(observableMetricsSystem) .metricsSystem(observableMetricsSystem)
.privacyParameters(privacyParameters) .privacyParameters(privacyParameters)
.dataDirectory(tempDir) .dataDirectory(tempDir)

@ -32,7 +32,7 @@ import org.hyperledger.besu.datatypes.Address;
import org.hyperledger.besu.ethereum.ProtocolContext; import org.hyperledger.besu.ethereum.ProtocolContext;
import org.hyperledger.besu.ethereum.chain.MutableBlockchain; import org.hyperledger.besu.ethereum.chain.MutableBlockchain;
import org.hyperledger.besu.ethereum.core.BlockHeaderFunctions; import org.hyperledger.besu.ethereum.core.BlockHeaderFunctions;
import org.hyperledger.besu.ethereum.core.MiningParameters; import org.hyperledger.besu.ethereum.core.MiningConfiguration;
import org.hyperledger.besu.ethereum.mainnet.ProtocolSchedule; import org.hyperledger.besu.ethereum.mainnet.ProtocolSchedule;
import java.util.List; import java.util.List;
@ -107,7 +107,7 @@ public class QbftBesuControllerBuilderTest extends AbstractBftBesuControllerBuil
assertThatThrownBy( assertThatThrownBy(
() -> () ->
bftBesuControllerBuilder.createAdditionalJsonRpcMethodFactory( bftBesuControllerBuilder.createAdditionalJsonRpcMethodFactory(
protocolContext, protocolSchedule, MiningParameters.newDefault())) protocolContext, protocolSchedule, MiningConfiguration.newDefault()))
.isInstanceOf(NullPointerException.class) .isInstanceOf(NullPointerException.class)
.hasMessage("transactionValidatorProvider should have been initialised"); .hasMessage("transactionValidatorProvider should have been initialised");
} }

@ -35,10 +35,10 @@ import org.hyperledger.besu.ethereum.ProtocolContext;
import org.hyperledger.besu.ethereum.chain.MutableBlockchain; import org.hyperledger.besu.ethereum.chain.MutableBlockchain;
import org.hyperledger.besu.ethereum.core.BlockHeaderTestFixture; import org.hyperledger.besu.ethereum.core.BlockHeaderTestFixture;
import org.hyperledger.besu.ethereum.core.Difficulty; import org.hyperledger.besu.ethereum.core.Difficulty;
import org.hyperledger.besu.ethereum.core.ImmutableMiningParameters; import org.hyperledger.besu.ethereum.core.ImmutableMiningConfiguration;
import org.hyperledger.besu.ethereum.core.ImmutableMiningParameters.MutableInitValues; import org.hyperledger.besu.ethereum.core.ImmutableMiningConfiguration.MutableInitValues;
import org.hyperledger.besu.ethereum.core.InMemoryKeyValueStorageProvider; import org.hyperledger.besu.ethereum.core.InMemoryKeyValueStorageProvider;
import org.hyperledger.besu.ethereum.core.MiningParameters; import org.hyperledger.besu.ethereum.core.MiningConfiguration;
import org.hyperledger.besu.ethereum.eth.manager.EthProtocolManager; import org.hyperledger.besu.ethereum.eth.manager.EthProtocolManager;
import org.hyperledger.besu.ethereum.eth.sync.state.SyncState; import org.hyperledger.besu.ethereum.eth.sync.state.SyncState;
import org.hyperledger.besu.ethereum.eth.transactions.TransactionPool; import org.hyperledger.besu.ethereum.eth.transactions.TransactionPool;
@ -84,7 +84,7 @@ public class TransitionControllerBuilderTest {
CliqueBesuControllerBuilder cliqueBuilder = new CliqueBesuControllerBuilder(); CliqueBesuControllerBuilder cliqueBuilder = new CliqueBesuControllerBuilder();
BesuControllerBuilder powBuilder = new MainnetBesuControllerBuilder(); BesuControllerBuilder powBuilder = new MainnetBesuControllerBuilder();
MergeBesuControllerBuilder postMergeBuilder = new MergeBesuControllerBuilder(); MergeBesuControllerBuilder postMergeBuilder = new MergeBesuControllerBuilder();
MiningParameters miningParameters; MiningConfiguration miningConfiguration;
TransitionProtocolSchedule transitionProtocolSchedule; TransitionProtocolSchedule transitionProtocolSchedule;
@ -118,27 +118,27 @@ public class TransitionControllerBuilderTest {
.thenReturn(mergeContext); .thenReturn(mergeContext);
when(ethProtocolManager.ethContext().getScheduler()) when(ethProtocolManager.ethContext().getScheduler())
.thenReturn(new DeterministicEthScheduler()); .thenReturn(new DeterministicEthScheduler());
miningParameters = MiningParameters.newDefault(); miningConfiguration = MiningConfiguration.newDefault();
} }
@Test @Test
public void assertCliqueMiningOverridePreMerge() { public void assertCliqueMiningOverridePreMerge() {
assertThat(miningParameters.isMiningEnabled()).isFalse(); assertThat(miningConfiguration.isMiningEnabled()).isFalse();
var transCoordinator = buildTransitionCoordinator(cliqueBuilder, postMergeBuilder); var transCoordinator = buildTransitionCoordinator(cliqueBuilder, postMergeBuilder);
assertThat(transCoordinator.isMiningBeforeMerge()).isTrue(); assertThat(transCoordinator.isMiningBeforeMerge()).isTrue();
} }
@Test @Test
public void assertPoWIsNotMiningPreMerge() { public void assertPoWIsNotMiningPreMerge() {
assertThat(miningParameters.isMiningEnabled()).isFalse(); assertThat(miningConfiguration.isMiningEnabled()).isFalse();
var transCoordinator = buildTransitionCoordinator(powBuilder, postMergeBuilder); var transCoordinator = buildTransitionCoordinator(powBuilder, postMergeBuilder);
assertThat(transCoordinator.isMiningBeforeMerge()).isFalse(); assertThat(transCoordinator.isMiningBeforeMerge()).isFalse();
} }
@Test @Test
public void assertPowMiningPreMerge() { public void assertPowMiningPreMerge() {
miningParameters = miningConfiguration =
ImmutableMiningParameters.builder() ImmutableMiningConfiguration.builder()
.mutableInitValues(MutableInitValues.builder().isMiningEnabled(true).build()) .mutableInitValues(MutableInitValues.builder().isMiningEnabled(true).build())
.build(); .build();
var transCoordinator = buildTransitionCoordinator(powBuilder, postMergeBuilder); var transCoordinator = buildTransitionCoordinator(powBuilder, postMergeBuilder);
@ -273,7 +273,7 @@ public class TransitionControllerBuilderTest {
transitionProtocolSchedule, transitionProtocolSchedule,
protocolContext, protocolContext,
transactionPool, transactionPool,
miningParameters, miningConfiguration,
syncState, syncState,
ethProtocolManager); ethProtocolManager);

@ -36,7 +36,7 @@ import org.hyperledger.besu.ethereum.core.BlockBody;
import org.hyperledger.besu.ethereum.core.BlockDataGenerator; import org.hyperledger.besu.ethereum.core.BlockDataGenerator;
import org.hyperledger.besu.ethereum.core.BlockHeaderTestFixture; import org.hyperledger.besu.ethereum.core.BlockHeaderTestFixture;
import org.hyperledger.besu.ethereum.core.Difficulty; import org.hyperledger.besu.ethereum.core.Difficulty;
import org.hyperledger.besu.ethereum.core.MiningParameters; import org.hyperledger.besu.ethereum.core.MiningConfiguration;
import org.hyperledger.besu.ethereum.core.MutableWorldState; import org.hyperledger.besu.ethereum.core.MutableWorldState;
import org.hyperledger.besu.ethereum.core.TransactionReceipt; import org.hyperledger.besu.ethereum.core.TransactionReceipt;
import org.hyperledger.besu.ethereum.core.TransactionTestFixture; import org.hyperledger.besu.ethereum.core.TransactionTestFixture;
@ -173,7 +173,7 @@ public class BesuEventsImplTest {
syncState, syncState,
txPoolConfig, txPoolConfig,
new BlobCache(), new BlobCache(),
MiningParameters.newDefault()); MiningConfiguration.newDefault());
serviceImpl = serviceImpl =
new BesuEventsImpl( new BesuEventsImpl(

@ -31,7 +31,7 @@ import org.hyperledger.besu.ethereum.api.query.BlockchainQueries;
import org.hyperledger.besu.ethereum.chain.MutableBlockchain; import org.hyperledger.besu.ethereum.chain.MutableBlockchain;
import org.hyperledger.besu.ethereum.core.Block; import org.hyperledger.besu.ethereum.core.Block;
import org.hyperledger.besu.ethereum.core.BlockchainSetupUtil; import org.hyperledger.besu.ethereum.core.BlockchainSetupUtil;
import org.hyperledger.besu.ethereum.core.MiningParameters; import org.hyperledger.besu.ethereum.core.MiningConfiguration;
import org.hyperledger.besu.ethereum.worldstate.WorldStateArchive; import org.hyperledger.besu.ethereum.worldstate.WorldStateArchive;
import org.hyperledger.besu.evm.log.Log; import org.hyperledger.besu.evm.log.Log;
import org.hyperledger.besu.evm.worldstate.WorldView; import org.hyperledger.besu.evm.worldstate.WorldView;
@ -80,7 +80,7 @@ class TraceServiceImplTest {
blockchainSetupUtil.getProtocolSchedule(), blockchainSetupUtil.getProtocolSchedule(),
blockchain, blockchain,
worldStateArchive, worldStateArchive,
MiningParameters.newDefault()); MiningConfiguration.newDefault());
traceService = traceService =
new TraceServiceImpl(blockchainQueries, blockchainSetupUtil.getProtocolSchedule()); new TraceServiceImpl(blockchainQueries, blockchainSetupUtil.getProtocolSchedule());
} }

@ -22,7 +22,7 @@ import org.hyperledger.besu.cryptoservices.NodeKey;
import org.hyperledger.besu.datatypes.Address; import org.hyperledger.besu.datatypes.Address;
import org.hyperledger.besu.datatypes.Wei; import org.hyperledger.besu.datatypes.Wei;
import org.hyperledger.besu.ethereum.chain.BadBlockManager; import org.hyperledger.besu.ethereum.chain.BadBlockManager;
import org.hyperledger.besu.ethereum.core.MiningParameters; import org.hyperledger.besu.ethereum.core.MiningConfiguration;
import org.hyperledger.besu.ethereum.core.PrivacyParameters; import org.hyperledger.besu.ethereum.core.PrivacyParameters;
import org.hyperledger.besu.ethereum.core.Util; import org.hyperledger.besu.ethereum.core.Util;
import org.hyperledger.besu.ethereum.mainnet.BlockHeaderValidator; import org.hyperledger.besu.ethereum.mainnet.BlockHeaderValidator;
@ -63,7 +63,7 @@ public class CliqueProtocolSchedule {
* @param privacyParameters the privacy parameters * @param privacyParameters the privacy parameters
* @param isRevertReasonEnabled the is revert reason enabled * @param isRevertReasonEnabled the is revert reason enabled
* @param evmConfiguration the evm configuration * @param evmConfiguration the evm configuration
* @param miningParameters the mining parameters * @param miningConfiguration the mining parameters
* @param badBlockManager the cache to use to keep invalid blocks * @param badBlockManager the cache to use to keep invalid blocks
* @param isParallelTxProcessingEnabled indicates whether parallel transaction is enabled * @param isParallelTxProcessingEnabled indicates whether parallel transaction is enabled
* @param metricsSystem A metricSystem instance to be able to expose metrics in the underlying * @param metricsSystem A metricSystem instance to be able to expose metrics in the underlying
@ -77,7 +77,7 @@ public class CliqueProtocolSchedule {
final PrivacyParameters privacyParameters, final PrivacyParameters privacyParameters,
final boolean isRevertReasonEnabled, final boolean isRevertReasonEnabled,
final EvmConfiguration evmConfiguration, final EvmConfiguration evmConfiguration,
final MiningParameters miningParameters, final MiningConfiguration miningConfiguration,
final BadBlockManager badBlockManager, final BadBlockManager badBlockManager,
final boolean isParallelTxProcessingEnabled, final boolean isParallelTxProcessingEnabled,
final MetricsSystem metricsSystem) { final MetricsSystem metricsSystem) {
@ -115,7 +115,7 @@ public class CliqueProtocolSchedule {
privacyParameters, privacyParameters,
isRevertReasonEnabled, isRevertReasonEnabled,
evmConfiguration, evmConfiguration,
miningParameters, miningConfiguration,
badBlockManager, badBlockManager,
isParallelTxProcessingEnabled, isParallelTxProcessingEnabled,
metricsSystem) metricsSystem)
@ -130,7 +130,7 @@ public class CliqueProtocolSchedule {
* @param nodeKey the node key * @param nodeKey the node key
* @param isRevertReasonEnabled the is revert reason enabled * @param isRevertReasonEnabled the is revert reason enabled
* @param evmConfiguration the evm configuration * @param evmConfiguration the evm configuration
* @param miningParameters the mining parameters * @param miningConfiguration the mining parameters
* @param badBlockManager the cache to use to keep invalid blocks * @param badBlockManager the cache to use to keep invalid blocks
* @param isParallelTxProcessingEnabled indicates whether parallel transaction is enabled * @param isParallelTxProcessingEnabled indicates whether parallel transaction is enabled
* @param metricsSystem A metricSystem instance to be able to expose metrics in the underlying * @param metricsSystem A metricSystem instance to be able to expose metrics in the underlying
@ -144,7 +144,7 @@ public class CliqueProtocolSchedule {
final NodeKey nodeKey, final NodeKey nodeKey,
final boolean isRevertReasonEnabled, final boolean isRevertReasonEnabled,
final EvmConfiguration evmConfiguration, final EvmConfiguration evmConfiguration,
final MiningParameters miningParameters, final MiningConfiguration miningConfiguration,
final BadBlockManager badBlockManager, final BadBlockManager badBlockManager,
final boolean isParallelTxProcessingEnabled, final boolean isParallelTxProcessingEnabled,
final MetricsSystem metricsSystem) { final MetricsSystem metricsSystem) {
@ -155,7 +155,7 @@ public class CliqueProtocolSchedule {
PrivacyParameters.DEFAULT, PrivacyParameters.DEFAULT,
isRevertReasonEnabled, isRevertReasonEnabled,
evmConfiguration, evmConfiguration,
miningParameters, miningConfiguration,
badBlockManager, badBlockManager,
isParallelTxProcessingEnabled, isParallelTxProcessingEnabled,
metricsSystem); metricsSystem);

@ -29,7 +29,7 @@ import org.hyperledger.besu.ethereum.blockcreation.AbstractBlockCreator;
import org.hyperledger.besu.ethereum.core.BlockHeader; import org.hyperledger.besu.ethereum.core.BlockHeader;
import org.hyperledger.besu.ethereum.core.BlockHeaderBuilder; import org.hyperledger.besu.ethereum.core.BlockHeaderBuilder;
import org.hyperledger.besu.ethereum.core.BlockHeaderFunctions; import org.hyperledger.besu.ethereum.core.BlockHeaderFunctions;
import org.hyperledger.besu.ethereum.core.MiningParameters; import org.hyperledger.besu.ethereum.core.MiningConfiguration;
import org.hyperledger.besu.ethereum.core.SealableBlockHeader; import org.hyperledger.besu.ethereum.core.SealableBlockHeader;
import org.hyperledger.besu.ethereum.core.Util; import org.hyperledger.besu.ethereum.core.Util;
import org.hyperledger.besu.ethereum.eth.manager.EthScheduler; import org.hyperledger.besu.ethereum.eth.manager.EthScheduler;
@ -48,7 +48,7 @@ public class CliqueBlockCreator extends AbstractBlockCreator {
/** /**
* Instantiates a new Clique block creator. * Instantiates a new Clique block creator.
* *
* @param miningParameters the mining parameters * @param miningConfiguration the mining parameters
* @param extraDataCalculator the extra data calculator * @param extraDataCalculator the extra data calculator
* @param transactionPool the pending transactions * @param transactionPool the pending transactions
* @param protocolContext the protocol context * @param protocolContext the protocol context
@ -58,7 +58,7 @@ public class CliqueBlockCreator extends AbstractBlockCreator {
* @param ethScheduler the scheduler for asynchronous block creation tasks * @param ethScheduler the scheduler for asynchronous block creation tasks
*/ */
public CliqueBlockCreator( public CliqueBlockCreator(
final MiningParameters miningParameters, final MiningConfiguration miningConfiguration,
final ExtraDataCalculator extraDataCalculator, final ExtraDataCalculator extraDataCalculator,
final TransactionPool transactionPool, final TransactionPool transactionPool,
final ProtocolContext protocolContext, final ProtocolContext protocolContext,
@ -67,7 +67,7 @@ public class CliqueBlockCreator extends AbstractBlockCreator {
final EpochManager epochManager, final EpochManager epochManager,
final EthScheduler ethScheduler) { final EthScheduler ethScheduler) {
super( super(
miningParameters, miningConfiguration,
__ -> Util.publicKeyToAddress(nodeKey.getPublicKey()), __ -> Util.publicKeyToAddress(nodeKey.getPublicKey()),
extraDataCalculator, extraDataCalculator,
transactionPool, transactionPool,

@ -28,7 +28,7 @@ import org.hyperledger.besu.ethereum.blockcreation.AbstractMinerExecutor;
import org.hyperledger.besu.ethereum.chain.MinedBlockObserver; import org.hyperledger.besu.ethereum.chain.MinedBlockObserver;
import org.hyperledger.besu.ethereum.chain.PoWObserver; import org.hyperledger.besu.ethereum.chain.PoWObserver;
import org.hyperledger.besu.ethereum.core.BlockHeader; import org.hyperledger.besu.ethereum.core.BlockHeader;
import org.hyperledger.besu.ethereum.core.MiningParameters; import org.hyperledger.besu.ethereum.core.MiningConfiguration;
import org.hyperledger.besu.ethereum.core.Util; import org.hyperledger.besu.ethereum.core.Util;
import org.hyperledger.besu.ethereum.eth.manager.EthScheduler; import org.hyperledger.besu.ethereum.eth.manager.EthScheduler;
import org.hyperledger.besu.ethereum.eth.transactions.TransactionPool; import org.hyperledger.besu.ethereum.eth.transactions.TransactionPool;
@ -70,7 +70,7 @@ public class CliqueMinerExecutor extends AbstractMinerExecutor<CliqueBlockMiner>
final ProtocolSchedule protocolSchedule, final ProtocolSchedule protocolSchedule,
final TransactionPool transactionPool, final TransactionPool transactionPool,
final NodeKey nodeKey, final NodeKey nodeKey,
final MiningParameters miningParams, final MiningConfiguration miningParams,
final AbstractBlockScheduler blockScheduler, final AbstractBlockScheduler blockScheduler,
final EpochManager epochManager, final EpochManager epochManager,
final ForksSchedule<CliqueConfigOptions> forksSchedule, final ForksSchedule<CliqueConfigOptions> forksSchedule,
@ -97,7 +97,7 @@ public class CliqueMinerExecutor extends AbstractMinerExecutor<CliqueBlockMiner>
final Function<BlockHeader, CliqueBlockCreator> blockCreator = final Function<BlockHeader, CliqueBlockCreator> blockCreator =
(header) -> (header) ->
new CliqueBlockCreator( new CliqueBlockCreator(
miningParameters, miningConfiguration,
this::calculateExtraData, this::calculateExtraData,
transactionPool, transactionPool,
protocolContext, protocolContext,
@ -119,7 +119,7 @@ public class CliqueMinerExecutor extends AbstractMinerExecutor<CliqueBlockMiner>
@Override @Override
public Optional<Address> getCoinbase() { public Optional<Address> getCoinbase() {
return miningParameters.getCoinbase(); return miningConfiguration.getCoinbase();
} }
/** /**
@ -134,7 +134,7 @@ public class CliqueMinerExecutor extends AbstractMinerExecutor<CliqueBlockMiner>
final Bytes vanityDataToInsert = final Bytes vanityDataToInsert =
ConsensusHelpers.zeroLeftPad( ConsensusHelpers.zeroLeftPad(
miningParameters.getExtraData(), CliqueExtraData.EXTRA_VANITY_LENGTH); miningConfiguration.getExtraData(), CliqueExtraData.EXTRA_VANITY_LENGTH);
// Building ON TOP of canonical head, if the next block is epoch, include validators. // Building ON TOP of canonical head, if the next block is epoch, include validators.
if (epochManager.isEpochBlock(parentHeader.getNumber() + 1)) { if (epochManager.isEpochBlock(parentHeader.getNumber() + 1)) {

@ -31,7 +31,7 @@ import org.hyperledger.besu.ethereum.api.jsonrpc.internal.methods.JsonRpcMethod;
import org.hyperledger.besu.ethereum.api.jsonrpc.methods.ApiGroupJsonRpcMethods; import org.hyperledger.besu.ethereum.api.jsonrpc.methods.ApiGroupJsonRpcMethods;
import org.hyperledger.besu.ethereum.api.query.BlockchainQueries; import org.hyperledger.besu.ethereum.api.query.BlockchainQueries;
import org.hyperledger.besu.ethereum.chain.MutableBlockchain; import org.hyperledger.besu.ethereum.chain.MutableBlockchain;
import org.hyperledger.besu.ethereum.core.MiningParameters; import org.hyperledger.besu.ethereum.core.MiningConfiguration;
import org.hyperledger.besu.ethereum.mainnet.ProtocolSchedule; import org.hyperledger.besu.ethereum.mainnet.ProtocolSchedule;
import org.hyperledger.besu.ethereum.worldstate.WorldStateArchive; import org.hyperledger.besu.ethereum.worldstate.WorldStateArchive;
@ -41,22 +41,22 @@ import java.util.Map;
public class CliqueJsonRpcMethods extends ApiGroupJsonRpcMethods { public class CliqueJsonRpcMethods extends ApiGroupJsonRpcMethods {
private final ProtocolContext context; private final ProtocolContext context;
private final ProtocolSchedule protocolSchedule; private final ProtocolSchedule protocolSchedule;
private final MiningParameters miningParameters; private final MiningConfiguration miningConfiguration;
/** /**
* Instantiates a new Clique json rpc methods. * Instantiates a new Clique json rpc methods.
* *
* @param context the protocol context * @param context the protocol context
* @param protocolSchedule the protocol schedule * @param protocolSchedule the protocol schedule
* @param miningParameters the mining parameters * @param miningConfiguration the mining parameters
*/ */
public CliqueJsonRpcMethods( public CliqueJsonRpcMethods(
final ProtocolContext context, final ProtocolContext context,
final ProtocolSchedule protocolSchedule, final ProtocolSchedule protocolSchedule,
final MiningParameters miningParameters) { final MiningConfiguration miningConfiguration) {
this.context = context; this.context = context;
this.protocolSchedule = protocolSchedule; this.protocolSchedule = protocolSchedule;
this.miningParameters = miningParameters; this.miningConfiguration = miningConfiguration;
} }
@Override @Override
@ -69,7 +69,7 @@ public class CliqueJsonRpcMethods extends ApiGroupJsonRpcMethods {
final MutableBlockchain blockchain = context.getBlockchain(); final MutableBlockchain blockchain = context.getBlockchain();
final WorldStateArchive worldStateArchive = context.getWorldStateArchive(); final WorldStateArchive worldStateArchive = context.getWorldStateArchive();
final BlockchainQueries blockchainQueries = final BlockchainQueries blockchainQueries =
new BlockchainQueries(protocolSchedule, blockchain, worldStateArchive, miningParameters); new BlockchainQueries(protocolSchedule, blockchain, worldStateArchive, miningConfiguration);
final ValidatorProvider validatorProvider = final ValidatorProvider validatorProvider =
context.getConsensusContext(CliqueContext.class).getValidatorProvider(); context.getConsensusContext(CliqueContext.class).getValidatorProvider();

@ -32,7 +32,7 @@ import org.hyperledger.besu.datatypes.Wei;
import org.hyperledger.besu.ethereum.chain.BadBlockManager; import org.hyperledger.besu.ethereum.chain.BadBlockManager;
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.MiningConfiguration;
import org.hyperledger.besu.ethereum.mainnet.HeaderValidationMode; import org.hyperledger.besu.ethereum.mainnet.HeaderValidationMode;
import org.hyperledger.besu.ethereum.mainnet.ProtocolSchedule; import org.hyperledger.besu.ethereum.mainnet.ProtocolSchedule;
import org.hyperledger.besu.ethereum.mainnet.ProtocolSpec; import org.hyperledger.besu.ethereum.mainnet.ProtocolSpec;
@ -68,7 +68,7 @@ public class CliqueProtocolScheduleTest {
NODE_KEY, NODE_KEY,
false, false,
EvmConfiguration.DEFAULT, EvmConfiguration.DEFAULT,
MiningParameters.MINING_DISABLED, MiningConfiguration.MINING_DISABLED,
new BadBlockManager(), new BadBlockManager(),
false, false,
new NoOpMetricsSystem()); new NoOpMetricsSystem());
@ -94,7 +94,7 @@ public class CliqueProtocolScheduleTest {
NODE_KEY, NODE_KEY,
false, false,
EvmConfiguration.DEFAULT, EvmConfiguration.DEFAULT,
MiningParameters.MINING_DISABLED, MiningConfiguration.MINING_DISABLED,
new BadBlockManager(), new BadBlockManager(),
false, false,
new NoOpMetricsSystem()) new NoOpMetricsSystem())
@ -120,7 +120,7 @@ public class CliqueProtocolScheduleTest {
NODE_KEY, NODE_KEY,
false, false,
EvmConfiguration.DEFAULT, EvmConfiguration.DEFAULT,
MiningParameters.MINING_DISABLED, MiningConfiguration.MINING_DISABLED,
new BadBlockManager(), new BadBlockManager(),
false, false,
new NoOpMetricsSystem())) new NoOpMetricsSystem()))
@ -142,7 +142,7 @@ public class CliqueProtocolScheduleTest {
NODE_KEY, NODE_KEY,
false, false,
EvmConfiguration.DEFAULT, EvmConfiguration.DEFAULT,
MiningParameters.MINING_DISABLED, MiningConfiguration.MINING_DISABLED,
new BadBlockManager(), new BadBlockManager(),
false, false,
new NoOpMetricsSystem())) new NoOpMetricsSystem()))
@ -168,7 +168,7 @@ public class CliqueProtocolScheduleTest {
NODE_KEY, NODE_KEY,
false, false,
EvmConfiguration.DEFAULT, EvmConfiguration.DEFAULT,
MiningParameters.MINING_DISABLED, MiningConfiguration.MINING_DISABLED,
new BadBlockManager(), new BadBlockManager(),
false, false,
new NoOpMetricsSystem()); new NoOpMetricsSystem());

@ -49,9 +49,9 @@ import org.hyperledger.besu.ethereum.core.AddressHelpers;
import org.hyperledger.besu.ethereum.core.Block; import org.hyperledger.besu.ethereum.core.Block;
import org.hyperledger.besu.ethereum.core.BlockBody; import org.hyperledger.besu.ethereum.core.BlockBody;
import org.hyperledger.besu.ethereum.core.BlockHeaderTestFixture; import org.hyperledger.besu.ethereum.core.BlockHeaderTestFixture;
import org.hyperledger.besu.ethereum.core.ImmutableMiningParameters; import org.hyperledger.besu.ethereum.core.ImmutableMiningConfiguration;
import org.hyperledger.besu.ethereum.core.ImmutableMiningParameters.MutableInitValues; import org.hyperledger.besu.ethereum.core.ImmutableMiningConfiguration.MutableInitValues;
import org.hyperledger.besu.ethereum.core.MiningParameters; import org.hyperledger.besu.ethereum.core.MiningConfiguration;
import org.hyperledger.besu.ethereum.core.Util; import org.hyperledger.besu.ethereum.core.Util;
import org.hyperledger.besu.ethereum.eth.manager.EthContext; import org.hyperledger.besu.ethereum.eth.manager.EthContext;
import org.hyperledger.besu.ethereum.eth.manager.EthScheduler; import org.hyperledger.besu.ethereum.eth.manager.EthScheduler;
@ -106,7 +106,7 @@ public class CliqueBlockCreatorTest {
proposerNodeKey, proposerNodeKey,
false, false,
EvmConfiguration.DEFAULT, EvmConfiguration.DEFAULT,
MiningParameters.MINING_DISABLED, MiningConfiguration.MINING_DISABLED,
new BadBlockManager(), new BadBlockManager(),
false, false,
new NoOpMetricsSystem()); new NoOpMetricsSystem());
@ -146,11 +146,11 @@ public class CliqueBlockCreatorTest {
final Address coinbase = AddressHelpers.ofValue(1); final Address coinbase = AddressHelpers.ofValue(1);
final MiningParameters miningParameters = createMiningParameters(extraData, coinbase); final MiningConfiguration miningConfiguration = createMiningParameters(extraData, coinbase);
final CliqueBlockCreator blockCreator = final CliqueBlockCreator blockCreator =
new CliqueBlockCreator( new CliqueBlockCreator(
miningParameters, miningConfiguration,
parent -> extraData, parent -> extraData,
createTransactionPool(), createTransactionPool(),
protocolContext, protocolContext,
@ -175,11 +175,11 @@ public class CliqueBlockCreatorTest {
when(voteProvider.getVoteAfterBlock(any(), any())) when(voteProvider.getVoteAfterBlock(any(), any()))
.thenReturn(Optional.of(new ValidatorVote(VoteType.ADD, coinbase, a1))); .thenReturn(Optional.of(new ValidatorVote(VoteType.ADD, coinbase, a1)));
final MiningParameters miningParameters = createMiningParameters(extraData, coinbase); final MiningConfiguration miningConfiguration = createMiningParameters(extraData, coinbase);
final CliqueBlockCreator blockCreator = final CliqueBlockCreator blockCreator =
new CliqueBlockCreator( new CliqueBlockCreator(
miningParameters, miningConfiguration,
parent -> extraData, parent -> extraData,
createTransactionPool(), createTransactionPool(),
protocolContext, protocolContext,
@ -209,11 +209,11 @@ public class CliqueBlockCreatorTest {
when(mockVoteProvider.getVoteAfterBlock(any(), any())) when(mockVoteProvider.getVoteAfterBlock(any(), any()))
.thenReturn(Optional.of(new ValidatorVote(VoteType.ADD, coinbase, a1))); .thenReturn(Optional.of(new ValidatorVote(VoteType.ADD, coinbase, a1)));
final MiningParameters miningParameters = createMiningParameters(extraData, coinbase); final MiningConfiguration miningConfiguration = createMiningParameters(extraData, coinbase);
final CliqueBlockCreator blockCreator = final CliqueBlockCreator blockCreator =
new CliqueBlockCreator( new CliqueBlockCreator(
miningParameters, miningConfiguration,
parent -> extraData, parent -> extraData,
createTransactionPool(), createTransactionPool(),
protocolContext, protocolContext,
@ -252,10 +252,10 @@ public class CliqueBlockCreatorTest {
return transactionPool; return transactionPool;
} }
private static MiningParameters createMiningParameters( private static MiningConfiguration createMiningParameters(
final Bytes extraData, final Address coinbase) { final Bytes extraData, final Address coinbase) {
final MiningParameters miningParameters = final MiningConfiguration miningConfiguration =
ImmutableMiningParameters.builder() ImmutableMiningConfiguration.builder()
.mutableInitValues( .mutableInitValues(
MutableInitValues.builder() MutableInitValues.builder()
.extraData(extraData) .extraData(extraData)
@ -264,6 +264,6 @@ public class CliqueBlockCreatorTest {
.coinbase(coinbase) .coinbase(coinbase)
.build()) .build())
.build(); .build();
return miningParameters; return miningConfiguration;
} }
} }

@ -39,9 +39,9 @@ import org.hyperledger.besu.ethereum.chain.BadBlockManager;
import org.hyperledger.besu.ethereum.core.AddressHelpers; import org.hyperledger.besu.ethereum.core.AddressHelpers;
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.ImmutableMiningParameters; import org.hyperledger.besu.ethereum.core.ImmutableMiningConfiguration;
import org.hyperledger.besu.ethereum.core.ImmutableMiningParameters.MutableInitValues; import org.hyperledger.besu.ethereum.core.ImmutableMiningConfiguration.MutableInitValues;
import org.hyperledger.besu.ethereum.core.MiningParameters; import org.hyperledger.besu.ethereum.core.MiningConfiguration;
import org.hyperledger.besu.ethereum.core.Util; import org.hyperledger.besu.ethereum.core.Util;
import org.hyperledger.besu.ethereum.eth.manager.EthContext; import org.hyperledger.besu.ethereum.eth.manager.EthContext;
import org.hyperledger.besu.ethereum.eth.manager.EthScheduler; import org.hyperledger.besu.ethereum.eth.manager.EthScheduler;
@ -105,7 +105,7 @@ public class CliqueMinerExecutorTest {
proposerNodeKey, proposerNodeKey,
false, false,
EvmConfiguration.DEFAULT, EvmConfiguration.DEFAULT,
MiningParameters.MINING_DISABLED, MiningConfiguration.MINING_DISABLED,
new BadBlockManager(), new BadBlockManager(),
false, false,
new NoOpMetricsSystem()); new NoOpMetricsSystem());
@ -117,7 +117,7 @@ public class CliqueMinerExecutorTest {
public void extraDataCreatedOnEpochBlocksContainsValidators() { public void extraDataCreatedOnEpochBlocksContainsValidators() {
final Bytes vanityData = generateRandomVanityData(); final Bytes vanityData = generateRandomVanityData();
final MiningParameters miningParameters = createMiningParameters(vanityData); final MiningConfiguration miningConfiguration = createMiningParameters(vanityData);
final CliqueMinerExecutor executor = final CliqueMinerExecutor executor =
new CliqueMinerExecutor( new CliqueMinerExecutor(
@ -125,7 +125,7 @@ public class CliqueMinerExecutorTest {
cliqueProtocolSchedule, cliqueProtocolSchedule,
createTransactionPool(), createTransactionPool(),
proposerNodeKey, proposerNodeKey,
miningParameters, miningConfiguration,
mock(CliqueBlockScheduler.class), mock(CliqueBlockScheduler.class),
new EpochManager(EPOCH_LENGTH), new EpochManager(EPOCH_LENGTH),
null, null,
@ -153,7 +153,7 @@ public class CliqueMinerExecutorTest {
public void extraDataForNonEpochBlocksDoesNotContainValidaors() { public void extraDataForNonEpochBlocksDoesNotContainValidaors() {
final Bytes vanityData = generateRandomVanityData(); final Bytes vanityData = generateRandomVanityData();
final MiningParameters miningParameters = createMiningParameters(vanityData); final MiningConfiguration miningConfiguration = createMiningParameters(vanityData);
final CliqueMinerExecutor executor = final CliqueMinerExecutor executor =
new CliqueMinerExecutor( new CliqueMinerExecutor(
@ -161,7 +161,7 @@ public class CliqueMinerExecutorTest {
cliqueProtocolSchedule, cliqueProtocolSchedule,
createTransactionPool(), createTransactionPool(),
proposerNodeKey, proposerNodeKey,
miningParameters, miningConfiguration,
mock(CliqueBlockScheduler.class), mock(CliqueBlockScheduler.class),
new EpochManager(EPOCH_LENGTH), new EpochManager(EPOCH_LENGTH),
null, null,
@ -189,7 +189,7 @@ public class CliqueMinerExecutorTest {
final Bytes initialVanityData = generateRandomVanityData(); final Bytes initialVanityData = generateRandomVanityData();
final Bytes modifiedVanityData = generateRandomVanityData(); final Bytes modifiedVanityData = generateRandomVanityData();
final MiningParameters miningParameters = createMiningParameters(initialVanityData); final MiningConfiguration miningConfiguration = createMiningParameters(initialVanityData);
final CliqueMinerExecutor executor = final CliqueMinerExecutor executor =
new CliqueMinerExecutor( new CliqueMinerExecutor(
@ -197,13 +197,13 @@ public class CliqueMinerExecutorTest {
cliqueProtocolSchedule, cliqueProtocolSchedule,
createTransactionPool(), createTransactionPool(),
proposerNodeKey, proposerNodeKey,
miningParameters, miningConfiguration,
mock(CliqueBlockScheduler.class), mock(CliqueBlockScheduler.class),
new EpochManager(EPOCH_LENGTH), new EpochManager(EPOCH_LENGTH),
null, null,
ethScheduler); ethScheduler);
miningParameters.setExtraData(modifiedVanityData); miningConfiguration.setExtraData(modifiedVanityData);
final Bytes extraDataBytes = executor.calculateExtraData(blockHeaderBuilder.buildHeader()); final Bytes extraDataBytes = executor.calculateExtraData(blockHeaderBuilder.buildHeader());
final CliqueExtraData cliqueExtraData = final CliqueExtraData cliqueExtraData =
@ -253,8 +253,8 @@ public class CliqueMinerExecutorTest {
return Bytes.wrap(vanityData); return Bytes.wrap(vanityData);
} }
private static MiningParameters createMiningParameters(final Bytes vanityData) { private static MiningConfiguration createMiningParameters(final Bytes vanityData) {
return ImmutableMiningParameters.builder() return ImmutableMiningConfiguration.builder()
.mutableInitValues( .mutableInitValues(
MutableInitValues.builder() MutableInitValues.builder()
.extraData(vanityData) .extraData(vanityData)

@ -19,7 +19,7 @@ import org.hyperledger.besu.config.GenesisConfigOptions;
import org.hyperledger.besu.consensus.common.ForksSchedule; import org.hyperledger.besu.consensus.common.ForksSchedule;
import org.hyperledger.besu.datatypes.Wei; import org.hyperledger.besu.datatypes.Wei;
import org.hyperledger.besu.ethereum.chain.BadBlockManager; import org.hyperledger.besu.ethereum.chain.BadBlockManager;
import org.hyperledger.besu.ethereum.core.MiningParameters; import org.hyperledger.besu.ethereum.core.MiningConfiguration;
import org.hyperledger.besu.ethereum.core.PrivacyParameters; import org.hyperledger.besu.ethereum.core.PrivacyParameters;
import org.hyperledger.besu.ethereum.mainnet.BlockHeaderValidator; import org.hyperledger.besu.ethereum.mainnet.BlockHeaderValidator;
import org.hyperledger.besu.ethereum.mainnet.DefaultProtocolSchedule; import org.hyperledger.besu.ethereum.mainnet.DefaultProtocolSchedule;
@ -58,7 +58,7 @@ public abstract class BaseBftProtocolScheduleBuilder {
* @param isRevertReasonEnabled the is revert reason enabled * @param isRevertReasonEnabled the is revert reason enabled
* @param bftExtraDataCodec the bft extra data codec * @param bftExtraDataCodec the bft extra data codec
* @param evmConfiguration the evm configuration * @param evmConfiguration the evm configuration
* @param miningParameters the mining parameters * @param miningConfiguration the mining parameters
* @param badBlockManager the cache to use to keep invalid blocks * @param badBlockManager the cache to use to keep invalid blocks
* @param isParallelTxProcessingEnabled indicates whether parallel transaction is enabled. * @param isParallelTxProcessingEnabled indicates whether parallel transaction is enabled.
* @param metricsSystem metricsSystem A metricSystem instance to be able to expose metrics in the * @param metricsSystem metricsSystem A metricSystem instance to be able to expose metrics in the
@ -72,7 +72,7 @@ public abstract class BaseBftProtocolScheduleBuilder {
final boolean isRevertReasonEnabled, final boolean isRevertReasonEnabled,
final BftExtraDataCodec bftExtraDataCodec, final BftExtraDataCodec bftExtraDataCodec,
final EvmConfiguration evmConfiguration, final EvmConfiguration evmConfiguration,
final MiningParameters miningParameters, final MiningConfiguration miningConfiguration,
final BadBlockManager badBlockManager, final BadBlockManager badBlockManager,
final boolean isParallelTxProcessingEnabled, final boolean isParallelTxProcessingEnabled,
final MetricsSystem metricsSystem) { final MetricsSystem metricsSystem) {
@ -96,7 +96,7 @@ public abstract class BaseBftProtocolScheduleBuilder {
privacyParameters, privacyParameters,
isRevertReasonEnabled, isRevertReasonEnabled,
evmConfiguration, evmConfiguration,
miningParameters, miningConfiguration,
badBlockManager, badBlockManager,
isParallelTxProcessingEnabled, isParallelTxProcessingEnabled,
metricsSystem) metricsSystem)

@ -25,7 +25,7 @@ import org.hyperledger.besu.ethereum.ProtocolContext;
import org.hyperledger.besu.ethereum.blockcreation.AbstractBlockCreator; import org.hyperledger.besu.ethereum.blockcreation.AbstractBlockCreator;
import org.hyperledger.besu.ethereum.core.BlockHeader; import org.hyperledger.besu.ethereum.core.BlockHeader;
import org.hyperledger.besu.ethereum.core.BlockHeaderBuilder; import org.hyperledger.besu.ethereum.core.BlockHeaderBuilder;
import org.hyperledger.besu.ethereum.core.MiningParameters; import org.hyperledger.besu.ethereum.core.MiningConfiguration;
import org.hyperledger.besu.ethereum.core.SealableBlockHeader; import org.hyperledger.besu.ethereum.core.SealableBlockHeader;
import org.hyperledger.besu.ethereum.eth.manager.EthScheduler; import org.hyperledger.besu.ethereum.eth.manager.EthScheduler;
import org.hyperledger.besu.ethereum.eth.transactions.TransactionPool; import org.hyperledger.besu.ethereum.eth.transactions.TransactionPool;
@ -46,7 +46,7 @@ public class BftBlockCreator extends AbstractBlockCreator {
/** /**
* Instantiates a new Bft block creator. * Instantiates a new Bft block creator.
* *
* @param miningParameters the mining parameters * @param miningConfiguration the mining parameters
* @param forksSchedule the forks schedule * @param forksSchedule the forks schedule
* @param localAddress the local address * @param localAddress the local address
* @param extraDataCalculator the extra data calculator * @param extraDataCalculator the extra data calculator
@ -57,7 +57,7 @@ public class BftBlockCreator extends AbstractBlockCreator {
* @param ethScheduler the scheduler for asynchronous block creation tasks * @param ethScheduler the scheduler for asynchronous block creation tasks
*/ */
public BftBlockCreator( public BftBlockCreator(
final MiningParameters miningParameters, final MiningConfiguration miningConfiguration,
final ForksSchedule<? extends BftConfigOptions> forksSchedule, final ForksSchedule<? extends BftConfigOptions> forksSchedule,
final Address localAddress, final Address localAddress,
final ExtraDataCalculator extraDataCalculator, final ExtraDataCalculator extraDataCalculator,
@ -67,7 +67,7 @@ public class BftBlockCreator extends AbstractBlockCreator {
final BftExtraDataCodec bftExtraDataCodec, final BftExtraDataCodec bftExtraDataCodec,
final EthScheduler ethScheduler) { final EthScheduler ethScheduler) {
super( super(
miningParameters.setCoinbase(localAddress), miningConfiguration.setCoinbase(localAddress),
miningBeneficiaryCalculator(localAddress, forksSchedule), miningBeneficiaryCalculator(localAddress, forksSchedule),
extraDataCalculator, extraDataCalculator,
transactionPool, transactionPool,

@ -31,7 +31,7 @@ import org.hyperledger.besu.datatypes.Wei;
import org.hyperledger.besu.ethereum.ProtocolContext; import org.hyperledger.besu.ethereum.ProtocolContext;
import org.hyperledger.besu.ethereum.blockcreation.BlockCreator; import org.hyperledger.besu.ethereum.blockcreation.BlockCreator;
import org.hyperledger.besu.ethereum.core.BlockHeader; import org.hyperledger.besu.ethereum.core.BlockHeader;
import org.hyperledger.besu.ethereum.core.MiningParameters; import org.hyperledger.besu.ethereum.core.MiningConfiguration;
import org.hyperledger.besu.ethereum.eth.manager.EthScheduler; import org.hyperledger.besu.ethereum.eth.manager.EthScheduler;
import org.hyperledger.besu.ethereum.eth.transactions.TransactionPool; import org.hyperledger.besu.ethereum.eth.transactions.TransactionPool;
import org.hyperledger.besu.ethereum.mainnet.AbstractGasLimitSpecification; import org.hyperledger.besu.ethereum.mainnet.AbstractGasLimitSpecification;
@ -54,7 +54,7 @@ public class BftBlockCreatorFactory<T extends BftConfigOptions> {
protected final ForksSchedule<T> forksSchedule; protected final ForksSchedule<T> forksSchedule;
/** The Mining parameters */ /** The Mining parameters */
protected final MiningParameters miningParameters; protected final MiningConfiguration miningConfiguration;
private final TransactionPool transactionPool; private final TransactionPool transactionPool;
@ -89,7 +89,7 @@ public class BftBlockCreatorFactory<T extends BftConfigOptions> {
final ProtocolContext protocolContext, final ProtocolContext protocolContext,
final ProtocolSchedule protocolSchedule, final ProtocolSchedule protocolSchedule,
final ForksSchedule<T> forksSchedule, final ForksSchedule<T> forksSchedule,
final MiningParameters miningParams, final MiningConfiguration miningParams,
final Address localAddress, final Address localAddress,
final BftExtraDataCodec bftExtraDataCodec, final BftExtraDataCodec bftExtraDataCodec,
final EthScheduler ethScheduler) { final EthScheduler ethScheduler) {
@ -98,7 +98,7 @@ public class BftBlockCreatorFactory<T extends BftConfigOptions> {
this.protocolSchedule = protocolSchedule; this.protocolSchedule = protocolSchedule;
this.forksSchedule = forksSchedule; this.forksSchedule = forksSchedule;
this.localAddress = localAddress; this.localAddress = localAddress;
this.miningParameters = miningParams; this.miningConfiguration = miningParams;
this.bftExtraDataCodec = bftExtraDataCodec; this.bftExtraDataCodec = bftExtraDataCodec;
this.ethScheduler = ethScheduler; this.ethScheduler = ethScheduler;
} }
@ -111,7 +111,7 @@ public class BftBlockCreatorFactory<T extends BftConfigOptions> {
*/ */
public BlockCreator create(final int round) { public BlockCreator create(final int round) {
return new BftBlockCreator( return new BftBlockCreator(
miningParameters, miningConfiguration,
forksSchedule, forksSchedule,
localAddress, localAddress,
ph -> createExtraData(round, ph), ph -> createExtraData(round, ph),
@ -128,7 +128,7 @@ public class BftBlockCreatorFactory<T extends BftConfigOptions> {
* @param minTransactionGasPrice the min transaction gas price * @param minTransactionGasPrice the min transaction gas price
*/ */
public void setMinTransactionGasPrice(final Wei minTransactionGasPrice) { public void setMinTransactionGasPrice(final Wei minTransactionGasPrice) {
miningParameters.setMinTransactionGasPrice(minTransactionGasPrice); miningConfiguration.setMinTransactionGasPrice(minTransactionGasPrice);
} }
/** /**
@ -137,7 +137,7 @@ public class BftBlockCreatorFactory<T extends BftConfigOptions> {
* @return the min transaction gas price * @return the min transaction gas price
*/ */
public Wei getMinTransactionGasPrice() { public Wei getMinTransactionGasPrice() {
return miningParameters.getMinTransactionGasPrice(); return miningConfiguration.getMinTransactionGasPrice();
} }
/** /**
@ -146,7 +146,7 @@ public class BftBlockCreatorFactory<T extends BftConfigOptions> {
* @return min priority fee per gas * @return min priority fee per gas
*/ */
public Wei getMinPriorityFeePerGas() { public Wei getMinPriorityFeePerGas() {
return miningParameters.getMinPriorityFeePerGas(); return miningConfiguration.getMinPriorityFeePerGas();
} }
/** /**
@ -171,7 +171,7 @@ public class BftBlockCreatorFactory<T extends BftConfigOptions> {
final BftExtraData extraData = final BftExtraData extraData =
new BftExtraData( new BftExtraData(
ConsensusHelpers.zeroLeftPad( ConsensusHelpers.zeroLeftPad(
miningParameters.getExtraData(), BftExtraDataCodec.EXTRA_VANITY_LENGTH), miningConfiguration.getExtraData(), BftExtraDataCodec.EXTRA_VANITY_LENGTH),
Collections.emptyList(), Collections.emptyList(),
toVote(proposal), toVote(proposal),
round, round,
@ -187,7 +187,7 @@ public class BftBlockCreatorFactory<T extends BftConfigOptions> {
*/ */
public void changeTargetGasLimit(final Long newTargetGasLimit) { public void changeTargetGasLimit(final Long newTargetGasLimit) {
if (AbstractGasLimitSpecification.isValidTargetGasLimit(newTargetGasLimit)) { if (AbstractGasLimitSpecification.isValidTargetGasLimit(newTargetGasLimit)) {
miningParameters.setTargetGasLimit(newTargetGasLimit); miningConfiguration.setTargetGasLimit(newTargetGasLimit);
} else { } else {
throw new UnsupportedOperationException("Specified target gas limit is invalid"); throw new UnsupportedOperationException("Specified target gas limit is invalid");
} }

@ -21,7 +21,7 @@ import org.hyperledger.besu.config.StubGenesisConfigOptions;
import org.hyperledger.besu.consensus.common.bft.BftProtocolSchedule; import org.hyperledger.besu.consensus.common.bft.BftProtocolSchedule;
import org.hyperledger.besu.ethereum.chain.BadBlockManager; import org.hyperledger.besu.ethereum.chain.BadBlockManager;
import org.hyperledger.besu.ethereum.core.MilestoneStreamingProtocolSchedule; import org.hyperledger.besu.ethereum.core.MilestoneStreamingProtocolSchedule;
import org.hyperledger.besu.ethereum.core.MiningParameters; import org.hyperledger.besu.ethereum.core.MiningConfiguration;
import org.hyperledger.besu.ethereum.core.PrivacyParameters; import org.hyperledger.besu.ethereum.core.PrivacyParameters;
import org.hyperledger.besu.ethereum.mainnet.DefaultProtocolSchedule; import org.hyperledger.besu.ethereum.mainnet.DefaultProtocolSchedule;
import org.hyperledger.besu.ethereum.mainnet.ProtocolSchedule; import org.hyperledger.besu.ethereum.mainnet.ProtocolSchedule;
@ -177,7 +177,7 @@ public class CombinedProtocolScheduleFactoryTest {
new PrivacyParameters(), new PrivacyParameters(),
false, false,
EvmConfiguration.DEFAULT, EvmConfiguration.DEFAULT,
MiningParameters.MINING_DISABLED, MiningConfiguration.MINING_DISABLED,
new BadBlockManager(), new BadBlockManager(),
false, false,
new NoOpMetricsSystem()); new NoOpMetricsSystem());

@ -31,7 +31,7 @@ import org.hyperledger.besu.ethereum.chain.BadBlockManager;
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.MilestoneStreamingProtocolSchedule; import org.hyperledger.besu.ethereum.core.MilestoneStreamingProtocolSchedule;
import org.hyperledger.besu.ethereum.core.MiningParameters; import org.hyperledger.besu.ethereum.core.MiningConfiguration;
import org.hyperledger.besu.ethereum.core.PrivacyParameters; import org.hyperledger.besu.ethereum.core.PrivacyParameters;
import org.hyperledger.besu.ethereum.mainnet.BlockHeaderValidator; import org.hyperledger.besu.ethereum.mainnet.BlockHeaderValidator;
import org.hyperledger.besu.ethereum.mainnet.DefaultProtocolSchedule; import org.hyperledger.besu.ethereum.mainnet.DefaultProtocolSchedule;
@ -245,7 +245,7 @@ public class BaseBftProtocolScheduleBuilderTest {
false, false,
bftExtraDataCodec, bftExtraDataCodec,
EvmConfiguration.DEFAULT, EvmConfiguration.DEFAULT,
MiningParameters.MINING_DISABLED, MiningConfiguration.MINING_DISABLED,
new BadBlockManager(), new BadBlockManager(),
false, false,
new NoOpMetricsSystem()); new NoOpMetricsSystem());

@ -78,9 +78,9 @@ import org.hyperledger.besu.ethereum.core.BlockBody;
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.Difficulty; import org.hyperledger.besu.ethereum.core.Difficulty;
import org.hyperledger.besu.ethereum.core.ImmutableMiningParameters; import org.hyperledger.besu.ethereum.core.ImmutableMiningConfiguration;
import org.hyperledger.besu.ethereum.core.ImmutableMiningParameters.MutableInitValues; import org.hyperledger.besu.ethereum.core.ImmutableMiningConfiguration.MutableInitValues;
import org.hyperledger.besu.ethereum.core.MiningParameters; import org.hyperledger.besu.ethereum.core.MiningConfiguration;
import org.hyperledger.besu.ethereum.core.Util; import org.hyperledger.besu.ethereum.core.Util;
import org.hyperledger.besu.ethereum.eth.manager.EthContext; import org.hyperledger.besu.ethereum.eth.manager.EthContext;
import org.hyperledger.besu.ethereum.eth.manager.EthScheduler; import org.hyperledger.besu.ethereum.eth.manager.EthScheduler;
@ -310,8 +310,8 @@ public class TestContextBuilder {
final WorldStateArchive worldStateArchive = createInMemoryWorldStateArchive(); final WorldStateArchive worldStateArchive = createInMemoryWorldStateArchive();
final MiningParameters miningParams = final MiningConfiguration miningParams =
ImmutableMiningParameters.builder() ImmutableMiningConfiguration.builder()
.mutableInitValues( .mutableInitValues(
MutableInitValues.builder() MutableInitValues.builder()
.isMiningEnabled(true) .isMiningEnabled(true)
@ -334,7 +334,7 @@ public class TestContextBuilder {
forksSchedule, forksSchedule,
IBFT_EXTRA_DATA_ENCODER, IBFT_EXTRA_DATA_ENCODER,
EvmConfiguration.DEFAULT, EvmConfiguration.DEFAULT,
MiningParameters.MINING_DISABLED, MiningConfiguration.MINING_DISABLED,
new BadBlockManager(), new BadBlockManager(),
false, false,
new NoOpMetricsSystem()); new NoOpMetricsSystem());

@ -21,7 +21,7 @@ import org.hyperledger.besu.consensus.common.bft.BaseBftProtocolScheduleBuilder;
import org.hyperledger.besu.consensus.common.bft.BftExtraDataCodec; import org.hyperledger.besu.consensus.common.bft.BftExtraDataCodec;
import org.hyperledger.besu.consensus.common.bft.BftProtocolSchedule; import org.hyperledger.besu.consensus.common.bft.BftProtocolSchedule;
import org.hyperledger.besu.ethereum.chain.BadBlockManager; import org.hyperledger.besu.ethereum.chain.BadBlockManager;
import org.hyperledger.besu.ethereum.core.MiningParameters; import org.hyperledger.besu.ethereum.core.MiningConfiguration;
import org.hyperledger.besu.ethereum.core.PrivacyParameters; import org.hyperledger.besu.ethereum.core.PrivacyParameters;
import org.hyperledger.besu.ethereum.mainnet.BlockHeaderValidator; import org.hyperledger.besu.ethereum.mainnet.BlockHeaderValidator;
import org.hyperledger.besu.ethereum.mainnet.feemarket.BaseFeeMarket; import org.hyperledger.besu.ethereum.mainnet.feemarket.BaseFeeMarket;
@ -46,7 +46,7 @@ public class IbftProtocolScheduleBuilder extends BaseBftProtocolScheduleBuilder
* @param isRevertReasonEnabled the is revert reason enabled * @param isRevertReasonEnabled the is revert reason enabled
* @param bftExtraDataCodec the bft extra data codec * @param bftExtraDataCodec the bft extra data codec
* @param evmConfiguration the evm configuration * @param evmConfiguration the evm configuration
* @param miningParameters the mining parameters * @param miningConfiguration the mining parameters
* @param badBlockManager the cache to use to keep invalid blocks * @param badBlockManager the cache to use to keep invalid blocks
* @param isParallelTxProcessingEnabled indicates whether parallel transaction is enabled * @param isParallelTxProcessingEnabled indicates whether parallel transaction is enabled
* @param metricsSystem A metricSystem instance to be able to expose metrics in the underlying * @param metricsSystem A metricSystem instance to be able to expose metrics in the underlying
@ -60,7 +60,7 @@ public class IbftProtocolScheduleBuilder extends BaseBftProtocolScheduleBuilder
final boolean isRevertReasonEnabled, final boolean isRevertReasonEnabled,
final BftExtraDataCodec bftExtraDataCodec, final BftExtraDataCodec bftExtraDataCodec,
final EvmConfiguration evmConfiguration, final EvmConfiguration evmConfiguration,
final MiningParameters miningParameters, final MiningConfiguration miningConfiguration,
final BadBlockManager badBlockManager, final BadBlockManager badBlockManager,
final boolean isParallelTxProcessingEnabled, final boolean isParallelTxProcessingEnabled,
final MetricsSystem metricsSystem) { final MetricsSystem metricsSystem) {
@ -72,7 +72,7 @@ public class IbftProtocolScheduleBuilder extends BaseBftProtocolScheduleBuilder
isRevertReasonEnabled, isRevertReasonEnabled,
bftExtraDataCodec, bftExtraDataCodec,
evmConfiguration, evmConfiguration,
miningParameters, miningConfiguration,
badBlockManager, badBlockManager,
isParallelTxProcessingEnabled, isParallelTxProcessingEnabled,
metricsSystem); metricsSystem);
@ -85,7 +85,7 @@ public class IbftProtocolScheduleBuilder extends BaseBftProtocolScheduleBuilder
* @param forksSchedule the forks schedule * @param forksSchedule the forks schedule
* @param bftExtraDataCodec the bft extra data codec * @param bftExtraDataCodec the bft extra data codec
* @param evmConfiguration the evm configuration * @param evmConfiguration the evm configuration
* @param miningParameters the mining parameters * @param miningConfiguration the mining parameters
* @param badBlockManager the cache to use to keep invalid blocks * @param badBlockManager the cache to use to keep invalid blocks
* @param isParallelTxProcessingEnabled indicates whether parallel transaction is enabled. * @param isParallelTxProcessingEnabled indicates whether parallel transaction is enabled.
* @param metricsSystem A metricSystem instance to be able to expose metrics in the underlying * @param metricsSystem A metricSystem instance to be able to expose metrics in the underlying
@ -97,7 +97,7 @@ public class IbftProtocolScheduleBuilder extends BaseBftProtocolScheduleBuilder
final ForksSchedule<BftConfigOptions> forksSchedule, final ForksSchedule<BftConfigOptions> forksSchedule,
final BftExtraDataCodec bftExtraDataCodec, final BftExtraDataCodec bftExtraDataCodec,
final EvmConfiguration evmConfiguration, final EvmConfiguration evmConfiguration,
final MiningParameters miningParameters, final MiningConfiguration miningConfiguration,
final BadBlockManager badBlockManager, final BadBlockManager badBlockManager,
final boolean isParallelTxProcessingEnabled, final boolean isParallelTxProcessingEnabled,
final MetricsSystem metricsSystem) { final MetricsSystem metricsSystem) {
@ -108,7 +108,7 @@ public class IbftProtocolScheduleBuilder extends BaseBftProtocolScheduleBuilder
false, false,
bftExtraDataCodec, bftExtraDataCodec,
evmConfiguration, evmConfiguration,
miningParameters, miningConfiguration,
badBlockManager, badBlockManager,
isParallelTxProcessingEnabled, isParallelTxProcessingEnabled,
metricsSystem); metricsSystem);

@ -32,7 +32,7 @@ import org.hyperledger.besu.ethereum.api.jsonrpc.internal.methods.JsonRpcMethod;
import org.hyperledger.besu.ethereum.api.jsonrpc.methods.ApiGroupJsonRpcMethods; import org.hyperledger.besu.ethereum.api.jsonrpc.methods.ApiGroupJsonRpcMethods;
import org.hyperledger.besu.ethereum.api.query.BlockchainQueries; import org.hyperledger.besu.ethereum.api.query.BlockchainQueries;
import org.hyperledger.besu.ethereum.chain.MutableBlockchain; import org.hyperledger.besu.ethereum.chain.MutableBlockchain;
import org.hyperledger.besu.ethereum.core.MiningParameters; import org.hyperledger.besu.ethereum.core.MiningConfiguration;
import org.hyperledger.besu.ethereum.mainnet.ProtocolSchedule; import org.hyperledger.besu.ethereum.mainnet.ProtocolSchedule;
import java.util.Map; import java.util.Map;
@ -42,22 +42,22 @@ public class IbftJsonRpcMethods extends ApiGroupJsonRpcMethods {
private final ProtocolContext context; private final ProtocolContext context;
private final ProtocolSchedule protocolSchedule; private final ProtocolSchedule protocolSchedule;
private final MiningParameters miningParameters; private final MiningConfiguration miningConfiguration;
/** /**
* Instantiates a new Ibft json rpc methods. * Instantiates a new Ibft json rpc methods.
* *
* @param context the protocol context * @param context the protocol context
* @param protocolSchedule the protocol schedule * @param protocolSchedule the protocol schedule
* @param miningParameters the mining parameters * @param miningConfiguration the mining parameters
*/ */
public IbftJsonRpcMethods( public IbftJsonRpcMethods(
final ProtocolContext context, final ProtocolContext context,
final ProtocolSchedule protocolSchedule, final ProtocolSchedule protocolSchedule,
final MiningParameters miningParameters) { final MiningConfiguration miningConfiguration) {
this.context = context; this.context = context;
this.protocolSchedule = protocolSchedule; this.protocolSchedule = protocolSchedule;
this.miningParameters = miningParameters; this.miningConfiguration = miningConfiguration;
} }
@Override @Override
@ -70,7 +70,7 @@ public class IbftJsonRpcMethods extends ApiGroupJsonRpcMethods {
final MutableBlockchain blockchain = context.getBlockchain(); final MutableBlockchain blockchain = context.getBlockchain();
final BlockchainQueries blockchainQueries = final BlockchainQueries blockchainQueries =
new BlockchainQueries( new BlockchainQueries(
protocolSchedule, blockchain, context.getWorldStateArchive(), miningParameters); protocolSchedule, blockchain, context.getWorldStateArchive(), miningConfiguration);
final BftContext bftContext = context.getConsensusContext(BftContext.class); final BftContext bftContext = context.getConsensusContext(BftContext.class);
final BlockInterface blockInterface = bftContext.getBlockInterface(); final BlockInterface blockInterface = bftContext.getBlockInterface();
final ValidatorProvider validatorProvider = final ValidatorProvider validatorProvider =

@ -39,7 +39,7 @@ import org.hyperledger.besu.ethereum.ProtocolContext;
import org.hyperledger.besu.ethereum.chain.BadBlockManager; import org.hyperledger.besu.ethereum.chain.BadBlockManager;
import org.hyperledger.besu.ethereum.core.BlockHeader; import org.hyperledger.besu.ethereum.core.BlockHeader;
import org.hyperledger.besu.ethereum.core.MilestoneStreamingProtocolSchedule; import org.hyperledger.besu.ethereum.core.MilestoneStreamingProtocolSchedule;
import org.hyperledger.besu.ethereum.core.MiningParameters; import org.hyperledger.besu.ethereum.core.MiningConfiguration;
import org.hyperledger.besu.ethereum.core.PrivacyParameters; import org.hyperledger.besu.ethereum.core.PrivacyParameters;
import org.hyperledger.besu.ethereum.core.Util; import org.hyperledger.besu.ethereum.core.Util;
import org.hyperledger.besu.ethereum.core.components.EthereumCoreComponent; import org.hyperledger.besu.ethereum.core.components.EthereumCoreComponent;
@ -127,7 +127,7 @@ public class IbftProtocolScheduleTest {
false, false,
bftExtraDataCodec, bftExtraDataCodec,
EvmConfiguration.DEFAULT, EvmConfiguration.DEFAULT,
MiningParameters.MINING_DISABLED, MiningConfiguration.MINING_DISABLED,
new BadBlockManager(), new BadBlockManager(),
false, false,
new NoOpMetricsSystem()); new NoOpMetricsSystem());
@ -191,8 +191,8 @@ public class IbftProtocolScheduleTest {
@Module @Module
static class NoMiningParamters { static class NoMiningParamters {
@Provides @Provides
MiningParameters provideMiningParameters() { MiningConfiguration provideMiningParameters() {
return MiningParameters.MINING_DISABLED; return MiningConfiguration.MINING_DISABLED;
} }
} }
} }

@ -42,9 +42,9 @@ import org.hyperledger.besu.ethereum.core.AddressHelpers;
import org.hyperledger.besu.ethereum.core.Block; import org.hyperledger.besu.ethereum.core.Block;
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.ImmutableMiningParameters; import org.hyperledger.besu.ethereum.core.ImmutableMiningConfiguration;
import org.hyperledger.besu.ethereum.core.ImmutableMiningParameters.MutableInitValues; import org.hyperledger.besu.ethereum.core.ImmutableMiningConfiguration.MutableInitValues;
import org.hyperledger.besu.ethereum.core.MiningParameters; import org.hyperledger.besu.ethereum.core.MiningConfiguration;
import org.hyperledger.besu.ethereum.core.PrivacyParameters; import org.hyperledger.besu.ethereum.core.PrivacyParameters;
import org.hyperledger.besu.ethereum.eth.manager.EthContext; import org.hyperledger.besu.ethereum.eth.manager.EthContext;
import org.hyperledger.besu.ethereum.eth.transactions.BlobCache; import org.hyperledger.besu.ethereum.eth.transactions.BlobCache;
@ -122,7 +122,7 @@ public class BftBlockCreatorTest {
false, false,
bftExtraDataEncoder, bftExtraDataEncoder,
EvmConfiguration.DEFAULT, EvmConfiguration.DEFAULT,
MiningParameters.MINING_DISABLED, MiningConfiguration.MINING_DISABLED,
new BadBlockManager(), new BadBlockManager(),
false, false,
new NoOpMetricsSystem()); new NoOpMetricsSystem());
@ -159,8 +159,8 @@ public class BftBlockCreatorTest {
transactionPool.setEnabled(); transactionPool.setEnabled();
final MiningParameters miningParameters = final MiningConfiguration miningConfiguration =
ImmutableMiningParameters.builder() ImmutableMiningConfiguration.builder()
.mutableInitValues( .mutableInitValues(
MutableInitValues.builder() MutableInitValues.builder()
.extraData( .extraData(
@ -178,7 +178,7 @@ public class BftBlockCreatorTest {
final BftBlockCreator blockCreator = final BftBlockCreator blockCreator =
new BftBlockCreator( new BftBlockCreator(
miningParameters, miningConfiguration,
forksSchedule, forksSchedule,
initialValidatorList.get(0), initialValidatorList.get(0),
parent -> parent ->

@ -70,7 +70,7 @@ import org.hyperledger.besu.ethereum.core.Block;
import org.hyperledger.besu.ethereum.core.BlockBody; import org.hyperledger.besu.ethereum.core.BlockBody;
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.MiningConfiguration;
import org.hyperledger.besu.ethereum.core.PrivacyParameters; import org.hyperledger.besu.ethereum.core.PrivacyParameters;
import org.hyperledger.besu.ethereum.core.Util; import org.hyperledger.besu.ethereum.core.Util;
import org.hyperledger.besu.ethereum.mainnet.DefaultProtocolSchedule; import org.hyperledger.besu.ethereum.mainnet.DefaultProtocolSchedule;
@ -185,7 +185,7 @@ public class IbftBlockHeightManagerTest {
new PrivacyParameters(), new PrivacyParameters(),
false, false,
EvmConfiguration.DEFAULT, EvmConfiguration.DEFAULT,
MiningParameters.MINING_DISABLED, MiningConfiguration.MINING_DISABLED,
new BadBlockManager(), new BadBlockManager(),
false, false,
new NoOpMetricsSystem()); new NoOpMetricsSystem());

@ -17,7 +17,7 @@ package org.hyperledger.besu.consensus.merge;
import org.hyperledger.besu.config.GenesisConfigOptions; import org.hyperledger.besu.config.GenesisConfigOptions;
import org.hyperledger.besu.datatypes.Wei; import org.hyperledger.besu.datatypes.Wei;
import org.hyperledger.besu.ethereum.chain.BadBlockManager; import org.hyperledger.besu.ethereum.chain.BadBlockManager;
import org.hyperledger.besu.ethereum.core.MiningParameters; import org.hyperledger.besu.ethereum.core.MiningConfiguration;
import org.hyperledger.besu.ethereum.core.PrivacyParameters; import org.hyperledger.besu.ethereum.core.PrivacyParameters;
import org.hyperledger.besu.ethereum.mainnet.BlockHeaderValidator; import org.hyperledger.besu.ethereum.mainnet.BlockHeaderValidator;
import org.hyperledger.besu.ethereum.mainnet.ProtocolSchedule; import org.hyperledger.besu.ethereum.mainnet.ProtocolSchedule;
@ -48,7 +48,7 @@ public class MergeProtocolSchedule {
* *
* @param config the config * @param config the config
* @param isRevertReasonEnabled the is revert reason enabled * @param isRevertReasonEnabled the is revert reason enabled
* @param miningParameters the mining parameters * @param miningConfiguration the mining parameters
* @param badBlockManager the cache to use to keep invalid blocks * @param badBlockManager the cache to use to keep invalid blocks
* @param isParallelTxProcessingEnabled indicates whether parallel transaction is enabled. * @param isParallelTxProcessingEnabled indicates whether parallel transaction is enabled.
* @return the protocol schedule * @return the protocol schedule
@ -56,7 +56,7 @@ public class MergeProtocolSchedule {
public static ProtocolSchedule create( public static ProtocolSchedule create(
final GenesisConfigOptions config, final GenesisConfigOptions config,
final boolean isRevertReasonEnabled, final boolean isRevertReasonEnabled,
final MiningParameters miningParameters, final MiningConfiguration miningConfiguration,
final BadBlockManager badBlockManager, final BadBlockManager badBlockManager,
final boolean isParallelTxProcessingEnabled, final boolean isParallelTxProcessingEnabled,
final MetricsSystem metricsSystem) { final MetricsSystem metricsSystem) {
@ -64,7 +64,7 @@ public class MergeProtocolSchedule {
config, config,
PrivacyParameters.DEFAULT, PrivacyParameters.DEFAULT,
isRevertReasonEnabled, isRevertReasonEnabled,
miningParameters, miningConfiguration,
badBlockManager, badBlockManager,
isParallelTxProcessingEnabled, isParallelTxProcessingEnabled,
metricsSystem); metricsSystem);
@ -76,7 +76,7 @@ public class MergeProtocolSchedule {
* @param config the config * @param config the config
* @param privacyParameters the privacy parameters * @param privacyParameters the privacy parameters
* @param isRevertReasonEnabled the is revert reason enabled * @param isRevertReasonEnabled the is revert reason enabled
* @param miningParameters the mining parameters * @param miningConfiguration the mining parameters
* @param badBlockManager the cache to use to keep invalid blocks * @param badBlockManager the cache to use to keep invalid blocks
* @param isParallelTxProcessingEnabled indicates whether parallel transaction is enabled. * @param isParallelTxProcessingEnabled indicates whether parallel transaction is enabled.
* @return the protocol schedule * @return the protocol schedule
@ -85,7 +85,7 @@ public class MergeProtocolSchedule {
final GenesisConfigOptions config, final GenesisConfigOptions config,
final PrivacyParameters privacyParameters, final PrivacyParameters privacyParameters,
final boolean isRevertReasonEnabled, final boolean isRevertReasonEnabled,
final MiningParameters miningParameters, final MiningConfiguration miningConfiguration,
final BadBlockManager badBlockManager, final BadBlockManager badBlockManager,
final boolean isParallelTxProcessingEnabled, final boolean isParallelTxProcessingEnabled,
final MetricsSystem metricsSystem) { final MetricsSystem metricsSystem) {
@ -106,7 +106,7 @@ public class MergeProtocolSchedule {
privacyParameters, privacyParameters,
isRevertReasonEnabled, isRevertReasonEnabled,
EvmConfiguration.DEFAULT, EvmConfiguration.DEFAULT,
miningParameters, miningConfiguration,
badBlockManager, badBlockManager,
isParallelTxProcessingEnabled, isParallelTxProcessingEnabled,
metricsSystem) metricsSystem)

@ -20,7 +20,7 @@ import org.hyperledger.besu.ethereum.ProtocolContext;
import org.hyperledger.besu.ethereum.chain.BadBlockManager; import org.hyperledger.besu.ethereum.chain.BadBlockManager;
import org.hyperledger.besu.ethereum.core.BlockHeader; import org.hyperledger.besu.ethereum.core.BlockHeader;
import org.hyperledger.besu.ethereum.core.Difficulty; import org.hyperledger.besu.ethereum.core.Difficulty;
import org.hyperledger.besu.ethereum.core.MiningParameters; import org.hyperledger.besu.ethereum.core.MiningConfiguration;
import org.hyperledger.besu.ethereum.core.PermissionTransactionFilter; import org.hyperledger.besu.ethereum.core.PermissionTransactionFilter;
import org.hyperledger.besu.ethereum.core.ProcessableBlockHeader; import org.hyperledger.besu.ethereum.core.ProcessableBlockHeader;
import org.hyperledger.besu.ethereum.mainnet.MainnetProtocolSchedule; import org.hyperledger.besu.ethereum.mainnet.MainnetProtocolSchedule;
@ -65,21 +65,21 @@ public class TransitionProtocolSchedule implements ProtocolSchedule {
* *
* @param genesisConfigOptions {@link GenesisConfigOptions} containing the config options for the * @param genesisConfigOptions {@link GenesisConfigOptions} containing the config options for the
* milestone starting points * milestone starting points
* @param miningParameters the mining parameters * @param miningConfiguration the mining parameters
* @param badBlockManager the cache to use to keep invalid blocks * @param badBlockManager the cache to use to keep invalid blocks
* @param isParallelTxProcessingEnabled indicates whether parallel transaction is enabled. * @param isParallelTxProcessingEnabled indicates whether parallel transaction is enabled.
* @return an initialised TransitionProtocolSchedule using post-merge defaults * @return an initialised TransitionProtocolSchedule using post-merge defaults
*/ */
public static TransitionProtocolSchedule fromConfig( public static TransitionProtocolSchedule fromConfig(
final GenesisConfigOptions genesisConfigOptions, final GenesisConfigOptions genesisConfigOptions,
final MiningParameters miningParameters, final MiningConfiguration miningConfiguration,
final BadBlockManager badBlockManager, final BadBlockManager badBlockManager,
final boolean isParallelTxProcessingEnabled, final boolean isParallelTxProcessingEnabled,
final MetricsSystem metricsSystem) { final MetricsSystem metricsSystem) {
ProtocolSchedule preMergeProtocolSchedule = ProtocolSchedule preMergeProtocolSchedule =
MainnetProtocolSchedule.fromConfig( MainnetProtocolSchedule.fromConfig(
genesisConfigOptions, genesisConfigOptions,
miningParameters, miningConfiguration,
badBlockManager, badBlockManager,
isParallelTxProcessingEnabled, isParallelTxProcessingEnabled,
metricsSystem); metricsSystem);
@ -87,7 +87,7 @@ public class TransitionProtocolSchedule implements ProtocolSchedule {
MergeProtocolSchedule.create( MergeProtocolSchedule.create(
genesisConfigOptions, genesisConfigOptions,
false, false,
miningParameters, miningConfiguration,
badBlockManager, badBlockManager,
isParallelTxProcessingEnabled, isParallelTxProcessingEnabled,
metricsSystem); metricsSystem);

@ -19,7 +19,7 @@ import org.hyperledger.besu.ethereum.blockcreation.AbstractBlockCreator;
import org.hyperledger.besu.ethereum.core.BlockHeader; import org.hyperledger.besu.ethereum.core.BlockHeader;
import org.hyperledger.besu.ethereum.core.BlockHeaderBuilder; import org.hyperledger.besu.ethereum.core.BlockHeaderBuilder;
import org.hyperledger.besu.ethereum.core.Difficulty; import org.hyperledger.besu.ethereum.core.Difficulty;
import org.hyperledger.besu.ethereum.core.MiningParameters; import org.hyperledger.besu.ethereum.core.MiningConfiguration;
import org.hyperledger.besu.ethereum.core.SealableBlockHeader; import org.hyperledger.besu.ethereum.core.SealableBlockHeader;
import org.hyperledger.besu.ethereum.core.Transaction; import org.hyperledger.besu.ethereum.core.Transaction;
import org.hyperledger.besu.ethereum.core.Withdrawal; import org.hyperledger.besu.ethereum.core.Withdrawal;
@ -39,7 +39,7 @@ class MergeBlockCreator extends AbstractBlockCreator {
/** /**
* Instantiates a new Merge block creator. * Instantiates a new Merge block creator.
* *
* @param miningParameters the mining parameters * @param miningConfiguration the mining parameters
* @param extraDataCalculator the extra data calculator * @param extraDataCalculator the extra data calculator
* @param transactionPool the pending transactions * @param transactionPool the pending transactions
* @param protocolContext the protocol context * @param protocolContext the protocol context
@ -47,7 +47,7 @@ class MergeBlockCreator extends AbstractBlockCreator {
* @param parentHeader the parent header * @param parentHeader the parent header
*/ */
public MergeBlockCreator( public MergeBlockCreator(
final MiningParameters miningParameters, final MiningConfiguration miningConfiguration,
final ExtraDataCalculator extraDataCalculator, final ExtraDataCalculator extraDataCalculator,
final TransactionPool transactionPool, final TransactionPool transactionPool,
final ProtocolContext protocolContext, final ProtocolContext protocolContext,
@ -55,8 +55,8 @@ class MergeBlockCreator extends AbstractBlockCreator {
final BlockHeader parentHeader, final BlockHeader parentHeader,
final EthScheduler ethScheduler) { final EthScheduler ethScheduler) {
super( super(
miningParameters, miningConfiguration,
__ -> miningParameters.getCoinbase().orElseThrow(), __ -> miningConfiguration.getCoinbase().orElseThrow(),
extraDataCalculator, extraDataCalculator,
transactionPool, transactionPool,
protocolContext, protocolContext,

@ -33,7 +33,7 @@ import org.hyperledger.besu.ethereum.core.Block;
import org.hyperledger.besu.ethereum.core.BlockHeader; import org.hyperledger.besu.ethereum.core.BlockHeader;
import org.hyperledger.besu.ethereum.core.BlockWithReceipts; import org.hyperledger.besu.ethereum.core.BlockWithReceipts;
import org.hyperledger.besu.ethereum.core.Difficulty; import org.hyperledger.besu.ethereum.core.Difficulty;
import org.hyperledger.besu.ethereum.core.MiningParameters; import org.hyperledger.besu.ethereum.core.MiningConfiguration;
import org.hyperledger.besu.ethereum.core.MutableWorldState; import org.hyperledger.besu.ethereum.core.MutableWorldState;
import org.hyperledger.besu.ethereum.core.Transaction; import org.hyperledger.besu.ethereum.core.Transaction;
import org.hyperledger.besu.ethereum.core.Withdrawal; import org.hyperledger.besu.ethereum.core.Withdrawal;
@ -81,7 +81,7 @@ public class MergeCoordinator implements MergeMiningCoordinator, BadChainListene
private static final long DEFAULT_TARGET_GAS_LIMIT = 30000000L; private static final long DEFAULT_TARGET_GAS_LIMIT = 30000000L;
/** The Mining parameters. */ /** The Mining parameters. */
protected final MiningParameters miningParameters; protected final MiningConfiguration miningConfiguration;
/** The Merge block creator factory. */ /** The Merge block creator factory. */
protected final MergeBlockCreatorFactory mergeBlockCreatorFactory; protected final MergeBlockCreatorFactory mergeBlockCreatorFactory;
@ -120,7 +120,7 @@ public class MergeCoordinator implements MergeMiningCoordinator, BadChainListene
final ProtocolSchedule protocolSchedule, final ProtocolSchedule protocolSchedule,
final EthScheduler ethScheduler, final EthScheduler ethScheduler,
final TransactionPool transactionPool, final TransactionPool transactionPool,
final MiningParameters miningParams, final MiningConfiguration miningParams,
final BackwardSyncContext backwardSyncContext, final BackwardSyncContext backwardSyncContext,
final Optional<Address> depositContractAddress) { final Optional<Address> depositContractAddress) {
this.protocolContext = protocolContext; this.protocolContext = protocolContext;
@ -137,14 +137,14 @@ public class MergeCoordinator implements MergeMiningCoordinator, BadChainListene
} }
miningParams.setMinBlockOccupancyRatio(TRY_FILL_BLOCK); miningParams.setMinBlockOccupancyRatio(TRY_FILL_BLOCK);
this.miningParameters = miningParams; this.miningConfiguration = miningParams;
this.mergeBlockCreatorFactory = this.mergeBlockCreatorFactory =
(parentHeader, address) -> { (parentHeader, address) -> {
address.ifPresent(miningParams::setCoinbase); address.ifPresent(miningParams::setCoinbase);
return new MergeBlockCreator( return new MergeBlockCreator(
miningParameters, miningConfiguration,
parent -> miningParameters.getExtraData(), parent -> miningConfiguration.getExtraData(),
transactionPool, transactionPool,
protocolContext, protocolContext,
protocolSchedule, protocolSchedule,
@ -169,7 +169,7 @@ public class MergeCoordinator implements MergeMiningCoordinator, BadChainListene
final ProtocolContext protocolContext, final ProtocolContext protocolContext,
final ProtocolSchedule protocolSchedule, final ProtocolSchedule protocolSchedule,
final EthScheduler ethScheduler, final EthScheduler ethScheduler,
final MiningParameters miningParams, final MiningConfiguration miningParams,
final BackwardSyncContext backwardSyncContext, final BackwardSyncContext backwardSyncContext,
final MergeBlockCreatorFactory mergeBlockCreatorFactory) { final MergeBlockCreatorFactory mergeBlockCreatorFactory) {
@ -182,7 +182,7 @@ public class MergeCoordinator implements MergeMiningCoordinator, BadChainListene
miningParams.setTargetGasLimit(DEFAULT_TARGET_GAS_LIMIT); miningParams.setTargetGasLimit(DEFAULT_TARGET_GAS_LIMIT);
} }
miningParams.setMinBlockOccupancyRatio(TRY_FILL_BLOCK); miningParams.setMinBlockOccupancyRatio(TRY_FILL_BLOCK);
this.miningParameters = miningParams; this.miningConfiguration = miningParams;
this.mergeBlockCreatorFactory = mergeBlockCreatorFactory; this.mergeBlockCreatorFactory = mergeBlockCreatorFactory;
@ -215,17 +215,17 @@ public class MergeCoordinator implements MergeMiningCoordinator, BadChainListene
@Override @Override
public Wei getMinTransactionGasPrice() { public Wei getMinTransactionGasPrice() {
return miningParameters.getMinTransactionGasPrice(); return miningConfiguration.getMinTransactionGasPrice();
} }
@Override @Override
public Wei getMinPriorityFeePerGas() { public Wei getMinPriorityFeePerGas() {
return miningParameters.getMinPriorityFeePerGas(); return miningConfiguration.getMinPriorityFeePerGas();
} }
@Override @Override
public Optional<Address> getCoinbase() { public Optional<Address> getCoinbase() {
return miningParameters.getCoinbase(); return miningConfiguration.getCoinbase();
} }
@Override @Override
@ -244,7 +244,7 @@ public class MergeCoordinator implements MergeMiningCoordinator, BadChainListene
@Override @Override
public void changeTargetGasLimit(final Long newTargetGasLimit) { public void changeTargetGasLimit(final Long newTargetGasLimit) {
if (AbstractGasLimitSpecification.isValidTargetGasLimit(newTargetGasLimit)) { if (AbstractGasLimitSpecification.isValidTargetGasLimit(newTargetGasLimit)) {
this.miningParameters.setTargetGasLimit(newTargetGasLimit); this.miningConfiguration.setTargetGasLimit(newTargetGasLimit);
} else { } else {
throw new IllegalArgumentException("Specified target gas limit is invalid"); throw new IllegalArgumentException("Specified target gas limit is invalid");
} }
@ -383,13 +383,13 @@ public class MergeCoordinator implements MergeMiningCoordinator, BadChainListene
LOG.debug( LOG.debug(
"Block creation started for payload id {}, remaining time is {}ms", "Block creation started for payload id {}, remaining time is {}ms",
payloadIdentifier, payloadIdentifier,
miningParameters.getUnstable().getPosBlockCreationMaxTime()); miningConfiguration.getUnstable().getPosBlockCreationMaxTime());
ethScheduler ethScheduler
.scheduleBlockCreationTask( .scheduleBlockCreationTask(
() -> retryBlockCreationUntilUseful(payloadIdentifier, blockCreator)) () -> retryBlockCreationUntilUseful(payloadIdentifier, blockCreator))
.orTimeout( .orTimeout(
miningParameters.getUnstable().getPosBlockCreationMaxTime(), TimeUnit.MILLISECONDS) miningConfiguration.getUnstable().getPosBlockCreationMaxTime(), TimeUnit.MILLISECONDS)
.whenComplete( .whenComplete(
(unused, throwable) -> { (unused, throwable) -> {
if (throwable != null) { if (throwable != null) {
@ -416,7 +416,7 @@ public class MergeCoordinator implements MergeMiningCoordinator, BadChainListene
final long waitBeforeRepetition = final long waitBeforeRepetition =
Math.max( Math.max(
100, 100,
miningParameters.getUnstable().getPosBlockCreationRepetitionMinDuration() miningConfiguration.getUnstable().getPosBlockCreationRepetitionMinDuration()
- lastDuration); - lastDuration);
LOG.debug("Waiting {}ms before repeating block creation", waitBeforeRepetition); LOG.debug("Waiting {}ms before repeating block creation", waitBeforeRepetition);
Thread.sleep(waitBeforeRepetition); Thread.sleep(waitBeforeRepetition);
@ -726,7 +726,7 @@ public class MergeCoordinator implements MergeMiningCoordinator, BadChainListene
@Override @Override
public boolean isMiningBeforeMerge() { public boolean isMiningBeforeMerge() {
return miningParameters.isMiningEnabled(); return miningConfiguration.isMiningEnabled();
} }
private Optional<Hash> findValidAncestor(final Blockchain chain, final Hash parentHash) { private Optional<Hash> findValidAncestor(final Blockchain chain, final Hash parentHash) {

@ -22,7 +22,7 @@ import org.hyperledger.besu.datatypes.Wei;
import org.hyperledger.besu.ethereum.chain.BadBlockManager; import org.hyperledger.besu.ethereum.chain.BadBlockManager;
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.MiningConfiguration;
import org.hyperledger.besu.ethereum.mainnet.MainnetBlockProcessor; import org.hyperledger.besu.ethereum.mainnet.MainnetBlockProcessor;
import org.hyperledger.besu.ethereum.mainnet.ProtocolSchedule; import org.hyperledger.besu.ethereum.mainnet.ProtocolSchedule;
import org.hyperledger.besu.ethereum.mainnet.ProtocolSpec; import org.hyperledger.besu.ethereum.mainnet.ProtocolSpec;
@ -51,7 +51,7 @@ public class MergeProtocolScheduleTest {
MergeProtocolSchedule.create( MergeProtocolSchedule.create(
config, config,
false, false,
MiningParameters.MINING_DISABLED, MiningConfiguration.MINING_DISABLED,
new BadBlockManager(), new BadBlockManager(),
false, false,
new NoOpMetricsSystem()); new NoOpMetricsSystem());
@ -72,7 +72,7 @@ public class MergeProtocolScheduleTest {
MergeProtocolSchedule.create( MergeProtocolSchedule.create(
config, config,
false, false,
MiningParameters.MINING_DISABLED, MiningConfiguration.MINING_DISABLED,
new BadBlockManager(), new BadBlockManager(),
false, false,
new NoOpMetricsSystem()); new NoOpMetricsSystem());
@ -113,7 +113,7 @@ public class MergeProtocolScheduleTest {
MergeProtocolSchedule.create( MergeProtocolSchedule.create(
config, config,
false, false,
MiningParameters.MINING_DISABLED, MiningConfiguration.MINING_DISABLED,
new BadBlockManager(), new BadBlockManager(),
false, false,
new NoOpMetricsSystem()); new NoOpMetricsSystem());
@ -146,7 +146,7 @@ public class MergeProtocolScheduleTest {
MergeProtocolSchedule.create( MergeProtocolSchedule.create(
config, config,
false, false,
MiningParameters.MINING_DISABLED, MiningConfiguration.MINING_DISABLED,
new BadBlockManager(), new BadBlockManager(),
false, false,
new NoOpMetricsSystem()); new NoOpMetricsSystem());
@ -180,7 +180,7 @@ public class MergeProtocolScheduleTest {
MergeProtocolSchedule.create( MergeProtocolSchedule.create(
GenesisConfigFile.DEFAULT.getConfigOptions(), GenesisConfigFile.DEFAULT.getConfigOptions(),
false, false,
MiningParameters.MINING_DISABLED, MiningConfiguration.MINING_DISABLED,
new BadBlockManager(), new BadBlockManager(),
false, false,
new NoOpMetricsSystem()) new NoOpMetricsSystem())

@ -55,10 +55,10 @@ import org.hyperledger.besu.ethereum.core.BlockBody;
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.Difficulty; import org.hyperledger.besu.ethereum.core.Difficulty;
import org.hyperledger.besu.ethereum.core.ImmutableMiningParameters; import org.hyperledger.besu.ethereum.core.ImmutableMiningConfiguration;
import org.hyperledger.besu.ethereum.core.ImmutableMiningParameters.MutableInitValues; import org.hyperledger.besu.ethereum.core.ImmutableMiningConfiguration.MutableInitValues;
import org.hyperledger.besu.ethereum.core.ImmutableMiningParameters.Unstable; import org.hyperledger.besu.ethereum.core.ImmutableMiningConfiguration.Unstable;
import org.hyperledger.besu.ethereum.core.MiningParameters; import org.hyperledger.besu.ethereum.core.MiningConfiguration;
import org.hyperledger.besu.ethereum.core.Synchronizer; import org.hyperledger.besu.ethereum.core.Synchronizer;
import org.hyperledger.besu.ethereum.core.TransactionTestFixture; import org.hyperledger.besu.ethereum.core.TransactionTestFixture;
import org.hyperledger.besu.ethereum.eth.manager.EthContext; import org.hyperledger.besu.ethereum.eth.manager.EthContext;
@ -135,8 +135,8 @@ public class MergeCoordinatorTest implements MergeGenesisConfigHelper {
private final Address coinbase = genesisAllocations(getPosGenesisConfigFile()).findFirst().get(); private final Address coinbase = genesisAllocations(getPosGenesisConfigFile()).findFirst().get();
private MiningParameters miningParameters = private MiningConfiguration miningConfiguration =
ImmutableMiningParameters.builder() ImmutableMiningConfiguration.builder()
.mutableInitValues(MutableInitValues.builder().coinbase(coinbase).build()) .mutableInitValues(MutableInitValues.builder().coinbase(coinbase).build())
.unstable( .unstable(
Unstable.builder() Unstable.builder()
@ -228,7 +228,7 @@ public class MergeCoordinatorTest implements MergeGenesisConfigHelper {
protocolSchedule, protocolSchedule,
ethScheduler, ethScheduler,
transactionPool, transactionPool,
miningParameters, miningConfiguration,
backwardSyncContext, backwardSyncContext,
Optional.empty()); Optional.empty());
} }
@ -273,7 +273,7 @@ public class MergeCoordinatorTest implements MergeGenesisConfigHelper {
MergeBlockCreator beingSpiedOn = MergeBlockCreator beingSpiedOn =
spy( spy(
new MergeBlockCreator( new MergeBlockCreator(
miningParameters, miningConfiguration,
parent -> Bytes.EMPTY, parent -> Bytes.EMPTY,
transactionPool, transactionPool,
protocolContext, protocolContext,
@ -302,7 +302,7 @@ public class MergeCoordinatorTest implements MergeGenesisConfigHelper {
protocolContext, protocolContext,
protocolSchedule, protocolSchedule,
ethScheduler, ethScheduler,
miningParameters, miningConfiguration,
backwardSyncContext, backwardSyncContext,
mergeBlockCreatorFactory)); mergeBlockCreatorFactory));
@ -543,9 +543,9 @@ public class MergeCoordinatorTest implements MergeGenesisConfigHelper {
@Test @Test
public void shouldStopRetryBlockCreationIfTimeExpired() throws InterruptedException { public void shouldStopRetryBlockCreationIfTimeExpired() throws InterruptedException {
final AtomicLong retries = new AtomicLong(0); final AtomicLong retries = new AtomicLong(0);
miningParameters = miningConfiguration =
ImmutableMiningParameters.builder() ImmutableMiningConfiguration.builder()
.from(miningParameters) .from(miningConfiguration)
.unstable(Unstable.builder().posBlockCreationMaxTime(100).build()) .unstable(Unstable.builder().posBlockCreationMaxTime(100).build())
.build(); .build();
doAnswer( doAnswer(
@ -737,8 +737,8 @@ public class MergeCoordinatorTest implements MergeGenesisConfigHelper {
public void shouldUseExtraDataFromMiningParameters() { public void shouldUseExtraDataFromMiningParameters() {
final Bytes extraData = Bytes.fromHexString("0x1234"); final Bytes extraData = Bytes.fromHexString("0x1234");
miningParameters = miningConfiguration =
ImmutableMiningParameters.builder() ImmutableMiningConfiguration.builder()
.mutableInitValues(MutableInitValues.builder().extraData(extraData).build()) .mutableInitValues(MutableInitValues.builder().extraData(extraData).build())
.build(); .build();
@ -748,7 +748,7 @@ public class MergeCoordinatorTest implements MergeGenesisConfigHelper {
protocolSchedule, protocolSchedule,
ethScheduler, ethScheduler,
transactionPool, transactionPool,
miningParameters, miningConfiguration,
backwardSyncContext, backwardSyncContext,
Optional.empty()); Optional.empty());

@ -19,7 +19,7 @@ import org.hyperledger.besu.config.GenesisConfigFile;
import org.hyperledger.besu.consensus.merge.MergeProtocolSchedule; import org.hyperledger.besu.consensus.merge.MergeProtocolSchedule;
import org.hyperledger.besu.datatypes.Address; import org.hyperledger.besu.datatypes.Address;
import org.hyperledger.besu.ethereum.chain.BadBlockManager; import org.hyperledger.besu.ethereum.chain.BadBlockManager;
import org.hyperledger.besu.ethereum.core.MiningParameters; import org.hyperledger.besu.ethereum.core.MiningConfiguration;
import org.hyperledger.besu.ethereum.mainnet.ProtocolSchedule; import org.hyperledger.besu.ethereum.mainnet.ProtocolSchedule;
import org.hyperledger.besu.metrics.noop.NoOpMetricsSystem; import org.hyperledger.besu.metrics.noop.NoOpMetricsSystem;
@ -56,7 +56,7 @@ public interface MergeGenesisConfigHelper {
return MergeProtocolSchedule.create( return MergeProtocolSchedule.create(
getPosGenesisConfigFile().getConfigOptions(), getPosGenesisConfigFile().getConfigOptions(),
false, false,
MiningParameters.MINING_DISABLED, MiningConfiguration.MINING_DISABLED,
new BadBlockManager(), new BadBlockManager(),
false, false,
new NoOpMetricsSystem()); new NoOpMetricsSystem());

@ -34,8 +34,8 @@ import org.hyperledger.besu.ethereum.core.BlockBody;
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.Difficulty; import org.hyperledger.besu.ethereum.core.Difficulty;
import org.hyperledger.besu.ethereum.core.ImmutableMiningParameters; import org.hyperledger.besu.ethereum.core.ImmutableMiningConfiguration;
import org.hyperledger.besu.ethereum.core.ImmutableMiningParameters.MutableInitValues; import org.hyperledger.besu.ethereum.core.ImmutableMiningConfiguration.MutableInitValues;
import org.hyperledger.besu.ethereum.eth.manager.EthScheduler; import org.hyperledger.besu.ethereum.eth.manager.EthScheduler;
import org.hyperledger.besu.ethereum.eth.sync.backwardsync.BackwardSyncContext; import org.hyperledger.besu.ethereum.eth.sync.backwardsync.BackwardSyncContext;
import org.hyperledger.besu.ethereum.eth.transactions.TransactionPool; import org.hyperledger.besu.ethereum.eth.transactions.TransactionPool;
@ -96,7 +96,7 @@ public class MergeReorgTest implements MergeGenesisConfigHelper {
mockProtocolSchedule, mockProtocolSchedule,
ethScheduler, ethScheduler,
mockTransactionPool, mockTransactionPool,
ImmutableMiningParameters.builder() ImmutableMiningConfiguration.builder()
.mutableInitValues(MutableInitValues.builder().coinbase(coinbase).build()) .mutableInitValues(MutableInitValues.builder().coinbase(coinbase).build())
.build(), .build(),
mock(BackwardSyncContext.class), mock(BackwardSyncContext.class),

@ -91,9 +91,9 @@ import org.hyperledger.besu.ethereum.core.BlockBody;
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.Difficulty; import org.hyperledger.besu.ethereum.core.Difficulty;
import org.hyperledger.besu.ethereum.core.ImmutableMiningParameters; import org.hyperledger.besu.ethereum.core.ImmutableMiningConfiguration;
import org.hyperledger.besu.ethereum.core.ImmutableMiningParameters.MutableInitValues; import org.hyperledger.besu.ethereum.core.ImmutableMiningConfiguration.MutableInitValues;
import org.hyperledger.besu.ethereum.core.MiningParameters; import org.hyperledger.besu.ethereum.core.MiningConfiguration;
import org.hyperledger.besu.ethereum.core.ProtocolScheduleFixture; import org.hyperledger.besu.ethereum.core.ProtocolScheduleFixture;
import org.hyperledger.besu.ethereum.core.Util; import org.hyperledger.besu.ethereum.core.Util;
import org.hyperledger.besu.ethereum.eth.manager.EthContext; import org.hyperledger.besu.ethereum.eth.manager.EthContext;
@ -387,8 +387,8 @@ public class TestContextBuilder {
final boolean useFixedBaseFee, final boolean useFixedBaseFee,
final List<QbftFork> qbftForks) { final List<QbftFork> qbftForks) {
final MiningParameters miningParams = final MiningConfiguration miningParams =
ImmutableMiningParameters.builder() ImmutableMiningConfiguration.builder()
.mutableInitValues( .mutableInitValues(
MutableInitValues.builder() MutableInitValues.builder()
.isMiningEnabled(true) .isMiningEnabled(true)
@ -438,7 +438,7 @@ public class TestContextBuilder {
forksSchedule, forksSchedule,
BFT_EXTRA_DATA_ENCODER, BFT_EXTRA_DATA_ENCODER,
EvmConfiguration.DEFAULT, EvmConfiguration.DEFAULT,
MiningParameters.MINING_DISABLED, MiningConfiguration.MINING_DISABLED,
new BadBlockManager(), new BadBlockManager(),
false, false,
new NoOpMetricsSystem()); new NoOpMetricsSystem());

@ -24,7 +24,7 @@ import org.hyperledger.besu.consensus.common.bft.BaseBftProtocolScheduleBuilder;
import org.hyperledger.besu.consensus.common.bft.BftExtraDataCodec; import org.hyperledger.besu.consensus.common.bft.BftExtraDataCodec;
import org.hyperledger.besu.consensus.common.bft.BftProtocolSchedule; import org.hyperledger.besu.consensus.common.bft.BftProtocolSchedule;
import org.hyperledger.besu.ethereum.chain.BadBlockManager; import org.hyperledger.besu.ethereum.chain.BadBlockManager;
import org.hyperledger.besu.ethereum.core.MiningParameters; import org.hyperledger.besu.ethereum.core.MiningConfiguration;
import org.hyperledger.besu.ethereum.core.PrivacyParameters; import org.hyperledger.besu.ethereum.core.PrivacyParameters;
import org.hyperledger.besu.ethereum.mainnet.BlockHeaderValidator; import org.hyperledger.besu.ethereum.mainnet.BlockHeaderValidator;
import org.hyperledger.besu.ethereum.mainnet.ProtocolSchedule; import org.hyperledger.besu.ethereum.mainnet.ProtocolSchedule;
@ -50,7 +50,7 @@ public class QbftProtocolScheduleBuilder extends BaseBftProtocolScheduleBuilder
* @param isRevertReasonEnabled the is revert reason enabled * @param isRevertReasonEnabled the is revert reason enabled
* @param bftExtraDataCodec the bft extra data codec * @param bftExtraDataCodec the bft extra data codec
* @param evmConfiguration the evm configuration * @param evmConfiguration the evm configuration
* @param miningParameters The mining parameters * @param miningConfiguration The mining parameters
* @param badBlockManager the cache to use to keep invalid blocks * @param badBlockManager the cache to use to keep invalid blocks
* @param isParallelTxProcessingEnabled indicates whether parallel transaction is enabled. * @param isParallelTxProcessingEnabled indicates whether parallel transaction is enabled.
* @param metricsSystem A metricSystem instance to be able to expose metrics in the underlying * @param metricsSystem A metricSystem instance to be able to expose metrics in the underlying
@ -64,7 +64,7 @@ public class QbftProtocolScheduleBuilder extends BaseBftProtocolScheduleBuilder
final boolean isRevertReasonEnabled, final boolean isRevertReasonEnabled,
final BftExtraDataCodec bftExtraDataCodec, final BftExtraDataCodec bftExtraDataCodec,
final EvmConfiguration evmConfiguration, final EvmConfiguration evmConfiguration,
final MiningParameters miningParameters, final MiningConfiguration miningConfiguration,
final BadBlockManager badBlockManager, final BadBlockManager badBlockManager,
final boolean isParallelTxProcessingEnabled, final boolean isParallelTxProcessingEnabled,
final MetricsSystem metricsSystem) { final MetricsSystem metricsSystem) {
@ -76,7 +76,7 @@ public class QbftProtocolScheduleBuilder extends BaseBftProtocolScheduleBuilder
isRevertReasonEnabled, isRevertReasonEnabled,
bftExtraDataCodec, bftExtraDataCodec,
evmConfiguration, evmConfiguration,
miningParameters, miningConfiguration,
badBlockManager, badBlockManager,
isParallelTxProcessingEnabled, isParallelTxProcessingEnabled,
metricsSystem); metricsSystem);
@ -89,7 +89,7 @@ public class QbftProtocolScheduleBuilder extends BaseBftProtocolScheduleBuilder
* @param qbftForksSchedule the qbft forks schedule * @param qbftForksSchedule the qbft forks schedule
* @param bftExtraDataCodec the bft extra data codec * @param bftExtraDataCodec the bft extra data codec
* @param evmConfiguration the evm configuration * @param evmConfiguration the evm configuration
* @param miningParameters The mining parameters * @param miningConfiguration The mining parameters
* @param badBlockManager the cache to use to keep invalid blocks * @param badBlockManager the cache to use to keep invalid blocks
* @param isParallelTxProcessingEnabled indicates whether parallel transaction is enabled. * @param isParallelTxProcessingEnabled indicates whether parallel transaction is enabled.
* @param metricsSystem A metricSystem instance to be able to expose metrics in the underlying * @param metricsSystem A metricSystem instance to be able to expose metrics in the underlying
@ -101,7 +101,7 @@ public class QbftProtocolScheduleBuilder extends BaseBftProtocolScheduleBuilder
final ForksSchedule<QbftConfigOptions> qbftForksSchedule, final ForksSchedule<QbftConfigOptions> qbftForksSchedule,
final BftExtraDataCodec bftExtraDataCodec, final BftExtraDataCodec bftExtraDataCodec,
final EvmConfiguration evmConfiguration, final EvmConfiguration evmConfiguration,
final MiningParameters miningParameters, final MiningConfiguration miningConfiguration,
final BadBlockManager badBlockManager, final BadBlockManager badBlockManager,
final boolean isParallelTxProcessingEnabled, final boolean isParallelTxProcessingEnabled,
final MetricsSystem metricsSystem) { final MetricsSystem metricsSystem) {
@ -112,7 +112,7 @@ public class QbftProtocolScheduleBuilder extends BaseBftProtocolScheduleBuilder
false, false,
bftExtraDataCodec, bftExtraDataCodec,
evmConfiguration, evmConfiguration,
miningParameters, miningConfiguration,
badBlockManager, badBlockManager,
isParallelTxProcessingEnabled, isParallelTxProcessingEnabled,
metricsSystem); metricsSystem);
@ -125,7 +125,7 @@ public class QbftProtocolScheduleBuilder extends BaseBftProtocolScheduleBuilder
* @param qbftForksSchedule the qbft forks schedule * @param qbftForksSchedule the qbft forks schedule
* @param isRevertReasonEnabled the is revert reason enabled * @param isRevertReasonEnabled the is revert reason enabled
* @param bftExtraDataCodec the bft extra data codec * @param bftExtraDataCodec the bft extra data codec
* @param miningParameters The mining parameters * @param miningConfiguration The mining parameters
* @param badBlockManager the cache to use to keep invalid blocks * @param badBlockManager the cache to use to keep invalid blocks
* @param isParallelTxProcessingEnabled indicates whether parallel transaction is enabled. * @param isParallelTxProcessingEnabled indicates whether parallel transaction is enabled.
* @param metricsSystem A metricSystem instance to be able to expose metrics in the underlying * @param metricsSystem A metricSystem instance to be able to expose metrics in the underlying
@ -137,7 +137,7 @@ public class QbftProtocolScheduleBuilder extends BaseBftProtocolScheduleBuilder
final ForksSchedule<QbftConfigOptions> qbftForksSchedule, final ForksSchedule<QbftConfigOptions> qbftForksSchedule,
final boolean isRevertReasonEnabled, final boolean isRevertReasonEnabled,
final BftExtraDataCodec bftExtraDataCodec, final BftExtraDataCodec bftExtraDataCodec,
final MiningParameters miningParameters, final MiningConfiguration miningConfiguration,
final BadBlockManager badBlockManager, final BadBlockManager badBlockManager,
final boolean isParallelTxProcessingEnabled, final boolean isParallelTxProcessingEnabled,
final MetricsSystem metricsSystem) { final MetricsSystem metricsSystem) {
@ -148,7 +148,7 @@ public class QbftProtocolScheduleBuilder extends BaseBftProtocolScheduleBuilder
isRevertReasonEnabled, isRevertReasonEnabled,
bftExtraDataCodec, bftExtraDataCodec,
EvmConfiguration.DEFAULT, EvmConfiguration.DEFAULT,
miningParameters, miningConfiguration,
badBlockManager, badBlockManager,
isParallelTxProcessingEnabled, isParallelTxProcessingEnabled,
metricsSystem); metricsSystem);

@ -23,7 +23,7 @@ import org.hyperledger.besu.consensus.common.bft.blockcreation.BftBlockCreatorFa
import org.hyperledger.besu.datatypes.Address; import org.hyperledger.besu.datatypes.Address;
import org.hyperledger.besu.ethereum.ProtocolContext; import org.hyperledger.besu.ethereum.ProtocolContext;
import org.hyperledger.besu.ethereum.core.BlockHeader; import org.hyperledger.besu.ethereum.core.BlockHeader;
import org.hyperledger.besu.ethereum.core.MiningParameters; import org.hyperledger.besu.ethereum.core.MiningConfiguration;
import org.hyperledger.besu.ethereum.eth.manager.EthScheduler; import org.hyperledger.besu.ethereum.eth.manager.EthScheduler;
import org.hyperledger.besu.ethereum.eth.transactions.TransactionPool; import org.hyperledger.besu.ethereum.eth.transactions.TransactionPool;
import org.hyperledger.besu.ethereum.mainnet.ProtocolSchedule; import org.hyperledger.besu.ethereum.mainnet.ProtocolSchedule;
@ -52,7 +52,7 @@ public class QbftBlockCreatorFactory extends BftBlockCreatorFactory<QbftConfigOp
final ProtocolContext protocolContext, final ProtocolContext protocolContext,
final ProtocolSchedule protocolSchedule, final ProtocolSchedule protocolSchedule,
final ForksSchedule<QbftConfigOptions> forksSchedule, final ForksSchedule<QbftConfigOptions> forksSchedule,
final MiningParameters miningParams, final MiningConfiguration miningParams,
final Address localAddress, final Address localAddress,
final BftExtraDataCodec bftExtraDataCodec, final BftExtraDataCodec bftExtraDataCodec,
final EthScheduler ethScheduler) { final EthScheduler ethScheduler) {
@ -74,7 +74,7 @@ public class QbftBlockCreatorFactory extends BftBlockCreatorFactory<QbftConfigOp
final BftExtraData extraData = final BftExtraData extraData =
new BftExtraData( new BftExtraData(
ConsensusHelpers.zeroLeftPad( ConsensusHelpers.zeroLeftPad(
miningParameters.getExtraData(), BftExtraDataCodec.EXTRA_VANITY_LENGTH), miningConfiguration.getExtraData(), BftExtraDataCodec.EXTRA_VANITY_LENGTH),
Collections.emptyList(), Collections.emptyList(),
Optional.empty(), Optional.empty(),
round, round,

@ -30,7 +30,7 @@ import org.hyperledger.besu.ethereum.api.jsonrpc.RpcApis;
import org.hyperledger.besu.ethereum.api.jsonrpc.internal.methods.JsonRpcMethod; import org.hyperledger.besu.ethereum.api.jsonrpc.internal.methods.JsonRpcMethod;
import org.hyperledger.besu.ethereum.api.jsonrpc.methods.ApiGroupJsonRpcMethods; import org.hyperledger.besu.ethereum.api.jsonrpc.methods.ApiGroupJsonRpcMethods;
import org.hyperledger.besu.ethereum.api.query.BlockchainQueries; import org.hyperledger.besu.ethereum.api.query.BlockchainQueries;
import org.hyperledger.besu.ethereum.core.MiningParameters; import org.hyperledger.besu.ethereum.core.MiningConfiguration;
import org.hyperledger.besu.ethereum.mainnet.ProtocolSchedule; import org.hyperledger.besu.ethereum.mainnet.ProtocolSchedule;
import java.util.Map; import java.util.Map;
@ -41,7 +41,7 @@ public class QbftJsonRpcMethods extends ApiGroupJsonRpcMethods {
private final ProtocolContext context; private final ProtocolContext context;
private final ValidatorProvider readOnlyValidatorProvider; private final ValidatorProvider readOnlyValidatorProvider;
private final ProtocolSchedule protocolSchedule; private final ProtocolSchedule protocolSchedule;
private final MiningParameters miningParameters; private final MiningConfiguration miningConfiguration;
private final BftConfigOptions bftConfig; private final BftConfigOptions bftConfig;
/** /**
@ -49,20 +49,20 @@ public class QbftJsonRpcMethods extends ApiGroupJsonRpcMethods {
* *
* @param context the protocol context * @param context the protocol context
* @param protocolSchedule the protocol schedule * @param protocolSchedule the protocol schedule
* @param miningParameters the mining parameters * @param miningConfiguration the mining parameters
* @param readOnlyValidatorProvider the read only validator provider * @param readOnlyValidatorProvider the read only validator provider
* @param bftConfig the BFT config options, containing QBFT-specific settings * @param bftConfig the BFT config options, containing QBFT-specific settings
*/ */
public QbftJsonRpcMethods( public QbftJsonRpcMethods(
final ProtocolContext context, final ProtocolContext context,
final ProtocolSchedule protocolSchedule, final ProtocolSchedule protocolSchedule,
final MiningParameters miningParameters, final MiningConfiguration miningConfiguration,
final ValidatorProvider readOnlyValidatorProvider, final ValidatorProvider readOnlyValidatorProvider,
final BftConfigOptions bftConfig) { final BftConfigOptions bftConfig) {
this.context = context; this.context = context;
this.readOnlyValidatorProvider = readOnlyValidatorProvider; this.readOnlyValidatorProvider = readOnlyValidatorProvider;
this.protocolSchedule = protocolSchedule; this.protocolSchedule = protocolSchedule;
this.miningParameters = miningParameters; this.miningConfiguration = miningConfiguration;
this.bftConfig = bftConfig; this.bftConfig = bftConfig;
} }
@ -78,7 +78,7 @@ public class QbftJsonRpcMethods extends ApiGroupJsonRpcMethods {
protocolSchedule, protocolSchedule,
context.getBlockchain(), context.getBlockchain(),
context.getWorldStateArchive(), context.getWorldStateArchive(),
miningParameters); miningConfiguration);
final BftContext bftContext = context.getConsensusContext(BftContext.class); final BftContext bftContext = context.getConsensusContext(BftContext.class);
final BlockInterface blockInterface = bftContext.getBlockInterface(); final BlockInterface blockInterface = bftContext.getBlockInterface();
final ValidatorProvider validatorProvider = bftContext.getValidatorProvider(); final ValidatorProvider validatorProvider = bftContext.getValidatorProvider();

@ -36,7 +36,7 @@ import org.hyperledger.besu.ethereum.ProtocolContext;
import org.hyperledger.besu.ethereum.chain.BadBlockManager; import org.hyperledger.besu.ethereum.chain.BadBlockManager;
import org.hyperledger.besu.ethereum.core.BlockHeader; import org.hyperledger.besu.ethereum.core.BlockHeader;
import org.hyperledger.besu.ethereum.core.MilestoneStreamingProtocolSchedule; import org.hyperledger.besu.ethereum.core.MilestoneStreamingProtocolSchedule;
import org.hyperledger.besu.ethereum.core.MiningParameters; import org.hyperledger.besu.ethereum.core.MiningConfiguration;
import org.hyperledger.besu.ethereum.core.PrivacyParameters; import org.hyperledger.besu.ethereum.core.PrivacyParameters;
import org.hyperledger.besu.ethereum.core.Util; import org.hyperledger.besu.ethereum.core.Util;
import org.hyperledger.besu.ethereum.mainnet.HeaderValidationMode; import org.hyperledger.besu.ethereum.mainnet.HeaderValidationMode;
@ -138,7 +138,7 @@ public class QbftProtocolScheduleTest {
false, false,
bftExtraDataCodec, bftExtraDataCodec,
EvmConfiguration.DEFAULT, EvmConfiguration.DEFAULT,
MiningParameters.MINING_DISABLED, MiningConfiguration.MINING_DISABLED,
new BadBlockManager(), new BadBlockManager(),
false, false,
new NoOpMetricsSystem()); new NoOpMetricsSystem());

@ -30,9 +30,9 @@ import org.hyperledger.besu.consensus.qbft.QbftExtraDataCodec;
import org.hyperledger.besu.datatypes.Address; import org.hyperledger.besu.datatypes.Address;
import org.hyperledger.besu.ethereum.ProtocolContext; import org.hyperledger.besu.ethereum.ProtocolContext;
import org.hyperledger.besu.ethereum.core.BlockHeader; import org.hyperledger.besu.ethereum.core.BlockHeader;
import org.hyperledger.besu.ethereum.core.ImmutableMiningParameters; import org.hyperledger.besu.ethereum.core.ImmutableMiningConfiguration;
import org.hyperledger.besu.ethereum.core.ImmutableMiningParameters.MutableInitValues; import org.hyperledger.besu.ethereum.core.ImmutableMiningConfiguration.MutableInitValues;
import org.hyperledger.besu.ethereum.core.MiningParameters; import org.hyperledger.besu.ethereum.core.MiningConfiguration;
import org.hyperledger.besu.ethereum.eth.transactions.TransactionPool; import org.hyperledger.besu.ethereum.eth.transactions.TransactionPool;
import org.hyperledger.besu.ethereum.mainnet.ProtocolSchedule; import org.hyperledger.besu.ethereum.mainnet.ProtocolSchedule;
import org.hyperledger.besu.testutil.DeterministicEthScheduler; import org.hyperledger.besu.testutil.DeterministicEthScheduler;
@ -50,8 +50,8 @@ public class QbftBlockCreatorFactoryTest {
@BeforeEach @BeforeEach
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
public void setUp() { public void setUp() {
final MiningParameters miningParams = final MiningConfiguration miningParams =
ImmutableMiningParameters.builder() ImmutableMiningConfiguration.builder()
.mutableInitValues( .mutableInitValues(
MutableInitValues.builder() MutableInitValues.builder()
.extraData(Bytes.wrap("Qbft tests".getBytes(UTF_8))) .extraData(Bytes.wrap("Qbft tests".getBytes(UTF_8)))

@ -69,7 +69,7 @@ import org.hyperledger.besu.ethereum.core.Block;
import org.hyperledger.besu.ethereum.core.BlockBody; import org.hyperledger.besu.ethereum.core.BlockBody;
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.MiningConfiguration;
import org.hyperledger.besu.ethereum.core.PrivacyParameters; import org.hyperledger.besu.ethereum.core.PrivacyParameters;
import org.hyperledger.besu.ethereum.core.Util; import org.hyperledger.besu.ethereum.core.Util;
import org.hyperledger.besu.ethereum.mainnet.DefaultProtocolSchedule; import org.hyperledger.besu.ethereum.mainnet.DefaultProtocolSchedule;
@ -187,7 +187,7 @@ public class QbftBlockHeightManagerTest {
new PrivacyParameters(), new PrivacyParameters(),
false, false,
EvmConfiguration.DEFAULT, EvmConfiguration.DEFAULT,
MiningParameters.MINING_DISABLED, MiningConfiguration.MINING_DISABLED,
new BadBlockManager(), new BadBlockManager(),
false, false,
new NoOpMetricsSystem()); new NoOpMetricsSystem());

@ -19,7 +19,7 @@ import org.hyperledger.besu.ethereum.chain.BadBlockManager;
import org.hyperledger.besu.ethereum.chain.GenesisState; import org.hyperledger.besu.ethereum.chain.GenesisState;
import org.hyperledger.besu.ethereum.core.Block; import org.hyperledger.besu.ethereum.core.Block;
import org.hyperledger.besu.ethereum.core.BlockHeaderFunctions; import org.hyperledger.besu.ethereum.core.BlockHeaderFunctions;
import org.hyperledger.besu.ethereum.core.MiningParameters; import org.hyperledger.besu.ethereum.core.MiningConfiguration;
import org.hyperledger.besu.ethereum.mainnet.MainnetProtocolSchedule; import org.hyperledger.besu.ethereum.mainnet.MainnetProtocolSchedule;
import org.hyperledger.besu.ethereum.mainnet.ProtocolSchedule; import org.hyperledger.besu.ethereum.mainnet.ProtocolSchedule;
import org.hyperledger.besu.ethereum.mainnet.ScheduleBasedBlockHeaderFunctions; import org.hyperledger.besu.ethereum.mainnet.ScheduleBasedBlockHeaderFunctions;
@ -46,7 +46,7 @@ public class BlockchainImporter {
protocolSchedule = protocolSchedule =
MainnetProtocolSchedule.fromConfig( MainnetProtocolSchedule.fromConfig(
GenesisConfigFile.fromConfig(genesisJson).getConfigOptions(), GenesisConfigFile.fromConfig(genesisJson).getConfigOptions(),
MiningParameters.newDefault(), MiningConfiguration.newDefault(),
new BadBlockManager(), new BadBlockManager(),
false, false,
new NoOpMetricsSystem()); new NoOpMetricsSystem());

@ -33,7 +33,7 @@ import org.hyperledger.besu.ethereum.chain.BadBlockManager;
import org.hyperledger.besu.ethereum.chain.MutableBlockchain; import org.hyperledger.besu.ethereum.chain.MutableBlockchain;
import org.hyperledger.besu.ethereum.core.Block; import org.hyperledger.besu.ethereum.core.Block;
import org.hyperledger.besu.ethereum.core.BlockImporter; import org.hyperledger.besu.ethereum.core.BlockImporter;
import org.hyperledger.besu.ethereum.core.MiningParameters; import org.hyperledger.besu.ethereum.core.MiningConfiguration;
import org.hyperledger.besu.ethereum.core.PrivacyParameters; import org.hyperledger.besu.ethereum.core.PrivacyParameters;
import org.hyperledger.besu.ethereum.core.Synchronizer; import org.hyperledger.besu.ethereum.core.Synchronizer;
import org.hyperledger.besu.ethereum.eth.manager.EthPeers; import org.hyperledger.besu.ethereum.eth.manager.EthPeers;
@ -94,7 +94,7 @@ public class JsonRpcTestMethodsFactory {
} }
this.blockchainQueries = this.blockchainQueries =
new BlockchainQueries( new BlockchainQueries(
protocolSchedule, blockchain, stateArchive, MiningParameters.newDefault()); protocolSchedule, blockchain, stateArchive, MiningConfiguration.newDefault());
} }
public JsonRpcTestMethodsFactory( public JsonRpcTestMethodsFactory(
@ -112,7 +112,7 @@ public class JsonRpcTestMethodsFactory {
importer.getProtocolSchedule(), importer.getProtocolSchedule(),
blockchain, blockchain,
stateArchive, stateArchive,
MiningParameters.newDefault()); MiningConfiguration.newDefault());
this.synchronizer = mock(Synchronizer.class); this.synchronizer = mock(Synchronizer.class);
} }
@ -133,7 +133,7 @@ public class JsonRpcTestMethodsFactory {
importer.getProtocolSchedule(), importer.getProtocolSchedule(),
blockchain, blockchain,
stateArchive, stateArchive,
MiningParameters.newDefault()); MiningConfiguration.newDefault());
} }
public BlockchainQueries getBlockchainQueries() { public BlockchainQueries getBlockchainQueries() {
@ -152,7 +152,7 @@ public class JsonRpcTestMethodsFactory {
final P2PNetwork peerDiscovery = mock(P2PNetwork.class); final P2PNetwork peerDiscovery = mock(P2PNetwork.class);
final EthPeers ethPeers = mock(EthPeers.class); final EthPeers ethPeers = mock(EthPeers.class);
final TransactionPool transactionPool = mock(TransactionPool.class); final TransactionPool transactionPool = mock(TransactionPool.class);
final MiningParameters miningParameters = mock(MiningParameters.class); final MiningConfiguration miningConfiguration = mock(MiningConfiguration.class);
final PoWMiningCoordinator miningCoordinator = mock(PoWMiningCoordinator.class); final PoWMiningCoordinator miningCoordinator = mock(PoWMiningCoordinator.class);
final ObservableMetricsSystem metricsSystem = new NoOpMetricsSystem(); final ObservableMetricsSystem metricsSystem = new NoOpMetricsSystem();
final Optional<AccountLocalConfigPermissioningController> accountWhitelistController = final Optional<AccountLocalConfigPermissioningController> accountWhitelistController =
@ -198,7 +198,7 @@ public class JsonRpcTestMethodsFactory {
context, context,
filterManager, filterManager,
transactionPool, transactionPool,
miningParameters, miningConfiguration,
miningCoordinator, miningCoordinator,
metricsSystem, metricsSystem,
new HashSet<>(), new HashSet<>(),

@ -45,7 +45,7 @@ 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.Difficulty; import org.hyperledger.besu.ethereum.core.Difficulty;
import org.hyperledger.besu.ethereum.core.ExecutionContextTestFixture; import org.hyperledger.besu.ethereum.core.ExecutionContextTestFixture;
import org.hyperledger.besu.ethereum.core.MiningParameters; import org.hyperledger.besu.ethereum.core.MiningConfiguration;
import org.hyperledger.besu.ethereum.core.Transaction; import org.hyperledger.besu.ethereum.core.Transaction;
import org.hyperledger.besu.ethereum.core.TransactionReceipt; import org.hyperledger.besu.ethereum.core.TransactionReceipt;
import org.hyperledger.besu.ethereum.eth.manager.EthContext; import org.hyperledger.besu.ethereum.eth.manager.EthContext;
@ -130,7 +130,7 @@ public class EthGetFilterChangesIntegrationTest {
executionContext.getProtocolSchedule(), executionContext.getProtocolSchedule(),
blockchain, blockchain,
protocolContext.getWorldStateArchive(), protocolContext.getWorldStateArchive(),
MiningParameters.newDefault()); MiningConfiguration.newDefault());
filterManager = filterManager =
new FilterManagerBuilder() new FilterManagerBuilder()
.blockchainQueries(blockchainQueries) .blockchainQueries(blockchainQueries)

@ -45,7 +45,7 @@ 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.Difficulty; import org.hyperledger.besu.ethereum.core.Difficulty;
import org.hyperledger.besu.ethereum.core.ExecutionContextTestFixture; import org.hyperledger.besu.ethereum.core.ExecutionContextTestFixture;
import org.hyperledger.besu.ethereum.core.MiningParameters; import org.hyperledger.besu.ethereum.core.MiningConfiguration;
import org.hyperledger.besu.ethereum.core.Transaction; import org.hyperledger.besu.ethereum.core.Transaction;
import org.hyperledger.besu.ethereum.core.TransactionReceipt; import org.hyperledger.besu.ethereum.core.TransactionReceipt;
import org.hyperledger.besu.ethereum.eth.manager.EthContext; import org.hyperledger.besu.ethereum.eth.manager.EthContext;
@ -130,7 +130,7 @@ public class EthGetFilterChangesIntegrationTest {
executionContext.getProtocolSchedule(), executionContext.getProtocolSchedule(),
blockchain, blockchain,
protocolContext.getWorldStateArchive(), protocolContext.getWorldStateArchive(),
MiningParameters.newDefault()); MiningConfiguration.newDefault());
filterManager = filterManager =
new FilterManagerBuilder() new FilterManagerBuilder()
.blockchainQueries(blockchainQueries) .blockchainQueries(blockchainQueries)

@ -19,13 +19,13 @@ import org.hyperledger.besu.ethereum.api.jsonrpc.internal.JsonRpcRequestContext;
import org.hyperledger.besu.ethereum.api.jsonrpc.internal.methods.JsonRpcMethod; import org.hyperledger.besu.ethereum.api.jsonrpc.internal.methods.JsonRpcMethod;
import org.hyperledger.besu.ethereum.api.jsonrpc.internal.response.JsonRpcResponse; import org.hyperledger.besu.ethereum.api.jsonrpc.internal.response.JsonRpcResponse;
import org.hyperledger.besu.ethereum.api.jsonrpc.internal.response.JsonRpcSuccessResponse; import org.hyperledger.besu.ethereum.api.jsonrpc.internal.response.JsonRpcSuccessResponse;
import org.hyperledger.besu.ethereum.core.MiningParameters; import org.hyperledger.besu.ethereum.core.MiningConfiguration;
public class MinerGetExtraData implements JsonRpcMethod { public class MinerGetExtraData implements JsonRpcMethod {
private final MiningParameters miningParameters; private final MiningConfiguration miningConfiguration;
public MinerGetExtraData(final MiningParameters miningParameters) { public MinerGetExtraData(final MiningConfiguration miningConfiguration) {
this.miningParameters = miningParameters; this.miningConfiguration = miningConfiguration;
} }
@Override @Override
@ -36,6 +36,6 @@ public class MinerGetExtraData implements JsonRpcMethod {
@Override @Override
public JsonRpcResponse response(final JsonRpcRequestContext requestContext) { public JsonRpcResponse response(final JsonRpcRequestContext requestContext) {
return new JsonRpcSuccessResponse( return new JsonRpcSuccessResponse(
requestContext.getRequest().getId(), miningParameters.getExtraData().toShortHexString()); requestContext.getRequest().getId(), miningConfiguration.getExtraData().toShortHexString());
} }
} }

@ -20,13 +20,13 @@ import org.hyperledger.besu.ethereum.api.jsonrpc.internal.methods.JsonRpcMethod;
import org.hyperledger.besu.ethereum.api.jsonrpc.internal.response.JsonRpcResponse; import org.hyperledger.besu.ethereum.api.jsonrpc.internal.response.JsonRpcResponse;
import org.hyperledger.besu.ethereum.api.jsonrpc.internal.response.JsonRpcSuccessResponse; import org.hyperledger.besu.ethereum.api.jsonrpc.internal.response.JsonRpcSuccessResponse;
import org.hyperledger.besu.ethereum.api.jsonrpc.internal.results.Quantity; import org.hyperledger.besu.ethereum.api.jsonrpc.internal.results.Quantity;
import org.hyperledger.besu.ethereum.core.MiningParameters; import org.hyperledger.besu.ethereum.core.MiningConfiguration;
public class MinerGetMinGasPrice implements JsonRpcMethod { public class MinerGetMinGasPrice implements JsonRpcMethod {
private final MiningParameters miningParameters; private final MiningConfiguration miningConfiguration;
public MinerGetMinGasPrice(final MiningParameters miningParameters) { public MinerGetMinGasPrice(final MiningConfiguration miningConfiguration) {
this.miningParameters = miningParameters; this.miningConfiguration = miningConfiguration;
} }
@Override @Override
@ -38,6 +38,6 @@ public class MinerGetMinGasPrice implements JsonRpcMethod {
public JsonRpcResponse response(final JsonRpcRequestContext requestContext) { public JsonRpcResponse response(final JsonRpcRequestContext requestContext) {
return new JsonRpcSuccessResponse( return new JsonRpcSuccessResponse(
requestContext.getRequest().getId(), requestContext.getRequest().getId(),
Quantity.create(miningParameters.getMinTransactionGasPrice())); Quantity.create(miningConfiguration.getMinTransactionGasPrice()));
} }
} }

@ -20,13 +20,13 @@ import org.hyperledger.besu.ethereum.api.jsonrpc.internal.methods.JsonRpcMethod;
import org.hyperledger.besu.ethereum.api.jsonrpc.internal.response.JsonRpcResponse; import org.hyperledger.besu.ethereum.api.jsonrpc.internal.response.JsonRpcResponse;
import org.hyperledger.besu.ethereum.api.jsonrpc.internal.response.JsonRpcSuccessResponse; import org.hyperledger.besu.ethereum.api.jsonrpc.internal.response.JsonRpcSuccessResponse;
import org.hyperledger.besu.ethereum.api.jsonrpc.internal.results.Quantity; import org.hyperledger.besu.ethereum.api.jsonrpc.internal.results.Quantity;
import org.hyperledger.besu.ethereum.core.MiningParameters; import org.hyperledger.besu.ethereum.core.MiningConfiguration;
public class MinerGetMinPriorityFee implements JsonRpcMethod { public class MinerGetMinPriorityFee implements JsonRpcMethod {
private final MiningParameters miningParameters; private final MiningConfiguration miningConfiguration;
public MinerGetMinPriorityFee(final MiningParameters miningParameters) { public MinerGetMinPriorityFee(final MiningConfiguration miningConfiguration) {
this.miningParameters = miningParameters; this.miningConfiguration = miningConfiguration;
} }
@Override @Override
@ -38,6 +38,6 @@ public class MinerGetMinPriorityFee implements JsonRpcMethod {
public JsonRpcResponse response(final JsonRpcRequestContext requestContext) { public JsonRpcResponse response(final JsonRpcRequestContext requestContext) {
return new JsonRpcSuccessResponse( return new JsonRpcSuccessResponse(
requestContext.getRequest().getId(), requestContext.getRequest().getId(),
Quantity.create(miningParameters.getMinPriorityFeePerGas())); Quantity.create(miningConfiguration.getMinPriorityFeePerGas()));
} }
} }

@ -23,7 +23,7 @@ import org.hyperledger.besu.ethereum.api.jsonrpc.internal.response.JsonRpcErrorR
import org.hyperledger.besu.ethereum.api.jsonrpc.internal.response.JsonRpcResponse; import org.hyperledger.besu.ethereum.api.jsonrpc.internal.response.JsonRpcResponse;
import org.hyperledger.besu.ethereum.api.jsonrpc.internal.response.JsonRpcSuccessResponse; import org.hyperledger.besu.ethereum.api.jsonrpc.internal.response.JsonRpcSuccessResponse;
import org.hyperledger.besu.ethereum.api.jsonrpc.internal.response.RpcErrorType; import org.hyperledger.besu.ethereum.api.jsonrpc.internal.response.RpcErrorType;
import org.hyperledger.besu.ethereum.core.MiningParameters; import org.hyperledger.besu.ethereum.core.MiningConfiguration;
import java.nio.charset.StandardCharsets; import java.nio.charset.StandardCharsets;
@ -35,10 +35,10 @@ import org.slf4j.LoggerFactory;
public class MinerSetExtraData implements JsonRpcMethod { public class MinerSetExtraData implements JsonRpcMethod {
private static final Logger LOG = LoggerFactory.getLogger(MinerSetExtraData.class); private static final Logger LOG = LoggerFactory.getLogger(MinerSetExtraData.class);
private final MiningParameters miningParameters; private final MiningConfiguration miningConfiguration;
public MinerSetExtraData(final MiningParameters miningParameters) { public MinerSetExtraData(final MiningConfiguration miningConfiguration) {
this.miningParameters = miningParameters; this.miningConfiguration = miningConfiguration;
} }
@Override @Override
@ -53,7 +53,7 @@ public class MinerSetExtraData implements JsonRpcMethod {
Bytes32.fromHexStringLenient( Bytes32.fromHexStringLenient(
rawParam); // done for validation, we want a hex string and max 32 bytes rawParam); // done for validation, we want a hex string and max 32 bytes
final var extraData = Bytes.fromHexStringLenient(rawParam); final var extraData = Bytes.fromHexStringLenient(rawParam);
miningParameters.setExtraData(extraData); miningConfiguration.setExtraData(extraData);
LOG.atDebug() LOG.atDebug()
.setMessage("set extra data, raw=[{}] parsed=[{}], UTF-8=[{}]") .setMessage("set extra data, raw=[{}] parsed=[{}], UTF-8=[{}]")
.addArgument(rawParam) .addArgument(rawParam)

@ -25,7 +25,7 @@ import org.hyperledger.besu.ethereum.api.jsonrpc.internal.response.JsonRpcErrorR
import org.hyperledger.besu.ethereum.api.jsonrpc.internal.response.JsonRpcResponse; import org.hyperledger.besu.ethereum.api.jsonrpc.internal.response.JsonRpcResponse;
import org.hyperledger.besu.ethereum.api.jsonrpc.internal.response.JsonRpcSuccessResponse; import org.hyperledger.besu.ethereum.api.jsonrpc.internal.response.JsonRpcSuccessResponse;
import org.hyperledger.besu.ethereum.api.jsonrpc.internal.response.RpcErrorType; import org.hyperledger.besu.ethereum.api.jsonrpc.internal.response.RpcErrorType;
import org.hyperledger.besu.ethereum.core.MiningParameters; import org.hyperledger.besu.ethereum.core.MiningConfiguration;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
@ -33,10 +33,10 @@ import org.slf4j.LoggerFactory;
public class MinerSetMinGasPrice implements JsonRpcMethod { public class MinerSetMinGasPrice implements JsonRpcMethod {
private static final Logger LOG = LoggerFactory.getLogger(MinerSetMinGasPrice.class); private static final Logger LOG = LoggerFactory.getLogger(MinerSetMinGasPrice.class);
private final MiningParameters miningParameters; private final MiningConfiguration miningConfiguration;
public MinerSetMinGasPrice(final MiningParameters miningParameters) { public MinerSetMinGasPrice(final MiningConfiguration miningConfiguration) {
this.miningParameters = miningParameters; this.miningConfiguration = miningConfiguration;
} }
@Override @Override
@ -49,7 +49,7 @@ public class MinerSetMinGasPrice implements JsonRpcMethod {
try { try {
final Wei minGasPrice = final Wei minGasPrice =
Wei.fromHexString(requestContext.getRequiredParameter(0, String.class)); Wei.fromHexString(requestContext.getRequiredParameter(0, String.class));
miningParameters.setMinTransactionGasPrice(minGasPrice); miningConfiguration.setMinTransactionGasPrice(minGasPrice);
LOG.debug("min gas price changed to {}", minGasPrice.toHumanReadableString()); LOG.debug("min gas price changed to {}", minGasPrice.toHumanReadableString());
return new JsonRpcSuccessResponse(requestContext.getRequest().getId(), true); return new JsonRpcSuccessResponse(requestContext.getRequest().getId(), true);
} catch (final IllegalArgumentException invalidJsonRpcParameters) { } catch (final IllegalArgumentException invalidJsonRpcParameters) {

@ -24,7 +24,7 @@ import org.hyperledger.besu.ethereum.api.jsonrpc.internal.response.JsonRpcErrorR
import org.hyperledger.besu.ethereum.api.jsonrpc.internal.response.JsonRpcResponse; import org.hyperledger.besu.ethereum.api.jsonrpc.internal.response.JsonRpcResponse;
import org.hyperledger.besu.ethereum.api.jsonrpc.internal.response.JsonRpcSuccessResponse; import org.hyperledger.besu.ethereum.api.jsonrpc.internal.response.JsonRpcSuccessResponse;
import org.hyperledger.besu.ethereum.api.jsonrpc.internal.response.RpcErrorType; import org.hyperledger.besu.ethereum.api.jsonrpc.internal.response.RpcErrorType;
import org.hyperledger.besu.ethereum.core.MiningParameters; import org.hyperledger.besu.ethereum.core.MiningConfiguration;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
@ -32,10 +32,10 @@ import org.slf4j.LoggerFactory;
public class MinerSetMinPriorityFee implements JsonRpcMethod { public class MinerSetMinPriorityFee implements JsonRpcMethod {
private static final Logger LOG = LoggerFactory.getLogger(MinerSetMinPriorityFee.class); private static final Logger LOG = LoggerFactory.getLogger(MinerSetMinPriorityFee.class);
private final MiningParameters miningParameters; private final MiningConfiguration miningConfiguration;
public MinerSetMinPriorityFee(final MiningParameters miningParameters) { public MinerSetMinPriorityFee(final MiningConfiguration miningConfiguration) {
this.miningParameters = miningParameters; this.miningConfiguration = miningConfiguration;
} }
@Override @Override
@ -48,7 +48,7 @@ public class MinerSetMinPriorityFee implements JsonRpcMethod {
try { try {
final Wei minPriorityFeePerGas = final Wei minPriorityFeePerGas =
Wei.fromHexString(requestContext.getRequiredParameter(0, String.class)); Wei.fromHexString(requestContext.getRequiredParameter(0, String.class));
miningParameters.setMinPriorityFeePerGas(minPriorityFeePerGas); miningConfiguration.setMinPriorityFeePerGas(minPriorityFeePerGas);
LOG.debug( LOG.debug(
"min priority fee per gas changed to {}", minPriorityFeePerGas.toHumanReadableString()); "min priority fee per gas changed to {}", minPriorityFeePerGas.toHumanReadableString());
return new JsonRpcSuccessResponse(requestContext.getRequest().getId(), true); return new JsonRpcSuccessResponse(requestContext.getRequest().getId(), true);

@ -25,7 +25,7 @@ import org.hyperledger.besu.ethereum.api.jsonrpc.internal.methods.RpcModules;
import org.hyperledger.besu.ethereum.api.jsonrpc.websocket.WebSocketConfiguration; import org.hyperledger.besu.ethereum.api.jsonrpc.websocket.WebSocketConfiguration;
import org.hyperledger.besu.ethereum.api.query.BlockchainQueries; import org.hyperledger.besu.ethereum.api.query.BlockchainQueries;
import org.hyperledger.besu.ethereum.blockcreation.MiningCoordinator; import org.hyperledger.besu.ethereum.blockcreation.MiningCoordinator;
import org.hyperledger.besu.ethereum.core.MiningParameters; import org.hyperledger.besu.ethereum.core.MiningConfiguration;
import org.hyperledger.besu.ethereum.core.PrivacyParameters; import org.hyperledger.besu.ethereum.core.PrivacyParameters;
import org.hyperledger.besu.ethereum.core.Synchronizer; import org.hyperledger.besu.ethereum.core.Synchronizer;
import org.hyperledger.besu.ethereum.eth.manager.EthPeers; import org.hyperledger.besu.ethereum.eth.manager.EthPeers;
@ -67,7 +67,7 @@ public class JsonRpcMethodsFactory {
final ProtocolContext protocolContext, final ProtocolContext protocolContext,
final FilterManager filterManager, final FilterManager filterManager,
final TransactionPool transactionPool, final TransactionPool transactionPool,
final MiningParameters miningParameters, final MiningConfiguration miningConfiguration,
final MiningCoordinator miningCoordinator, final MiningCoordinator miningCoordinator,
final ObservableMetricsSystem metricsSystem, final ObservableMetricsSystem metricsSystem,
final Set<Capability> supportedCapabilities, final Set<Capability> supportedCapabilities,
@ -139,7 +139,7 @@ public class JsonRpcMethodsFactory {
webSocketConfiguration, webSocketConfiguration,
metricsConfiguration, metricsConfiguration,
graphQLConfiguration), graphQLConfiguration),
new MinerJsonRpcMethods(miningParameters, miningCoordinator), new MinerJsonRpcMethods(miningConfiguration, miningCoordinator),
new PermJsonRpcMethods(accountsAllowlistController, nodeAllowlistController), new PermJsonRpcMethods(accountsAllowlistController, nodeAllowlistController),
new PrivJsonRpcMethods( new PrivJsonRpcMethods(
blockchainQueries, blockchainQueries,

@ -28,18 +28,18 @@ import org.hyperledger.besu.ethereum.api.jsonrpc.internal.methods.miner.MinerSet
import org.hyperledger.besu.ethereum.api.jsonrpc.internal.methods.miner.MinerStart; import org.hyperledger.besu.ethereum.api.jsonrpc.internal.methods.miner.MinerStart;
import org.hyperledger.besu.ethereum.api.jsonrpc.internal.methods.miner.MinerStop; import org.hyperledger.besu.ethereum.api.jsonrpc.internal.methods.miner.MinerStop;
import org.hyperledger.besu.ethereum.blockcreation.MiningCoordinator; import org.hyperledger.besu.ethereum.blockcreation.MiningCoordinator;
import org.hyperledger.besu.ethereum.core.MiningParameters; import org.hyperledger.besu.ethereum.core.MiningConfiguration;
import java.util.Map; import java.util.Map;
public class MinerJsonRpcMethods extends ApiGroupJsonRpcMethods { public class MinerJsonRpcMethods extends ApiGroupJsonRpcMethods {
private final MiningCoordinator miningCoordinator; private final MiningCoordinator miningCoordinator;
private final MiningParameters miningParameters; private final MiningConfiguration miningConfiguration;
public MinerJsonRpcMethods( public MinerJsonRpcMethods(
final MiningParameters miningParameters, final MiningCoordinator miningCoordinator) { final MiningConfiguration miningConfiguration, final MiningCoordinator miningCoordinator) {
this.miningParameters = miningParameters; this.miningConfiguration = miningConfiguration;
this.miningCoordinator = miningCoordinator; this.miningCoordinator = miningCoordinator;
} }
@ -57,11 +57,11 @@ public class MinerJsonRpcMethods extends ApiGroupJsonRpcMethods {
minerSetCoinbase, minerSetCoinbase,
new MinerSetEtherbase(minerSetCoinbase), new MinerSetEtherbase(minerSetCoinbase),
new MinerChangeTargetGasLimit(miningCoordinator), new MinerChangeTargetGasLimit(miningCoordinator),
new MinerGetMinPriorityFee(miningParameters), new MinerGetMinPriorityFee(miningConfiguration),
new MinerSetMinPriorityFee(miningParameters), new MinerSetMinPriorityFee(miningConfiguration),
new MinerGetMinGasPrice(miningParameters), new MinerGetMinGasPrice(miningConfiguration),
new MinerSetMinGasPrice(miningParameters), new MinerSetMinGasPrice(miningConfiguration),
new MinerGetExtraData(miningParameters), new MinerGetExtraData(miningConfiguration),
new MinerSetExtraData(miningParameters)); new MinerSetExtraData(miningConfiguration));
} }
} }

@ -30,7 +30,7 @@ import org.hyperledger.besu.ethereum.core.Block;
import org.hyperledger.besu.ethereum.core.BlockBody; import org.hyperledger.besu.ethereum.core.BlockBody;
import org.hyperledger.besu.ethereum.core.BlockHeader; import org.hyperledger.besu.ethereum.core.BlockHeader;
import org.hyperledger.besu.ethereum.core.LogWithMetadata; import org.hyperledger.besu.ethereum.core.LogWithMetadata;
import org.hyperledger.besu.ethereum.core.MiningParameters; import org.hyperledger.besu.ethereum.core.MiningConfiguration;
import org.hyperledger.besu.ethereum.core.MutableWorldState; import org.hyperledger.besu.ethereum.core.MutableWorldState;
import org.hyperledger.besu.ethereum.core.Transaction; import org.hyperledger.besu.ethereum.core.Transaction;
import org.hyperledger.besu.ethereum.core.TransactionReceipt; import org.hyperledger.besu.ethereum.core.TransactionReceipt;
@ -77,20 +77,20 @@ public class BlockchainQueries {
private final Optional<TransactionLogBloomCacher> transactionLogBloomCacher; private final Optional<TransactionLogBloomCacher> transactionLogBloomCacher;
private final Optional<EthScheduler> ethScheduler; private final Optional<EthScheduler> ethScheduler;
private final ApiConfiguration apiConfig; private final ApiConfiguration apiConfig;
private final MiningParameters miningParameters; private final MiningConfiguration miningConfiguration;
public BlockchainQueries( public BlockchainQueries(
final ProtocolSchedule protocolSchedule, final ProtocolSchedule protocolSchedule,
final Blockchain blockchain, final Blockchain blockchain,
final WorldStateArchive worldStateArchive, final WorldStateArchive worldStateArchive,
final MiningParameters miningParameters) { final MiningConfiguration miningConfiguration) {
this( this(
protocolSchedule, protocolSchedule,
blockchain, blockchain,
worldStateArchive, worldStateArchive,
Optional.empty(), Optional.empty(),
Optional.empty(), Optional.empty(),
miningParameters); miningConfiguration);
} }
public BlockchainQueries( public BlockchainQueries(
@ -98,14 +98,14 @@ public class BlockchainQueries {
final Blockchain blockchain, final Blockchain blockchain,
final WorldStateArchive worldStateArchive, final WorldStateArchive worldStateArchive,
final EthScheduler scheduler, final EthScheduler scheduler,
final MiningParameters miningParameters) { final MiningConfiguration miningConfiguration) {
this( this(
protocolSchedule, protocolSchedule,
blockchain, blockchain,
worldStateArchive, worldStateArchive,
Optional.empty(), Optional.empty(),
Optional.ofNullable(scheduler), Optional.ofNullable(scheduler),
miningParameters); miningConfiguration);
} }
public BlockchainQueries( public BlockchainQueries(
@ -114,7 +114,7 @@ public class BlockchainQueries {
final WorldStateArchive worldStateArchive, final WorldStateArchive worldStateArchive,
final Optional<Path> cachePath, final Optional<Path> cachePath,
final Optional<EthScheduler> scheduler, final Optional<EthScheduler> scheduler,
final MiningParameters miningParameters) { final MiningConfiguration miningConfiguration) {
this( this(
protocolSchedule, protocolSchedule,
blockchain, blockchain,
@ -122,7 +122,7 @@ public class BlockchainQueries {
cachePath, cachePath,
scheduler, scheduler,
ImmutableApiConfiguration.builder().build(), ImmutableApiConfiguration.builder().build(),
miningParameters); miningConfiguration);
} }
public BlockchainQueries( public BlockchainQueries(
@ -132,7 +132,7 @@ public class BlockchainQueries {
final Optional<Path> cachePath, final Optional<Path> cachePath,
final Optional<EthScheduler> scheduler, final Optional<EthScheduler> scheduler,
final ApiConfiguration apiConfig, final ApiConfiguration apiConfig,
final MiningParameters miningParameters) { final MiningConfiguration miningConfiguration) {
this.protocolSchedule = protocolSchedule; this.protocolSchedule = protocolSchedule;
this.blockchain = blockchain; this.blockchain = blockchain;
this.worldStateArchive = worldStateArchive; this.worldStateArchive = worldStateArchive;
@ -144,7 +144,7 @@ public class BlockchainQueries {
new TransactionLogBloomCacher(blockchain, cachePath.get(), scheduler.get())) new TransactionLogBloomCacher(blockchain, cachePath.get(), scheduler.get()))
: Optional.empty(); : Optional.empty();
this.apiConfig = apiConfig; this.apiConfig = apiConfig;
this.miningParameters = miningParameters; this.miningConfiguration = miningConfiguration;
} }
public Blockchain getBlockchain() { public Blockchain getBlockchain() {
@ -1034,7 +1034,7 @@ public class BlockchainQueries {
private Wei gasPriceLowerBound( private Wei gasPriceLowerBound(
final BlockHeader chainHeadHeader, final FeeMarket nextBlockFeeMarket) { final BlockHeader chainHeadHeader, final FeeMarket nextBlockFeeMarket) {
final var minGasPrice = miningParameters.getMinTransactionGasPrice(); final var minGasPrice = miningConfiguration.getMinTransactionGasPrice();
if (nextBlockFeeMarket.implementsBaseFee()) { if (nextBlockFeeMarket.implementsBaseFee()) {
return UInt256s.max( return UInt256s.max(
@ -1070,9 +1070,9 @@ public class BlockchainQueries {
.toArray(Wei[]::new); .toArray(Wei[]::new);
return gasCollection.length == 0 return gasCollection.length == 0
? miningParameters.getMinPriorityFeePerGas() ? miningConfiguration.getMinPriorityFeePerGas()
: UInt256s.max( : UInt256s.max(
miningParameters.getMinPriorityFeePerGas(), miningConfiguration.getMinPriorityFeePerGas(),
gasCollection[ gasCollection[
Math.min( Math.min(
gasCollection.length - 1, gasCollection.length - 1,

@ -27,7 +27,7 @@ import org.hyperledger.besu.ethereum.chain.BadBlockManager;
import org.hyperledger.besu.ethereum.chain.MutableBlockchain; import org.hyperledger.besu.ethereum.chain.MutableBlockchain;
import org.hyperledger.besu.ethereum.core.BlockchainSetupUtil; import org.hyperledger.besu.ethereum.core.BlockchainSetupUtil;
import org.hyperledger.besu.ethereum.core.DefaultSyncStatus; import org.hyperledger.besu.ethereum.core.DefaultSyncStatus;
import org.hyperledger.besu.ethereum.core.MiningParameters; import org.hyperledger.besu.ethereum.core.MiningConfiguration;
import org.hyperledger.besu.ethereum.core.Synchronizer; import org.hyperledger.besu.ethereum.core.Synchronizer;
import org.hyperledger.besu.ethereum.core.Transaction; import org.hyperledger.besu.ethereum.core.Transaction;
import org.hyperledger.besu.ethereum.eth.EthProtocol; import org.hyperledger.besu.ethereum.eth.EthProtocol;
@ -119,7 +119,7 @@ public abstract class AbstractEthGraphQLHttpServiceTest {
Optional.empty(), Optional.empty(),
Optional.empty(), Optional.empty(),
ImmutableApiConfiguration.builder().build(), ImmutableApiConfiguration.builder().build(),
MiningParameters.newDefault().setMinTransactionGasPrice(Wei.ZERO)); MiningConfiguration.newDefault().setMinTransactionGasPrice(Wei.ZERO));
final Set<Capability> supportedCapabilities = new HashSet<>(); final Set<Capability> supportedCapabilities = new HashSet<>();
supportedCapabilities.add(EthProtocol.ETH62); supportedCapabilities.add(EthProtocol.ETH62);

@ -35,7 +35,7 @@ import org.hyperledger.besu.ethereum.api.jsonrpc.websocket.WebSocketConfiguratio
import org.hyperledger.besu.ethereum.api.query.BlockchainQueries; import org.hyperledger.besu.ethereum.api.query.BlockchainQueries;
import org.hyperledger.besu.ethereum.blockcreation.PoWMiningCoordinator; import org.hyperledger.besu.ethereum.blockcreation.PoWMiningCoordinator;
import org.hyperledger.besu.ethereum.core.BlockchainSetupUtil; import org.hyperledger.besu.ethereum.core.BlockchainSetupUtil;
import org.hyperledger.besu.ethereum.core.MiningParameters; import org.hyperledger.besu.ethereum.core.MiningConfiguration;
import org.hyperledger.besu.ethereum.core.PrivacyParameters; import org.hyperledger.besu.ethereum.core.PrivacyParameters;
import org.hyperledger.besu.ethereum.core.Synchronizer; import org.hyperledger.besu.ethereum.core.Synchronizer;
import org.hyperledger.besu.ethereum.core.Transaction; import org.hyperledger.besu.ethereum.core.Transaction;
@ -137,7 +137,7 @@ public abstract class AbstractJsonRpcHttpServiceTest {
final Synchronizer synchronizerMock = mock(Synchronizer.class); final Synchronizer synchronizerMock = mock(Synchronizer.class);
final P2PNetwork peerDiscoveryMock = mock(P2PNetwork.class); final P2PNetwork peerDiscoveryMock = mock(P2PNetwork.class);
final TransactionPool transactionPoolMock = mock(TransactionPool.class); final TransactionPool transactionPoolMock = mock(TransactionPool.class);
final MiningParameters miningParameters = mock(MiningParameters.class); final MiningConfiguration miningConfiguration = mock(MiningConfiguration.class);
final PoWMiningCoordinator miningCoordinatorMock = mock(PoWMiningCoordinator.class); final PoWMiningCoordinator miningCoordinatorMock = mock(PoWMiningCoordinator.class);
when(transactionPoolMock.addTransactionViaApi(any(Transaction.class))) when(transactionPoolMock.addTransactionViaApi(any(Transaction.class)))
.thenReturn(ValidationResult.valid()); .thenReturn(ValidationResult.valid());
@ -151,7 +151,7 @@ public abstract class AbstractJsonRpcHttpServiceTest {
blockchainSetupUtil.getProtocolSchedule(), blockchainSetupUtil.getProtocolSchedule(),
blockchainSetupUtil.getBlockchain(), blockchainSetupUtil.getBlockchain(),
blockchainSetupUtil.getWorldArchive(), blockchainSetupUtil.getWorldArchive(),
miningParameters); miningConfiguration);
final FilterIdGenerator filterIdGenerator = mock(FilterIdGenerator.class); final FilterIdGenerator filterIdGenerator = mock(FilterIdGenerator.class);
final FilterRepository filterRepository = new FilterRepository(); final FilterRepository filterRepository = new FilterRepository();
when(filterIdGenerator.nextId()).thenReturn("0x1"); when(filterIdGenerator.nextId()).thenReturn("0x1");
@ -183,7 +183,7 @@ public abstract class AbstractJsonRpcHttpServiceTest {
protocolContext, protocolContext,
filterManager, filterManager,
transactionPoolMock, transactionPoolMock,
miningParameters, miningConfiguration,
miningCoordinatorMock, miningCoordinatorMock,
new NoOpMetricsSystem(), new NoOpMetricsSystem(),
supportedCapabilities, supportedCapabilities,

@ -30,7 +30,7 @@ import org.hyperledger.besu.ethereum.api.jsonrpc.websocket.WebSocketConfiguratio
import org.hyperledger.besu.ethereum.api.query.BlockchainQueries; import org.hyperledger.besu.ethereum.api.query.BlockchainQueries;
import org.hyperledger.besu.ethereum.blockcreation.PoWMiningCoordinator; import org.hyperledger.besu.ethereum.blockcreation.PoWMiningCoordinator;
import org.hyperledger.besu.ethereum.chain.BadBlockManager; import org.hyperledger.besu.ethereum.chain.BadBlockManager;
import org.hyperledger.besu.ethereum.core.MiningParameters; import org.hyperledger.besu.ethereum.core.MiningConfiguration;
import org.hyperledger.besu.ethereum.core.PrivacyParameters; import org.hyperledger.besu.ethereum.core.PrivacyParameters;
import org.hyperledger.besu.ethereum.core.Synchronizer; import org.hyperledger.besu.ethereum.core.Synchronizer;
import org.hyperledger.besu.ethereum.eth.EthProtocol; import org.hyperledger.besu.ethereum.eth.EthProtocol;
@ -113,14 +113,14 @@ public class JsonRpcHttpServiceHostAllowlistTest {
synchronizer, synchronizer,
MainnetProtocolSchedule.fromConfig( MainnetProtocolSchedule.fromConfig(
new StubGenesisConfigOptions().constantinopleBlock(0).chainId(CHAIN_ID), new StubGenesisConfigOptions().constantinopleBlock(0).chainId(CHAIN_ID),
MiningParameters.MINING_DISABLED, MiningConfiguration.MINING_DISABLED,
new BadBlockManager(), new BadBlockManager(),
false, false,
new NoOpMetricsSystem()), new NoOpMetricsSystem()),
mock(ProtocolContext.class), mock(ProtocolContext.class),
mock(FilterManager.class), mock(FilterManager.class),
mock(TransactionPool.class), mock(TransactionPool.class),
mock(MiningParameters.class), mock(MiningConfiguration.class),
mock(PoWMiningCoordinator.class), mock(PoWMiningCoordinator.class),
new NoOpMetricsSystem(), new NoOpMetricsSystem(),
supportedCapabilities, supportedCapabilities,

@ -37,7 +37,7 @@ import org.hyperledger.besu.ethereum.api.jsonrpc.websocket.WebSocketConfiguratio
import org.hyperledger.besu.ethereum.api.query.BlockchainQueries; import org.hyperledger.besu.ethereum.api.query.BlockchainQueries;
import org.hyperledger.besu.ethereum.blockcreation.PoWMiningCoordinator; import org.hyperledger.besu.ethereum.blockcreation.PoWMiningCoordinator;
import org.hyperledger.besu.ethereum.chain.BadBlockManager; import org.hyperledger.besu.ethereum.chain.BadBlockManager;
import org.hyperledger.besu.ethereum.core.MiningParameters; import org.hyperledger.besu.ethereum.core.MiningConfiguration;
import org.hyperledger.besu.ethereum.core.PrivacyParameters; import org.hyperledger.besu.ethereum.core.PrivacyParameters;
import org.hyperledger.besu.ethereum.core.Synchronizer; import org.hyperledger.besu.ethereum.core.Synchronizer;
import org.hyperledger.besu.ethereum.eth.EthProtocol; import org.hyperledger.besu.ethereum.eth.EthProtocol;
@ -144,14 +144,14 @@ public class JsonRpcHttpServiceLoginTest {
synchronizer, synchronizer,
MainnetProtocolSchedule.fromConfig( MainnetProtocolSchedule.fromConfig(
genesisConfigOptions, genesisConfigOptions,
MiningParameters.MINING_DISABLED, MiningConfiguration.MINING_DISABLED,
new BadBlockManager(), new BadBlockManager(),
false, false,
new NoOpMetricsSystem()), new NoOpMetricsSystem()),
mock(ProtocolContext.class), mock(ProtocolContext.class),
mock(FilterManager.class), mock(FilterManager.class),
mock(TransactionPool.class), mock(TransactionPool.class),
mock(MiningParameters.class), mock(MiningConfiguration.class),
mock(PoWMiningCoordinator.class), mock(PoWMiningCoordinator.class),
new NoOpMetricsSystem(), new NoOpMetricsSystem(),
supportedCapabilities, supportedCapabilities,

@ -36,7 +36,7 @@ import org.hyperledger.besu.ethereum.blockcreation.PoWMiningCoordinator;
import org.hyperledger.besu.ethereum.chain.MutableBlockchain; import org.hyperledger.besu.ethereum.chain.MutableBlockchain;
import org.hyperledger.besu.ethereum.core.Block; import org.hyperledger.besu.ethereum.core.Block;
import org.hyperledger.besu.ethereum.core.InMemoryKeyValueStorageProvider; import org.hyperledger.besu.ethereum.core.InMemoryKeyValueStorageProvider;
import org.hyperledger.besu.ethereum.core.MiningParameters; import org.hyperledger.besu.ethereum.core.MiningConfiguration;
import org.hyperledger.besu.ethereum.core.PrivacyParameters; import org.hyperledger.besu.ethereum.core.PrivacyParameters;
import org.hyperledger.besu.ethereum.core.ProtocolScheduleFixture; import org.hyperledger.besu.ethereum.core.ProtocolScheduleFixture;
import org.hyperledger.besu.ethereum.core.Synchronizer; import org.hyperledger.besu.ethereum.core.Synchronizer;
@ -217,7 +217,7 @@ public class JsonRpcHttpServiceRpcApisTest {
mock(ProtocolContext.class), mock(ProtocolContext.class),
mock(FilterManager.class), mock(FilterManager.class),
mock(TransactionPool.class), mock(TransactionPool.class),
mock(MiningParameters.class), mock(MiningConfiguration.class),
mock(PoWMiningCoordinator.class), mock(PoWMiningCoordinator.class),
new NoOpMetricsSystem(), new NoOpMetricsSystem(),
supportedCapabilities, supportedCapabilities,
@ -328,7 +328,7 @@ public class JsonRpcHttpServiceRpcApisTest {
mock(ProtocolContext.class), mock(ProtocolContext.class),
mock(FilterManager.class), mock(FilterManager.class),
mock(TransactionPool.class), mock(TransactionPool.class),
mock(MiningParameters.class), mock(MiningConfiguration.class),
mock(PoWMiningCoordinator.class), mock(PoWMiningCoordinator.class),
new NoOpMetricsSystem(), new NoOpMetricsSystem(),
supportedCapabilities, supportedCapabilities,

@ -30,7 +30,7 @@ import org.hyperledger.besu.ethereum.blockcreation.PoWMiningCoordinator;
import org.hyperledger.besu.ethereum.chain.BadBlockManager; import org.hyperledger.besu.ethereum.chain.BadBlockManager;
import org.hyperledger.besu.ethereum.chain.Blockchain; import org.hyperledger.besu.ethereum.chain.Blockchain;
import org.hyperledger.besu.ethereum.chain.ChainHead; import org.hyperledger.besu.ethereum.chain.ChainHead;
import org.hyperledger.besu.ethereum.core.MiningParameters; import org.hyperledger.besu.ethereum.core.MiningConfiguration;
import org.hyperledger.besu.ethereum.core.PrivacyParameters; import org.hyperledger.besu.ethereum.core.PrivacyParameters;
import org.hyperledger.besu.ethereum.core.Synchronizer; import org.hyperledger.besu.ethereum.core.Synchronizer;
import org.hyperledger.besu.ethereum.eth.EthProtocol; import org.hyperledger.besu.ethereum.eth.EthProtocol;
@ -122,14 +122,14 @@ public class JsonRpcHttpServiceTestBase {
MainnetProtocolSchedule.fromConfig( MainnetProtocolSchedule.fromConfig(
new StubGenesisConfigOptions().constantinopleBlock(0).chainId(CHAIN_ID), new StubGenesisConfigOptions().constantinopleBlock(0).chainId(CHAIN_ID),
EvmConfiguration.DEFAULT, EvmConfiguration.DEFAULT,
MiningParameters.MINING_DISABLED, MiningConfiguration.MINING_DISABLED,
new BadBlockManager(), new BadBlockManager(),
false, false,
new NoOpMetricsSystem()), new NoOpMetricsSystem()),
mock(ProtocolContext.class), mock(ProtocolContext.class),
mock(FilterManager.class), mock(FilterManager.class),
mock(TransactionPool.class), mock(TransactionPool.class),
mock(MiningParameters.class), mock(MiningConfiguration.class),
mock(PoWMiningCoordinator.class), mock(PoWMiningCoordinator.class),
new NoOpMetricsSystem(), new NoOpMetricsSystem(),
supportedCapabilities, supportedCapabilities,

@ -37,7 +37,7 @@ import org.hyperledger.besu.ethereum.api.tls.SelfSignedP12Certificate;
import org.hyperledger.besu.ethereum.api.tls.TlsConfiguration; import org.hyperledger.besu.ethereum.api.tls.TlsConfiguration;
import org.hyperledger.besu.ethereum.blockcreation.PoWMiningCoordinator; import org.hyperledger.besu.ethereum.blockcreation.PoWMiningCoordinator;
import org.hyperledger.besu.ethereum.chain.BadBlockManager; import org.hyperledger.besu.ethereum.chain.BadBlockManager;
import org.hyperledger.besu.ethereum.core.MiningParameters; import org.hyperledger.besu.ethereum.core.MiningConfiguration;
import org.hyperledger.besu.ethereum.core.PrivacyParameters; import org.hyperledger.besu.ethereum.core.PrivacyParameters;
import org.hyperledger.besu.ethereum.core.Synchronizer; import org.hyperledger.besu.ethereum.core.Synchronizer;
import org.hyperledger.besu.ethereum.eth.EthProtocol; import org.hyperledger.besu.ethereum.eth.EthProtocol;
@ -127,14 +127,14 @@ public class JsonRpcHttpServiceTlsClientAuthTest {
synchronizer, synchronizer,
MainnetProtocolSchedule.fromConfig( MainnetProtocolSchedule.fromConfig(
new StubGenesisConfigOptions().constantinopleBlock(0).chainId(CHAIN_ID), new StubGenesisConfigOptions().constantinopleBlock(0).chainId(CHAIN_ID),
MiningParameters.MINING_DISABLED, MiningConfiguration.MINING_DISABLED,
new BadBlockManager(), new BadBlockManager(),
false, false,
new NoOpMetricsSystem()), new NoOpMetricsSystem()),
mock(ProtocolContext.class), mock(ProtocolContext.class),
mock(FilterManager.class), mock(FilterManager.class),
mock(TransactionPool.class), mock(TransactionPool.class),
mock(MiningParameters.class), mock(MiningConfiguration.class),
mock(PoWMiningCoordinator.class), mock(PoWMiningCoordinator.class),
new NoOpMetricsSystem(), new NoOpMetricsSystem(),
supportedCapabilities, supportedCapabilities,

@ -36,7 +36,7 @@ import org.hyperledger.besu.ethereum.api.tls.SelfSignedP12Certificate;
import org.hyperledger.besu.ethereum.api.tls.TlsConfiguration; import org.hyperledger.besu.ethereum.api.tls.TlsConfiguration;
import org.hyperledger.besu.ethereum.blockcreation.PoWMiningCoordinator; import org.hyperledger.besu.ethereum.blockcreation.PoWMiningCoordinator;
import org.hyperledger.besu.ethereum.chain.BadBlockManager; import org.hyperledger.besu.ethereum.chain.BadBlockManager;
import org.hyperledger.besu.ethereum.core.MiningParameters; import org.hyperledger.besu.ethereum.core.MiningConfiguration;
import org.hyperledger.besu.ethereum.core.PrivacyParameters; import org.hyperledger.besu.ethereum.core.PrivacyParameters;
import org.hyperledger.besu.ethereum.core.Synchronizer; import org.hyperledger.besu.ethereum.core.Synchronizer;
import org.hyperledger.besu.ethereum.eth.EthProtocol; import org.hyperledger.besu.ethereum.eth.EthProtocol;
@ -115,14 +115,14 @@ class JsonRpcHttpServiceTlsMisconfigurationTest {
synchronizer, synchronizer,
MainnetProtocolSchedule.fromConfig( MainnetProtocolSchedule.fromConfig(
new StubGenesisConfigOptions().constantinopleBlock(0).chainId(CHAIN_ID), new StubGenesisConfigOptions().constantinopleBlock(0).chainId(CHAIN_ID),
MiningParameters.MINING_DISABLED, MiningConfiguration.MINING_DISABLED,
new BadBlockManager(), new BadBlockManager(),
false, false,
new NoOpMetricsSystem()), new NoOpMetricsSystem()),
mock(ProtocolContext.class), mock(ProtocolContext.class),
mock(FilterManager.class), mock(FilterManager.class),
mock(TransactionPool.class), mock(TransactionPool.class),
mock(MiningParameters.class), mock(MiningConfiguration.class),
mock(PoWMiningCoordinator.class), mock(PoWMiningCoordinator.class),
new NoOpMetricsSystem(), new NoOpMetricsSystem(),
supportedCapabilities, supportedCapabilities,

@ -36,7 +36,7 @@ import org.hyperledger.besu.ethereum.api.tls.SelfSignedP12Certificate;
import org.hyperledger.besu.ethereum.api.tls.TlsConfiguration; import org.hyperledger.besu.ethereum.api.tls.TlsConfiguration;
import org.hyperledger.besu.ethereum.blockcreation.PoWMiningCoordinator; import org.hyperledger.besu.ethereum.blockcreation.PoWMiningCoordinator;
import org.hyperledger.besu.ethereum.chain.BadBlockManager; import org.hyperledger.besu.ethereum.chain.BadBlockManager;
import org.hyperledger.besu.ethereum.core.MiningParameters; import org.hyperledger.besu.ethereum.core.MiningConfiguration;
import org.hyperledger.besu.ethereum.core.PrivacyParameters; import org.hyperledger.besu.ethereum.core.PrivacyParameters;
import org.hyperledger.besu.ethereum.core.Synchronizer; import org.hyperledger.besu.ethereum.core.Synchronizer;
import org.hyperledger.besu.ethereum.eth.EthProtocol; import org.hyperledger.besu.ethereum.eth.EthProtocol;
@ -116,14 +116,14 @@ public class JsonRpcHttpServiceTlsTest {
synchronizer, synchronizer,
MainnetProtocolSchedule.fromConfig( MainnetProtocolSchedule.fromConfig(
new StubGenesisConfigOptions().constantinopleBlock(0).chainId(CHAIN_ID), new StubGenesisConfigOptions().constantinopleBlock(0).chainId(CHAIN_ID),
MiningParameters.MINING_DISABLED, MiningConfiguration.MINING_DISABLED,
new BadBlockManager(), new BadBlockManager(),
false, false,
new NoOpMetricsSystem()), new NoOpMetricsSystem()),
mock(ProtocolContext.class), mock(ProtocolContext.class),
mock(FilterManager.class), mock(FilterManager.class),
mock(TransactionPool.class), mock(TransactionPool.class),
mock(MiningParameters.class), mock(MiningConfiguration.class),
mock(PoWMiningCoordinator.class), mock(PoWMiningCoordinator.class),
new NoOpMetricsSystem(), new NoOpMetricsSystem(),
supportedCapabilities, supportedCapabilities,

@ -39,7 +39,7 @@ import org.hyperledger.besu.ethereum.core.Block;
import org.hyperledger.besu.ethereum.core.BlockBody; import org.hyperledger.besu.ethereum.core.BlockBody;
import org.hyperledger.besu.ethereum.core.BlockHeader; import org.hyperledger.besu.ethereum.core.BlockHeader;
import org.hyperledger.besu.ethereum.core.Difficulty; import org.hyperledger.besu.ethereum.core.Difficulty;
import org.hyperledger.besu.ethereum.core.MiningParameters; import org.hyperledger.besu.ethereum.core.MiningConfiguration;
import org.hyperledger.besu.ethereum.core.Transaction; import org.hyperledger.besu.ethereum.core.Transaction;
import org.hyperledger.besu.ethereum.mainnet.ProtocolSchedule; import org.hyperledger.besu.ethereum.mainnet.ProtocolSchedule;
import org.hyperledger.besu.ethereum.mainnet.ProtocolSpec; import org.hyperledger.besu.ethereum.mainnet.ProtocolSpec;
@ -77,13 +77,13 @@ public class EthGasPriceTest {
@Mock private ProtocolSchedule protocolSchedule; @Mock private ProtocolSchedule protocolSchedule;
@Mock private Blockchain blockchain; @Mock private Blockchain blockchain;
private EthGasPrice method; private EthGasPrice method;
private MiningParameters miningParameters; private MiningConfiguration miningConfiguration;
@BeforeEach @BeforeEach
public void setUp() { public void setUp() {
ApiConfiguration apiConfig = createDefaultApiConfiguration(); ApiConfiguration apiConfig = createDefaultApiConfiguration();
miningParameters = miningConfiguration =
MiningParameters.newDefault().setMinTransactionGasPrice(DEFAULT_MIN_GAS_PRICE); MiningConfiguration.newDefault().setMinTransactionGasPrice(DEFAULT_MIN_GAS_PRICE);
method = createEthGasPriceMethod(apiConfig); method = createEthGasPriceMethod(apiConfig);
} }
@ -96,7 +96,7 @@ public class EthGasPriceTest {
public void shouldReturnMinValueWhenNoTransactionsExist() { public void shouldReturnMinValueWhenNoTransactionsExist() {
final JsonRpcRequestContext request = requestWithParams(); final JsonRpcRequestContext request = requestWithParams();
final String expectedWei = "0x4d2"; // minGasPrice > nextBlockBaseFee final String expectedWei = "0x4d2"; // minGasPrice > nextBlockBaseFee
miningParameters.setMinTransactionGasPrice(Wei.fromHexString(expectedWei)); miningConfiguration.setMinTransactionGasPrice(Wei.fromHexString(expectedWei));
final JsonRpcResponse expectedResponse = final JsonRpcResponse expectedResponse =
new JsonRpcSuccessResponse(request.getRequest().getId(), expectedWei); new JsonRpcSuccessResponse(request.getRequest().getId(), expectedWei);
@ -117,7 +117,7 @@ public class EthGasPriceTest {
final JsonRpcRequestContext request = requestWithParams(); final JsonRpcRequestContext request = requestWithParams();
final String expectedWei = final String expectedWei =
DEFAULT_BASE_FEE.toShortHexString(); // nextBlockBaseFee > minGasPrice DEFAULT_BASE_FEE.toShortHexString(); // nextBlockBaseFee > minGasPrice
miningParameters.setMinTransactionGasPrice(Wei.fromHexString(expectedWei)); miningConfiguration.setMinTransactionGasPrice(Wei.fromHexString(expectedWei));
final JsonRpcResponse expectedResponse = final JsonRpcResponse expectedResponse =
new JsonRpcSuccessResponse(request.getRequest().getId(), expectedWei); new JsonRpcSuccessResponse(request.getRequest().getId(), expectedWei);
@ -234,7 +234,7 @@ public class EthGasPriceTest {
@MethodSource("ethGasPriceAtGenesis") @MethodSource("ethGasPriceAtGenesis")
public void ethGasPriceAtGenesis( public void ethGasPriceAtGenesis(
final Wei minGasPrice, final Optional<Wei> maybeGenesisBaseFee, final Wei expectedGasPrice) { final Wei minGasPrice, final Optional<Wei> maybeGenesisBaseFee, final Wei expectedGasPrice) {
miningParameters.setMinTransactionGasPrice(minGasPrice); miningConfiguration.setMinTransactionGasPrice(minGasPrice);
if (maybeGenesisBaseFee.isPresent()) { if (maybeGenesisBaseFee.isPresent()) {
mockBaseFeeMarket(); mockBaseFeeMarket();
@ -267,7 +267,7 @@ public class EthGasPriceTest {
final Long lowerBoundCoefficient, final Long lowerBoundCoefficient,
final Long upperBoundCoefficient, final Long upperBoundCoefficient,
final long expectedGasPrice) { final long expectedGasPrice) {
miningParameters.setMinTransactionGasPrice(Wei.of(100)); miningConfiguration.setMinTransactionGasPrice(Wei.of(100));
mockBaseFeeMarket(); mockBaseFeeMarket();
@ -423,7 +423,7 @@ public class EthGasPriceTest {
Optional.empty(), Optional.empty(),
Optional.empty(), Optional.empty(),
apiConfig, apiConfig,
miningParameters), miningConfiguration),
apiConfig); apiConfig);
} }
} }

@ -35,7 +35,7 @@ import org.hyperledger.besu.ethereum.chain.MutableBlockchain;
import org.hyperledger.besu.ethereum.core.Block; import org.hyperledger.besu.ethereum.core.Block;
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.MiningParameters; import org.hyperledger.besu.ethereum.core.MiningConfiguration;
import org.hyperledger.besu.ethereum.core.Synchronizer; import org.hyperledger.besu.ethereum.core.Synchronizer;
import org.hyperledger.besu.ethereum.core.TransactionReceipt; import org.hyperledger.besu.ethereum.core.TransactionReceipt;
import org.hyperledger.besu.ethereum.mainnet.ProtocolSchedule; import org.hyperledger.besu.ethereum.mainnet.ProtocolSchedule;
@ -93,7 +93,7 @@ public class EthGetBlockByNumberTest {
blockchainQueries = blockchainQueries =
spy( spy(
new BlockchainQueries( new BlockchainQueries(
protocolSchedule, blockchain, worldStateArchive, MiningParameters.newDefault())); protocolSchedule, blockchain, worldStateArchive, MiningConfiguration.newDefault()));
method = new EthGetBlockByNumber(blockchainQueries, blockResult, synchronizer); method = new EthGetBlockByNumber(blockchainQueries, blockResult, synchronizer);
} }

@ -35,7 +35,7 @@ import org.hyperledger.besu.ethereum.api.query.BlockchainQueries;
import org.hyperledger.besu.ethereum.chain.MutableBlockchain; import org.hyperledger.besu.ethereum.chain.MutableBlockchain;
import org.hyperledger.besu.ethereum.core.Block; import org.hyperledger.besu.ethereum.core.Block;
import org.hyperledger.besu.ethereum.core.BlockDataGenerator; import org.hyperledger.besu.ethereum.core.BlockDataGenerator;
import org.hyperledger.besu.ethereum.core.MiningParameters; import org.hyperledger.besu.ethereum.core.MiningConfiguration;
import org.hyperledger.besu.ethereum.core.Transaction; import org.hyperledger.besu.ethereum.core.Transaction;
import org.hyperledger.besu.ethereum.core.TransactionReceipt; import org.hyperledger.besu.ethereum.core.TransactionReceipt;
import org.hyperledger.besu.ethereum.mainnet.ProtocolSchedule; import org.hyperledger.besu.ethereum.mainnet.ProtocolSchedule;
@ -86,7 +86,7 @@ public class EthGetBlockReceiptsTest {
blockchainQueries = blockchainQueries =
spy( spy(
new BlockchainQueries( new BlockchainQueries(
protocolSchedule, blockchain, worldStateArchive, MiningParameters.newDefault())); protocolSchedule, blockchain, worldStateArchive, MiningConfiguration.newDefault()));
protocolSchedule = mock(ProtocolSchedule.class); protocolSchedule = mock(ProtocolSchedule.class);
method = new EthGetBlockReceipts(blockchainQueries, protocolSchedule); method = new EthGetBlockReceipts(blockchainQueries, protocolSchedule);
} }

@ -39,7 +39,7 @@ import org.hyperledger.besu.ethereum.api.query.BlockchainQueries;
import org.hyperledger.besu.ethereum.chain.Blockchain; import org.hyperledger.besu.ethereum.chain.Blockchain;
import org.hyperledger.besu.ethereum.chain.ChainHead; import org.hyperledger.besu.ethereum.chain.ChainHead;
import org.hyperledger.besu.ethereum.core.BlockHeader; import org.hyperledger.besu.ethereum.core.BlockHeader;
import org.hyperledger.besu.ethereum.core.MiningParameters; import org.hyperledger.besu.ethereum.core.MiningConfiguration;
import org.hyperledger.besu.ethereum.mainnet.ProtocolSchedule; import org.hyperledger.besu.ethereum.mainnet.ProtocolSchedule;
import org.hyperledger.besu.ethereum.proof.WorldStateProof; import org.hyperledger.besu.ethereum.proof.WorldStateProof;
import org.hyperledger.besu.ethereum.worldstate.StateTrieAccountValue; import org.hyperledger.besu.ethereum.worldstate.StateTrieAccountValue;
@ -89,7 +89,7 @@ class EthGetProofTest {
blockchainQueries = blockchainQueries =
spy( spy(
new BlockchainQueries( new BlockchainQueries(
protocolSchedule, blockchain, archive, MiningParameters.newDefault())); protocolSchedule, blockchain, archive, MiningConfiguration.newDefault()));
when(blockchainQueries.getBlockchain()).thenReturn(blockchain); when(blockchainQueries.getBlockchain()).thenReturn(blockchain);
when(blockchainQueries.headBlockNumber()).thenReturn(14L); when(blockchainQueries.headBlockNumber()).thenReturn(14L);
when(blockchain.getChainHead()).thenReturn(chainHead); when(blockchain.getChainHead()).thenReturn(chainHead);

@ -42,7 +42,7 @@ import org.hyperledger.besu.ethereum.core.BlockBody;
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.MiningConfiguration;
import org.hyperledger.besu.ethereum.core.Transaction; import org.hyperledger.besu.ethereum.core.Transaction;
import org.hyperledger.besu.ethereum.core.TransactionReceipt; import org.hyperledger.besu.ethereum.core.TransactionReceipt;
import org.hyperledger.besu.ethereum.mainnet.PoWHasher; import org.hyperledger.besu.ethereum.mainnet.PoWHasher;
@ -195,7 +195,7 @@ public class EthGetTransactionReceiptTest {
protocolSchedule, protocolSchedule,
blockchain, blockchain,
mock(WorldStateArchive.class), mock(WorldStateArchive.class),
MiningParameters.newDefault())); MiningConfiguration.newDefault()));
private final EthGetTransactionReceipt ethGetTransactionReceipt = private final EthGetTransactionReceipt ethGetTransactionReceipt =
new EthGetTransactionReceipt(blockchainQueries, protocolSchedule); new EthGetTransactionReceipt(blockchainQueries, protocolSchedule);
private final String receiptString = private final String receiptString =

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save