Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement miner_setMinPriorityFee and miner_getMinPriorityFee #6080

Merged
merged 40 commits into from
Oct 25, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
c57c2ac
Refactor mining options
fab-10 Oct 10, 2023
b408b64
Fix null pointer exception
fab-10 Oct 10, 2023
da79e09
fix another null pointer exception
fab-10 Oct 10, 2023
7684d7e
uncomment code
fab-10 Oct 10, 2023
78741da
Move miner options tests
fab-10 Oct 11, 2023
18bcce3
Unit test fixes
fab-10 Oct 12, 2023
59fbe8e
Removed the commented code
fab-10 Oct 12, 2023
8f14dd3
WIP
fab-10 Oct 13, 2023
2280e02
Merge branch 'main' into mining-options-refactor
fab-10 Oct 13, 2023
65bdabd
WIP
fab-10 Oct 13, 2023
5e012d0
New miner option: min-priority-fee
fab-10 Oct 16, 2023
84919f4
Remove not relevant for this feature
fab-10 Oct 16, 2023
e89a244
Remove not relevant for this feature
fab-10 Oct 16, 2023
20e498b
Merge branch 'main' into mining-options-refactor
fab-10 Oct 16, 2023
a260a7d
Merge branch 'mining-options-refactor' into min-priority-fee
fab-10 Oct 16, 2023
86b9a6e
Merge branch 'main' into mining-options-refactor
fab-10 Oct 17, 2023
2267bc7
Fix javadoc
fab-10 Oct 17, 2023
c6b56d2
Remove code not belonging to this PR
fab-10 Oct 17, 2023
477acf9
coinbase is an updatable parameter
fab-10 Oct 17, 2023
4626230
Move MiningOptions to upper package
fab-10 Oct 17, 2023
25b1522
Fix coinbase for *bft
fab-10 Oct 17, 2023
38feb6d
Merge branch 'mining-options-refactor' into min-priority-fee
fab-10 Oct 17, 2023
b7f4213
Implement methods to get and set min priority fee
Gabriel-Trintinalia Oct 18, 2023
ae775ae
Merge branch 'main' into mining-options-refactor
fab-10 Oct 18, 2023
31f2183
Fix spotless
Gabriel-Trintinalia Oct 19, 2023
16315a4
Merge branch 'main' into mining-options-refactor
macfarla Oct 20, 2023
2700930
Merge branch 'mining-options-refactor' of github.com:fab-10/besu into…
fab-10 Oct 23, 2023
e55392b
Apply suggestions from code review
fab-10 Oct 23, 2023
d710e5c
Merge branch 'main' into mining-options-refactor
fab-10 Oct 24, 2023
639af82
Update besu/src/main/java/org/hyperledger/besu/cli/BesuCommand.java
fab-10 Oct 24, 2023
232caa6
Merge branch 'mining-options-refactor' of github.com:fab-10/besu into…
fab-10 Oct 24, 2023
878969d
Merge branch 'main' into mining-options-refactor
fab-10 Oct 24, 2023
07dc4e0
Merge branch 'mining-options-refactor' into min-priority-fee
fab-10 Oct 24, 2023
4cb4f6c
Merge branch 'min-priority-fee' into change-min-priority-fee
Gabriel-Trintinalia Oct 24, 2023
e2bf4e4
Add new config option to everything config
Gabriel-Trintinalia Oct 24, 2023
65b84e5
Fix unit test
Gabriel-Trintinalia Oct 25, 2023
2e823ac
Merge branch 'main' into change-min-priority-fee
Gabriel-Trintinalia Oct 25, 2023
9027349
Merge branch 'main' into change-min-priority-fee
pinges Oct 25, 2023
f0a4c97
Accept PR suggestions
Gabriel-Trintinalia Oct 25, 2023
dca9676
Merge branch 'change-min-priority-fee' of https://github.com/Gabriel-…
Gabriel-Trintinalia Oct 25, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
WIP
Signed-off-by: Fabio Di Fabio <fabio.difabio@consensys.net>
  • Loading branch information
fab-10 committed Oct 13, 2023
commit 65bdabd80a09f94f987ad848adf32c753ce0590a
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,7 @@ public void startNode(final BesuNode node) {
params.add(node.getMiningParameters().getStratumNetworkInterface());
params.add("--min-gas-price");
params.add(
Integer.toString(
node.getMiningParameters().getDynamic().getMinTransactionGasPrice().intValue()));
Integer.toString(node.getMiningParameters().getMinTransactionGasPrice().intValue()));
params.add("--Xminer-remote-sealers-limit");
params.add(
Integer.toString(node.getMiningParameters().getUnstable().getRemoteSealersLimit()));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@

import org.hyperledger.besu.cli.config.NetworkName;
import org.hyperledger.besu.crypto.KeyPair;
import org.hyperledger.besu.datatypes.Wei;
import org.hyperledger.besu.ethereum.api.jsonrpc.JsonRpcConfiguration;
import org.hyperledger.besu.ethereum.api.jsonrpc.RpcApis;
import org.hyperledger.besu.ethereum.api.jsonrpc.authentication.JwtAlgorithm;
Expand Down Expand Up @@ -57,13 +56,7 @@ public class BesuNodeConfigurationBuilder {
private String name;
private Optional<Path> dataPath = Optional.empty();
private MiningParameters miningParameters =
ImmutableMiningParameters.builder()
.isMiningEnabled(false)
.coinbase(AddressHelpers.ofValue(1))
.build()
.getDynamic()
.setMinTransactionGasPrice(Wei.of(1000))
.toParameters();
ImmutableMiningParameters.builder().coinbase(AddressHelpers.ofValue(1)).build();

private JsonRpcConfiguration jsonRpcConfiguration = JsonRpcConfiguration.createDefault();
private JsonRpcConfiguration engineRpcConfiguration = JsonRpcConfiguration.createEngineDefault();
Expand Down Expand Up @@ -117,14 +110,7 @@ public BesuNodeConfigurationBuilder miningEnabled() {
}

public BesuNodeConfigurationBuilder miningEnabled(final boolean enabled) {
this.miningParameters =
ImmutableMiningParameters.builder()
.isMiningEnabled(enabled)
.coinbase(AddressHelpers.ofValue(1))
.build()
.getDynamic()
.setMinTransactionGasPrice(Wei.of(1000))
.toParameters();
this.miningParameters = miningParameters.setMiningEnabled(enabled);
this.jsonRpcConfiguration.addRpcApi(RpcApis.MINER.name());
return this;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import org.hyperledger.besu.ethereum.api.jsonrpc.websocket.WebSocketConfiguration;
import org.hyperledger.besu.ethereum.core.AddressHelpers;
import org.hyperledger.besu.ethereum.core.ImmutableMiningParameters;
import org.hyperledger.besu.ethereum.core.ImmutableMiningParameters.UpdatableInitValues;
import org.hyperledger.besu.ethereum.core.InMemoryPrivacyStorageProvider;
import org.hyperledger.besu.ethereum.core.MiningParameters;
import org.hyperledger.besu.ethereum.core.PrivacyParameters;
Expand Down Expand Up @@ -305,12 +306,13 @@ public BesuNode createNodeWithMultiTenantedPrivacy(

final MiningParameters miningParameters =
ImmutableMiningParameters.builder()
.isMiningEnabled(true)
.updatableInitValues(
UpdatableInitValues.builder()
.isMiningEnabled(true)
.minTransactionGasPrice(Wei.ZERO)
.build())
.coinbase(AddressHelpers.ofValue(1))
.build()
.getDynamic()
.setMinTransactionGasPrice(Wei.ZERO)
.toParameters();
.build();

return create(
new BesuNodeConfigurationBuilder()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import org.hyperledger.besu.datatypes.Wei;
import org.hyperledger.besu.ethereum.core.AddressHelpers;
import org.hyperledger.besu.ethereum.core.ImmutableMiningParameters;
import org.hyperledger.besu.ethereum.core.ImmutableMiningParameters.UpdatableInitValues;
import org.hyperledger.besu.ethereum.core.MiningParameters;
import org.hyperledger.besu.tests.acceptance.dsl.account.Account;
import org.hyperledger.besu.tests.acceptance.dsl.blockchain.Amount;
Expand Down Expand Up @@ -61,12 +62,13 @@ public void shouldMineOnSingleNodeWithFreeGas_Berlin() throws Exception {
final BesuNode minerNode = nodeFactory.createNode(besu, "miner1");
final MiningParameters zeroGasMiningParams =
ImmutableMiningParameters.builder()
.isMiningEnabled(true)
.updatableInitValues(
UpdatableInitValues.builder()
.isMiningEnabled(true)
.minTransactionGasPrice(Wei.ZERO)
.build())
.coinbase(AddressHelpers.ofValue(1))
.build()
.getDynamic()
.setMinTransactionGasPrice(Wei.ZERO)
.toParameters();
.build();
minerNode.setMiningParameters(zeroGasMiningParams);

cluster.start(minerNode);
Expand Down
23 changes: 12 additions & 11 deletions besu/src/main/java/org/hyperledger/besu/cli/BesuCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -1424,7 +1424,7 @@ public void run() {

// Need to create vertx after cmdline has been parsed, such that metricsSystem is configurable
vertx = createVertx(createVertxOptions(metricsSystem.get()));
miningParameters = buildMiningParameters();
miningParameters = getMiningParameters();

validateOptions();
configure();
Expand Down Expand Up @@ -1663,7 +1663,7 @@ private void validatePluginOptions() {
"--privacy-marker-transaction-signing-key-file can not be used in conjunction with a plugin that specifies a PrivateMarkerTransactionFactory");
}

if (Wei.ZERO.compareTo(miningParameters.getDynamic().getMinTransactionGasPrice()) < 0
if (Wei.ZERO.compareTo(getMiningParameters().getMinTransactionGasPrice()) < 0
&& (privacyOptionGroup.privateMarkerTransactionSigningKeyPath == null
&& (privacyPluginService == null
|| privacyPluginService.getPrivateMarkerTransactionFactory() == null))) {
Expand Down Expand Up @@ -2134,7 +2134,7 @@ public BesuControllerBuilder getControllerBuilder() {
.transactionSelectorFactory(getTransactionSelectorFactory())
.pluginTransactionValidatorFactory(getPluginTransactionValidatorFactory())
.dataDirectory(dataDir())
.miningParameters(miningParameters)
.miningParameters(getMiningParameters())
.transactionPoolConfiguration(buildTransactionPoolConfiguration())
.nodeKey(new NodeKey(securityModule()))
.metricsSystem(metricsSystem.get())
Expand All @@ -2149,8 +2149,7 @@ public BesuControllerBuilder getControllerBuilder() {
new PrunerConfiguration(pruningBlockConfirmations, pruningBlocksRetained))
.genesisConfigOverrides(genesisConfigOverrides)
.gasLimitCalculator(
miningParameters != null
&& miningParameters.getDynamic().getTargetGasLimit().isPresent()
getMiningParameters().getTargetGasLimit().isPresent()
? new FrontierTargetingGasLimitCalculator()
: GasLimitCalculator.constant())
.requiredBlocks(requiredBlocks)
Expand Down Expand Up @@ -2479,8 +2478,7 @@ private ApiConfiguration apiConfiguration() {
.gasPriceBlocks(apiGasPriceBlocks)
.gasPricePercentile(apiGasPricePercentile)
.gasPriceMinSupplier(
miningParameters.getDynamic().getMinTransactionGasPrice().getAsBigInteger()
::longValueExact)
getMiningParameters().getMinTransactionGasPrice().getAsBigInteger()::longValueExact)
.gasPriceMax(apiGasPriceMax)
.build();
}
Expand Down Expand Up @@ -2816,8 +2814,11 @@ private TransactionPoolConfiguration buildTransactionPoolConfiguration() {
.build();
}

private MiningParameters buildMiningParameters() {
return miningOptions.toDomainObject();
private MiningParameters getMiningParameters() {
if (miningParameters == null) {
miningParameters = miningOptions.toDomainObject();
}
return miningParameters;
}

private boolean isPruningEnabled() {
Expand Down Expand Up @@ -3216,8 +3217,8 @@ private List<Integer> getEffectivePorts() {
effectivePorts, metricsOptionGroup.metricsPort, metricsOptionGroup.isMetricsEnabled);
addPortIfEnabled(
effectivePorts,
miningParameters.getStratumPort(),
miningParameters.isStratumMiningEnabled());
getMiningParameters().getStratumPort(),
getMiningParameters().isStratumMiningEnabled());
return effectivePorts;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@
package org.hyperledger.besu.cli.options.stable;

import static java.util.Arrays.asList;
import static org.hyperledger.besu.ethereum.core.MiningParameters.Dynamic.DEFAULT_EXTRA_DATA;
import static org.hyperledger.besu.ethereum.core.MiningParameters.Dynamic.DEFAULT_MIN_BLOCK_OCCUPANCY_RATIO;
import static org.hyperledger.besu.ethereum.core.MiningParameters.Dynamic.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.MiningParameters.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.MiningParameters.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.MiningParameters.Unstable.DEFAULT_REMOTE_SEALERS_TTL;
import static org.hyperledger.besu.ethereum.core.MiningParameters.UpdatableInitValues.DEFAULT_EXTRA_DATA;
import static org.hyperledger.besu.ethereum.core.MiningParameters.UpdatableInitValues.DEFAULT_MIN_BLOCK_OCCUPANCY_RATIO;
import static org.hyperledger.besu.ethereum.core.MiningParameters.UpdatableInitValues.DEFAULT_MIN_TRANSACTION_GAS_PRICE;

import org.hyperledger.besu.cli.options.CLIOptions;
import org.hyperledger.besu.cli.util.CommandLineUtils;
Expand Down Expand Up @@ -236,11 +236,9 @@ static MiningOptions fromConfig(final MiningParameters miningParameters) {
miningOptions.iStratumMiningEnabled = miningParameters.isStratumMiningEnabled();
miningOptions.stratumNetworkInterface = miningParameters.getStratumNetworkInterface();
miningOptions.stratumPort = miningParameters.getStratumPort();
miningOptions.extraData = miningParameters.getDynamic().getExtraData();
miningOptions.minTransactionGasPrice =
miningParameters.getDynamic().getMinTransactionGasPrice();
miningOptions.minBlockOccupancyRatio =
miningParameters.getDynamic().getMinBlockOccupancyRatio();
miningOptions.extraData = miningParameters.getExtraData();
miningOptions.minTransactionGasPrice = miningParameters.getMinTransactionGasPrice();
miningOptions.minBlockOccupancyRatio = miningParameters.getMinBlockOccupancyRatio();
miningOptions.unstableOptions.remoteSealersLimit =
miningParameters.getUnstable().getRemoteSealersLimit();
miningOptions.unstableOptions.remoteSealersTimeToLive =
Expand All @@ -257,18 +255,26 @@ static MiningOptions fromConfig(final MiningParameters miningParameters) {
miningParameters.getUnstable().getPosBlockCreationRepetitionMinDuration();

miningParameters.getCoinbase().ifPresent(coinbase -> miningOptions.coinbase = coinbase);
miningParameters
.getDynamic()
.getTargetGasLimit()
.ifPresent(tgl -> miningOptions.targetGasLimit = tgl);
miningParameters.getTargetGasLimit().ifPresent(tgl -> miningOptions.targetGasLimit = tgl);
return miningOptions;
}

@Override
public MiningParameters toDomainObject() {
final var updatableInitValuesBuilder =
ImmutableMiningParameters.UpdatableInitValues.builder()
.isMiningEnabled(isMiningEnabled)
.extraData(extraData)
.minTransactionGasPrice(minTransactionGasPrice)
.minBlockOccupancyRatio(minBlockOccupancyRatio);

if (targetGasLimit != null) {
updatableInitValuesBuilder.targetGasLimit(targetGasLimit);
}

final var miningParametersBuilder =
ImmutableMiningParameters.builder()
.isMiningEnabled(isMiningEnabled)
.updatableInitValues(updatableInitValuesBuilder.build())
.isStratumMiningEnabled(iStratumMiningEnabled)
.stratumNetworkInterface(stratumNetworkInterface)
.stratumPort(stratumPort)
Expand All @@ -288,18 +294,7 @@ public MiningParameters toDomainObject() {
miningParametersBuilder.coinbase(coinbase);
}

final var dynamicParameters =
miningParametersBuilder
.build()
.getDynamic()
.setExtraData(extraData)
.setMinBlockOccupancyRatio(minBlockOccupancyRatio)
.setMinTransactionGasPrice(minTransactionGasPrice);

if (targetGasLimit != null) {
dynamicParameters.setTargetGasLimit(targetGasLimit);
}
return dynamicParameters.toParameters();
return miningParametersBuilder.build();
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
import org.hyperledger.besu.ethereum.blockcreation.IncrementingNonceGenerator;
import org.hyperledger.besu.ethereum.chain.Blockchain;
import org.hyperledger.besu.ethereum.core.ImmutableMiningParameters;
import org.hyperledger.besu.ethereum.core.ImmutableMiningParameters.UpdatableInitValues;
import org.hyperledger.besu.ethereum.core.MiningParameters;
import org.hyperledger.besu.metrics.MetricsService;
import org.hyperledger.besu.metrics.prometheus.MetricsConfiguration;
Expand Down Expand Up @@ -269,13 +270,14 @@ private MiningParameters getMiningParameters() {
final Address coinbase = Address.ZERO;
final Bytes extraData = Bytes.EMPTY;
return ImmutableMiningParameters.builder()
.updatableInitValues(
UpdatableInitValues.builder()
.nonceGenerator(new IncrementingNonceGenerator(0))
.extraData(extraData)
.minTransactionGasPrice(minTransactionGasPrice)
.build())
.coinbase(coinbase)
.nonceGenerator(new IncrementingNonceGenerator(0))
.build()
.getDynamic()
.setExtraData(extraData)
.setMinTransactionGasPrice(minTransactionGasPrice)
.toParameters();
.build();
}

private void importJsonBlocks(final BesuController controller, final Path path)
Expand Down Expand Up @@ -370,7 +372,11 @@ public void run() {
}

private BesuController createBesuController() {
return parentCommand.parentCommand.buildController();
return parentCommand
.parentCommand
.getControllerBuilder()
.miningParameters(MiningParameters.newDefault())
.build();
}

private void exportRlpFormat(final BesuController controller) throws IOException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
import org.hyperledger.besu.ethereum.blockcreation.MiningCoordinator;
import org.hyperledger.besu.ethereum.chain.Blockchain;
import org.hyperledger.besu.ethereum.core.BlockHeader;
import org.hyperledger.besu.ethereum.core.ImmutableMiningParameters;
import org.hyperledger.besu.ethereum.core.MiningParameters;
import org.hyperledger.besu.ethereum.core.Util;
import org.hyperledger.besu.ethereum.eth.manager.EthProtocolManager;
Expand Down Expand Up @@ -149,6 +148,6 @@ protected CliqueContext createConsensusContext(
@Override
public MiningParameters getMiningParameterOverrides(final MiningParameters fromCli) {
// Clique mines by default, reflect that with in the mining parameters:
return ImmutableMiningParameters.builder().from(fromCli).isMiningEnabled(true).build();
return fromCli.setMiningEnabled(true);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,7 @@ protected MiningCoordinator createMiningCoordinator(
MainnetBlockHeaderValidator.MINIMUM_SECONDS_SINCE_PARENT,
MainnetBlockHeaderValidator.TIMESTAMP_TOLERANCE_S,
clock),
epochCalculator,
miningParameters.getUnstable().getPowJobTimeToLive(),
miningParameters.getUnstable().getMaxOmmerDepth());
epochCalculator);

final PoWMiningCoordinator miningCoordinator =
new PoWMiningCoordinator(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
import org.hyperledger.besu.ethereum.blockcreation.MiningCoordinator;
import org.hyperledger.besu.ethereum.chain.Blockchain;
import org.hyperledger.besu.ethereum.chain.MutableBlockchain;
import org.hyperledger.besu.ethereum.core.ImmutableMiningParameters;
import org.hyperledger.besu.ethereum.core.MiningParameters;
import org.hyperledger.besu.ethereum.core.PrivacyParameters;
import org.hyperledger.besu.ethereum.core.Synchronizer;
Expand Down Expand Up @@ -135,10 +134,7 @@ protected MiningCoordinator createMiningCoordinator(
transitionProtocolSchedule.getPreMergeSchedule(),
protocolContext,
transactionPool,
ImmutableMiningParameters.builder()
.from(miningParameters)
.isMiningEnabled(false)
.build(),
MiningParameters.MINING_DISABLED,
syncState,
ethProtocolManager),
mergeBesuControllerBuilder.createTransitionMiningCoordinator(
Expand Down Expand Up @@ -281,7 +277,7 @@ private void initTransitionWatcher(
}
});

// initialize our merge miningParameters merge status before we would start either
// initialize our merge context merge status before we would start either
Blockchain blockchain = protocolContext.getBlockchain();
blockchain
.getTotalDifficultyByHash(blockchain.getChainHeadHash())
Expand Down
4 changes: 2 additions & 2 deletions besu/src/test/java/org/hyperledger/besu/PrivacyReorgTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@
import org.hyperledger.besu.ethereum.core.Block;
import org.hyperledger.besu.ethereum.core.BlockDataGenerator;
import org.hyperledger.besu.ethereum.core.Difficulty;
import org.hyperledger.besu.ethereum.core.ImmutableMiningParameters;
import org.hyperledger.besu.ethereum.core.InMemoryKeyValueStorageProvider;
import org.hyperledger.besu.ethereum.core.InMemoryPrivacyStorageProvider;
import org.hyperledger.besu.ethereum.core.MiningParameters;
import org.hyperledger.besu.ethereum.core.PrivacyParameters;
import org.hyperledger.besu.ethereum.core.Transaction;
import org.hyperledger.besu.ethereum.eth.EthProtocolConfiguration;
Expand Down Expand Up @@ -187,7 +187,7 @@ public void setUp() throws IOException {
.ethProtocolConfiguration(EthProtocolConfiguration.defaultConfig())
.storageProvider(new InMemoryKeyValueStorageProvider())
.networkId(BigInteger.ONE)
.miningParameters(ImmutableMiningParameters.builder().isMiningEnabled(false).build())
.miningParameters(MiningParameters.newDefault())
.nodeKey(NodeKeyUtils.generate())
.metricsSystem(new NoOpMetricsSystem())
.dataDirectory(folder)
Expand Down
4 changes: 2 additions & 2 deletions besu/src/test/java/org/hyperledger/besu/PrivacyTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@
import org.hyperledger.besu.ethereum.GasLimitCalculator;
import org.hyperledger.besu.ethereum.core.BlockHeader;
import org.hyperledger.besu.ethereum.core.BlockHeaderTestFixture;
import org.hyperledger.besu.ethereum.core.ImmutableMiningParameters;
import org.hyperledger.besu.ethereum.core.InMemoryKeyValueStorageProvider;
import org.hyperledger.besu.ethereum.core.MiningParameters;
import org.hyperledger.besu.ethereum.core.PrivacyParameters;
import org.hyperledger.besu.ethereum.eth.EthProtocolConfiguration;
import org.hyperledger.besu.ethereum.eth.sync.SyncMode;
Expand Down Expand Up @@ -111,7 +111,7 @@ private BesuController setUpControllerWithPrivacyEnabled(final boolean flexibleE
.ethProtocolConfiguration(EthProtocolConfiguration.defaultConfig())
.storageProvider(new InMemoryKeyValueStorageProvider())
.networkId(BigInteger.ONE)
.miningParameters(ImmutableMiningParameters.builder().isMiningEnabled(false).build())
.miningParameters(MiningParameters.newDefault())
.nodeKey(NodeKeyUtils.generate())
.metricsSystem(new NoOpMetricsSystem())
.dataDirectory(dataDir)
Expand Down
Loading
Loading