mirror of
https://github.com/vacp2p/linea-besu.git
synced 2026-01-09 07:27:55 -05:00
IntelliJ do not fail me (#7846)
Signed-off-by: jflo <justin+github@florentine.us>
This commit is contained in:
committed by
GitHub
parent
7eb7b870c3
commit
8fce5aa6ff
@@ -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.ipc.JsonRpcIpcConfiguration;
|
||||
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.Util;
|
||||
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 String name;
|
||||
private MiningParameters miningParameters;
|
||||
private MiningConfiguration miningConfiguration;
|
||||
private TransactionPoolConfiguration txPoolConfiguration;
|
||||
private final List<String> runCommand;
|
||||
private PrivacyParameters privacyParameters = PrivacyParameters.DEFAULT;
|
||||
@@ -139,7 +139,7 @@ public class BesuNode implements NodeConfiguration, RunnableNode, AutoCloseable
|
||||
public BesuNode(
|
||||
final String name,
|
||||
final Optional<Path> dataPath,
|
||||
final MiningParameters miningParameters,
|
||||
final MiningConfiguration miningConfiguration,
|
||||
final TransactionPoolConfiguration txPoolConfiguration,
|
||||
final JsonRpcConfiguration jsonRpcConfiguration,
|
||||
final Optional<JsonRpcConfiguration> engineRpcConfiguration,
|
||||
@@ -191,7 +191,7 @@ public class BesuNode implements NodeConfiguration, RunnableNode, AutoCloseable
|
||||
},
|
||||
() -> this.keyPair = KeyPairUtil.loadKeyPair(homeDirectory));
|
||||
this.name = name;
|
||||
this.miningParameters = miningParameters;
|
||||
this.miningConfiguration = miningConfiguration;
|
||||
this.txPoolConfiguration = txPoolConfiguration;
|
||||
this.jsonRpcConfiguration = jsonRpcConfiguration;
|
||||
this.engineRpcConfiguration = engineRpcConfiguration;
|
||||
@@ -678,12 +678,12 @@ public class BesuNode implements NodeConfiguration, RunnableNode, AutoCloseable
|
||||
this.bootnodes.addAll(bootnodes);
|
||||
}
|
||||
|
||||
public MiningParameters getMiningParameters() {
|
||||
return miningParameters;
|
||||
public MiningConfiguration getMiningParameters() {
|
||||
return miningConfiguration;
|
||||
}
|
||||
|
||||
public void setMiningParameters(final MiningParameters miningParameters) {
|
||||
this.miningParameters = miningParameters;
|
||||
public void setMiningParameters(final MiningConfiguration miningConfiguration) {
|
||||
this.miningConfiguration = miningConfiguration;
|
||||
}
|
||||
|
||||
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.jsonrpc.InProcessRpcConfiguration;
|
||||
import org.hyperledger.besu.ethereum.chain.Blockchain;
|
||||
import org.hyperledger.besu.ethereum.core.ImmutableMiningParameters;
|
||||
import org.hyperledger.besu.ethereum.core.MiningParameters;
|
||||
import org.hyperledger.besu.ethereum.core.ImmutableMiningConfiguration;
|
||||
import org.hyperledger.besu.ethereum.core.MiningConfiguration;
|
||||
import org.hyperledger.besu.ethereum.core.plugins.PluginConfiguration;
|
||||
import org.hyperledger.besu.ethereum.core.plugins.PluginInfo;
|
||||
import org.hyperledger.besu.ethereum.eth.EthProtocolConfiguration;
|
||||
@@ -448,7 +448,7 @@ public class ThreadBesuNodeRunner implements BesuNodeRunner {
|
||||
final BesuControllerBuilder builder,
|
||||
final MetricsSystem metricsSystem,
|
||||
final KeyValueStorageProvider storageProvider,
|
||||
final MiningParameters miningParameters) {
|
||||
final MiningConfiguration miningConfiguration) {
|
||||
|
||||
builder
|
||||
.synchronizerConfiguration(synchronizerConfiguration)
|
||||
@@ -461,7 +461,7 @@ public class ThreadBesuNodeRunner implements BesuNodeRunner {
|
||||
.evmConfiguration(EvmConfiguration.DEFAULT)
|
||||
.maxPeers(25)
|
||||
.maxRemotelyInitiatedPeers(15)
|
||||
.miningParameters(miningParameters)
|
||||
.miningParameters(miningConfiguration)
|
||||
.randomPeerPriority(false)
|
||||
.besuComponent(null);
|
||||
return builder.build();
|
||||
@@ -564,11 +564,11 @@ public class ThreadBesuNodeRunner implements BesuNodeRunner {
|
||||
}
|
||||
|
||||
@Provides
|
||||
public MiningParameters provideMiningParameters(
|
||||
public MiningConfiguration provideMiningParameters(
|
||||
final TransactionSelectionServiceImpl transactionSelectionServiceImpl,
|
||||
final BesuNode node) {
|
||||
final var miningParameters =
|
||||
ImmutableMiningParameters.builder()
|
||||
ImmutableMiningConfiguration.builder()
|
||||
.from(node.getMiningParameters())
|
||||
.transactionSelectionService(transactionSelectionServiceImpl)
|
||||
.build();
|
||||
@@ -579,11 +579,11 @@ public class ThreadBesuNodeRunner implements BesuNodeRunner {
|
||||
@Provides
|
||||
@Inject
|
||||
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();
|
||||
commonPluginConfiguration.init(
|
||||
dataDir, dataDir.resolve(DATABASE_PATH), node.getDataStorageConfiguration());
|
||||
commonPluginConfiguration.withMiningParameters(miningParameters);
|
||||
commonPluginConfiguration.withMiningParameters(miningConfiguration);
|
||||
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.ipc.JsonRpcIpcConfiguration;
|
||||
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.eth.transactions.TransactionPoolConfiguration;
|
||||
import org.hyperledger.besu.ethereum.p2p.config.NetworkingConfiguration;
|
||||
@@ -40,7 +40,7 @@ public class BesuNodeConfiguration {
|
||||
|
||||
private final String name;
|
||||
private final Optional<Path> dataPath;
|
||||
private final MiningParameters miningParameters;
|
||||
private final MiningConfiguration miningConfiguration;
|
||||
private final TransactionPoolConfiguration transactionPoolConfiguration;
|
||||
private final JsonRpcConfiguration jsonRpcConfiguration;
|
||||
private final Optional<JsonRpcConfiguration> engineRpcConfiguration;
|
||||
@@ -78,7 +78,7 @@ public class BesuNodeConfiguration {
|
||||
BesuNodeConfiguration(
|
||||
final String name,
|
||||
final Optional<Path> dataPath,
|
||||
final MiningParameters miningParameters,
|
||||
final MiningConfiguration miningConfiguration,
|
||||
final TransactionPoolConfiguration transactionPoolConfiguration,
|
||||
final JsonRpcConfiguration jsonRpcConfiguration,
|
||||
final Optional<JsonRpcConfiguration> engineRpcConfiguration,
|
||||
@@ -113,7 +113,7 @@ public class BesuNodeConfiguration {
|
||||
final boolean strictTxReplayProtectionEnabled,
|
||||
final Map<String, String> environment) {
|
||||
this.name = name;
|
||||
this.miningParameters = miningParameters;
|
||||
this.miningConfiguration = miningConfiguration;
|
||||
this.transactionPoolConfiguration = transactionPoolConfiguration;
|
||||
this.jsonRpcConfiguration = jsonRpcConfiguration;
|
||||
this.engineRpcConfiguration = engineRpcConfiguration;
|
||||
@@ -154,8 +154,8 @@ public class BesuNodeConfiguration {
|
||||
return name;
|
||||
}
|
||||
|
||||
public MiningParameters getMiningParameters() {
|
||||
return miningParameters;
|
||||
public MiningConfiguration getMiningParameters() {
|
||||
return miningConfiguration;
|
||||
}
|
||||
|
||||
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.tls.FileBasedPasswordProvider;
|
||||
import org.hyperledger.besu.ethereum.core.AddressHelpers;
|
||||
import org.hyperledger.besu.ethereum.core.ImmutableMiningParameters;
|
||||
import org.hyperledger.besu.ethereum.core.ImmutableMiningParameters.MutableInitValues;
|
||||
import org.hyperledger.besu.ethereum.core.MiningParameters;
|
||||
import org.hyperledger.besu.ethereum.core.ImmutableMiningConfiguration;
|
||||
import org.hyperledger.besu.ethereum.core.ImmutableMiningConfiguration.MutableInitValues;
|
||||
import org.hyperledger.besu.ethereum.core.MiningConfiguration;
|
||||
import org.hyperledger.besu.ethereum.core.PrivacyParameters;
|
||||
import org.hyperledger.besu.ethereum.eth.transactions.TransactionPoolConfiguration;
|
||||
import org.hyperledger.besu.ethereum.p2p.config.NetworkingConfiguration;
|
||||
@@ -61,8 +61,8 @@ public class BesuNodeConfigurationBuilder {
|
||||
|
||||
private String name;
|
||||
private Optional<Path> dataPath = Optional.empty();
|
||||
private MiningParameters miningParameters =
|
||||
ImmutableMiningParameters.builder()
|
||||
private MiningConfiguration miningConfiguration =
|
||||
ImmutableMiningConfiguration.builder()
|
||||
.mutableInitValues(
|
||||
MutableInitValues.builder().coinbase(AddressHelpers.ofValue(1)).build())
|
||||
.build();
|
||||
@@ -125,13 +125,14 @@ public class BesuNodeConfigurationBuilder {
|
||||
}
|
||||
|
||||
public BesuNodeConfigurationBuilder miningEnabled(final boolean enabled) {
|
||||
this.miningParameters = miningParameters.setMiningEnabled(enabled);
|
||||
this.miningConfiguration = miningConfiguration.setMiningEnabled(enabled);
|
||||
this.jsonRpcConfiguration.addRpcApi(RpcApis.MINER.name());
|
||||
return this;
|
||||
}
|
||||
|
||||
public BesuNodeConfigurationBuilder miningConfiguration(final MiningParameters miningParameters) {
|
||||
this.miningParameters = miningParameters;
|
||||
public BesuNodeConfigurationBuilder miningConfiguration(
|
||||
final MiningConfiguration miningConfiguration) {
|
||||
this.miningConfiguration = miningConfiguration;
|
||||
this.jsonRpcConfiguration.addRpcApi(RpcApis.MINER.name());
|
||||
return this;
|
||||
}
|
||||
@@ -527,7 +528,7 @@ public class BesuNodeConfigurationBuilder {
|
||||
return new BesuNodeConfiguration(
|
||||
name,
|
||||
dataPath,
|
||||
miningParameters,
|
||||
miningConfiguration,
|
||||
transactionPoolConfiguration,
|
||||
jsonRpcConfiguration,
|
||||
Optional.of(engineRpcConfiguration),
|
||||
|
||||
@@ -17,9 +17,9 @@ package org.hyperledger.besu.tests.acceptance.bft;
|
||||
import org.hyperledger.besu.config.JsonUtil;
|
||||
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.MutableInitValues;
|
||||
import org.hyperledger.besu.ethereum.core.MiningParameters;
|
||||
import org.hyperledger.besu.ethereum.core.ImmutableMiningConfiguration;
|
||||
import org.hyperledger.besu.ethereum.core.ImmutableMiningConfiguration.MutableInitValues;
|
||||
import org.hyperledger.besu.ethereum.core.MiningConfiguration;
|
||||
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.node.BesuNode;
|
||||
@@ -62,8 +62,8 @@ public class BftMiningAcceptanceTest extends ParameterizedBftTestBase {
|
||||
final String testName, final BftAcceptanceTestParameterization nodeFactory) throws Exception {
|
||||
setUp(testName, nodeFactory);
|
||||
final BesuNode minerNode = nodeFactory.createNode(besu, "miner1");
|
||||
final MiningParameters zeroGasMiningParams =
|
||||
ImmutableMiningParameters.builder()
|
||||
final MiningConfiguration zeroGasMiningParams =
|
||||
ImmutableMiningConfiguration.builder()
|
||||
.mutableInitValues(
|
||||
MutableInitValues.builder()
|
||||
.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.chain.Blockchain;
|
||||
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.Synchronizer;
|
||||
import org.hyperledger.besu.ethereum.eth.manager.EthPeers;
|
||||
@@ -773,7 +773,7 @@ public class RunnerBuilder {
|
||||
|
||||
final TransactionPool transactionPool = besuController.getTransactionPool();
|
||||
final MiningCoordinator miningCoordinator = besuController.getMiningCoordinator();
|
||||
final MiningParameters miningParameters = besuController.getMiningParameters();
|
||||
final MiningConfiguration miningConfiguration = besuController.getMiningParameters();
|
||||
|
||||
final BlockchainQueries blockchainQueries =
|
||||
new BlockchainQueries(
|
||||
@@ -783,7 +783,7 @@ public class RunnerBuilder {
|
||||
Optional.of(dataDir.resolve(CACHE_PATH)),
|
||||
Optional.of(besuController.getProtocolManager().ethContext().getScheduler()),
|
||||
apiConfiguration,
|
||||
miningParameters);
|
||||
miningConfiguration);
|
||||
|
||||
final PrivacyParameters privacyParameters = besuController.getPrivacyParameters();
|
||||
|
||||
@@ -802,7 +802,7 @@ public class RunnerBuilder {
|
||||
|
||||
Optional<StratumServer> stratumServer = Optional.empty();
|
||||
|
||||
if (miningParameters.isStratumMiningEnabled()) {
|
||||
if (miningConfiguration.isStratumMiningEnabled()) {
|
||||
if (!(miningCoordinator instanceof PoWMiningCoordinator powMiningCoordinator)) {
|
||||
throw new IllegalArgumentException(
|
||||
"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(
|
||||
vertx,
|
||||
powMiningCoordinator,
|
||||
miningParameters.getStratumPort(),
|
||||
miningParameters.getStratumNetworkInterface(),
|
||||
miningParameters.getUnstable().getStratumExtranonce(),
|
||||
miningConfiguration.getStratumPort(),
|
||||
miningConfiguration.getStratumNetworkInterface(),
|
||||
miningConfiguration.getUnstable().getStratumExtranonce(),
|
||||
metricsSystem));
|
||||
miningCoordinator.addEthHashObserver(stratumServer.get());
|
||||
LOG.debug("added ethash observer: {}", stratumServer.get());
|
||||
@@ -849,7 +849,7 @@ public class RunnerBuilder {
|
||||
blockchainQueries,
|
||||
synchronizer,
|
||||
transactionPool,
|
||||
miningParameters,
|
||||
miningConfiguration,
|
||||
miningCoordinator,
|
||||
metricsSystem,
|
||||
supportedCapabilities,
|
||||
@@ -896,7 +896,7 @@ public class RunnerBuilder {
|
||||
blockchainQueries,
|
||||
synchronizer,
|
||||
transactionPool,
|
||||
miningParameters,
|
||||
miningConfiguration,
|
||||
miningCoordinator,
|
||||
metricsSystem,
|
||||
supportedCapabilities,
|
||||
@@ -989,7 +989,7 @@ public class RunnerBuilder {
|
||||
blockchainQueries,
|
||||
synchronizer,
|
||||
transactionPool,
|
||||
miningParameters,
|
||||
miningConfiguration,
|
||||
miningCoordinator,
|
||||
metricsSystem,
|
||||
supportedCapabilities,
|
||||
@@ -1070,7 +1070,7 @@ public class RunnerBuilder {
|
||||
blockchainQueries,
|
||||
synchronizer,
|
||||
transactionPool,
|
||||
miningParameters,
|
||||
miningConfiguration,
|
||||
miningCoordinator,
|
||||
metricsSystem,
|
||||
supportedCapabilities,
|
||||
@@ -1111,7 +1111,7 @@ public class RunnerBuilder {
|
||||
blockchainQueries,
|
||||
synchronizer,
|
||||
transactionPool,
|
||||
miningParameters,
|
||||
miningConfiguration,
|
||||
miningCoordinator,
|
||||
metricsSystem,
|
||||
supportedCapabilities,
|
||||
@@ -1273,7 +1273,7 @@ public class RunnerBuilder {
|
||||
final BlockchainQueries blockchainQueries,
|
||||
final Synchronizer synchronizer,
|
||||
final TransactionPool transactionPool,
|
||||
final MiningParameters miningParameters,
|
||||
final MiningConfiguration miningConfiguration,
|
||||
final MiningCoordinator miningCoordinator,
|
||||
final ObservableMetricsSystem metricsSystem,
|
||||
final Set<Capability> supportedCapabilities,
|
||||
@@ -1308,7 +1308,7 @@ public class RunnerBuilder {
|
||||
protocolContext,
|
||||
filterManager,
|
||||
transactionPool,
|
||||
miningParameters,
|
||||
miningConfiguration,
|
||||
miningCoordinator,
|
||||
metricsSystem,
|
||||
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.query.BlockchainQueries;
|
||||
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.PrivacyParameters;
|
||||
import org.hyperledger.besu.ethereum.core.VersionMetadata;
|
||||
@@ -338,7 +338,7 @@ public class BesuCommand implements DefaultCommandValues, Runnable {
|
||||
Suppliers.memoize(this::readGenesisConfigFile);
|
||||
private final Supplier<GenesisConfigOptions> genesisConfigOptionsSupplier =
|
||||
Suppliers.memoize(this::readGenesisConfigOptions);
|
||||
private final Supplier<MiningParameters> miningParametersSupplier =
|
||||
private final Supplier<MiningConfiguration> miningParametersSupplier =
|
||||
Suppliers.memoize(this::getMiningParameters);
|
||||
|
||||
private RocksDBPlugin rocksDBPlugin;
|
||||
@@ -2117,7 +2117,7 @@ public class BesuCommand implements DefaultCommandValues, Runnable {
|
||||
return txPoolConfBuilder.build();
|
||||
}
|
||||
|
||||
private MiningParameters getMiningParameters() {
|
||||
private MiningConfiguration getMiningParameters() {
|
||||
miningOptions.setTransactionSelectionService(transactionSelectionServiceImpl);
|
||||
final var miningParameters = miningOptions.toDomainObject();
|
||||
getGenesisBlockPeriodSeconds(genesisConfigOptionsSupplier.get())
|
||||
@@ -2169,8 +2169,8 @@ public class BesuCommand implements DefaultCommandValues, Runnable {
|
||||
return dataStorageConfiguration;
|
||||
}
|
||||
|
||||
private void initMiningParametersMetrics(final MiningParameters miningParameters) {
|
||||
new MiningParametersMetrics(getMetricsSystem(), miningParameters);
|
||||
private void initMiningParametersMetrics(final MiningConfiguration miningConfiguration) {
|
||||
new MiningParametersMetrics(getMetricsSystem(), miningConfiguration);
|
||||
}
|
||||
|
||||
private OptionalInt getGenesisBlockPeriodSeconds(
|
||||
|
||||
@@ -17,27 +17,27 @@ package org.hyperledger.besu.cli.options;
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
import static java.util.Arrays.asList;
|
||||
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.MiningParameters.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.MiningParameters.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.MiningParameters.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.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.MiningConfiguration.DEFAULT_NON_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.MiningConfiguration.MutableInitValues.DEFAULT_EXTRA_DATA;
|
||||
import static org.hyperledger.besu.ethereum.core.MiningConfiguration.MutableInitValues.DEFAULT_MIN_BLOCK_OCCUPANCY_RATIO;
|
||||
import static org.hyperledger.besu.ethereum.core.MiningConfiguration.MutableInitValues.DEFAULT_MIN_PRIORITY_FEE_PER_GAS;
|
||||
import static org.hyperledger.besu.ethereum.core.MiningConfiguration.MutableInitValues.DEFAULT_MIN_TRANSACTION_GAS_PRICE;
|
||||
import static org.hyperledger.besu.ethereum.core.MiningConfiguration.Unstable.DEFAULT_MAX_OMMERS_DEPTH;
|
||||
import static org.hyperledger.besu.ethereum.core.MiningConfiguration.Unstable.DEFAULT_POS_BLOCK_CREATION_MAX_TIME;
|
||||
import static org.hyperledger.besu.ethereum.core.MiningConfiguration.Unstable.DEFAULT_POS_BLOCK_CREATION_REPETITION_MIN_DURATION;
|
||||
import static org.hyperledger.besu.ethereum.core.MiningConfiguration.Unstable.DEFAULT_POW_JOB_TTL;
|
||||
import static org.hyperledger.besu.ethereum.core.MiningConfiguration.Unstable.DEFAULT_REMOTE_SEALERS_LIMIT;
|
||||
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.util.CommandLineUtils;
|
||||
import org.hyperledger.besu.config.GenesisConfigOptions;
|
||||
import org.hyperledger.besu.datatypes.Address;
|
||||
import org.hyperledger.besu.datatypes.Wei;
|
||||
import org.hyperledger.besu.ethereum.core.ImmutableMiningParameters;
|
||||
import org.hyperledger.besu.ethereum.core.ImmutableMiningParameters.MutableInitValues;
|
||||
import org.hyperledger.besu.ethereum.core.MiningParameters;
|
||||
import org.hyperledger.besu.ethereum.core.ImmutableMiningConfiguration;
|
||||
import org.hyperledger.besu.ethereum.core.ImmutableMiningConfiguration.MutableInitValues;
|
||||
import org.hyperledger.besu.ethereum.core.MiningConfiguration;
|
||||
import org.hyperledger.besu.plugin.services.TransactionSelectionService;
|
||||
import org.hyperledger.besu.util.number.PositiveNumber;
|
||||
|
||||
@@ -50,7 +50,7 @@ import picocli.CommandLine.Option;
|
||||
import picocli.CommandLine.ParameterException;
|
||||
|
||||
/** The Mining CLI options. */
|
||||
public class MiningOptions implements CLIOptions<MiningParameters> {
|
||||
public class MiningOptions implements CLIOptions<MiningConfiguration> {
|
||||
|
||||
@Option(
|
||||
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();
|
||||
miningOptions.setTransactionSelectionService(miningParameters.getTransactionSelectionService());
|
||||
miningOptions.isMiningEnabled = miningParameters.isMiningEnabled();
|
||||
miningOptions.iStratumMiningEnabled = miningParameters.isStratumMiningEnabled();
|
||||
miningOptions.stratumNetworkInterface = miningParameters.getStratumNetworkInterface();
|
||||
miningOptions.stratumPort = miningParameters.getStratumPort();
|
||||
miningOptions.extraData = miningParameters.getExtraData();
|
||||
miningOptions.minTransactionGasPrice = miningParameters.getMinTransactionGasPrice();
|
||||
miningOptions.minPriorityFeePerGas = miningParameters.getMinPriorityFeePerGas();
|
||||
miningOptions.minBlockOccupancyRatio = miningParameters.getMinBlockOccupancyRatio();
|
||||
miningOptions.setTransactionSelectionService(
|
||||
miningConfiguration.getTransactionSelectionService());
|
||||
miningOptions.isMiningEnabled = miningConfiguration.isMiningEnabled();
|
||||
miningOptions.iStratumMiningEnabled = miningConfiguration.isStratumMiningEnabled();
|
||||
miningOptions.stratumNetworkInterface = miningConfiguration.getStratumNetworkInterface();
|
||||
miningOptions.stratumPort = miningConfiguration.getStratumPort();
|
||||
miningOptions.extraData = miningConfiguration.getExtraData();
|
||||
miningOptions.minTransactionGasPrice = miningConfiguration.getMinTransactionGasPrice();
|
||||
miningOptions.minPriorityFeePerGas = miningConfiguration.getMinPriorityFeePerGas();
|
||||
miningOptions.minBlockOccupancyRatio = miningConfiguration.getMinBlockOccupancyRatio();
|
||||
miningOptions.nonPoaBlockTxsSelectionMaxTime =
|
||||
miningParameters.getNonPoaBlockTxsSelectionMaxTime();
|
||||
miningOptions.poaBlockTxsSelectionMaxTime = miningParameters.getPoaBlockTxsSelectionMaxTime();
|
||||
miningConfiguration.getNonPoaBlockTxsSelectionMaxTime();
|
||||
miningOptions.poaBlockTxsSelectionMaxTime =
|
||||
miningConfiguration.getPoaBlockTxsSelectionMaxTime();
|
||||
|
||||
miningOptions.unstableOptions.remoteSealersLimit =
|
||||
miningParameters.getUnstable().getRemoteSealersLimit();
|
||||
miningConfiguration.getUnstable().getRemoteSealersLimit();
|
||||
miningOptions.unstableOptions.remoteSealersTimeToLive =
|
||||
miningParameters.getUnstable().getRemoteSealersTimeToLive();
|
||||
miningConfiguration.getUnstable().getRemoteSealersTimeToLive();
|
||||
miningOptions.unstableOptions.powJobTimeToLive =
|
||||
miningParameters.getUnstable().getPowJobTimeToLive();
|
||||
miningConfiguration.getUnstable().getPowJobTimeToLive();
|
||||
miningOptions.unstableOptions.maxOmmersDepth =
|
||||
miningParameters.getUnstable().getMaxOmmerDepth();
|
||||
miningConfiguration.getUnstable().getMaxOmmerDepth();
|
||||
miningOptions.unstableOptions.stratumExtranonce =
|
||||
miningParameters.getUnstable().getStratumExtranonce();
|
||||
miningConfiguration.getUnstable().getStratumExtranonce();
|
||||
miningOptions.unstableOptions.posBlockCreationMaxTime =
|
||||
miningParameters.getUnstable().getPosBlockCreationMaxTime();
|
||||
miningConfiguration.getUnstable().getPosBlockCreationMaxTime();
|
||||
miningOptions.unstableOptions.posBlockCreationRepetitionMinDuration =
|
||||
miningParameters.getUnstable().getPosBlockCreationRepetitionMinDuration();
|
||||
miningConfiguration.getUnstable().getPosBlockCreationRepetitionMinDuration();
|
||||
|
||||
miningParameters.getCoinbase().ifPresent(coinbase -> miningOptions.coinbase = coinbase);
|
||||
miningParameters.getTargetGasLimit().ifPresent(tgl -> miningOptions.targetGasLimit = tgl);
|
||||
miningConfiguration.getCoinbase().ifPresent(coinbase -> miningOptions.coinbase = coinbase);
|
||||
miningConfiguration.getTargetGasLimit().ifPresent(tgl -> miningOptions.targetGasLimit = tgl);
|
||||
return miningOptions;
|
||||
}
|
||||
|
||||
@Override
|
||||
public MiningParameters toDomainObject() {
|
||||
public MiningConfiguration toDomainObject() {
|
||||
checkNotNull(
|
||||
transactionSelectionService,
|
||||
"transactionSelectionService must be set before using this object");
|
||||
@@ -356,7 +358,7 @@ public class MiningOptions implements CLIOptions<MiningParameters> {
|
||||
updatableInitValuesBuilder.coinbase(coinbase);
|
||||
}
|
||||
|
||||
return ImmutableMiningParameters.builder()
|
||||
return ImmutableMiningConfiguration.builder()
|
||||
.transactionSelectionService(transactionSelectionService)
|
||||
.mutableInitValues(updatableInitValuesBuilder.build())
|
||||
.isStratumMiningEnabled(iStratumMiningEnabled)
|
||||
@@ -365,7 +367,7 @@ public class MiningOptions implements CLIOptions<MiningParameters> {
|
||||
.nonPoaBlockTxsSelectionMaxTime(nonPoaBlockTxsSelectionMaxTime)
|
||||
.poaBlockTxsSelectionMaxTime(poaBlockTxsSelectionMaxTime)
|
||||
.unstable(
|
||||
ImmutableMiningParameters.Unstable.builder()
|
||||
ImmutableMiningConfiguration.Unstable.builder()
|
||||
.remoteSealersLimit(unstableOptions.remoteSealersLimit)
|
||||
.remoteSealersTimeToLive(unstableOptions.remoteSealersTimeToLive)
|
||||
.powJobTimeToLive(unstableOptions.powJobTimeToLive)
|
||||
|
||||
@@ -31,9 +31,9 @@ import org.hyperledger.besu.datatypes.Wei;
|
||||
import org.hyperledger.besu.ethereum.ProtocolContext;
|
||||
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.MutableInitValues;
|
||||
import org.hyperledger.besu.ethereum.core.MiningParameters;
|
||||
import org.hyperledger.besu.ethereum.core.ImmutableMiningConfiguration;
|
||||
import org.hyperledger.besu.ethereum.core.ImmutableMiningConfiguration.MutableInitValues;
|
||||
import org.hyperledger.besu.ethereum.core.MiningConfiguration;
|
||||
import org.hyperledger.besu.metrics.MetricsService;
|
||||
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;
|
||||
// Extradata and coinbase can be configured on a per-block level via the json file
|
||||
final Address coinbase = Address.ZERO;
|
||||
final Bytes extraData = Bytes.EMPTY;
|
||||
return ImmutableMiningParameters.builder()
|
||||
return ImmutableMiningConfiguration.builder()
|
||||
.mutableInitValues(
|
||||
MutableInitValues.builder()
|
||||
.nonceGenerator(new IncrementingNonceGenerator(0))
|
||||
@@ -377,7 +377,7 @@ public class BlocksSubCommand implements Runnable {
|
||||
return parentCommand
|
||||
.parentCommand
|
||||
.setupControllerBuilder()
|
||||
.miningParameters(MiningParameters.newDefault())
|
||||
.miningParameters(MiningConfiguration.newDefault())
|
||||
.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.methods.JsonRpcMethods;
|
||||
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.Synchronizer;
|
||||
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 PrivacyParameters privacyParameters;
|
||||
private final List<Closeable> closeables;
|
||||
private final MiningParameters miningParameters;
|
||||
private final MiningConfiguration miningConfiguration;
|
||||
private final PluginServiceFactory additionalPluginServices;
|
||||
private final SyncState syncState;
|
||||
private final EthPeers ethPeers;
|
||||
@@ -91,7 +91,7 @@ public class BesuController implements java.io.Closeable {
|
||||
* @param transactionPool the transaction pool
|
||||
* @param miningCoordinator the mining coordinator
|
||||
* @param privacyParameters the privacy parameters
|
||||
* @param miningParameters the mining parameters
|
||||
* @param miningConfiguration the mining parameters
|
||||
* @param additionalJsonRpcMethodsFactory the additional json rpc methods factory
|
||||
* @param nodeKey the node key
|
||||
* @param closeables the closeables
|
||||
@@ -111,7 +111,7 @@ public class BesuController implements java.io.Closeable {
|
||||
final TransactionPool transactionPool,
|
||||
final MiningCoordinator miningCoordinator,
|
||||
final PrivacyParameters privacyParameters,
|
||||
final MiningParameters miningParameters,
|
||||
final MiningConfiguration miningConfiguration,
|
||||
final JsonRpcMethods additionalJsonRpcMethodsFactory,
|
||||
final NodeKey nodeKey,
|
||||
final List<Closeable> closeables,
|
||||
@@ -132,7 +132,7 @@ public class BesuController implements java.io.Closeable {
|
||||
this.miningCoordinator = miningCoordinator;
|
||||
this.privacyParameters = privacyParameters;
|
||||
this.closeables = closeables;
|
||||
this.miningParameters = miningParameters;
|
||||
this.miningConfiguration = miningConfiguration;
|
||||
this.additionalPluginServices = additionalPluginServices;
|
||||
this.ethPeers = ethPeers;
|
||||
this.storageProvider = storageProvider;
|
||||
@@ -265,8 +265,8 @@ public class BesuController implements java.io.Closeable {
|
||||
*
|
||||
* @return the mining parameters
|
||||
*/
|
||||
public MiningParameters getMiningParameters() {
|
||||
return miningParameters;
|
||||
public MiningConfiguration getMiningParameters() {
|
||||
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.core.BlockHeader;
|
||||
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.eth.EthProtocol;
|
||||
import org.hyperledger.besu.ethereum.eth.EthProtocolConfiguration;
|
||||
@@ -144,7 +144,7 @@ public abstract class BesuControllerBuilder implements MiningParameterOverrides
|
||||
protected BigInteger networkId;
|
||||
|
||||
/** The Mining parameters. */
|
||||
protected MiningParameters miningParameters;
|
||||
protected MiningConfiguration miningConfiguration;
|
||||
|
||||
/** The Metrics system. */
|
||||
protected ObservableMetricsSystem metricsSystem;
|
||||
@@ -296,11 +296,11 @@ public abstract class BesuControllerBuilder implements MiningParameterOverrides
|
||||
/**
|
||||
* Mining parameters besu controller builder.
|
||||
*
|
||||
* @param miningParameters the mining parameters
|
||||
* @param miningConfiguration the mining parameters
|
||||
* @return the besu controller builder
|
||||
*/
|
||||
public BesuControllerBuilder miningParameters(final MiningParameters miningParameters) {
|
||||
this.miningParameters = miningParameters;
|
||||
public BesuControllerBuilder miningParameters(final MiningConfiguration miningConfiguration) {
|
||||
this.miningConfiguration = miningConfiguration;
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -543,7 +543,7 @@ public abstract class BesuControllerBuilder implements MiningParameterOverrides
|
||||
checkNotNull(syncConfig, "Missing sync config");
|
||||
checkNotNull(ethereumWireProtocolConfiguration, "Missing ethereum protocol configuration");
|
||||
checkNotNull(networkId, "Missing network ID");
|
||||
checkNotNull(miningParameters, "Missing mining parameters");
|
||||
checkNotNull(miningConfiguration, "Missing mining parameters");
|
||||
checkNotNull(metricsSystem, "Missing metrics system");
|
||||
checkNotNull(privacyParameters, "Missing privacy parameters");
|
||||
checkNotNull(dataDirectory, "Missing data directory"); // Why do we need this?
|
||||
@@ -680,7 +680,7 @@ public abstract class BesuControllerBuilder implements MiningParameterOverrides
|
||||
syncState,
|
||||
transactionPoolConfiguration,
|
||||
besuComponent.map(BesuComponent::getBlobCache).orElse(new BlobCache()),
|
||||
miningParameters);
|
||||
miningConfiguration);
|
||||
|
||||
final List<PeerValidator> peerValidators = createPeerValidators(protocolSchedule);
|
||||
|
||||
@@ -734,7 +734,7 @@ public abstract class BesuControllerBuilder implements MiningParameterOverrides
|
||||
protocolSchedule,
|
||||
protocolContext,
|
||||
transactionPool,
|
||||
miningParameters,
|
||||
miningConfiguration,
|
||||
syncState,
|
||||
ethProtocolManager);
|
||||
|
||||
@@ -745,7 +745,8 @@ public abstract class BesuControllerBuilder implements MiningParameterOverrides
|
||||
createSubProtocolConfiguration(ethProtocolManager, maybeSnapProtocolManager);
|
||||
|
||||
final JsonRpcMethods additionalJsonRpcMethodFactory =
|
||||
createAdditionalJsonRpcMethodFactory(protocolContext, protocolSchedule, miningParameters);
|
||||
createAdditionalJsonRpcMethodFactory(
|
||||
protocolContext, protocolSchedule, miningConfiguration);
|
||||
|
||||
if (DataStorageFormat.BONSAI.equals(dataStorageConfiguration.getDataStorageFormat())) {
|
||||
final DiffBasedSubStorageConfiguration subStorageConfiguration =
|
||||
@@ -779,7 +780,7 @@ public abstract class BesuControllerBuilder implements MiningParameterOverrides
|
||||
transactionPool,
|
||||
miningCoordinator,
|
||||
privacyParameters,
|
||||
miningParameters,
|
||||
miningConfiguration,
|
||||
additionalJsonRpcMethodFactory,
|
||||
nodeKey,
|
||||
closeables,
|
||||
@@ -938,13 +939,13 @@ public abstract class BesuControllerBuilder implements MiningParameterOverrides
|
||||
*
|
||||
* @param protocolContext the protocol context
|
||||
* @param protocolSchedule the protocol schedule
|
||||
* @param miningParameters the mining parameters
|
||||
* @param miningConfiguration the mining parameters
|
||||
* @return the json rpc methods
|
||||
*/
|
||||
protected JsonRpcMethods createAdditionalJsonRpcMethodFactory(
|
||||
final ProtocolContext protocolContext,
|
||||
final ProtocolSchedule protocolSchedule,
|
||||
final MiningParameters miningParameters) {
|
||||
final MiningConfiguration miningConfiguration) {
|
||||
return apis -> Collections.emptyMap();
|
||||
}
|
||||
|
||||
@@ -972,7 +973,7 @@ public abstract class BesuControllerBuilder implements MiningParameterOverrides
|
||||
* @param protocolSchedule the protocol schedule
|
||||
* @param protocolContext the protocol context
|
||||
* @param transactionPool the transaction pool
|
||||
* @param miningParameters the mining parameters
|
||||
* @param miningConfiguration the mining parameters
|
||||
* @param syncState the sync state
|
||||
* @param ethProtocolManager the eth protocol manager
|
||||
* @return the mining coordinator
|
||||
@@ -981,7 +982,7 @@ public abstract class BesuControllerBuilder implements MiningParameterOverrides
|
||||
ProtocolSchedule protocolSchedule,
|
||||
ProtocolContext protocolContext,
|
||||
TransactionPool transactionPool,
|
||||
MiningParameters miningParameters,
|
||||
MiningConfiguration miningConfiguration,
|
||||
SyncState syncState,
|
||||
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.chain.Blockchain;
|
||||
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.eth.manager.EthProtocolManager;
|
||||
import org.hyperledger.besu.ethereum.eth.sync.state.SyncState;
|
||||
@@ -74,8 +74,8 @@ public class CliqueBesuControllerBuilder extends BesuControllerBuilder {
|
||||
protected JsonRpcMethods createAdditionalJsonRpcMethodFactory(
|
||||
final ProtocolContext protocolContext,
|
||||
final ProtocolSchedule protocolSchedule,
|
||||
final MiningParameters miningParameters) {
|
||||
return new CliqueJsonRpcMethods(protocolContext, protocolSchedule, miningParameters);
|
||||
final MiningConfiguration miningConfiguration) {
|
||||
return new CliqueJsonRpcMethods(protocolContext, protocolSchedule, miningConfiguration);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -83,7 +83,7 @@ public class CliqueBesuControllerBuilder extends BesuControllerBuilder {
|
||||
final ProtocolSchedule protocolSchedule,
|
||||
final ProtocolContext protocolContext,
|
||||
final TransactionPool transactionPool,
|
||||
final MiningParameters miningParameters,
|
||||
final MiningConfiguration miningConfiguration,
|
||||
final SyncState syncState,
|
||||
final EthProtocolManager ethProtocolManager) {
|
||||
final CliqueMinerExecutor miningExecutor =
|
||||
@@ -92,7 +92,7 @@ public class CliqueBesuControllerBuilder extends BesuControllerBuilder {
|
||||
protocolSchedule,
|
||||
transactionPool,
|
||||
nodeKey,
|
||||
miningParameters,
|
||||
miningConfiguration,
|
||||
new CliqueBlockScheduler(
|
||||
clock,
|
||||
protocolContext.getConsensusContext(CliqueContext.class).getValidatorProvider(),
|
||||
@@ -113,7 +113,7 @@ public class CliqueBesuControllerBuilder extends BesuControllerBuilder {
|
||||
.getBlockchain()
|
||||
.observeBlockAdded(
|
||||
o ->
|
||||
miningParameters.setBlockPeriodSeconds(
|
||||
miningConfiguration.setBlockPeriodSeconds(
|
||||
forksSchedule
|
||||
.getFork(o.getBlock().getHeader().getNumber() + 1)
|
||||
.getValue()
|
||||
@@ -134,7 +134,7 @@ public class CliqueBesuControllerBuilder extends BesuControllerBuilder {
|
||||
nodeKey,
|
||||
isRevertReasonEnabled,
|
||||
evmConfiguration,
|
||||
miningParameters,
|
||||
miningConfiguration,
|
||||
badBlockManager,
|
||||
isParallelTxProcessingEnabled,
|
||||
metricsSystem);
|
||||
@@ -171,7 +171,7 @@ public class CliqueBesuControllerBuilder extends BesuControllerBuilder {
|
||||
}
|
||||
|
||||
@Override
|
||||
public MiningParameters getMiningParameterOverrides(final MiningParameters fromCli) {
|
||||
public MiningConfiguration getMiningParameterOverrides(final MiningConfiguration fromCli) {
|
||||
// Clique mines by default, reflect that with in the mining parameters:
|
||||
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.chain.Blockchain;
|
||||
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.eth.EthProtocolConfiguration;
|
||||
import org.hyperledger.besu.ethereum.eth.manager.EthContext;
|
||||
@@ -128,7 +128,7 @@ public class ConsensusScheduleBesuControllerBuilder extends BesuControllerBuilde
|
||||
final ProtocolSchedule protocolSchedule,
|
||||
final ProtocolContext protocolContext,
|
||||
final TransactionPool transactionPool,
|
||||
final MiningParameters miningParameters,
|
||||
final MiningConfiguration miningConfiguration,
|
||||
final SyncState syncState,
|
||||
final EthProtocolManager ethProtocolManager) {
|
||||
|
||||
@@ -143,7 +143,7 @@ public class ConsensusScheduleBesuControllerBuilder extends BesuControllerBuilde
|
||||
protocolSchedule,
|
||||
protocolContext,
|
||||
transactionPool,
|
||||
miningParameters,
|
||||
miningConfiguration,
|
||||
syncState,
|
||||
ethProtocolManager)))
|
||||
.collect(Collectors.toList());
|
||||
@@ -206,10 +206,11 @@ public class ConsensusScheduleBesuControllerBuilder extends BesuControllerBuilde
|
||||
protected JsonRpcMethods createAdditionalJsonRpcMethodFactory(
|
||||
final ProtocolContext protocolContext,
|
||||
final ProtocolSchedule protocolSchedule,
|
||||
final MiningParameters miningParameters) {
|
||||
final MiningConfiguration miningConfiguration) {
|
||||
return besuControllerBuilderSchedule
|
||||
.get(0L)
|
||||
.createAdditionalJsonRpcMethodFactory(protocolContext, protocolSchedule, miningParameters);
|
||||
.createAdditionalJsonRpcMethodFactory(
|
||||
protocolContext, protocolSchedule, miningConfiguration);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -297,9 +298,9 @@ public class ConsensusScheduleBesuControllerBuilder extends BesuControllerBuilde
|
||||
}
|
||||
|
||||
@Override
|
||||
public BesuControllerBuilder miningParameters(final MiningParameters miningParameters) {
|
||||
besuControllerBuilderSchedule.values().forEach(b -> b.miningParameters(miningParameters));
|
||||
return super.miningParameters(miningParameters);
|
||||
public BesuControllerBuilder miningParameters(final MiningConfiguration miningConfiguration) {
|
||||
besuControllerBuilderSchedule.values().forEach(b -> b.miningParameters(miningConfiguration));
|
||||
return super.miningParameters(miningConfiguration);
|
||||
}
|
||||
|
||||
@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.MutableBlockchain;
|
||||
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.eth.EthProtocol;
|
||||
import org.hyperledger.besu.ethereum.eth.SnapProtocol;
|
||||
@@ -114,8 +114,8 @@ public class IbftBesuControllerBuilder extends BftBesuControllerBuilder {
|
||||
protected JsonRpcMethods createAdditionalJsonRpcMethodFactory(
|
||||
final ProtocolContext protocolContext,
|
||||
final ProtocolSchedule protocolSchedule,
|
||||
final MiningParameters miningParameters) {
|
||||
return new IbftJsonRpcMethods(protocolContext, protocolSchedule, miningParameters);
|
||||
final MiningConfiguration miningConfiguration) {
|
||||
return new IbftJsonRpcMethods(protocolContext, protocolSchedule, miningConfiguration);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -141,7 +141,7 @@ public class IbftBesuControllerBuilder extends BftBesuControllerBuilder {
|
||||
final ProtocolSchedule protocolSchedule,
|
||||
final ProtocolContext protocolContext,
|
||||
final TransactionPool transactionPool,
|
||||
final MiningParameters miningParameters,
|
||||
final MiningConfiguration miningConfiguration,
|
||||
final SyncState syncState,
|
||||
final EthProtocolManager ethProtocolManager) {
|
||||
final MutableBlockchain blockchain = protocolContext.getBlockchain();
|
||||
@@ -156,7 +156,7 @@ public class IbftBesuControllerBuilder extends BftBesuControllerBuilder {
|
||||
protocolContext,
|
||||
bftProtocolSchedule,
|
||||
forksSchedule,
|
||||
miningParameters,
|
||||
miningConfiguration,
|
||||
localAddress,
|
||||
bftExtraDataCodec().get(),
|
||||
ethProtocolManager.ethContext().getScheduler());
|
||||
@@ -247,7 +247,7 @@ public class IbftBesuControllerBuilder extends BftBesuControllerBuilder {
|
||||
.getBlockchain()
|
||||
.observeBlockAdded(
|
||||
o ->
|
||||
miningParameters.setBlockPeriodSeconds(
|
||||
miningConfiguration.setBlockPeriodSeconds(
|
||||
forksSchedule
|
||||
.getFork(o.getBlock().getHeader().getNumber() + 1)
|
||||
.getValue()
|
||||
@@ -303,7 +303,7 @@ public class IbftBesuControllerBuilder extends BftBesuControllerBuilder {
|
||||
isRevertReasonEnabled,
|
||||
bftExtraDataCodec().get(),
|
||||
evmConfiguration,
|
||||
miningParameters,
|
||||
miningConfiguration,
|
||||
badBlockManager,
|
||||
isParallelTxProcessingEnabled,
|
||||
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.PoWMiningCoordinator;
|
||||
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.sync.state.SyncState;
|
||||
import org.hyperledger.besu.ethereum.eth.transactions.TransactionPool;
|
||||
@@ -46,7 +46,7 @@ public class MainnetBesuControllerBuilder extends BesuControllerBuilder {
|
||||
final ProtocolSchedule protocolSchedule,
|
||||
final ProtocolContext protocolContext,
|
||||
final TransactionPool transactionPool,
|
||||
final MiningParameters miningParameters,
|
||||
final MiningConfiguration miningConfiguration,
|
||||
final SyncState syncState,
|
||||
final EthProtocolManager ethProtocolManager) {
|
||||
|
||||
@@ -55,7 +55,7 @@ public class MainnetBesuControllerBuilder extends BesuControllerBuilder {
|
||||
protocolContext,
|
||||
protocolSchedule,
|
||||
transactionPool,
|
||||
miningParameters,
|
||||
miningConfiguration,
|
||||
new DefaultBlockScheduler(
|
||||
MainnetBlockHeaderValidator.MINIMUM_SECONDS_SINCE_PARENT,
|
||||
MainnetBlockHeaderValidator.TIMESTAMP_TOLERANCE_S,
|
||||
@@ -68,11 +68,11 @@ public class MainnetBesuControllerBuilder extends BesuControllerBuilder {
|
||||
protocolContext.getBlockchain(),
|
||||
executor,
|
||||
syncState,
|
||||
miningParameters.getUnstable().getRemoteSealersLimit(),
|
||||
miningParameters.getUnstable().getRemoteSealersTimeToLive());
|
||||
miningConfiguration.getUnstable().getRemoteSealersLimit(),
|
||||
miningConfiguration.getUnstable().getRemoteSealersTimeToLive());
|
||||
miningCoordinator.addMinedBlockObserver(ethProtocolManager);
|
||||
miningCoordinator.setStratumMiningEnabled(miningParameters.isStratumMiningEnabled());
|
||||
if (miningParameters.isMiningEnabled()) {
|
||||
miningCoordinator.setStratumMiningEnabled(miningConfiguration.isStratumMiningEnabled());
|
||||
if (miningConfiguration.isMiningEnabled()) {
|
||||
miningCoordinator.enable();
|
||||
}
|
||||
|
||||
@@ -100,7 +100,7 @@ public class MainnetBesuControllerBuilder extends BesuControllerBuilder {
|
||||
Optional.of(privacyParameters),
|
||||
Optional.of(isRevertReasonEnabled),
|
||||
Optional.of(evmConfiguration),
|
||||
super.miningParameters,
|
||||
super.miningConfiguration,
|
||||
badBlockManager,
|
||||
isParallelTxProcessingEnabled,
|
||||
metricsSystem);
|
||||
|
||||
@@ -26,7 +26,7 @@ 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.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.manager.EthContext;
|
||||
import org.hyperledger.besu.ethereum.eth.manager.EthMessages;
|
||||
@@ -67,14 +67,14 @@ public class MergeBesuControllerBuilder extends BesuControllerBuilder {
|
||||
final ProtocolSchedule protocolSchedule,
|
||||
final ProtocolContext protocolContext,
|
||||
final TransactionPool transactionPool,
|
||||
final MiningParameters miningParameters,
|
||||
final MiningConfiguration miningConfiguration,
|
||||
final SyncState syncState,
|
||||
final EthProtocolManager ethProtocolManager) {
|
||||
return createTransitionMiningCoordinator(
|
||||
protocolSchedule,
|
||||
protocolContext,
|
||||
transactionPool,
|
||||
miningParameters,
|
||||
miningConfiguration,
|
||||
syncState,
|
||||
new BackwardSyncContext(
|
||||
protocolContext,
|
||||
@@ -140,7 +140,7 @@ public class MergeBesuControllerBuilder extends BesuControllerBuilder {
|
||||
* @param protocolSchedule the protocol schedule
|
||||
* @param protocolContext the protocol context
|
||||
* @param transactionPool the transaction pool
|
||||
* @param miningParameters the mining parameters
|
||||
* @param miningConfiguration the mining parameters
|
||||
* @param syncState the sync state
|
||||
* @param backwardSyncContext the backward sync context
|
||||
* @param ethScheduler the scheduler
|
||||
@@ -150,7 +150,7 @@ public class MergeBesuControllerBuilder extends BesuControllerBuilder {
|
||||
final ProtocolSchedule protocolSchedule,
|
||||
final ProtocolContext protocolContext,
|
||||
final TransactionPool transactionPool,
|
||||
final MiningParameters miningParameters,
|
||||
final MiningConfiguration miningConfiguration,
|
||||
final SyncState syncState,
|
||||
final BackwardSyncContext backwardSyncContext,
|
||||
final EthScheduler ethScheduler) {
|
||||
@@ -165,7 +165,7 @@ public class MergeBesuControllerBuilder extends BesuControllerBuilder {
|
||||
protocolSchedule,
|
||||
ethScheduler,
|
||||
transactionPool,
|
||||
miningParameters,
|
||||
miningConfiguration,
|
||||
backwardSyncContext,
|
||||
depositContractAddress);
|
||||
}
|
||||
@@ -176,7 +176,7 @@ public class MergeBesuControllerBuilder extends BesuControllerBuilder {
|
||||
genesisConfigOptions,
|
||||
privacyParameters,
|
||||
isRevertReasonEnabled,
|
||||
miningParameters,
|
||||
miningConfiguration,
|
||||
badBlockManager,
|
||||
isParallelTxProcessingEnabled,
|
||||
metricsSystem);
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
*/
|
||||
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
|
||||
@@ -27,7 +27,7 @@ public interface MiningParameterOverrides {
|
||||
* @param fromCli The mining parameters that contains original values.
|
||||
* @return MiningParameters constructed from provided param with additional overridden parameters.
|
||||
*/
|
||||
default MiningParameters getMiningParameterOverrides(final MiningParameters fromCli) {
|
||||
default MiningConfiguration getMiningParameterOverrides(final MiningConfiguration 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.MutableBlockchain;
|
||||
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.eth.EthProtocol;
|
||||
import org.hyperledger.besu.ethereum.eth.SnapProtocol;
|
||||
@@ -130,12 +130,12 @@ public class QbftBesuControllerBuilder extends BftBesuControllerBuilder {
|
||||
protected JsonRpcMethods createAdditionalJsonRpcMethodFactory(
|
||||
final ProtocolContext protocolContext,
|
||||
final ProtocolSchedule protocolSchedule,
|
||||
final MiningParameters miningParameters) {
|
||||
final MiningConfiguration miningConfiguration) {
|
||||
|
||||
return new QbftJsonRpcMethods(
|
||||
protocolContext,
|
||||
protocolSchedule,
|
||||
miningParameters,
|
||||
miningConfiguration,
|
||||
createReadOnlyValidatorProvider(protocolContext.getBlockchain()),
|
||||
bftConfigOptions);
|
||||
}
|
||||
@@ -181,7 +181,7 @@ public class QbftBesuControllerBuilder extends BftBesuControllerBuilder {
|
||||
final ProtocolSchedule protocolSchedule,
|
||||
final ProtocolContext protocolContext,
|
||||
final TransactionPool transactionPool,
|
||||
final MiningParameters miningParameters,
|
||||
final MiningConfiguration miningConfiguration,
|
||||
final SyncState syncState,
|
||||
final EthProtocolManager ethProtocolManager) {
|
||||
final MutableBlockchain blockchain = protocolContext.getBlockchain();
|
||||
@@ -196,7 +196,7 @@ public class QbftBesuControllerBuilder extends BftBesuControllerBuilder {
|
||||
protocolContext,
|
||||
bftProtocolSchedule,
|
||||
qbftForksSchedule,
|
||||
miningParameters,
|
||||
miningConfiguration,
|
||||
localAddress,
|
||||
bftExtraDataCodec().get(),
|
||||
ethProtocolManager.ethContext().getScheduler());
|
||||
@@ -289,12 +289,12 @@ public class QbftBesuControllerBuilder extends BftBesuControllerBuilder {
|
||||
.getBlockchain()
|
||||
.observeBlockAdded(
|
||||
o -> {
|
||||
miningParameters.setBlockPeriodSeconds(
|
||||
miningConfiguration.setBlockPeriodSeconds(
|
||||
qbftForksSchedule
|
||||
.getFork(o.getBlock().getHeader().getNumber() + 1)
|
||||
.getValue()
|
||||
.getBlockPeriodSeconds());
|
||||
miningParameters.setEmptyBlockPeriodSeconds(
|
||||
miningConfiguration.setEmptyBlockPeriodSeconds(
|
||||
qbftForksSchedule
|
||||
.getFork(o.getBlock().getHeader().getNumber() + 1)
|
||||
.getValue()
|
||||
@@ -351,7 +351,7 @@ public class QbftBesuControllerBuilder extends BftBesuControllerBuilder {
|
||||
isRevertReasonEnabled,
|
||||
bftExtraDataCodec().get(),
|
||||
evmConfiguration,
|
||||
miningParameters,
|
||||
miningConfiguration,
|
||||
badBlockManager,
|
||||
isParallelTxProcessingEnabled,
|
||||
metricsSystem);
|
||||
|
||||
@@ -30,8 +30,8 @@ import org.hyperledger.besu.ethereum.ProtocolContext;
|
||||
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.ImmutableMiningConfiguration;
|
||||
import org.hyperledger.besu.ethereum.core.MiningConfiguration;
|
||||
import org.hyperledger.besu.ethereum.core.PrivacyParameters;
|
||||
import org.hyperledger.besu.ethereum.eth.EthProtocolConfiguration;
|
||||
import org.hyperledger.besu.ethereum.eth.manager.EthContext;
|
||||
@@ -102,7 +102,7 @@ public class TransitionBesuControllerBuilder extends BesuControllerBuilder {
|
||||
final ProtocolSchedule protocolSchedule,
|
||||
final ProtocolContext protocolContext,
|
||||
final TransactionPool transactionPool,
|
||||
final MiningParameters miningParameters,
|
||||
final MiningConfiguration miningConfiguration,
|
||||
final SyncState syncState,
|
||||
final EthProtocolManager ethProtocolManager) {
|
||||
|
||||
@@ -112,8 +112,8 @@ public class TransitionBesuControllerBuilder extends BesuControllerBuilder {
|
||||
|
||||
// PoA consensus mines by default, get consensus-specific mining parameters for
|
||||
// TransitionCoordinator:
|
||||
MiningParameters transitionMiningParameters =
|
||||
preMergeBesuControllerBuilder.getMiningParameterOverrides(miningParameters);
|
||||
MiningConfiguration transitionMiningConfiguration =
|
||||
preMergeBesuControllerBuilder.getMiningParameterOverrides(miningConfiguration);
|
||||
|
||||
// construct a transition backward sync context
|
||||
BackwardSyncContext transitionBackwardsSyncContext =
|
||||
@@ -131,10 +131,10 @@ public class TransitionBesuControllerBuilder extends BesuControllerBuilder {
|
||||
transitionProtocolSchedule.getPreMergeSchedule(),
|
||||
protocolContext,
|
||||
transactionPool,
|
||||
ImmutableMiningParameters.builder()
|
||||
.from(miningParameters)
|
||||
ImmutableMiningConfiguration.builder()
|
||||
.from(miningConfiguration)
|
||||
.mutableInitValues(
|
||||
ImmutableMiningParameters.MutableInitValues.builder()
|
||||
ImmutableMiningConfiguration.MutableInitValues.builder()
|
||||
.isMiningEnabled(false)
|
||||
.build())
|
||||
.build(),
|
||||
@@ -144,7 +144,7 @@ public class TransitionBesuControllerBuilder extends BesuControllerBuilder {
|
||||
transitionProtocolSchedule,
|
||||
protocolContext,
|
||||
transactionPool,
|
||||
transitionMiningParameters,
|
||||
transitionMiningConfiguration,
|
||||
syncState,
|
||||
transitionBackwardsSyncContext,
|
||||
ethProtocolManager.ethContext().getScheduler()));
|
||||
@@ -329,9 +329,9 @@ public class TransitionBesuControllerBuilder extends BesuControllerBuilder {
|
||||
}
|
||||
|
||||
@Override
|
||||
public BesuControllerBuilder miningParameters(final MiningParameters miningParameters) {
|
||||
super.miningParameters(miningParameters);
|
||||
return propagateConfig(z -> z.miningParameters(miningParameters));
|
||||
public BesuControllerBuilder miningParameters(final MiningConfiguration miningConfiguration) {
|
||||
super.miningParameters(miningConfiguration);
|
||||
return propagateConfig(z -> z.miningParameters(miningConfiguration));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -16,7 +16,7 @@ package org.hyperledger.besu.services;
|
||||
|
||||
import org.hyperledger.besu.cli.options.stable.JsonRpcHttpOptions;
|
||||
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.plugin.services.BesuConfiguration;
|
||||
import org.hyperledger.besu.plugin.services.storage.DataStorageFormat;
|
||||
@@ -31,7 +31,7 @@ public class BesuConfigurationImpl implements BesuConfiguration {
|
||||
private DataStorageConfiguration dataStorageConfiguration;
|
||||
|
||||
// defaults
|
||||
private MiningParameters miningParameters;
|
||||
private MiningConfiguration miningConfiguration;
|
||||
private Optional<String> rpcHttpHost = Optional.of("http://localhost");
|
||||
private Optional<Integer> rpcHttpPort = Optional.of(8545);
|
||||
|
||||
@@ -59,11 +59,11 @@ public class BesuConfigurationImpl implements BesuConfiguration {
|
||||
/**
|
||||
* Set the mining parameters
|
||||
*
|
||||
* @param miningParameters configured mining parameters
|
||||
* @param miningConfiguration configured mining parameters
|
||||
* @return BesuConfigurationImpl instance
|
||||
*/
|
||||
public BesuConfigurationImpl withMiningParameters(final MiningParameters miningParameters) {
|
||||
this.miningParameters = miningParameters;
|
||||
public BesuConfigurationImpl withMiningParameters(final MiningConfiguration miningConfiguration) {
|
||||
this.miningConfiguration = miningConfiguration;
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -106,7 +106,7 @@ public class BesuConfigurationImpl implements BesuConfiguration {
|
||||
|
||||
@Override
|
||||
public Wei getMinGasPrice() {
|
||||
return miningParameters.getMinTransactionGasPrice();
|
||||
return miningConfiguration.getMinTransactionGasPrice();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -31,7 +31,7 @@ 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.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.eth.EthProtocolConfiguration;
|
||||
import org.hyperledger.besu.ethereum.eth.sync.SyncMode;
|
||||
@@ -150,7 +150,7 @@ class FlexGroupPrivacyTest {
|
||||
.ethProtocolConfiguration(EthProtocolConfiguration.defaultConfig())
|
||||
.storageProvider(new InMemoryKeyValueStorageProvider())
|
||||
.networkId(BigInteger.ONE)
|
||||
.miningParameters(MiningParameters.newDefault())
|
||||
.miningParameters(MiningConfiguration.newDefault())
|
||||
.dataStorageConfiguration(dataStorageConfiguration)
|
||||
.nodeKey(NodeKeyUtils.generate())
|
||||
.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.core.BlockHeader;
|
||||
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.ForkIdManager;
|
||||
import org.hyperledger.besu.ethereum.mainnet.DefaultProtocolSchedule;
|
||||
@@ -174,7 +174,7 @@ public class ForkIdsNetworkConfigTest {
|
||||
(DefaultProtocolSchedule)
|
||||
MainnetProtocolSchedule.fromConfig(
|
||||
configOptions,
|
||||
MiningParameters.MINING_DISABLED,
|
||||
MiningConfiguration.MINING_DISABLED,
|
||||
new BadBlockManager(),
|
||||
false,
|
||||
new NoOpMetricsSystem()));
|
||||
@@ -184,7 +184,7 @@ public class ForkIdsNetworkConfigTest {
|
||||
MergeProtocolSchedule.create(
|
||||
configOptions,
|
||||
false,
|
||||
MiningParameters.MINING_DISABLED,
|
||||
MiningConfiguration.MINING_DISABLED,
|
||||
new BadBlockManager(),
|
||||
false,
|
||||
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.InMemoryKeyValueStorageProvider;
|
||||
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.Transaction;
|
||||
import org.hyperledger.besu.ethereum.eth.EthProtocolConfiguration;
|
||||
@@ -547,7 +547,7 @@ public class PrivacyReorgTest {
|
||||
.ethProtocolConfiguration(EthProtocolConfiguration.defaultConfig())
|
||||
.storageProvider(new InMemoryKeyValueStorageProvider())
|
||||
.networkId(BigInteger.ONE)
|
||||
.miningParameters(MiningParameters.newDefault())
|
||||
.miningParameters(MiningConfiguration.newDefault())
|
||||
.nodeKey(NodeKeyUtils.generate())
|
||||
.metricsSystem(new NoOpMetricsSystem())
|
||||
.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.BlockHeaderTestFixture;
|
||||
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.eth.EthProtocolConfiguration;
|
||||
import org.hyperledger.besu.ethereum.eth.sync.SyncMode;
|
||||
@@ -125,7 +125,7 @@ class PrivacyTest {
|
||||
.ethProtocolConfiguration(EthProtocolConfiguration.defaultConfig())
|
||||
.storageProvider(new InMemoryKeyValueStorageProvider())
|
||||
.networkId(BigInteger.ONE)
|
||||
.miningParameters(MiningParameters.newDefault())
|
||||
.miningParameters(MiningConfiguration.newDefault())
|
||||
.dataStorageConfiguration(dataStorageConfiguration)
|
||||
.nodeKey(NodeKeyUtils.generate())
|
||||
.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.BlockHeader;
|
||||
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.Synchronizer;
|
||||
import org.hyperledger.besu.ethereum.eth.manager.EthContext;
|
||||
@@ -128,7 +128,7 @@ public final class RunnerBuilderTest {
|
||||
when(besuController.getProtocolContext()).thenReturn(protocolContext);
|
||||
when(besuController.getProtocolSchedule()).thenReturn(protocolSchedule);
|
||||
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.getTransactionPool())
|
||||
.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.BlockSyncTestUtils;
|
||||
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.eth.EthProtocolConfiguration;
|
||||
import org.hyperledger.besu.ethereum.eth.sync.SyncMode;
|
||||
@@ -196,7 +196,7 @@ public final class RunnerTest {
|
||||
.isPeerTaskSystemEnabled(isPeerTaskSystemEnabled)
|
||||
.build();
|
||||
final ObservableMetricsSystem noOpMetricsSystem = new NoOpMetricsSystem();
|
||||
final var miningParameters = MiningParameters.newDefault();
|
||||
final var miningParameters = MiningConfiguration.newDefault();
|
||||
final var dataStorageConfiguration = DataStorageConfiguration.DEFAULT_FOREST_CONFIG;
|
||||
// Setup Runner with blocks
|
||||
final BesuController controllerAhead =
|
||||
@@ -415,11 +415,11 @@ public final class RunnerTest {
|
||||
final Path dataDir,
|
||||
final Path dbDir,
|
||||
final DataStorageConfiguration dataStorageConfiguration,
|
||||
final MiningParameters miningParameters) {
|
||||
final MiningConfiguration miningConfiguration) {
|
||||
final var besuConfiguration = new BesuConfigurationImpl();
|
||||
besuConfiguration
|
||||
.init(dataDir, dbDir, dataStorageConfiguration)
|
||||
.withMiningParameters(miningParameters);
|
||||
.withMiningParameters(miningConfiguration);
|
||||
return new KeyValueStorageProviderBuilder()
|
||||
.withStorageFactory(
|
||||
new RocksDBKeyValueStorageFactory(
|
||||
@@ -488,14 +488,14 @@ public final class RunnerTest {
|
||||
final NodeKey nodeKey,
|
||||
final StorageProvider storageProvider,
|
||||
final ObservableMetricsSystem metricsSystem,
|
||||
final MiningParameters miningParameters) {
|
||||
final MiningConfiguration miningConfiguration) {
|
||||
return new MainnetBesuControllerBuilder()
|
||||
.genesisConfigFile(genesisConfig)
|
||||
.synchronizerConfiguration(syncConfig)
|
||||
.ethProtocolConfiguration(EthProtocolConfiguration.defaultConfig())
|
||||
.dataDirectory(dataDir)
|
||||
.networkId(NETWORK_ID)
|
||||
.miningParameters(miningParameters)
|
||||
.miningParameters(miningConfiguration)
|
||||
.nodeKey(nodeKey)
|
||||
.storageProvider(storageProvider)
|
||||
.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.BlockHeaderFunctions;
|
||||
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.eth.EthProtocolConfiguration;
|
||||
import org.hyperledger.besu.ethereum.eth.sync.SyncMode;
|
||||
@@ -94,7 +94,7 @@ public final class RlpBlockExporterTest {
|
||||
.ethProtocolConfiguration(EthProtocolConfiguration.defaultConfig())
|
||||
.storageProvider(new InMemoryKeyValueStorageProvider())
|
||||
.networkId(BigInteger.ONE)
|
||||
.miningParameters(MiningParameters.newDefault())
|
||||
.miningParameters(MiningConfiguration.newDefault())
|
||||
.nodeKey(NodeKeyUtils.generate())
|
||||
.metricsSystem(new NoOpMetricsSystem())
|
||||
.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.BlockBody;
|
||||
import org.hyperledger.besu.ethereum.core.BlockHeader;
|
||||
import org.hyperledger.besu.ethereum.core.ImmutableMiningParameters;
|
||||
import org.hyperledger.besu.ethereum.core.ImmutableMiningParameters.MutableInitValues;
|
||||
import org.hyperledger.besu.ethereum.core.ImmutableMiningConfiguration;
|
||||
import org.hyperledger.besu.ethereum.core.ImmutableMiningConfiguration.MutableInitValues;
|
||||
import org.hyperledger.besu.ethereum.core.InMemoryKeyValueStorageProvider;
|
||||
import org.hyperledger.besu.ethereum.core.PrivacyParameters;
|
||||
import org.hyperledger.besu.ethereum.core.Transaction;
|
||||
@@ -458,7 +458,7 @@ public abstract class JsonBlockImporterTest {
|
||||
.storageProvider(new InMemoryKeyValueStorageProvider())
|
||||
.networkId(BigInteger.valueOf(10))
|
||||
.miningParameters(
|
||||
ImmutableMiningParameters.builder()
|
||||
ImmutableMiningConfiguration.builder()
|
||||
.mutableInitValues(
|
||||
MutableInitValues.builder()
|
||||
.isMiningEnabled(true)
|
||||
|
||||
@@ -26,7 +26,7 @@ import org.hyperledger.besu.controller.BesuController;
|
||||
import org.hyperledger.besu.cryptoservices.NodeKeyUtils;
|
||||
import org.hyperledger.besu.ethereum.GasLimitCalculator;
|
||||
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.eth.EthProtocolConfiguration;
|
||||
import org.hyperledger.besu.ethereum.eth.sync.SyncMode;
|
||||
@@ -69,7 +69,7 @@ public final class RlpBlockImporterTest {
|
||||
.ethProtocolConfiguration(EthProtocolConfiguration.defaultConfig())
|
||||
.storageProvider(new InMemoryKeyValueStorageProvider())
|
||||
.networkId(BigInteger.ONE)
|
||||
.miningParameters(MiningParameters.newDefault())
|
||||
.miningParameters(MiningConfiguration.newDefault())
|
||||
.nodeKey(NodeKeyUtils.generate())
|
||||
.metricsSystem(new NoOpMetricsSystem())
|
||||
.privacyParameters(PrivacyParameters.DEFAULT)
|
||||
@@ -103,7 +103,7 @@ public final class RlpBlockImporterTest {
|
||||
.ethProtocolConfiguration(EthProtocolConfiguration.defaultConfig())
|
||||
.storageProvider(new InMemoryKeyValueStorageProvider())
|
||||
.networkId(BigInteger.ONE)
|
||||
.miningParameters(MiningParameters.newDefault())
|
||||
.miningParameters(MiningConfiguration.newDefault())
|
||||
.nodeKey(NodeKeyUtils.generate())
|
||||
.metricsSystem(new NoOpMetricsSystem())
|
||||
.privacyParameters(PrivacyParameters.DEFAULT)
|
||||
@@ -134,7 +134,7 @@ public final class RlpBlockImporterTest {
|
||||
.ethProtocolConfiguration(EthProtocolConfiguration.defaultConfig())
|
||||
.storageProvider(new InMemoryKeyValueStorageProvider())
|
||||
.networkId(BigInteger.ONE)
|
||||
.miningParameters(MiningParameters.newDefault())
|
||||
.miningParameters(MiningConfiguration.newDefault())
|
||||
.nodeKey(NodeKeyUtils.generate())
|
||||
.metricsSystem(new NoOpMetricsSystem())
|
||||
.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.jsonrpc.JsonRpcConfiguration;
|
||||
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.SynchronizerConfiguration;
|
||||
import org.hyperledger.besu.ethereum.p2p.peers.EnodeURLImpl;
|
||||
@@ -277,8 +277,8 @@ public class BesuCommandTest extends CommandTestAbstract {
|
||||
verify(mockRunnerBuilder).build();
|
||||
|
||||
verify(mockControllerBuilderFactory).fromEthNetworkConfig(ethNetworkArg.capture(), any());
|
||||
final ArgumentCaptor<MiningParameters> miningArg =
|
||||
ArgumentCaptor.forClass(MiningParameters.class);
|
||||
final ArgumentCaptor<MiningConfiguration> miningArg =
|
||||
ArgumentCaptor.forClass(MiningConfiguration.class);
|
||||
verify(mockControllerBuilder).synchronizerConfiguration(syncConfigurationCaptor.capture());
|
||||
verify(mockControllerBuilder).dataDirectory(isNotNull());
|
||||
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.jsonrpc.JsonRpcConfiguration;
|
||||
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.SynchronizerConfiguration;
|
||||
import org.hyperledger.besu.ethereum.p2p.peers.EnodeURLImpl;
|
||||
@@ -200,7 +200,7 @@ public class CascadingDefaultProviderTest extends CommandTestAbstract {
|
||||
setEnvironmentVariable("BESU_MINER_COINBASE", expectedCoinbase);
|
||||
parseCommand("--config-file", configFile);
|
||||
|
||||
final var captMiningParameters = ArgumentCaptor.forClass(MiningParameters.class);
|
||||
final var captMiningParameters = ArgumentCaptor.forClass(MiningConfiguration.class);
|
||||
verify(mockControllerBuilder).miningParameters(captMiningParameters.capture());
|
||||
|
||||
assertThat(captMiningParameters.getValue().getCoinbase())
|
||||
@@ -219,7 +219,7 @@ public class CascadingDefaultProviderTest extends CommandTestAbstract {
|
||||
setEnvironmentVariable("BESU_MINER_COINBASE", "0x0000000000000000000000000000000000000004");
|
||||
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());
|
||||
|
||||
assertThat(captMiningParameters.getValue().getCoinbase())
|
||||
|
||||
@@ -15,19 +15,19 @@
|
||||
package org.hyperledger.besu.cli.options;
|
||||
|
||||
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.MiningParameters.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.DEFAULT_NON_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.MiningConfiguration.Unstable.DEFAULT_POS_BLOCK_CREATION_MAX_TIME;
|
||||
import static org.mockito.Mockito.atMost;
|
||||
import static org.mockito.Mockito.verify;
|
||||
|
||||
import org.hyperledger.besu.datatypes.Address;
|
||||
import org.hyperledger.besu.datatypes.Wei;
|
||||
import org.hyperledger.besu.ethereum.GasLimitCalculator;
|
||||
import org.hyperledger.besu.ethereum.core.ImmutableMiningParameters;
|
||||
import org.hyperledger.besu.ethereum.core.ImmutableMiningParameters.MutableInitValues;
|
||||
import org.hyperledger.besu.ethereum.core.ImmutableMiningParameters.Unstable;
|
||||
import org.hyperledger.besu.ethereum.core.MiningParameters;
|
||||
import org.hyperledger.besu.ethereum.core.ImmutableMiningConfiguration;
|
||||
import org.hyperledger.besu.ethereum.core.ImmutableMiningConfiguration.MutableInitValues;
|
||||
import org.hyperledger.besu.ethereum.core.ImmutableMiningConfiguration.Unstable;
|
||||
import org.hyperledger.besu.ethereum.core.MiningConfiguration;
|
||||
import org.hyperledger.besu.util.number.PositiveNumber;
|
||||
|
||||
import java.io.IOException;
|
||||
@@ -42,7 +42,7 @@ import org.mockito.ArgumentCaptor;
|
||||
import org.mockito.junit.jupiter.MockitoExtension;
|
||||
|
||||
@ExtendWith(MockitoExtension.class)
|
||||
public class MiningOptionsTest extends AbstractCLIOptionsTest<MiningParameters, MiningOptions> {
|
||||
public class MiningOptionsTest extends AbstractCLIOptionsTest<MiningConfiguration, MiningOptions> {
|
||||
|
||||
@Test
|
||||
public void besuDoesNotStartInMiningModeIfCoinbaseNotSet() {
|
||||
@@ -390,13 +390,13 @@ public class MiningOptionsTest extends AbstractCLIOptionsTest<MiningParameters,
|
||||
}
|
||||
|
||||
@Override
|
||||
protected MiningParameters createDefaultDomainObject() {
|
||||
return MiningParameters.newDefault();
|
||||
protected MiningConfiguration createDefaultDomainObject() {
|
||||
return MiningConfiguration.newDefault();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected MiningParameters createCustomizedDomainObject() {
|
||||
return ImmutableMiningParameters.builder()
|
||||
protected MiningConfiguration createCustomizedDomainObject() {
|
||||
return ImmutableMiningConfiguration.builder()
|
||||
.mutableInitValues(
|
||||
MutableInitValues.builder()
|
||||
.isMiningEnabled(true)
|
||||
@@ -410,7 +410,7 @@ public class MiningOptionsTest extends AbstractCLIOptionsTest<MiningParameters,
|
||||
}
|
||||
|
||||
@Override
|
||||
protected MiningOptions optionsFromDomainObject(final MiningParameters domainObject) {
|
||||
protected MiningOptions optionsFromDomainObject(final MiningConfiguration domainObject) {
|
||||
return MiningOptions.fromConfig(domainObject);
|
||||
}
|
||||
|
||||
@@ -424,11 +424,11 @@ public class MiningOptionsTest extends AbstractCLIOptionsTest<MiningParameters,
|
||||
return new String[] {"transactionSelectionService"};
|
||||
}
|
||||
|
||||
private MiningParameters runtimeConfiguration(
|
||||
final TestBesuCommand besuCommand, final MiningParameters miningParameters) {
|
||||
private MiningConfiguration runtimeConfiguration(
|
||||
final TestBesuCommand besuCommand, final MiningConfiguration miningConfiguration) {
|
||||
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.BlockHeaderFunctions;
|
||||
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.eth.EthProtocolConfiguration;
|
||||
import org.hyperledger.besu.ethereum.eth.sync.SynchronizerConfiguration;
|
||||
@@ -90,7 +90,7 @@ public abstract class AbstractBftBesuControllerBuilderTest {
|
||||
TransactionPoolConfiguration.DEFAULT;
|
||||
private final ObservableMetricsSystem observableMetricsSystem = new NoOpMetricsSystem();
|
||||
protected final ObjectMapper objectMapper = new ObjectMapper();
|
||||
private final MiningParameters miningParameters = MiningParameters.newDefault();
|
||||
private final MiningConfiguration miningConfiguration = MiningConfiguration.newDefault();
|
||||
@TempDir Path tempDir;
|
||||
|
||||
@BeforeEach
|
||||
@@ -146,7 +146,7 @@ public abstract class AbstractBftBesuControllerBuilderTest {
|
||||
.synchronizerConfiguration(synchronizerConfiguration)
|
||||
.ethProtocolConfiguration(ethProtocolConfiguration)
|
||||
.networkId(networkId)
|
||||
.miningParameters(miningParameters)
|
||||
.miningParameters(miningConfiguration)
|
||||
.metricsSystem(observableMetricsSystem)
|
||||
.privacyParameters(privacyParameters)
|
||||
.dataDirectory(tempDir)
|
||||
@@ -199,8 +199,8 @@ public abstract class AbstractBftBesuControllerBuilderTest {
|
||||
|
||||
protocolContext.getBlockchain().appendBlock(block1, List.of());
|
||||
|
||||
assertThat(miningParameters.getBlockPeriodSeconds()).isNotEmpty().hasValue(2);
|
||||
assertThat(miningParameters.getBlockTxsSelectionMaxTime()).isEqualTo(2000 * 75 / 100);
|
||||
assertThat(miningConfiguration.getBlockPeriodSeconds()).isNotEmpty().hasValue(2);
|
||||
assertThat(miningConfiguration.getBlockTxsSelectionMaxTime()).isEqualTo(2000 * 75 / 100);
|
||||
}
|
||||
|
||||
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.BlockHeader;
|
||||
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.eth.EthProtocolConfiguration;
|
||||
import org.hyperledger.besu.ethereum.eth.sync.SynchronizerConfiguration;
|
||||
@@ -95,7 +95,7 @@ public class CliqueBesuControllerBuilderTest {
|
||||
TransactionPoolConfiguration.DEFAULT;
|
||||
private final ObservableMetricsSystem observableMetricsSystem = new NoOpMetricsSystem();
|
||||
private final ObjectMapper objectMapper = new ObjectMapper();
|
||||
private final MiningParameters miningParameters = MiningParameters.newDefault();
|
||||
private final MiningConfiguration miningConfiguration = MiningConfiguration.newDefault();
|
||||
|
||||
@TempDir Path tempDir;
|
||||
|
||||
@@ -179,7 +179,7 @@ public class CliqueBesuControllerBuilderTest {
|
||||
.synchronizerConfiguration(synchronizerConfiguration)
|
||||
.ethProtocolConfiguration(ethProtocolConfiguration)
|
||||
.networkId(networkId)
|
||||
.miningParameters(miningParameters)
|
||||
.miningParameters(miningConfiguration)
|
||||
.metricsSystem(observableMetricsSystem)
|
||||
.privacyParameters(privacyParameters)
|
||||
.dataDirectory(tempDir)
|
||||
@@ -228,7 +228,7 @@ public class CliqueBesuControllerBuilderTest {
|
||||
|
||||
protocolContext.getBlockchain().appendBlock(block1, List.of());
|
||||
|
||||
assertThat(miningParameters.getBlockPeriodSeconds()).isNotEmpty().hasValue(2);
|
||||
assertThat(miningParameters.getBlockTxsSelectionMaxTime()).isEqualTo(2000 * 75 / 100);
|
||||
assertThat(miningConfiguration.getBlockPeriodSeconds()).isNotEmpty().hasValue(2);
|
||||
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.chain.Blockchain;
|
||||
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.sync.state.SyncState;
|
||||
import org.hyperledger.besu.ethereum.eth.transactions.TransactionPool;
|
||||
@@ -135,7 +135,7 @@ public class ConsensusScheduleBesuControllerBuilderTest {
|
||||
protocolSchedule1,
|
||||
mockProtocolContext,
|
||||
mock(TransactionPool.class),
|
||||
mock(MiningParameters.class),
|
||||
mock(MiningConfiguration.class),
|
||||
mock(SyncState.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.BlockHeaderTestFixture;
|
||||
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.eth.EthProtocolConfiguration;
|
||||
import org.hyperledger.besu.ethereum.eth.sync.SynchronizerConfiguration;
|
||||
@@ -95,7 +95,7 @@ public class MergeBesuControllerBuilderTest {
|
||||
@Mock CheckpointConfigOptions checkpointConfigOptions;
|
||||
|
||||
@Mock(answer = Answers.RETURNS_DEEP_STUBS)
|
||||
MiningParameters miningParameters;
|
||||
MiningConfiguration miningConfiguration;
|
||||
|
||||
@Mock PrivacyParameters privacyParameters;
|
||||
@Mock Clock clock;
|
||||
@@ -167,7 +167,7 @@ public class MergeBesuControllerBuilderTest {
|
||||
lenient()
|
||||
.when(worldStateKeyValueStorage.updater())
|
||||
.thenReturn(mock(ForestWorldStateKeyValueStorage.Updater.class));
|
||||
lenient().when(miningParameters.getTargetGasLimit()).thenReturn(OptionalLong.empty());
|
||||
lenient().when(miningConfiguration.getTargetGasLimit()).thenReturn(OptionalLong.empty());
|
||||
|
||||
besuControllerBuilder = visitWithMockConfigs(new MergeBesuControllerBuilder());
|
||||
}
|
||||
@@ -179,7 +179,7 @@ public class MergeBesuControllerBuilderTest {
|
||||
.genesisConfigFile(genesisConfigFile)
|
||||
.synchronizerConfiguration(synchronizerConfiguration)
|
||||
.ethProtocolConfiguration(ethProtocolConfiguration)
|
||||
.miningParameters(miningParameters)
|
||||
.miningParameters(miningConfiguration)
|
||||
.metricsSystem(observableMetricsSystem)
|
||||
.privacyParameters(privacyParameters)
|
||||
.dataDirectory(tempDir)
|
||||
|
||||
@@ -32,7 +32,7 @@ import org.hyperledger.besu.datatypes.Address;
|
||||
import org.hyperledger.besu.ethereum.ProtocolContext;
|
||||
import org.hyperledger.besu.ethereum.chain.MutableBlockchain;
|
||||
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 java.util.List;
|
||||
@@ -107,7 +107,7 @@ public class QbftBesuControllerBuilderTest extends AbstractBftBesuControllerBuil
|
||||
assertThatThrownBy(
|
||||
() ->
|
||||
bftBesuControllerBuilder.createAdditionalJsonRpcMethodFactory(
|
||||
protocolContext, protocolSchedule, MiningParameters.newDefault()))
|
||||
protocolContext, protocolSchedule, MiningConfiguration.newDefault()))
|
||||
.isInstanceOf(NullPointerException.class)
|
||||
.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.core.BlockHeaderTestFixture;
|
||||
import org.hyperledger.besu.ethereum.core.Difficulty;
|
||||
import org.hyperledger.besu.ethereum.core.ImmutableMiningParameters;
|
||||
import org.hyperledger.besu.ethereum.core.ImmutableMiningParameters.MutableInitValues;
|
||||
import org.hyperledger.besu.ethereum.core.ImmutableMiningConfiguration;
|
||||
import org.hyperledger.besu.ethereum.core.ImmutableMiningConfiguration.MutableInitValues;
|
||||
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.sync.state.SyncState;
|
||||
import org.hyperledger.besu.ethereum.eth.transactions.TransactionPool;
|
||||
@@ -84,7 +84,7 @@ public class TransitionControllerBuilderTest {
|
||||
CliqueBesuControllerBuilder cliqueBuilder = new CliqueBesuControllerBuilder();
|
||||
BesuControllerBuilder powBuilder = new MainnetBesuControllerBuilder();
|
||||
MergeBesuControllerBuilder postMergeBuilder = new MergeBesuControllerBuilder();
|
||||
MiningParameters miningParameters;
|
||||
MiningConfiguration miningConfiguration;
|
||||
|
||||
TransitionProtocolSchedule transitionProtocolSchedule;
|
||||
|
||||
@@ -118,27 +118,27 @@ public class TransitionControllerBuilderTest {
|
||||
.thenReturn(mergeContext);
|
||||
when(ethProtocolManager.ethContext().getScheduler())
|
||||
.thenReturn(new DeterministicEthScheduler());
|
||||
miningParameters = MiningParameters.newDefault();
|
||||
miningConfiguration = MiningConfiguration.newDefault();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void assertCliqueMiningOverridePreMerge() {
|
||||
assertThat(miningParameters.isMiningEnabled()).isFalse();
|
||||
assertThat(miningConfiguration.isMiningEnabled()).isFalse();
|
||||
var transCoordinator = buildTransitionCoordinator(cliqueBuilder, postMergeBuilder);
|
||||
assertThat(transCoordinator.isMiningBeforeMerge()).isTrue();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void assertPoWIsNotMiningPreMerge() {
|
||||
assertThat(miningParameters.isMiningEnabled()).isFalse();
|
||||
assertThat(miningConfiguration.isMiningEnabled()).isFalse();
|
||||
var transCoordinator = buildTransitionCoordinator(powBuilder, postMergeBuilder);
|
||||
assertThat(transCoordinator.isMiningBeforeMerge()).isFalse();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void assertPowMiningPreMerge() {
|
||||
miningParameters =
|
||||
ImmutableMiningParameters.builder()
|
||||
miningConfiguration =
|
||||
ImmutableMiningConfiguration.builder()
|
||||
.mutableInitValues(MutableInitValues.builder().isMiningEnabled(true).build())
|
||||
.build();
|
||||
var transCoordinator = buildTransitionCoordinator(powBuilder, postMergeBuilder);
|
||||
@@ -273,7 +273,7 @@ public class TransitionControllerBuilderTest {
|
||||
transitionProtocolSchedule,
|
||||
protocolContext,
|
||||
transactionPool,
|
||||
miningParameters,
|
||||
miningConfiguration,
|
||||
syncState,
|
||||
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.BlockHeaderTestFixture;
|
||||
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.TransactionReceipt;
|
||||
import org.hyperledger.besu.ethereum.core.TransactionTestFixture;
|
||||
@@ -173,7 +173,7 @@ public class BesuEventsImplTest {
|
||||
syncState,
|
||||
txPoolConfig,
|
||||
new BlobCache(),
|
||||
MiningParameters.newDefault());
|
||||
MiningConfiguration.newDefault());
|
||||
|
||||
serviceImpl =
|
||||
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.core.Block;
|
||||
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.evm.log.Log;
|
||||
import org.hyperledger.besu.evm.worldstate.WorldView;
|
||||
@@ -80,7 +80,7 @@ class TraceServiceImplTest {
|
||||
blockchainSetupUtil.getProtocolSchedule(),
|
||||
blockchain,
|
||||
worldStateArchive,
|
||||
MiningParameters.newDefault());
|
||||
MiningConfiguration.newDefault());
|
||||
traceService =
|
||||
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.Wei;
|
||||
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.Util;
|
||||
import org.hyperledger.besu.ethereum.mainnet.BlockHeaderValidator;
|
||||
@@ -63,7 +63,7 @@ public class CliqueProtocolSchedule {
|
||||
* @param privacyParameters the privacy parameters
|
||||
* @param isRevertReasonEnabled the is revert reason enabled
|
||||
* @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 isParallelTxProcessingEnabled indicates whether parallel transaction is enabled
|
||||
* @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 boolean isRevertReasonEnabled,
|
||||
final EvmConfiguration evmConfiguration,
|
||||
final MiningParameters miningParameters,
|
||||
final MiningConfiguration miningConfiguration,
|
||||
final BadBlockManager badBlockManager,
|
||||
final boolean isParallelTxProcessingEnabled,
|
||||
final MetricsSystem metricsSystem) {
|
||||
@@ -115,7 +115,7 @@ public class CliqueProtocolSchedule {
|
||||
privacyParameters,
|
||||
isRevertReasonEnabled,
|
||||
evmConfiguration,
|
||||
miningParameters,
|
||||
miningConfiguration,
|
||||
badBlockManager,
|
||||
isParallelTxProcessingEnabled,
|
||||
metricsSystem)
|
||||
@@ -130,7 +130,7 @@ public class CliqueProtocolSchedule {
|
||||
* @param nodeKey the node key
|
||||
* @param isRevertReasonEnabled the is revert reason enabled
|
||||
* @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 isParallelTxProcessingEnabled indicates whether parallel transaction is enabled
|
||||
* @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 boolean isRevertReasonEnabled,
|
||||
final EvmConfiguration evmConfiguration,
|
||||
final MiningParameters miningParameters,
|
||||
final MiningConfiguration miningConfiguration,
|
||||
final BadBlockManager badBlockManager,
|
||||
final boolean isParallelTxProcessingEnabled,
|
||||
final MetricsSystem metricsSystem) {
|
||||
@@ -155,7 +155,7 @@ public class CliqueProtocolSchedule {
|
||||
PrivacyParameters.DEFAULT,
|
||||
isRevertReasonEnabled,
|
||||
evmConfiguration,
|
||||
miningParameters,
|
||||
miningConfiguration,
|
||||
badBlockManager,
|
||||
isParallelTxProcessingEnabled,
|
||||
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.BlockHeaderBuilder;
|
||||
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.Util;
|
||||
import org.hyperledger.besu.ethereum.eth.manager.EthScheduler;
|
||||
@@ -48,7 +48,7 @@ public class CliqueBlockCreator extends AbstractBlockCreator {
|
||||
/**
|
||||
* Instantiates a new Clique block creator.
|
||||
*
|
||||
* @param miningParameters the mining parameters
|
||||
* @param miningConfiguration the mining parameters
|
||||
* @param extraDataCalculator the extra data calculator
|
||||
* @param transactionPool the pending transactions
|
||||
* @param protocolContext the protocol context
|
||||
@@ -58,7 +58,7 @@ public class CliqueBlockCreator extends AbstractBlockCreator {
|
||||
* @param ethScheduler the scheduler for asynchronous block creation tasks
|
||||
*/
|
||||
public CliqueBlockCreator(
|
||||
final MiningParameters miningParameters,
|
||||
final MiningConfiguration miningConfiguration,
|
||||
final ExtraDataCalculator extraDataCalculator,
|
||||
final TransactionPool transactionPool,
|
||||
final ProtocolContext protocolContext,
|
||||
@@ -67,7 +67,7 @@ public class CliqueBlockCreator extends AbstractBlockCreator {
|
||||
final EpochManager epochManager,
|
||||
final EthScheduler ethScheduler) {
|
||||
super(
|
||||
miningParameters,
|
||||
miningConfiguration,
|
||||
__ -> Util.publicKeyToAddress(nodeKey.getPublicKey()),
|
||||
extraDataCalculator,
|
||||
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.PoWObserver;
|
||||
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.eth.manager.EthScheduler;
|
||||
import org.hyperledger.besu.ethereum.eth.transactions.TransactionPool;
|
||||
@@ -70,7 +70,7 @@ public class CliqueMinerExecutor extends AbstractMinerExecutor<CliqueBlockMiner>
|
||||
final ProtocolSchedule protocolSchedule,
|
||||
final TransactionPool transactionPool,
|
||||
final NodeKey nodeKey,
|
||||
final MiningParameters miningParams,
|
||||
final MiningConfiguration miningParams,
|
||||
final AbstractBlockScheduler blockScheduler,
|
||||
final EpochManager epochManager,
|
||||
final ForksSchedule<CliqueConfigOptions> forksSchedule,
|
||||
@@ -97,7 +97,7 @@ public class CliqueMinerExecutor extends AbstractMinerExecutor<CliqueBlockMiner>
|
||||
final Function<BlockHeader, CliqueBlockCreator> blockCreator =
|
||||
(header) ->
|
||||
new CliqueBlockCreator(
|
||||
miningParameters,
|
||||
miningConfiguration,
|
||||
this::calculateExtraData,
|
||||
transactionPool,
|
||||
protocolContext,
|
||||
@@ -119,7 +119,7 @@ public class CliqueMinerExecutor extends AbstractMinerExecutor<CliqueBlockMiner>
|
||||
|
||||
@Override
|
||||
public Optional<Address> getCoinbase() {
|
||||
return miningParameters.getCoinbase();
|
||||
return miningConfiguration.getCoinbase();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -134,7 +134,7 @@ public class CliqueMinerExecutor extends AbstractMinerExecutor<CliqueBlockMiner>
|
||||
|
||||
final Bytes vanityDataToInsert =
|
||||
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.
|
||||
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.query.BlockchainQueries;
|
||||
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.worldstate.WorldStateArchive;
|
||||
|
||||
@@ -41,22 +41,22 @@ import java.util.Map;
|
||||
public class CliqueJsonRpcMethods extends ApiGroupJsonRpcMethods {
|
||||
private final ProtocolContext context;
|
||||
private final ProtocolSchedule protocolSchedule;
|
||||
private final MiningParameters miningParameters;
|
||||
private final MiningConfiguration miningConfiguration;
|
||||
|
||||
/**
|
||||
* Instantiates a new Clique json rpc methods.
|
||||
*
|
||||
* @param context the protocol context
|
||||
* @param protocolSchedule the protocol schedule
|
||||
* @param miningParameters the mining parameters
|
||||
* @param miningConfiguration the mining parameters
|
||||
*/
|
||||
public CliqueJsonRpcMethods(
|
||||
final ProtocolContext context,
|
||||
final ProtocolSchedule protocolSchedule,
|
||||
final MiningParameters miningParameters) {
|
||||
final MiningConfiguration miningConfiguration) {
|
||||
this.context = context;
|
||||
this.protocolSchedule = protocolSchedule;
|
||||
this.miningParameters = miningParameters;
|
||||
this.miningConfiguration = miningConfiguration;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -69,7 +69,7 @@ public class CliqueJsonRpcMethods extends ApiGroupJsonRpcMethods {
|
||||
final MutableBlockchain blockchain = context.getBlockchain();
|
||||
final WorldStateArchive worldStateArchive = context.getWorldStateArchive();
|
||||
final BlockchainQueries blockchainQueries =
|
||||
new BlockchainQueries(protocolSchedule, blockchain, worldStateArchive, miningParameters);
|
||||
new BlockchainQueries(protocolSchedule, blockchain, worldStateArchive, miningConfiguration);
|
||||
final ValidatorProvider validatorProvider =
|
||||
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.core.BlockHeader;
|
||||
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.ProtocolSchedule;
|
||||
import org.hyperledger.besu.ethereum.mainnet.ProtocolSpec;
|
||||
@@ -68,7 +68,7 @@ public class CliqueProtocolScheduleTest {
|
||||
NODE_KEY,
|
||||
false,
|
||||
EvmConfiguration.DEFAULT,
|
||||
MiningParameters.MINING_DISABLED,
|
||||
MiningConfiguration.MINING_DISABLED,
|
||||
new BadBlockManager(),
|
||||
false,
|
||||
new NoOpMetricsSystem());
|
||||
@@ -94,7 +94,7 @@ public class CliqueProtocolScheduleTest {
|
||||
NODE_KEY,
|
||||
false,
|
||||
EvmConfiguration.DEFAULT,
|
||||
MiningParameters.MINING_DISABLED,
|
||||
MiningConfiguration.MINING_DISABLED,
|
||||
new BadBlockManager(),
|
||||
false,
|
||||
new NoOpMetricsSystem())
|
||||
@@ -120,7 +120,7 @@ public class CliqueProtocolScheduleTest {
|
||||
NODE_KEY,
|
||||
false,
|
||||
EvmConfiguration.DEFAULT,
|
||||
MiningParameters.MINING_DISABLED,
|
||||
MiningConfiguration.MINING_DISABLED,
|
||||
new BadBlockManager(),
|
||||
false,
|
||||
new NoOpMetricsSystem()))
|
||||
@@ -142,7 +142,7 @@ public class CliqueProtocolScheduleTest {
|
||||
NODE_KEY,
|
||||
false,
|
||||
EvmConfiguration.DEFAULT,
|
||||
MiningParameters.MINING_DISABLED,
|
||||
MiningConfiguration.MINING_DISABLED,
|
||||
new BadBlockManager(),
|
||||
false,
|
||||
new NoOpMetricsSystem()))
|
||||
@@ -168,7 +168,7 @@ public class CliqueProtocolScheduleTest {
|
||||
NODE_KEY,
|
||||
false,
|
||||
EvmConfiguration.DEFAULT,
|
||||
MiningParameters.MINING_DISABLED,
|
||||
MiningConfiguration.MINING_DISABLED,
|
||||
new BadBlockManager(),
|
||||
false,
|
||||
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.BlockBody;
|
||||
import org.hyperledger.besu.ethereum.core.BlockHeaderTestFixture;
|
||||
import org.hyperledger.besu.ethereum.core.ImmutableMiningParameters;
|
||||
import org.hyperledger.besu.ethereum.core.ImmutableMiningParameters.MutableInitValues;
|
||||
import org.hyperledger.besu.ethereum.core.MiningParameters;
|
||||
import org.hyperledger.besu.ethereum.core.ImmutableMiningConfiguration;
|
||||
import org.hyperledger.besu.ethereum.core.ImmutableMiningConfiguration.MutableInitValues;
|
||||
import org.hyperledger.besu.ethereum.core.MiningConfiguration;
|
||||
import org.hyperledger.besu.ethereum.core.Util;
|
||||
import org.hyperledger.besu.ethereum.eth.manager.EthContext;
|
||||
import org.hyperledger.besu.ethereum.eth.manager.EthScheduler;
|
||||
@@ -106,7 +106,7 @@ public class CliqueBlockCreatorTest {
|
||||
proposerNodeKey,
|
||||
false,
|
||||
EvmConfiguration.DEFAULT,
|
||||
MiningParameters.MINING_DISABLED,
|
||||
MiningConfiguration.MINING_DISABLED,
|
||||
new BadBlockManager(),
|
||||
false,
|
||||
new NoOpMetricsSystem());
|
||||
@@ -146,11 +146,11 @@ public class CliqueBlockCreatorTest {
|
||||
|
||||
final Address coinbase = AddressHelpers.ofValue(1);
|
||||
|
||||
final MiningParameters miningParameters = createMiningParameters(extraData, coinbase);
|
||||
final MiningConfiguration miningConfiguration = createMiningParameters(extraData, coinbase);
|
||||
|
||||
final CliqueBlockCreator blockCreator =
|
||||
new CliqueBlockCreator(
|
||||
miningParameters,
|
||||
miningConfiguration,
|
||||
parent -> extraData,
|
||||
createTransactionPool(),
|
||||
protocolContext,
|
||||
@@ -175,11 +175,11 @@ public class CliqueBlockCreatorTest {
|
||||
when(voteProvider.getVoteAfterBlock(any(), any()))
|
||||
.thenReturn(Optional.of(new ValidatorVote(VoteType.ADD, coinbase, a1)));
|
||||
|
||||
final MiningParameters miningParameters = createMiningParameters(extraData, coinbase);
|
||||
final MiningConfiguration miningConfiguration = createMiningParameters(extraData, coinbase);
|
||||
|
||||
final CliqueBlockCreator blockCreator =
|
||||
new CliqueBlockCreator(
|
||||
miningParameters,
|
||||
miningConfiguration,
|
||||
parent -> extraData,
|
||||
createTransactionPool(),
|
||||
protocolContext,
|
||||
@@ -209,11 +209,11 @@ public class CliqueBlockCreatorTest {
|
||||
when(mockVoteProvider.getVoteAfterBlock(any(), any()))
|
||||
.thenReturn(Optional.of(new ValidatorVote(VoteType.ADD, coinbase, a1)));
|
||||
|
||||
final MiningParameters miningParameters = createMiningParameters(extraData, coinbase);
|
||||
final MiningConfiguration miningConfiguration = createMiningParameters(extraData, coinbase);
|
||||
|
||||
final CliqueBlockCreator blockCreator =
|
||||
new CliqueBlockCreator(
|
||||
miningParameters,
|
||||
miningConfiguration,
|
||||
parent -> extraData,
|
||||
createTransactionPool(),
|
||||
protocolContext,
|
||||
@@ -252,10 +252,10 @@ public class CliqueBlockCreatorTest {
|
||||
return transactionPool;
|
||||
}
|
||||
|
||||
private static MiningParameters createMiningParameters(
|
||||
private static MiningConfiguration createMiningParameters(
|
||||
final Bytes extraData, final Address coinbase) {
|
||||
final MiningParameters miningParameters =
|
||||
ImmutableMiningParameters.builder()
|
||||
final MiningConfiguration miningConfiguration =
|
||||
ImmutableMiningConfiguration.builder()
|
||||
.mutableInitValues(
|
||||
MutableInitValues.builder()
|
||||
.extraData(extraData)
|
||||
@@ -264,6 +264,6 @@ public class CliqueBlockCreatorTest {
|
||||
.coinbase(coinbase)
|
||||
.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.BlockHeader;
|
||||
import org.hyperledger.besu.ethereum.core.BlockHeaderTestFixture;
|
||||
import org.hyperledger.besu.ethereum.core.ImmutableMiningParameters;
|
||||
import org.hyperledger.besu.ethereum.core.ImmutableMiningParameters.MutableInitValues;
|
||||
import org.hyperledger.besu.ethereum.core.MiningParameters;
|
||||
import org.hyperledger.besu.ethereum.core.ImmutableMiningConfiguration;
|
||||
import org.hyperledger.besu.ethereum.core.ImmutableMiningConfiguration.MutableInitValues;
|
||||
import org.hyperledger.besu.ethereum.core.MiningConfiguration;
|
||||
import org.hyperledger.besu.ethereum.core.Util;
|
||||
import org.hyperledger.besu.ethereum.eth.manager.EthContext;
|
||||
import org.hyperledger.besu.ethereum.eth.manager.EthScheduler;
|
||||
@@ -105,7 +105,7 @@ public class CliqueMinerExecutorTest {
|
||||
proposerNodeKey,
|
||||
false,
|
||||
EvmConfiguration.DEFAULT,
|
||||
MiningParameters.MINING_DISABLED,
|
||||
MiningConfiguration.MINING_DISABLED,
|
||||
new BadBlockManager(),
|
||||
false,
|
||||
new NoOpMetricsSystem());
|
||||
@@ -117,7 +117,7 @@ public class CliqueMinerExecutorTest {
|
||||
public void extraDataCreatedOnEpochBlocksContainsValidators() {
|
||||
final Bytes vanityData = generateRandomVanityData();
|
||||
|
||||
final MiningParameters miningParameters = createMiningParameters(vanityData);
|
||||
final MiningConfiguration miningConfiguration = createMiningParameters(vanityData);
|
||||
|
||||
final CliqueMinerExecutor executor =
|
||||
new CliqueMinerExecutor(
|
||||
@@ -125,7 +125,7 @@ public class CliqueMinerExecutorTest {
|
||||
cliqueProtocolSchedule,
|
||||
createTransactionPool(),
|
||||
proposerNodeKey,
|
||||
miningParameters,
|
||||
miningConfiguration,
|
||||
mock(CliqueBlockScheduler.class),
|
||||
new EpochManager(EPOCH_LENGTH),
|
||||
null,
|
||||
@@ -153,7 +153,7 @@ public class CliqueMinerExecutorTest {
|
||||
public void extraDataForNonEpochBlocksDoesNotContainValidaors() {
|
||||
final Bytes vanityData = generateRandomVanityData();
|
||||
|
||||
final MiningParameters miningParameters = createMiningParameters(vanityData);
|
||||
final MiningConfiguration miningConfiguration = createMiningParameters(vanityData);
|
||||
|
||||
final CliqueMinerExecutor executor =
|
||||
new CliqueMinerExecutor(
|
||||
@@ -161,7 +161,7 @@ public class CliqueMinerExecutorTest {
|
||||
cliqueProtocolSchedule,
|
||||
createTransactionPool(),
|
||||
proposerNodeKey,
|
||||
miningParameters,
|
||||
miningConfiguration,
|
||||
mock(CliqueBlockScheduler.class),
|
||||
new EpochManager(EPOCH_LENGTH),
|
||||
null,
|
||||
@@ -189,7 +189,7 @@ public class CliqueMinerExecutorTest {
|
||||
final Bytes initialVanityData = generateRandomVanityData();
|
||||
final Bytes modifiedVanityData = generateRandomVanityData();
|
||||
|
||||
final MiningParameters miningParameters = createMiningParameters(initialVanityData);
|
||||
final MiningConfiguration miningConfiguration = createMiningParameters(initialVanityData);
|
||||
|
||||
final CliqueMinerExecutor executor =
|
||||
new CliqueMinerExecutor(
|
||||
@@ -197,13 +197,13 @@ public class CliqueMinerExecutorTest {
|
||||
cliqueProtocolSchedule,
|
||||
createTransactionPool(),
|
||||
proposerNodeKey,
|
||||
miningParameters,
|
||||
miningConfiguration,
|
||||
mock(CliqueBlockScheduler.class),
|
||||
new EpochManager(EPOCH_LENGTH),
|
||||
null,
|
||||
ethScheduler);
|
||||
|
||||
miningParameters.setExtraData(modifiedVanityData);
|
||||
miningConfiguration.setExtraData(modifiedVanityData);
|
||||
final Bytes extraDataBytes = executor.calculateExtraData(blockHeaderBuilder.buildHeader());
|
||||
|
||||
final CliqueExtraData cliqueExtraData =
|
||||
@@ -253,8 +253,8 @@ public class CliqueMinerExecutorTest {
|
||||
return Bytes.wrap(vanityData);
|
||||
}
|
||||
|
||||
private static MiningParameters createMiningParameters(final Bytes vanityData) {
|
||||
return ImmutableMiningParameters.builder()
|
||||
private static MiningConfiguration createMiningParameters(final Bytes vanityData) {
|
||||
return ImmutableMiningConfiguration.builder()
|
||||
.mutableInitValues(
|
||||
MutableInitValues.builder()
|
||||
.extraData(vanityData)
|
||||
|
||||
@@ -19,7 +19,7 @@ import org.hyperledger.besu.config.GenesisConfigOptions;
|
||||
import org.hyperledger.besu.consensus.common.ForksSchedule;
|
||||
import org.hyperledger.besu.datatypes.Wei;
|
||||
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.mainnet.BlockHeaderValidator;
|
||||
import org.hyperledger.besu.ethereum.mainnet.DefaultProtocolSchedule;
|
||||
@@ -58,7 +58,7 @@ public abstract class BaseBftProtocolScheduleBuilder {
|
||||
* @param isRevertReasonEnabled the is revert reason enabled
|
||||
* @param bftExtraDataCodec the bft extra data codec
|
||||
* @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 isParallelTxProcessingEnabled indicates whether parallel transaction is enabled.
|
||||
* @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 BftExtraDataCodec bftExtraDataCodec,
|
||||
final EvmConfiguration evmConfiguration,
|
||||
final MiningParameters miningParameters,
|
||||
final MiningConfiguration miningConfiguration,
|
||||
final BadBlockManager badBlockManager,
|
||||
final boolean isParallelTxProcessingEnabled,
|
||||
final MetricsSystem metricsSystem) {
|
||||
@@ -96,7 +96,7 @@ public abstract class BaseBftProtocolScheduleBuilder {
|
||||
privacyParameters,
|
||||
isRevertReasonEnabled,
|
||||
evmConfiguration,
|
||||
miningParameters,
|
||||
miningConfiguration,
|
||||
badBlockManager,
|
||||
isParallelTxProcessingEnabled,
|
||||
metricsSystem)
|
||||
|
||||
@@ -25,7 +25,7 @@ import org.hyperledger.besu.ethereum.ProtocolContext;
|
||||
import org.hyperledger.besu.ethereum.blockcreation.AbstractBlockCreator;
|
||||
import org.hyperledger.besu.ethereum.core.BlockHeader;
|
||||
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.eth.manager.EthScheduler;
|
||||
import org.hyperledger.besu.ethereum.eth.transactions.TransactionPool;
|
||||
@@ -46,7 +46,7 @@ public class BftBlockCreator extends AbstractBlockCreator {
|
||||
/**
|
||||
* Instantiates a new Bft block creator.
|
||||
*
|
||||
* @param miningParameters the mining parameters
|
||||
* @param miningConfiguration the mining parameters
|
||||
* @param forksSchedule the forks schedule
|
||||
* @param localAddress the local address
|
||||
* @param extraDataCalculator the extra data calculator
|
||||
@@ -57,7 +57,7 @@ public class BftBlockCreator extends AbstractBlockCreator {
|
||||
* @param ethScheduler the scheduler for asynchronous block creation tasks
|
||||
*/
|
||||
public BftBlockCreator(
|
||||
final MiningParameters miningParameters,
|
||||
final MiningConfiguration miningConfiguration,
|
||||
final ForksSchedule<? extends BftConfigOptions> forksSchedule,
|
||||
final Address localAddress,
|
||||
final ExtraDataCalculator extraDataCalculator,
|
||||
@@ -67,7 +67,7 @@ public class BftBlockCreator extends AbstractBlockCreator {
|
||||
final BftExtraDataCodec bftExtraDataCodec,
|
||||
final EthScheduler ethScheduler) {
|
||||
super(
|
||||
miningParameters.setCoinbase(localAddress),
|
||||
miningConfiguration.setCoinbase(localAddress),
|
||||
miningBeneficiaryCalculator(localAddress, forksSchedule),
|
||||
extraDataCalculator,
|
||||
transactionPool,
|
||||
|
||||
@@ -31,7 +31,7 @@ import org.hyperledger.besu.datatypes.Wei;
|
||||
import org.hyperledger.besu.ethereum.ProtocolContext;
|
||||
import org.hyperledger.besu.ethereum.blockcreation.BlockCreator;
|
||||
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.transactions.TransactionPool;
|
||||
import org.hyperledger.besu.ethereum.mainnet.AbstractGasLimitSpecification;
|
||||
@@ -54,7 +54,7 @@ public class BftBlockCreatorFactory<T extends BftConfigOptions> {
|
||||
protected final ForksSchedule<T> forksSchedule;
|
||||
|
||||
/** The Mining parameters */
|
||||
protected final MiningParameters miningParameters;
|
||||
protected final MiningConfiguration miningConfiguration;
|
||||
|
||||
private final TransactionPool transactionPool;
|
||||
|
||||
@@ -89,7 +89,7 @@ public class BftBlockCreatorFactory<T extends BftConfigOptions> {
|
||||
final ProtocolContext protocolContext,
|
||||
final ProtocolSchedule protocolSchedule,
|
||||
final ForksSchedule<T> forksSchedule,
|
||||
final MiningParameters miningParams,
|
||||
final MiningConfiguration miningParams,
|
||||
final Address localAddress,
|
||||
final BftExtraDataCodec bftExtraDataCodec,
|
||||
final EthScheduler ethScheduler) {
|
||||
@@ -98,7 +98,7 @@ public class BftBlockCreatorFactory<T extends BftConfigOptions> {
|
||||
this.protocolSchedule = protocolSchedule;
|
||||
this.forksSchedule = forksSchedule;
|
||||
this.localAddress = localAddress;
|
||||
this.miningParameters = miningParams;
|
||||
this.miningConfiguration = miningParams;
|
||||
this.bftExtraDataCodec = bftExtraDataCodec;
|
||||
this.ethScheduler = ethScheduler;
|
||||
}
|
||||
@@ -111,7 +111,7 @@ public class BftBlockCreatorFactory<T extends BftConfigOptions> {
|
||||
*/
|
||||
public BlockCreator create(final int round) {
|
||||
return new BftBlockCreator(
|
||||
miningParameters,
|
||||
miningConfiguration,
|
||||
forksSchedule,
|
||||
localAddress,
|
||||
ph -> createExtraData(round, ph),
|
||||
@@ -128,7 +128,7 @@ public class BftBlockCreatorFactory<T extends BftConfigOptions> {
|
||||
* @param minTransactionGasPrice the min transaction gas price
|
||||
*/
|
||||
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
|
||||
*/
|
||||
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
|
||||
*/
|
||||
public Wei getMinPriorityFeePerGas() {
|
||||
return miningParameters.getMinPriorityFeePerGas();
|
||||
return miningConfiguration.getMinPriorityFeePerGas();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -171,7 +171,7 @@ public class BftBlockCreatorFactory<T extends BftConfigOptions> {
|
||||
final BftExtraData extraData =
|
||||
new BftExtraData(
|
||||
ConsensusHelpers.zeroLeftPad(
|
||||
miningParameters.getExtraData(), BftExtraDataCodec.EXTRA_VANITY_LENGTH),
|
||||
miningConfiguration.getExtraData(), BftExtraDataCodec.EXTRA_VANITY_LENGTH),
|
||||
Collections.emptyList(),
|
||||
toVote(proposal),
|
||||
round,
|
||||
@@ -187,7 +187,7 @@ public class BftBlockCreatorFactory<T extends BftConfigOptions> {
|
||||
*/
|
||||
public void changeTargetGasLimit(final Long newTargetGasLimit) {
|
||||
if (AbstractGasLimitSpecification.isValidTargetGasLimit(newTargetGasLimit)) {
|
||||
miningParameters.setTargetGasLimit(newTargetGasLimit);
|
||||
miningConfiguration.setTargetGasLimit(newTargetGasLimit);
|
||||
} else {
|
||||
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.ethereum.chain.BadBlockManager;
|
||||
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.mainnet.DefaultProtocolSchedule;
|
||||
import org.hyperledger.besu.ethereum.mainnet.ProtocolSchedule;
|
||||
@@ -177,7 +177,7 @@ public class CombinedProtocolScheduleFactoryTest {
|
||||
new PrivacyParameters(),
|
||||
false,
|
||||
EvmConfiguration.DEFAULT,
|
||||
MiningParameters.MINING_DISABLED,
|
||||
MiningConfiguration.MINING_DISABLED,
|
||||
new BadBlockManager(),
|
||||
false,
|
||||
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.BlockHeaderTestFixture;
|
||||
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.mainnet.BlockHeaderValidator;
|
||||
import org.hyperledger.besu.ethereum.mainnet.DefaultProtocolSchedule;
|
||||
@@ -245,7 +245,7 @@ public class BaseBftProtocolScheduleBuilderTest {
|
||||
false,
|
||||
bftExtraDataCodec,
|
||||
EvmConfiguration.DEFAULT,
|
||||
MiningParameters.MINING_DISABLED,
|
||||
MiningConfiguration.MINING_DISABLED,
|
||||
new BadBlockManager(),
|
||||
false,
|
||||
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.BlockHeaderTestFixture;
|
||||
import org.hyperledger.besu.ethereum.core.Difficulty;
|
||||
import org.hyperledger.besu.ethereum.core.ImmutableMiningParameters;
|
||||
import org.hyperledger.besu.ethereum.core.ImmutableMiningParameters.MutableInitValues;
|
||||
import org.hyperledger.besu.ethereum.core.MiningParameters;
|
||||
import org.hyperledger.besu.ethereum.core.ImmutableMiningConfiguration;
|
||||
import org.hyperledger.besu.ethereum.core.ImmutableMiningConfiguration.MutableInitValues;
|
||||
import org.hyperledger.besu.ethereum.core.MiningConfiguration;
|
||||
import org.hyperledger.besu.ethereum.core.Util;
|
||||
import org.hyperledger.besu.ethereum.eth.manager.EthContext;
|
||||
import org.hyperledger.besu.ethereum.eth.manager.EthScheduler;
|
||||
@@ -310,8 +310,8 @@ public class TestContextBuilder {
|
||||
|
||||
final WorldStateArchive worldStateArchive = createInMemoryWorldStateArchive();
|
||||
|
||||
final MiningParameters miningParams =
|
||||
ImmutableMiningParameters.builder()
|
||||
final MiningConfiguration miningParams =
|
||||
ImmutableMiningConfiguration.builder()
|
||||
.mutableInitValues(
|
||||
MutableInitValues.builder()
|
||||
.isMiningEnabled(true)
|
||||
@@ -334,7 +334,7 @@ public class TestContextBuilder {
|
||||
forksSchedule,
|
||||
IBFT_EXTRA_DATA_ENCODER,
|
||||
EvmConfiguration.DEFAULT,
|
||||
MiningParameters.MINING_DISABLED,
|
||||
MiningConfiguration.MINING_DISABLED,
|
||||
new BadBlockManager(),
|
||||
false,
|
||||
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.BftProtocolSchedule;
|
||||
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.mainnet.BlockHeaderValidator;
|
||||
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 bftExtraDataCodec the bft extra data codec
|
||||
* @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 isParallelTxProcessingEnabled indicates whether parallel transaction is enabled
|
||||
* @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 BftExtraDataCodec bftExtraDataCodec,
|
||||
final EvmConfiguration evmConfiguration,
|
||||
final MiningParameters miningParameters,
|
||||
final MiningConfiguration miningConfiguration,
|
||||
final BadBlockManager badBlockManager,
|
||||
final boolean isParallelTxProcessingEnabled,
|
||||
final MetricsSystem metricsSystem) {
|
||||
@@ -72,7 +72,7 @@ public class IbftProtocolScheduleBuilder extends BaseBftProtocolScheduleBuilder
|
||||
isRevertReasonEnabled,
|
||||
bftExtraDataCodec,
|
||||
evmConfiguration,
|
||||
miningParameters,
|
||||
miningConfiguration,
|
||||
badBlockManager,
|
||||
isParallelTxProcessingEnabled,
|
||||
metricsSystem);
|
||||
@@ -85,7 +85,7 @@ public class IbftProtocolScheduleBuilder extends BaseBftProtocolScheduleBuilder
|
||||
* @param forksSchedule the forks schedule
|
||||
* @param bftExtraDataCodec the bft extra data codec
|
||||
* @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 isParallelTxProcessingEnabled indicates whether parallel transaction is enabled.
|
||||
* @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 BftExtraDataCodec bftExtraDataCodec,
|
||||
final EvmConfiguration evmConfiguration,
|
||||
final MiningParameters miningParameters,
|
||||
final MiningConfiguration miningConfiguration,
|
||||
final BadBlockManager badBlockManager,
|
||||
final boolean isParallelTxProcessingEnabled,
|
||||
final MetricsSystem metricsSystem) {
|
||||
@@ -108,7 +108,7 @@ public class IbftProtocolScheduleBuilder extends BaseBftProtocolScheduleBuilder
|
||||
false,
|
||||
bftExtraDataCodec,
|
||||
evmConfiguration,
|
||||
miningParameters,
|
||||
miningConfiguration,
|
||||
badBlockManager,
|
||||
isParallelTxProcessingEnabled,
|
||||
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.query.BlockchainQueries;
|
||||
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 java.util.Map;
|
||||
@@ -42,22 +42,22 @@ public class IbftJsonRpcMethods extends ApiGroupJsonRpcMethods {
|
||||
|
||||
private final ProtocolContext context;
|
||||
private final ProtocolSchedule protocolSchedule;
|
||||
private final MiningParameters miningParameters;
|
||||
private final MiningConfiguration miningConfiguration;
|
||||
|
||||
/**
|
||||
* Instantiates a new Ibft json rpc methods.
|
||||
*
|
||||
* @param context the protocol context
|
||||
* @param protocolSchedule the protocol schedule
|
||||
* @param miningParameters the mining parameters
|
||||
* @param miningConfiguration the mining parameters
|
||||
*/
|
||||
public IbftJsonRpcMethods(
|
||||
final ProtocolContext context,
|
||||
final ProtocolSchedule protocolSchedule,
|
||||
final MiningParameters miningParameters) {
|
||||
final MiningConfiguration miningConfiguration) {
|
||||
this.context = context;
|
||||
this.protocolSchedule = protocolSchedule;
|
||||
this.miningParameters = miningParameters;
|
||||
this.miningConfiguration = miningConfiguration;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -70,7 +70,7 @@ public class IbftJsonRpcMethods extends ApiGroupJsonRpcMethods {
|
||||
final MutableBlockchain blockchain = context.getBlockchain();
|
||||
final BlockchainQueries blockchainQueries =
|
||||
new BlockchainQueries(
|
||||
protocolSchedule, blockchain, context.getWorldStateArchive(), miningParameters);
|
||||
protocolSchedule, blockchain, context.getWorldStateArchive(), miningConfiguration);
|
||||
final BftContext bftContext = context.getConsensusContext(BftContext.class);
|
||||
final BlockInterface blockInterface = bftContext.getBlockInterface();
|
||||
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.core.BlockHeader;
|
||||
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.Util;
|
||||
import org.hyperledger.besu.ethereum.core.components.EthereumCoreComponent;
|
||||
@@ -127,7 +127,7 @@ public class IbftProtocolScheduleTest {
|
||||
false,
|
||||
bftExtraDataCodec,
|
||||
EvmConfiguration.DEFAULT,
|
||||
MiningParameters.MINING_DISABLED,
|
||||
MiningConfiguration.MINING_DISABLED,
|
||||
new BadBlockManager(),
|
||||
false,
|
||||
new NoOpMetricsSystem());
|
||||
@@ -191,8 +191,8 @@ public class IbftProtocolScheduleTest {
|
||||
@Module
|
||||
static class NoMiningParamters {
|
||||
@Provides
|
||||
MiningParameters provideMiningParameters() {
|
||||
return MiningParameters.MINING_DISABLED;
|
||||
MiningConfiguration provideMiningParameters() {
|
||||
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.BlockHeader;
|
||||
import org.hyperledger.besu.ethereum.core.BlockHeaderTestFixture;
|
||||
import org.hyperledger.besu.ethereum.core.ImmutableMiningParameters;
|
||||
import org.hyperledger.besu.ethereum.core.ImmutableMiningParameters.MutableInitValues;
|
||||
import org.hyperledger.besu.ethereum.core.MiningParameters;
|
||||
import org.hyperledger.besu.ethereum.core.ImmutableMiningConfiguration;
|
||||
import org.hyperledger.besu.ethereum.core.ImmutableMiningConfiguration.MutableInitValues;
|
||||
import org.hyperledger.besu.ethereum.core.MiningConfiguration;
|
||||
import org.hyperledger.besu.ethereum.core.PrivacyParameters;
|
||||
import org.hyperledger.besu.ethereum.eth.manager.EthContext;
|
||||
import org.hyperledger.besu.ethereum.eth.transactions.BlobCache;
|
||||
@@ -122,7 +122,7 @@ public class BftBlockCreatorTest {
|
||||
false,
|
||||
bftExtraDataEncoder,
|
||||
EvmConfiguration.DEFAULT,
|
||||
MiningParameters.MINING_DISABLED,
|
||||
MiningConfiguration.MINING_DISABLED,
|
||||
new BadBlockManager(),
|
||||
false,
|
||||
new NoOpMetricsSystem());
|
||||
@@ -159,8 +159,8 @@ public class BftBlockCreatorTest {
|
||||
|
||||
transactionPool.setEnabled();
|
||||
|
||||
final MiningParameters miningParameters =
|
||||
ImmutableMiningParameters.builder()
|
||||
final MiningConfiguration miningConfiguration =
|
||||
ImmutableMiningConfiguration.builder()
|
||||
.mutableInitValues(
|
||||
MutableInitValues.builder()
|
||||
.extraData(
|
||||
@@ -178,7 +178,7 @@ public class BftBlockCreatorTest {
|
||||
|
||||
final BftBlockCreator blockCreator =
|
||||
new BftBlockCreator(
|
||||
miningParameters,
|
||||
miningConfiguration,
|
||||
forksSchedule,
|
||||
initialValidatorList.get(0),
|
||||
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.BlockHeader;
|
||||
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.Util;
|
||||
import org.hyperledger.besu.ethereum.mainnet.DefaultProtocolSchedule;
|
||||
@@ -185,7 +185,7 @@ public class IbftBlockHeightManagerTest {
|
||||
new PrivacyParameters(),
|
||||
false,
|
||||
EvmConfiguration.DEFAULT,
|
||||
MiningParameters.MINING_DISABLED,
|
||||
MiningConfiguration.MINING_DISABLED,
|
||||
new BadBlockManager(),
|
||||
false,
|
||||
new NoOpMetricsSystem());
|
||||
|
||||
@@ -17,7 +17,7 @@ package org.hyperledger.besu.consensus.merge;
|
||||
import org.hyperledger.besu.config.GenesisConfigOptions;
|
||||
import org.hyperledger.besu.datatypes.Wei;
|
||||
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.mainnet.BlockHeaderValidator;
|
||||
import org.hyperledger.besu.ethereum.mainnet.ProtocolSchedule;
|
||||
@@ -48,7 +48,7 @@ public class MergeProtocolSchedule {
|
||||
*
|
||||
* @param config the config
|
||||
* @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 isParallelTxProcessingEnabled indicates whether parallel transaction is enabled.
|
||||
* @return the protocol schedule
|
||||
@@ -56,7 +56,7 @@ public class MergeProtocolSchedule {
|
||||
public static ProtocolSchedule create(
|
||||
final GenesisConfigOptions config,
|
||||
final boolean isRevertReasonEnabled,
|
||||
final MiningParameters miningParameters,
|
||||
final MiningConfiguration miningConfiguration,
|
||||
final BadBlockManager badBlockManager,
|
||||
final boolean isParallelTxProcessingEnabled,
|
||||
final MetricsSystem metricsSystem) {
|
||||
@@ -64,7 +64,7 @@ public class MergeProtocolSchedule {
|
||||
config,
|
||||
PrivacyParameters.DEFAULT,
|
||||
isRevertReasonEnabled,
|
||||
miningParameters,
|
||||
miningConfiguration,
|
||||
badBlockManager,
|
||||
isParallelTxProcessingEnabled,
|
||||
metricsSystem);
|
||||
@@ -76,7 +76,7 @@ public class MergeProtocolSchedule {
|
||||
* @param config the config
|
||||
* @param privacyParameters the privacy parameters
|
||||
* @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 isParallelTxProcessingEnabled indicates whether parallel transaction is enabled.
|
||||
* @return the protocol schedule
|
||||
@@ -85,7 +85,7 @@ public class MergeProtocolSchedule {
|
||||
final GenesisConfigOptions config,
|
||||
final PrivacyParameters privacyParameters,
|
||||
final boolean isRevertReasonEnabled,
|
||||
final MiningParameters miningParameters,
|
||||
final MiningConfiguration miningConfiguration,
|
||||
final BadBlockManager badBlockManager,
|
||||
final boolean isParallelTxProcessingEnabled,
|
||||
final MetricsSystem metricsSystem) {
|
||||
@@ -106,7 +106,7 @@ public class MergeProtocolSchedule {
|
||||
privacyParameters,
|
||||
isRevertReasonEnabled,
|
||||
EvmConfiguration.DEFAULT,
|
||||
miningParameters,
|
||||
miningConfiguration,
|
||||
badBlockManager,
|
||||
isParallelTxProcessingEnabled,
|
||||
metricsSystem)
|
||||
|
||||
@@ -20,7 +20,7 @@ import org.hyperledger.besu.ethereum.ProtocolContext;
|
||||
import org.hyperledger.besu.ethereum.chain.BadBlockManager;
|
||||
import org.hyperledger.besu.ethereum.core.BlockHeader;
|
||||
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.ProcessableBlockHeader;
|
||||
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
|
||||
* milestone starting points
|
||||
* @param miningParameters the mining parameters
|
||||
* @param miningConfiguration the mining parameters
|
||||
* @param badBlockManager the cache to use to keep invalid blocks
|
||||
* @param isParallelTxProcessingEnabled indicates whether parallel transaction is enabled.
|
||||
* @return an initialised TransitionProtocolSchedule using post-merge defaults
|
||||
*/
|
||||
public static TransitionProtocolSchedule fromConfig(
|
||||
final GenesisConfigOptions genesisConfigOptions,
|
||||
final MiningParameters miningParameters,
|
||||
final MiningConfiguration miningConfiguration,
|
||||
final BadBlockManager badBlockManager,
|
||||
final boolean isParallelTxProcessingEnabled,
|
||||
final MetricsSystem metricsSystem) {
|
||||
ProtocolSchedule preMergeProtocolSchedule =
|
||||
MainnetProtocolSchedule.fromConfig(
|
||||
genesisConfigOptions,
|
||||
miningParameters,
|
||||
miningConfiguration,
|
||||
badBlockManager,
|
||||
isParallelTxProcessingEnabled,
|
||||
metricsSystem);
|
||||
@@ -87,7 +87,7 @@ public class TransitionProtocolSchedule implements ProtocolSchedule {
|
||||
MergeProtocolSchedule.create(
|
||||
genesisConfigOptions,
|
||||
false,
|
||||
miningParameters,
|
||||
miningConfiguration,
|
||||
badBlockManager,
|
||||
isParallelTxProcessingEnabled,
|
||||
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.BlockHeaderBuilder;
|
||||
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.Transaction;
|
||||
import org.hyperledger.besu.ethereum.core.Withdrawal;
|
||||
@@ -39,7 +39,7 @@ class MergeBlockCreator extends AbstractBlockCreator {
|
||||
/**
|
||||
* Instantiates a new Merge block creator.
|
||||
*
|
||||
* @param miningParameters the mining parameters
|
||||
* @param miningConfiguration the mining parameters
|
||||
* @param extraDataCalculator the extra data calculator
|
||||
* @param transactionPool the pending transactions
|
||||
* @param protocolContext the protocol context
|
||||
@@ -47,7 +47,7 @@ class MergeBlockCreator extends AbstractBlockCreator {
|
||||
* @param parentHeader the parent header
|
||||
*/
|
||||
public MergeBlockCreator(
|
||||
final MiningParameters miningParameters,
|
||||
final MiningConfiguration miningConfiguration,
|
||||
final ExtraDataCalculator extraDataCalculator,
|
||||
final TransactionPool transactionPool,
|
||||
final ProtocolContext protocolContext,
|
||||
@@ -55,8 +55,8 @@ class MergeBlockCreator extends AbstractBlockCreator {
|
||||
final BlockHeader parentHeader,
|
||||
final EthScheduler ethScheduler) {
|
||||
super(
|
||||
miningParameters,
|
||||
__ -> miningParameters.getCoinbase().orElseThrow(),
|
||||
miningConfiguration,
|
||||
__ -> miningConfiguration.getCoinbase().orElseThrow(),
|
||||
extraDataCalculator,
|
||||
transactionPool,
|
||||
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.BlockWithReceipts;
|
||||
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.Transaction;
|
||||
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;
|
||||
|
||||
/** The Mining parameters. */
|
||||
protected final MiningParameters miningParameters;
|
||||
protected final MiningConfiguration miningConfiguration;
|
||||
|
||||
/** The Merge block creator factory. */
|
||||
protected final MergeBlockCreatorFactory mergeBlockCreatorFactory;
|
||||
@@ -120,7 +120,7 @@ public class MergeCoordinator implements MergeMiningCoordinator, BadChainListene
|
||||
final ProtocolSchedule protocolSchedule,
|
||||
final EthScheduler ethScheduler,
|
||||
final TransactionPool transactionPool,
|
||||
final MiningParameters miningParams,
|
||||
final MiningConfiguration miningParams,
|
||||
final BackwardSyncContext backwardSyncContext,
|
||||
final Optional<Address> depositContractAddress) {
|
||||
this.protocolContext = protocolContext;
|
||||
@@ -137,14 +137,14 @@ public class MergeCoordinator implements MergeMiningCoordinator, BadChainListene
|
||||
}
|
||||
miningParams.setMinBlockOccupancyRatio(TRY_FILL_BLOCK);
|
||||
|
||||
this.miningParameters = miningParams;
|
||||
this.miningConfiguration = miningParams;
|
||||
|
||||
this.mergeBlockCreatorFactory =
|
||||
(parentHeader, address) -> {
|
||||
address.ifPresent(miningParams::setCoinbase);
|
||||
return new MergeBlockCreator(
|
||||
miningParameters,
|
||||
parent -> miningParameters.getExtraData(),
|
||||
miningConfiguration,
|
||||
parent -> miningConfiguration.getExtraData(),
|
||||
transactionPool,
|
||||
protocolContext,
|
||||
protocolSchedule,
|
||||
@@ -169,7 +169,7 @@ public class MergeCoordinator implements MergeMiningCoordinator, BadChainListene
|
||||
final ProtocolContext protocolContext,
|
||||
final ProtocolSchedule protocolSchedule,
|
||||
final EthScheduler ethScheduler,
|
||||
final MiningParameters miningParams,
|
||||
final MiningConfiguration miningParams,
|
||||
final BackwardSyncContext backwardSyncContext,
|
||||
final MergeBlockCreatorFactory mergeBlockCreatorFactory) {
|
||||
|
||||
@@ -182,7 +182,7 @@ public class MergeCoordinator implements MergeMiningCoordinator, BadChainListene
|
||||
miningParams.setTargetGasLimit(DEFAULT_TARGET_GAS_LIMIT);
|
||||
}
|
||||
miningParams.setMinBlockOccupancyRatio(TRY_FILL_BLOCK);
|
||||
this.miningParameters = miningParams;
|
||||
this.miningConfiguration = miningParams;
|
||||
|
||||
this.mergeBlockCreatorFactory = mergeBlockCreatorFactory;
|
||||
|
||||
@@ -215,17 +215,17 @@ public class MergeCoordinator implements MergeMiningCoordinator, BadChainListene
|
||||
|
||||
@Override
|
||||
public Wei getMinTransactionGasPrice() {
|
||||
return miningParameters.getMinTransactionGasPrice();
|
||||
return miningConfiguration.getMinTransactionGasPrice();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Wei getMinPriorityFeePerGas() {
|
||||
return miningParameters.getMinPriorityFeePerGas();
|
||||
return miningConfiguration.getMinPriorityFeePerGas();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Optional<Address> getCoinbase() {
|
||||
return miningParameters.getCoinbase();
|
||||
return miningConfiguration.getCoinbase();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -244,7 +244,7 @@ public class MergeCoordinator implements MergeMiningCoordinator, BadChainListene
|
||||
@Override
|
||||
public void changeTargetGasLimit(final Long newTargetGasLimit) {
|
||||
if (AbstractGasLimitSpecification.isValidTargetGasLimit(newTargetGasLimit)) {
|
||||
this.miningParameters.setTargetGasLimit(newTargetGasLimit);
|
||||
this.miningConfiguration.setTargetGasLimit(newTargetGasLimit);
|
||||
} else {
|
||||
throw new IllegalArgumentException("Specified target gas limit is invalid");
|
||||
}
|
||||
@@ -383,13 +383,13 @@ public class MergeCoordinator implements MergeMiningCoordinator, BadChainListene
|
||||
LOG.debug(
|
||||
"Block creation started for payload id {}, remaining time is {}ms",
|
||||
payloadIdentifier,
|
||||
miningParameters.getUnstable().getPosBlockCreationMaxTime());
|
||||
miningConfiguration.getUnstable().getPosBlockCreationMaxTime());
|
||||
|
||||
ethScheduler
|
||||
.scheduleBlockCreationTask(
|
||||
() -> retryBlockCreationUntilUseful(payloadIdentifier, blockCreator))
|
||||
.orTimeout(
|
||||
miningParameters.getUnstable().getPosBlockCreationMaxTime(), TimeUnit.MILLISECONDS)
|
||||
miningConfiguration.getUnstable().getPosBlockCreationMaxTime(), TimeUnit.MILLISECONDS)
|
||||
.whenComplete(
|
||||
(unused, throwable) -> {
|
||||
if (throwable != null) {
|
||||
@@ -416,7 +416,7 @@ public class MergeCoordinator implements MergeMiningCoordinator, BadChainListene
|
||||
final long waitBeforeRepetition =
|
||||
Math.max(
|
||||
100,
|
||||
miningParameters.getUnstable().getPosBlockCreationRepetitionMinDuration()
|
||||
miningConfiguration.getUnstable().getPosBlockCreationRepetitionMinDuration()
|
||||
- lastDuration);
|
||||
LOG.debug("Waiting {}ms before repeating block creation", waitBeforeRepetition);
|
||||
Thread.sleep(waitBeforeRepetition);
|
||||
@@ -726,7 +726,7 @@ public class MergeCoordinator implements MergeMiningCoordinator, BadChainListene
|
||||
|
||||
@Override
|
||||
public boolean isMiningBeforeMerge() {
|
||||
return miningParameters.isMiningEnabled();
|
||||
return miningConfiguration.isMiningEnabled();
|
||||
}
|
||||
|
||||
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.core.BlockHeader;
|
||||
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.ProtocolSchedule;
|
||||
import org.hyperledger.besu.ethereum.mainnet.ProtocolSpec;
|
||||
@@ -51,7 +51,7 @@ public class MergeProtocolScheduleTest {
|
||||
MergeProtocolSchedule.create(
|
||||
config,
|
||||
false,
|
||||
MiningParameters.MINING_DISABLED,
|
||||
MiningConfiguration.MINING_DISABLED,
|
||||
new BadBlockManager(),
|
||||
false,
|
||||
new NoOpMetricsSystem());
|
||||
@@ -72,7 +72,7 @@ public class MergeProtocolScheduleTest {
|
||||
MergeProtocolSchedule.create(
|
||||
config,
|
||||
false,
|
||||
MiningParameters.MINING_DISABLED,
|
||||
MiningConfiguration.MINING_DISABLED,
|
||||
new BadBlockManager(),
|
||||
false,
|
||||
new NoOpMetricsSystem());
|
||||
@@ -113,7 +113,7 @@ public class MergeProtocolScheduleTest {
|
||||
MergeProtocolSchedule.create(
|
||||
config,
|
||||
false,
|
||||
MiningParameters.MINING_DISABLED,
|
||||
MiningConfiguration.MINING_DISABLED,
|
||||
new BadBlockManager(),
|
||||
false,
|
||||
new NoOpMetricsSystem());
|
||||
@@ -146,7 +146,7 @@ public class MergeProtocolScheduleTest {
|
||||
MergeProtocolSchedule.create(
|
||||
config,
|
||||
false,
|
||||
MiningParameters.MINING_DISABLED,
|
||||
MiningConfiguration.MINING_DISABLED,
|
||||
new BadBlockManager(),
|
||||
false,
|
||||
new NoOpMetricsSystem());
|
||||
@@ -180,7 +180,7 @@ public class MergeProtocolScheduleTest {
|
||||
MergeProtocolSchedule.create(
|
||||
GenesisConfigFile.DEFAULT.getConfigOptions(),
|
||||
false,
|
||||
MiningParameters.MINING_DISABLED,
|
||||
MiningConfiguration.MINING_DISABLED,
|
||||
new BadBlockManager(),
|
||||
false,
|
||||
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.BlockHeaderTestFixture;
|
||||
import org.hyperledger.besu.ethereum.core.Difficulty;
|
||||
import org.hyperledger.besu.ethereum.core.ImmutableMiningParameters;
|
||||
import org.hyperledger.besu.ethereum.core.ImmutableMiningParameters.MutableInitValues;
|
||||
import org.hyperledger.besu.ethereum.core.ImmutableMiningParameters.Unstable;
|
||||
import org.hyperledger.besu.ethereum.core.MiningParameters;
|
||||
import org.hyperledger.besu.ethereum.core.ImmutableMiningConfiguration;
|
||||
import org.hyperledger.besu.ethereum.core.ImmutableMiningConfiguration.MutableInitValues;
|
||||
import org.hyperledger.besu.ethereum.core.ImmutableMiningConfiguration.Unstable;
|
||||
import org.hyperledger.besu.ethereum.core.MiningConfiguration;
|
||||
import org.hyperledger.besu.ethereum.core.Synchronizer;
|
||||
import org.hyperledger.besu.ethereum.core.TransactionTestFixture;
|
||||
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 MiningParameters miningParameters =
|
||||
ImmutableMiningParameters.builder()
|
||||
private MiningConfiguration miningConfiguration =
|
||||
ImmutableMiningConfiguration.builder()
|
||||
.mutableInitValues(MutableInitValues.builder().coinbase(coinbase).build())
|
||||
.unstable(
|
||||
Unstable.builder()
|
||||
@@ -228,7 +228,7 @@ public class MergeCoordinatorTest implements MergeGenesisConfigHelper {
|
||||
protocolSchedule,
|
||||
ethScheduler,
|
||||
transactionPool,
|
||||
miningParameters,
|
||||
miningConfiguration,
|
||||
backwardSyncContext,
|
||||
Optional.empty());
|
||||
}
|
||||
@@ -273,7 +273,7 @@ public class MergeCoordinatorTest implements MergeGenesisConfigHelper {
|
||||
MergeBlockCreator beingSpiedOn =
|
||||
spy(
|
||||
new MergeBlockCreator(
|
||||
miningParameters,
|
||||
miningConfiguration,
|
||||
parent -> Bytes.EMPTY,
|
||||
transactionPool,
|
||||
protocolContext,
|
||||
@@ -302,7 +302,7 @@ public class MergeCoordinatorTest implements MergeGenesisConfigHelper {
|
||||
protocolContext,
|
||||
protocolSchedule,
|
||||
ethScheduler,
|
||||
miningParameters,
|
||||
miningConfiguration,
|
||||
backwardSyncContext,
|
||||
mergeBlockCreatorFactory));
|
||||
|
||||
@@ -543,9 +543,9 @@ public class MergeCoordinatorTest implements MergeGenesisConfigHelper {
|
||||
@Test
|
||||
public void shouldStopRetryBlockCreationIfTimeExpired() throws InterruptedException {
|
||||
final AtomicLong retries = new AtomicLong(0);
|
||||
miningParameters =
|
||||
ImmutableMiningParameters.builder()
|
||||
.from(miningParameters)
|
||||
miningConfiguration =
|
||||
ImmutableMiningConfiguration.builder()
|
||||
.from(miningConfiguration)
|
||||
.unstable(Unstable.builder().posBlockCreationMaxTime(100).build())
|
||||
.build();
|
||||
doAnswer(
|
||||
@@ -737,8 +737,8 @@ public class MergeCoordinatorTest implements MergeGenesisConfigHelper {
|
||||
public void shouldUseExtraDataFromMiningParameters() {
|
||||
final Bytes extraData = Bytes.fromHexString("0x1234");
|
||||
|
||||
miningParameters =
|
||||
ImmutableMiningParameters.builder()
|
||||
miningConfiguration =
|
||||
ImmutableMiningConfiguration.builder()
|
||||
.mutableInitValues(MutableInitValues.builder().extraData(extraData).build())
|
||||
.build();
|
||||
|
||||
@@ -748,7 +748,7 @@ public class MergeCoordinatorTest implements MergeGenesisConfigHelper {
|
||||
protocolSchedule,
|
||||
ethScheduler,
|
||||
transactionPool,
|
||||
miningParameters,
|
||||
miningConfiguration,
|
||||
backwardSyncContext,
|
||||
Optional.empty());
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ import org.hyperledger.besu.config.GenesisConfigFile;
|
||||
import org.hyperledger.besu.consensus.merge.MergeProtocolSchedule;
|
||||
import org.hyperledger.besu.datatypes.Address;
|
||||
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.metrics.noop.NoOpMetricsSystem;
|
||||
|
||||
@@ -56,7 +56,7 @@ public interface MergeGenesisConfigHelper {
|
||||
return MergeProtocolSchedule.create(
|
||||
getPosGenesisConfigFile().getConfigOptions(),
|
||||
false,
|
||||
MiningParameters.MINING_DISABLED,
|
||||
MiningConfiguration.MINING_DISABLED,
|
||||
new BadBlockManager(),
|
||||
false,
|
||||
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.BlockHeaderTestFixture;
|
||||
import org.hyperledger.besu.ethereum.core.Difficulty;
|
||||
import org.hyperledger.besu.ethereum.core.ImmutableMiningParameters;
|
||||
import org.hyperledger.besu.ethereum.core.ImmutableMiningParameters.MutableInitValues;
|
||||
import org.hyperledger.besu.ethereum.core.ImmutableMiningConfiguration;
|
||||
import org.hyperledger.besu.ethereum.core.ImmutableMiningConfiguration.MutableInitValues;
|
||||
import org.hyperledger.besu.ethereum.eth.manager.EthScheduler;
|
||||
import org.hyperledger.besu.ethereum.eth.sync.backwardsync.BackwardSyncContext;
|
||||
import org.hyperledger.besu.ethereum.eth.transactions.TransactionPool;
|
||||
@@ -96,7 +96,7 @@ public class MergeReorgTest implements MergeGenesisConfigHelper {
|
||||
mockProtocolSchedule,
|
||||
ethScheduler,
|
||||
mockTransactionPool,
|
||||
ImmutableMiningParameters.builder()
|
||||
ImmutableMiningConfiguration.builder()
|
||||
.mutableInitValues(MutableInitValues.builder().coinbase(coinbase).build())
|
||||
.build(),
|
||||
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.BlockHeaderTestFixture;
|
||||
import org.hyperledger.besu.ethereum.core.Difficulty;
|
||||
import org.hyperledger.besu.ethereum.core.ImmutableMiningParameters;
|
||||
import org.hyperledger.besu.ethereum.core.ImmutableMiningParameters.MutableInitValues;
|
||||
import org.hyperledger.besu.ethereum.core.MiningParameters;
|
||||
import org.hyperledger.besu.ethereum.core.ImmutableMiningConfiguration;
|
||||
import org.hyperledger.besu.ethereum.core.ImmutableMiningConfiguration.MutableInitValues;
|
||||
import org.hyperledger.besu.ethereum.core.MiningConfiguration;
|
||||
import org.hyperledger.besu.ethereum.core.ProtocolScheduleFixture;
|
||||
import org.hyperledger.besu.ethereum.core.Util;
|
||||
import org.hyperledger.besu.ethereum.eth.manager.EthContext;
|
||||
@@ -387,8 +387,8 @@ public class TestContextBuilder {
|
||||
final boolean useFixedBaseFee,
|
||||
final List<QbftFork> qbftForks) {
|
||||
|
||||
final MiningParameters miningParams =
|
||||
ImmutableMiningParameters.builder()
|
||||
final MiningConfiguration miningParams =
|
||||
ImmutableMiningConfiguration.builder()
|
||||
.mutableInitValues(
|
||||
MutableInitValues.builder()
|
||||
.isMiningEnabled(true)
|
||||
@@ -438,7 +438,7 @@ public class TestContextBuilder {
|
||||
forksSchedule,
|
||||
BFT_EXTRA_DATA_ENCODER,
|
||||
EvmConfiguration.DEFAULT,
|
||||
MiningParameters.MINING_DISABLED,
|
||||
MiningConfiguration.MINING_DISABLED,
|
||||
new BadBlockManager(),
|
||||
false,
|
||||
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.BftProtocolSchedule;
|
||||
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.mainnet.BlockHeaderValidator;
|
||||
import org.hyperledger.besu.ethereum.mainnet.ProtocolSchedule;
|
||||
@@ -50,7 +50,7 @@ public class QbftProtocolScheduleBuilder extends BaseBftProtocolScheduleBuilder
|
||||
* @param isRevertReasonEnabled the is revert reason enabled
|
||||
* @param bftExtraDataCodec the bft extra data codec
|
||||
* @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 isParallelTxProcessingEnabled indicates whether parallel transaction is enabled.
|
||||
* @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 BftExtraDataCodec bftExtraDataCodec,
|
||||
final EvmConfiguration evmConfiguration,
|
||||
final MiningParameters miningParameters,
|
||||
final MiningConfiguration miningConfiguration,
|
||||
final BadBlockManager badBlockManager,
|
||||
final boolean isParallelTxProcessingEnabled,
|
||||
final MetricsSystem metricsSystem) {
|
||||
@@ -76,7 +76,7 @@ public class QbftProtocolScheduleBuilder extends BaseBftProtocolScheduleBuilder
|
||||
isRevertReasonEnabled,
|
||||
bftExtraDataCodec,
|
||||
evmConfiguration,
|
||||
miningParameters,
|
||||
miningConfiguration,
|
||||
badBlockManager,
|
||||
isParallelTxProcessingEnabled,
|
||||
metricsSystem);
|
||||
@@ -89,7 +89,7 @@ public class QbftProtocolScheduleBuilder extends BaseBftProtocolScheduleBuilder
|
||||
* @param qbftForksSchedule the qbft forks schedule
|
||||
* @param bftExtraDataCodec the bft extra data codec
|
||||
* @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 isParallelTxProcessingEnabled indicates whether parallel transaction is enabled.
|
||||
* @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 BftExtraDataCodec bftExtraDataCodec,
|
||||
final EvmConfiguration evmConfiguration,
|
||||
final MiningParameters miningParameters,
|
||||
final MiningConfiguration miningConfiguration,
|
||||
final BadBlockManager badBlockManager,
|
||||
final boolean isParallelTxProcessingEnabled,
|
||||
final MetricsSystem metricsSystem) {
|
||||
@@ -112,7 +112,7 @@ public class QbftProtocolScheduleBuilder extends BaseBftProtocolScheduleBuilder
|
||||
false,
|
||||
bftExtraDataCodec,
|
||||
evmConfiguration,
|
||||
miningParameters,
|
||||
miningConfiguration,
|
||||
badBlockManager,
|
||||
isParallelTxProcessingEnabled,
|
||||
metricsSystem);
|
||||
@@ -125,7 +125,7 @@ public class QbftProtocolScheduleBuilder extends BaseBftProtocolScheduleBuilder
|
||||
* @param qbftForksSchedule the qbft forks schedule
|
||||
* @param isRevertReasonEnabled the is revert reason enabled
|
||||
* @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 isParallelTxProcessingEnabled indicates whether parallel transaction is enabled.
|
||||
* @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 boolean isRevertReasonEnabled,
|
||||
final BftExtraDataCodec bftExtraDataCodec,
|
||||
final MiningParameters miningParameters,
|
||||
final MiningConfiguration miningConfiguration,
|
||||
final BadBlockManager badBlockManager,
|
||||
final boolean isParallelTxProcessingEnabled,
|
||||
final MetricsSystem metricsSystem) {
|
||||
@@ -148,7 +148,7 @@ public class QbftProtocolScheduleBuilder extends BaseBftProtocolScheduleBuilder
|
||||
isRevertReasonEnabled,
|
||||
bftExtraDataCodec,
|
||||
EvmConfiguration.DEFAULT,
|
||||
miningParameters,
|
||||
miningConfiguration,
|
||||
badBlockManager,
|
||||
isParallelTxProcessingEnabled,
|
||||
metricsSystem);
|
||||
|
||||
@@ -23,7 +23,7 @@ import org.hyperledger.besu.consensus.common.bft.blockcreation.BftBlockCreatorFa
|
||||
import org.hyperledger.besu.datatypes.Address;
|
||||
import org.hyperledger.besu.ethereum.ProtocolContext;
|
||||
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.transactions.TransactionPool;
|
||||
import org.hyperledger.besu.ethereum.mainnet.ProtocolSchedule;
|
||||
@@ -52,7 +52,7 @@ public class QbftBlockCreatorFactory extends BftBlockCreatorFactory<QbftConfigOp
|
||||
final ProtocolContext protocolContext,
|
||||
final ProtocolSchedule protocolSchedule,
|
||||
final ForksSchedule<QbftConfigOptions> forksSchedule,
|
||||
final MiningParameters miningParams,
|
||||
final MiningConfiguration miningParams,
|
||||
final Address localAddress,
|
||||
final BftExtraDataCodec bftExtraDataCodec,
|
||||
final EthScheduler ethScheduler) {
|
||||
@@ -74,7 +74,7 @@ public class QbftBlockCreatorFactory extends BftBlockCreatorFactory<QbftConfigOp
|
||||
final BftExtraData extraData =
|
||||
new BftExtraData(
|
||||
ConsensusHelpers.zeroLeftPad(
|
||||
miningParameters.getExtraData(), BftExtraDataCodec.EXTRA_VANITY_LENGTH),
|
||||
miningConfiguration.getExtraData(), BftExtraDataCodec.EXTRA_VANITY_LENGTH),
|
||||
Collections.emptyList(),
|
||||
Optional.empty(),
|
||||
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.methods.ApiGroupJsonRpcMethods;
|
||||
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 java.util.Map;
|
||||
@@ -41,7 +41,7 @@ public class QbftJsonRpcMethods extends ApiGroupJsonRpcMethods {
|
||||
private final ProtocolContext context;
|
||||
private final ValidatorProvider readOnlyValidatorProvider;
|
||||
private final ProtocolSchedule protocolSchedule;
|
||||
private final MiningParameters miningParameters;
|
||||
private final MiningConfiguration miningConfiguration;
|
||||
private final BftConfigOptions bftConfig;
|
||||
|
||||
/**
|
||||
@@ -49,20 +49,20 @@ public class QbftJsonRpcMethods extends ApiGroupJsonRpcMethods {
|
||||
*
|
||||
* @param context the protocol context
|
||||
* @param protocolSchedule the protocol schedule
|
||||
* @param miningParameters the mining parameters
|
||||
* @param miningConfiguration the mining parameters
|
||||
* @param readOnlyValidatorProvider the read only validator provider
|
||||
* @param bftConfig the BFT config options, containing QBFT-specific settings
|
||||
*/
|
||||
public QbftJsonRpcMethods(
|
||||
final ProtocolContext context,
|
||||
final ProtocolSchedule protocolSchedule,
|
||||
final MiningParameters miningParameters,
|
||||
final MiningConfiguration miningConfiguration,
|
||||
final ValidatorProvider readOnlyValidatorProvider,
|
||||
final BftConfigOptions bftConfig) {
|
||||
this.context = context;
|
||||
this.readOnlyValidatorProvider = readOnlyValidatorProvider;
|
||||
this.protocolSchedule = protocolSchedule;
|
||||
this.miningParameters = miningParameters;
|
||||
this.miningConfiguration = miningConfiguration;
|
||||
this.bftConfig = bftConfig;
|
||||
}
|
||||
|
||||
@@ -78,7 +78,7 @@ public class QbftJsonRpcMethods extends ApiGroupJsonRpcMethods {
|
||||
protocolSchedule,
|
||||
context.getBlockchain(),
|
||||
context.getWorldStateArchive(),
|
||||
miningParameters);
|
||||
miningConfiguration);
|
||||
final BftContext bftContext = context.getConsensusContext(BftContext.class);
|
||||
final BlockInterface blockInterface = bftContext.getBlockInterface();
|
||||
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.core.BlockHeader;
|
||||
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.Util;
|
||||
import org.hyperledger.besu.ethereum.mainnet.HeaderValidationMode;
|
||||
@@ -138,7 +138,7 @@ public class QbftProtocolScheduleTest {
|
||||
false,
|
||||
bftExtraDataCodec,
|
||||
EvmConfiguration.DEFAULT,
|
||||
MiningParameters.MINING_DISABLED,
|
||||
MiningConfiguration.MINING_DISABLED,
|
||||
new BadBlockManager(),
|
||||
false,
|
||||
new NoOpMetricsSystem());
|
||||
|
||||
@@ -30,9 +30,9 @@ import org.hyperledger.besu.consensus.qbft.QbftExtraDataCodec;
|
||||
import org.hyperledger.besu.datatypes.Address;
|
||||
import org.hyperledger.besu.ethereum.ProtocolContext;
|
||||
import org.hyperledger.besu.ethereum.core.BlockHeader;
|
||||
import org.hyperledger.besu.ethereum.core.ImmutableMiningParameters;
|
||||
import org.hyperledger.besu.ethereum.core.ImmutableMiningParameters.MutableInitValues;
|
||||
import org.hyperledger.besu.ethereum.core.MiningParameters;
|
||||
import org.hyperledger.besu.ethereum.core.ImmutableMiningConfiguration;
|
||||
import org.hyperledger.besu.ethereum.core.ImmutableMiningConfiguration.MutableInitValues;
|
||||
import org.hyperledger.besu.ethereum.core.MiningConfiguration;
|
||||
import org.hyperledger.besu.ethereum.eth.transactions.TransactionPool;
|
||||
import org.hyperledger.besu.ethereum.mainnet.ProtocolSchedule;
|
||||
import org.hyperledger.besu.testutil.DeterministicEthScheduler;
|
||||
@@ -50,8 +50,8 @@ public class QbftBlockCreatorFactoryTest {
|
||||
@BeforeEach
|
||||
@SuppressWarnings("unchecked")
|
||||
public void setUp() {
|
||||
final MiningParameters miningParams =
|
||||
ImmutableMiningParameters.builder()
|
||||
final MiningConfiguration miningParams =
|
||||
ImmutableMiningConfiguration.builder()
|
||||
.mutableInitValues(
|
||||
MutableInitValues.builder()
|
||||
.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.BlockHeader;
|
||||
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.Util;
|
||||
import org.hyperledger.besu.ethereum.mainnet.DefaultProtocolSchedule;
|
||||
@@ -187,7 +187,7 @@ public class QbftBlockHeightManagerTest {
|
||||
new PrivacyParameters(),
|
||||
false,
|
||||
EvmConfiguration.DEFAULT,
|
||||
MiningParameters.MINING_DISABLED,
|
||||
MiningConfiguration.MINING_DISABLED,
|
||||
new BadBlockManager(),
|
||||
false,
|
||||
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.core.Block;
|
||||
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.ProtocolSchedule;
|
||||
import org.hyperledger.besu.ethereum.mainnet.ScheduleBasedBlockHeaderFunctions;
|
||||
@@ -46,7 +46,7 @@ public class BlockchainImporter {
|
||||
protocolSchedule =
|
||||
MainnetProtocolSchedule.fromConfig(
|
||||
GenesisConfigFile.fromConfig(genesisJson).getConfigOptions(),
|
||||
MiningParameters.newDefault(),
|
||||
MiningConfiguration.newDefault(),
|
||||
new BadBlockManager(),
|
||||
false,
|
||||
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.core.Block;
|
||||
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.Synchronizer;
|
||||
import org.hyperledger.besu.ethereum.eth.manager.EthPeers;
|
||||
@@ -94,7 +94,7 @@ public class JsonRpcTestMethodsFactory {
|
||||
}
|
||||
this.blockchainQueries =
|
||||
new BlockchainQueries(
|
||||
protocolSchedule, blockchain, stateArchive, MiningParameters.newDefault());
|
||||
protocolSchedule, blockchain, stateArchive, MiningConfiguration.newDefault());
|
||||
}
|
||||
|
||||
public JsonRpcTestMethodsFactory(
|
||||
@@ -112,7 +112,7 @@ public class JsonRpcTestMethodsFactory {
|
||||
importer.getProtocolSchedule(),
|
||||
blockchain,
|
||||
stateArchive,
|
||||
MiningParameters.newDefault());
|
||||
MiningConfiguration.newDefault());
|
||||
this.synchronizer = mock(Synchronizer.class);
|
||||
}
|
||||
|
||||
@@ -133,7 +133,7 @@ public class JsonRpcTestMethodsFactory {
|
||||
importer.getProtocolSchedule(),
|
||||
blockchain,
|
||||
stateArchive,
|
||||
MiningParameters.newDefault());
|
||||
MiningConfiguration.newDefault());
|
||||
}
|
||||
|
||||
public BlockchainQueries getBlockchainQueries() {
|
||||
@@ -152,7 +152,7 @@ public class JsonRpcTestMethodsFactory {
|
||||
final P2PNetwork peerDiscovery = mock(P2PNetwork.class);
|
||||
final EthPeers ethPeers = mock(EthPeers.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 ObservableMetricsSystem metricsSystem = new NoOpMetricsSystem();
|
||||
final Optional<AccountLocalConfigPermissioningController> accountWhitelistController =
|
||||
@@ -198,7 +198,7 @@ public class JsonRpcTestMethodsFactory {
|
||||
context,
|
||||
filterManager,
|
||||
transactionPool,
|
||||
miningParameters,
|
||||
miningConfiguration,
|
||||
miningCoordinator,
|
||||
metricsSystem,
|
||||
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.Difficulty;
|
||||
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.TransactionReceipt;
|
||||
import org.hyperledger.besu.ethereum.eth.manager.EthContext;
|
||||
@@ -130,7 +130,7 @@ public class EthGetFilterChangesIntegrationTest {
|
||||
executionContext.getProtocolSchedule(),
|
||||
blockchain,
|
||||
protocolContext.getWorldStateArchive(),
|
||||
MiningParameters.newDefault());
|
||||
MiningConfiguration.newDefault());
|
||||
filterManager =
|
||||
new FilterManagerBuilder()
|
||||
.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.Difficulty;
|
||||
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.TransactionReceipt;
|
||||
import org.hyperledger.besu.ethereum.eth.manager.EthContext;
|
||||
@@ -130,7 +130,7 @@ public class EthGetFilterChangesIntegrationTest {
|
||||
executionContext.getProtocolSchedule(),
|
||||
blockchain,
|
||||
protocolContext.getWorldStateArchive(),
|
||||
MiningParameters.newDefault());
|
||||
MiningConfiguration.newDefault());
|
||||
filterManager =
|
||||
new FilterManagerBuilder()
|
||||
.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.response.JsonRpcResponse;
|
||||
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 {
|
||||
private final MiningParameters miningParameters;
|
||||
private final MiningConfiguration miningConfiguration;
|
||||
|
||||
public MinerGetExtraData(final MiningParameters miningParameters) {
|
||||
this.miningParameters = miningParameters;
|
||||
public MinerGetExtraData(final MiningConfiguration miningConfiguration) {
|
||||
this.miningConfiguration = miningConfiguration;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -36,6 +36,6 @@ public class MinerGetExtraData implements JsonRpcMethod {
|
||||
@Override
|
||||
public JsonRpcResponse response(final JsonRpcRequestContext requestContext) {
|
||||
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.JsonRpcSuccessResponse;
|
||||
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 {
|
||||
private final MiningParameters miningParameters;
|
||||
private final MiningConfiguration miningConfiguration;
|
||||
|
||||
public MinerGetMinGasPrice(final MiningParameters miningParameters) {
|
||||
this.miningParameters = miningParameters;
|
||||
public MinerGetMinGasPrice(final MiningConfiguration miningConfiguration) {
|
||||
this.miningConfiguration = miningConfiguration;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -38,6 +38,6 @@ public class MinerGetMinGasPrice implements JsonRpcMethod {
|
||||
public JsonRpcResponse response(final JsonRpcRequestContext requestContext) {
|
||||
return new JsonRpcSuccessResponse(
|
||||
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.JsonRpcSuccessResponse;
|
||||
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 {
|
||||
private final MiningParameters miningParameters;
|
||||
private final MiningConfiguration miningConfiguration;
|
||||
|
||||
public MinerGetMinPriorityFee(final MiningParameters miningParameters) {
|
||||
this.miningParameters = miningParameters;
|
||||
public MinerGetMinPriorityFee(final MiningConfiguration miningConfiguration) {
|
||||
this.miningConfiguration = miningConfiguration;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -38,6 +38,6 @@ public class MinerGetMinPriorityFee implements JsonRpcMethod {
|
||||
public JsonRpcResponse response(final JsonRpcRequestContext requestContext) {
|
||||
return new JsonRpcSuccessResponse(
|
||||
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.JsonRpcSuccessResponse;
|
||||
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;
|
||||
|
||||
@@ -35,10 +35,10 @@ import org.slf4j.LoggerFactory;
|
||||
public class MinerSetExtraData implements JsonRpcMethod {
|
||||
private static final Logger LOG = LoggerFactory.getLogger(MinerSetExtraData.class);
|
||||
|
||||
private final MiningParameters miningParameters;
|
||||
private final MiningConfiguration miningConfiguration;
|
||||
|
||||
public MinerSetExtraData(final MiningParameters miningParameters) {
|
||||
this.miningParameters = miningParameters;
|
||||
public MinerSetExtraData(final MiningConfiguration miningConfiguration) {
|
||||
this.miningConfiguration = miningConfiguration;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -53,7 +53,7 @@ public class MinerSetExtraData implements JsonRpcMethod {
|
||||
Bytes32.fromHexStringLenient(
|
||||
rawParam); // done for validation, we want a hex string and max 32 bytes
|
||||
final var extraData = Bytes.fromHexStringLenient(rawParam);
|
||||
miningParameters.setExtraData(extraData);
|
||||
miningConfiguration.setExtraData(extraData);
|
||||
LOG.atDebug()
|
||||
.setMessage("set extra data, raw=[{}] parsed=[{}], UTF-8=[{}]")
|
||||
.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.JsonRpcSuccessResponse;
|
||||
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.LoggerFactory;
|
||||
@@ -33,10 +33,10 @@ import org.slf4j.LoggerFactory;
|
||||
public class MinerSetMinGasPrice implements JsonRpcMethod {
|
||||
private static final Logger LOG = LoggerFactory.getLogger(MinerSetMinGasPrice.class);
|
||||
|
||||
private final MiningParameters miningParameters;
|
||||
private final MiningConfiguration miningConfiguration;
|
||||
|
||||
public MinerSetMinGasPrice(final MiningParameters miningParameters) {
|
||||
this.miningParameters = miningParameters;
|
||||
public MinerSetMinGasPrice(final MiningConfiguration miningConfiguration) {
|
||||
this.miningConfiguration = miningConfiguration;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -49,7 +49,7 @@ public class MinerSetMinGasPrice implements JsonRpcMethod {
|
||||
try {
|
||||
final Wei minGasPrice =
|
||||
Wei.fromHexString(requestContext.getRequiredParameter(0, String.class));
|
||||
miningParameters.setMinTransactionGasPrice(minGasPrice);
|
||||
miningConfiguration.setMinTransactionGasPrice(minGasPrice);
|
||||
LOG.debug("min gas price changed to {}", minGasPrice.toHumanReadableString());
|
||||
return new JsonRpcSuccessResponse(requestContext.getRequest().getId(), true);
|
||||
} 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.JsonRpcSuccessResponse;
|
||||
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.LoggerFactory;
|
||||
@@ -32,10 +32,10 @@ import org.slf4j.LoggerFactory;
|
||||
public class MinerSetMinPriorityFee implements JsonRpcMethod {
|
||||
private static final Logger LOG = LoggerFactory.getLogger(MinerSetMinPriorityFee.class);
|
||||
|
||||
private final MiningParameters miningParameters;
|
||||
private final MiningConfiguration miningConfiguration;
|
||||
|
||||
public MinerSetMinPriorityFee(final MiningParameters miningParameters) {
|
||||
this.miningParameters = miningParameters;
|
||||
public MinerSetMinPriorityFee(final MiningConfiguration miningConfiguration) {
|
||||
this.miningConfiguration = miningConfiguration;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -48,7 +48,7 @@ public class MinerSetMinPriorityFee implements JsonRpcMethod {
|
||||
try {
|
||||
final Wei minPriorityFeePerGas =
|
||||
Wei.fromHexString(requestContext.getRequiredParameter(0, String.class));
|
||||
miningParameters.setMinPriorityFeePerGas(minPriorityFeePerGas);
|
||||
miningConfiguration.setMinPriorityFeePerGas(minPriorityFeePerGas);
|
||||
LOG.debug(
|
||||
"min priority fee per gas changed to {}", minPriorityFeePerGas.toHumanReadableString());
|
||||
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.query.BlockchainQueries;
|
||||
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.Synchronizer;
|
||||
import org.hyperledger.besu.ethereum.eth.manager.EthPeers;
|
||||
@@ -67,7 +67,7 @@ public class JsonRpcMethodsFactory {
|
||||
final ProtocolContext protocolContext,
|
||||
final FilterManager filterManager,
|
||||
final TransactionPool transactionPool,
|
||||
final MiningParameters miningParameters,
|
||||
final MiningConfiguration miningConfiguration,
|
||||
final MiningCoordinator miningCoordinator,
|
||||
final ObservableMetricsSystem metricsSystem,
|
||||
final Set<Capability> supportedCapabilities,
|
||||
@@ -139,7 +139,7 @@ public class JsonRpcMethodsFactory {
|
||||
webSocketConfiguration,
|
||||
metricsConfiguration,
|
||||
graphQLConfiguration),
|
||||
new MinerJsonRpcMethods(miningParameters, miningCoordinator),
|
||||
new MinerJsonRpcMethods(miningConfiguration, miningCoordinator),
|
||||
new PermJsonRpcMethods(accountsAllowlistController, nodeAllowlistController),
|
||||
new PrivJsonRpcMethods(
|
||||
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.MinerStop;
|
||||
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;
|
||||
|
||||
public class MinerJsonRpcMethods extends ApiGroupJsonRpcMethods {
|
||||
|
||||
private final MiningCoordinator miningCoordinator;
|
||||
private final MiningParameters miningParameters;
|
||||
private final MiningConfiguration miningConfiguration;
|
||||
|
||||
public MinerJsonRpcMethods(
|
||||
final MiningParameters miningParameters, final MiningCoordinator miningCoordinator) {
|
||||
this.miningParameters = miningParameters;
|
||||
final MiningConfiguration miningConfiguration, final MiningCoordinator miningCoordinator) {
|
||||
this.miningConfiguration = miningConfiguration;
|
||||
this.miningCoordinator = miningCoordinator;
|
||||
}
|
||||
|
||||
@@ -57,11 +57,11 @@ public class MinerJsonRpcMethods extends ApiGroupJsonRpcMethods {
|
||||
minerSetCoinbase,
|
||||
new MinerSetEtherbase(minerSetCoinbase),
|
||||
new MinerChangeTargetGasLimit(miningCoordinator),
|
||||
new MinerGetMinPriorityFee(miningParameters),
|
||||
new MinerSetMinPriorityFee(miningParameters),
|
||||
new MinerGetMinGasPrice(miningParameters),
|
||||
new MinerSetMinGasPrice(miningParameters),
|
||||
new MinerGetExtraData(miningParameters),
|
||||
new MinerSetExtraData(miningParameters));
|
||||
new MinerGetMinPriorityFee(miningConfiguration),
|
||||
new MinerSetMinPriorityFee(miningConfiguration),
|
||||
new MinerGetMinGasPrice(miningConfiguration),
|
||||
new MinerSetMinGasPrice(miningConfiguration),
|
||||
new MinerGetExtraData(miningConfiguration),
|
||||
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.BlockHeader;
|
||||
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.Transaction;
|
||||
import org.hyperledger.besu.ethereum.core.TransactionReceipt;
|
||||
@@ -77,20 +77,20 @@ public class BlockchainQueries {
|
||||
private final Optional<TransactionLogBloomCacher> transactionLogBloomCacher;
|
||||
private final Optional<EthScheduler> ethScheduler;
|
||||
private final ApiConfiguration apiConfig;
|
||||
private final MiningParameters miningParameters;
|
||||
private final MiningConfiguration miningConfiguration;
|
||||
|
||||
public BlockchainQueries(
|
||||
final ProtocolSchedule protocolSchedule,
|
||||
final Blockchain blockchain,
|
||||
final WorldStateArchive worldStateArchive,
|
||||
final MiningParameters miningParameters) {
|
||||
final MiningConfiguration miningConfiguration) {
|
||||
this(
|
||||
protocolSchedule,
|
||||
blockchain,
|
||||
worldStateArchive,
|
||||
Optional.empty(),
|
||||
Optional.empty(),
|
||||
miningParameters);
|
||||
miningConfiguration);
|
||||
}
|
||||
|
||||
public BlockchainQueries(
|
||||
@@ -98,14 +98,14 @@ public class BlockchainQueries {
|
||||
final Blockchain blockchain,
|
||||
final WorldStateArchive worldStateArchive,
|
||||
final EthScheduler scheduler,
|
||||
final MiningParameters miningParameters) {
|
||||
final MiningConfiguration miningConfiguration) {
|
||||
this(
|
||||
protocolSchedule,
|
||||
blockchain,
|
||||
worldStateArchive,
|
||||
Optional.empty(),
|
||||
Optional.ofNullable(scheduler),
|
||||
miningParameters);
|
||||
miningConfiguration);
|
||||
}
|
||||
|
||||
public BlockchainQueries(
|
||||
@@ -114,7 +114,7 @@ public class BlockchainQueries {
|
||||
final WorldStateArchive worldStateArchive,
|
||||
final Optional<Path> cachePath,
|
||||
final Optional<EthScheduler> scheduler,
|
||||
final MiningParameters miningParameters) {
|
||||
final MiningConfiguration miningConfiguration) {
|
||||
this(
|
||||
protocolSchedule,
|
||||
blockchain,
|
||||
@@ -122,7 +122,7 @@ public class BlockchainQueries {
|
||||
cachePath,
|
||||
scheduler,
|
||||
ImmutableApiConfiguration.builder().build(),
|
||||
miningParameters);
|
||||
miningConfiguration);
|
||||
}
|
||||
|
||||
public BlockchainQueries(
|
||||
@@ -132,7 +132,7 @@ public class BlockchainQueries {
|
||||
final Optional<Path> cachePath,
|
||||
final Optional<EthScheduler> scheduler,
|
||||
final ApiConfiguration apiConfig,
|
||||
final MiningParameters miningParameters) {
|
||||
final MiningConfiguration miningConfiguration) {
|
||||
this.protocolSchedule = protocolSchedule;
|
||||
this.blockchain = blockchain;
|
||||
this.worldStateArchive = worldStateArchive;
|
||||
@@ -144,7 +144,7 @@ public class BlockchainQueries {
|
||||
new TransactionLogBloomCacher(blockchain, cachePath.get(), scheduler.get()))
|
||||
: Optional.empty();
|
||||
this.apiConfig = apiConfig;
|
||||
this.miningParameters = miningParameters;
|
||||
this.miningConfiguration = miningConfiguration;
|
||||
}
|
||||
|
||||
public Blockchain getBlockchain() {
|
||||
@@ -1034,7 +1034,7 @@ public class BlockchainQueries {
|
||||
|
||||
private Wei gasPriceLowerBound(
|
||||
final BlockHeader chainHeadHeader, final FeeMarket nextBlockFeeMarket) {
|
||||
final var minGasPrice = miningParameters.getMinTransactionGasPrice();
|
||||
final var minGasPrice = miningConfiguration.getMinTransactionGasPrice();
|
||||
|
||||
if (nextBlockFeeMarket.implementsBaseFee()) {
|
||||
return UInt256s.max(
|
||||
@@ -1070,9 +1070,9 @@ public class BlockchainQueries {
|
||||
.toArray(Wei[]::new);
|
||||
|
||||
return gasCollection.length == 0
|
||||
? miningParameters.getMinPriorityFeePerGas()
|
||||
? miningConfiguration.getMinPriorityFeePerGas()
|
||||
: UInt256s.max(
|
||||
miningParameters.getMinPriorityFeePerGas(),
|
||||
miningConfiguration.getMinPriorityFeePerGas(),
|
||||
gasCollection[
|
||||
Math.min(
|
||||
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.core.BlockchainSetupUtil;
|
||||
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.Transaction;
|
||||
import org.hyperledger.besu.ethereum.eth.EthProtocol;
|
||||
@@ -119,7 +119,7 @@ public abstract class AbstractEthGraphQLHttpServiceTest {
|
||||
Optional.empty(),
|
||||
Optional.empty(),
|
||||
ImmutableApiConfiguration.builder().build(),
|
||||
MiningParameters.newDefault().setMinTransactionGasPrice(Wei.ZERO));
|
||||
MiningConfiguration.newDefault().setMinTransactionGasPrice(Wei.ZERO));
|
||||
|
||||
final Set<Capability> supportedCapabilities = new HashSet<>();
|
||||
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.blockcreation.PoWMiningCoordinator;
|
||||
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.Synchronizer;
|
||||
import org.hyperledger.besu.ethereum.core.Transaction;
|
||||
@@ -137,7 +137,7 @@ public abstract class AbstractJsonRpcHttpServiceTest {
|
||||
final Synchronizer synchronizerMock = mock(Synchronizer.class);
|
||||
final P2PNetwork peerDiscoveryMock = mock(P2PNetwork.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);
|
||||
when(transactionPoolMock.addTransactionViaApi(any(Transaction.class)))
|
||||
.thenReturn(ValidationResult.valid());
|
||||
@@ -151,7 +151,7 @@ public abstract class AbstractJsonRpcHttpServiceTest {
|
||||
blockchainSetupUtil.getProtocolSchedule(),
|
||||
blockchainSetupUtil.getBlockchain(),
|
||||
blockchainSetupUtil.getWorldArchive(),
|
||||
miningParameters);
|
||||
miningConfiguration);
|
||||
final FilterIdGenerator filterIdGenerator = mock(FilterIdGenerator.class);
|
||||
final FilterRepository filterRepository = new FilterRepository();
|
||||
when(filterIdGenerator.nextId()).thenReturn("0x1");
|
||||
@@ -183,7 +183,7 @@ public abstract class AbstractJsonRpcHttpServiceTest {
|
||||
protocolContext,
|
||||
filterManager,
|
||||
transactionPoolMock,
|
||||
miningParameters,
|
||||
miningConfiguration,
|
||||
miningCoordinatorMock,
|
||||
new NoOpMetricsSystem(),
|
||||
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.blockcreation.PoWMiningCoordinator;
|
||||
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.Synchronizer;
|
||||
import org.hyperledger.besu.ethereum.eth.EthProtocol;
|
||||
@@ -113,14 +113,14 @@ public class JsonRpcHttpServiceHostAllowlistTest {
|
||||
synchronizer,
|
||||
MainnetProtocolSchedule.fromConfig(
|
||||
new StubGenesisConfigOptions().constantinopleBlock(0).chainId(CHAIN_ID),
|
||||
MiningParameters.MINING_DISABLED,
|
||||
MiningConfiguration.MINING_DISABLED,
|
||||
new BadBlockManager(),
|
||||
false,
|
||||
new NoOpMetricsSystem()),
|
||||
mock(ProtocolContext.class),
|
||||
mock(FilterManager.class),
|
||||
mock(TransactionPool.class),
|
||||
mock(MiningParameters.class),
|
||||
mock(MiningConfiguration.class),
|
||||
mock(PoWMiningCoordinator.class),
|
||||
new NoOpMetricsSystem(),
|
||||
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.blockcreation.PoWMiningCoordinator;
|
||||
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.Synchronizer;
|
||||
import org.hyperledger.besu.ethereum.eth.EthProtocol;
|
||||
@@ -144,14 +144,14 @@ public class JsonRpcHttpServiceLoginTest {
|
||||
synchronizer,
|
||||
MainnetProtocolSchedule.fromConfig(
|
||||
genesisConfigOptions,
|
||||
MiningParameters.MINING_DISABLED,
|
||||
MiningConfiguration.MINING_DISABLED,
|
||||
new BadBlockManager(),
|
||||
false,
|
||||
new NoOpMetricsSystem()),
|
||||
mock(ProtocolContext.class),
|
||||
mock(FilterManager.class),
|
||||
mock(TransactionPool.class),
|
||||
mock(MiningParameters.class),
|
||||
mock(MiningConfiguration.class),
|
||||
mock(PoWMiningCoordinator.class),
|
||||
new NoOpMetricsSystem(),
|
||||
supportedCapabilities,
|
||||
|
||||
@@ -36,7 +36,7 @@ import org.hyperledger.besu.ethereum.blockcreation.PoWMiningCoordinator;
|
||||
import org.hyperledger.besu.ethereum.chain.MutableBlockchain;
|
||||
import org.hyperledger.besu.ethereum.core.Block;
|
||||
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.ProtocolScheduleFixture;
|
||||
import org.hyperledger.besu.ethereum.core.Synchronizer;
|
||||
@@ -217,7 +217,7 @@ public class JsonRpcHttpServiceRpcApisTest {
|
||||
mock(ProtocolContext.class),
|
||||
mock(FilterManager.class),
|
||||
mock(TransactionPool.class),
|
||||
mock(MiningParameters.class),
|
||||
mock(MiningConfiguration.class),
|
||||
mock(PoWMiningCoordinator.class),
|
||||
new NoOpMetricsSystem(),
|
||||
supportedCapabilities,
|
||||
@@ -328,7 +328,7 @@ public class JsonRpcHttpServiceRpcApisTest {
|
||||
mock(ProtocolContext.class),
|
||||
mock(FilterManager.class),
|
||||
mock(TransactionPool.class),
|
||||
mock(MiningParameters.class),
|
||||
mock(MiningConfiguration.class),
|
||||
mock(PoWMiningCoordinator.class),
|
||||
new NoOpMetricsSystem(),
|
||||
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.Blockchain;
|
||||
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.Synchronizer;
|
||||
import org.hyperledger.besu.ethereum.eth.EthProtocol;
|
||||
@@ -122,14 +122,14 @@ public class JsonRpcHttpServiceTestBase {
|
||||
MainnetProtocolSchedule.fromConfig(
|
||||
new StubGenesisConfigOptions().constantinopleBlock(0).chainId(CHAIN_ID),
|
||||
EvmConfiguration.DEFAULT,
|
||||
MiningParameters.MINING_DISABLED,
|
||||
MiningConfiguration.MINING_DISABLED,
|
||||
new BadBlockManager(),
|
||||
false,
|
||||
new NoOpMetricsSystem()),
|
||||
mock(ProtocolContext.class),
|
||||
mock(FilterManager.class),
|
||||
mock(TransactionPool.class),
|
||||
mock(MiningParameters.class),
|
||||
mock(MiningConfiguration.class),
|
||||
mock(PoWMiningCoordinator.class),
|
||||
new NoOpMetricsSystem(),
|
||||
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.blockcreation.PoWMiningCoordinator;
|
||||
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.Synchronizer;
|
||||
import org.hyperledger.besu.ethereum.eth.EthProtocol;
|
||||
@@ -127,14 +127,14 @@ public class JsonRpcHttpServiceTlsClientAuthTest {
|
||||
synchronizer,
|
||||
MainnetProtocolSchedule.fromConfig(
|
||||
new StubGenesisConfigOptions().constantinopleBlock(0).chainId(CHAIN_ID),
|
||||
MiningParameters.MINING_DISABLED,
|
||||
MiningConfiguration.MINING_DISABLED,
|
||||
new BadBlockManager(),
|
||||
false,
|
||||
new NoOpMetricsSystem()),
|
||||
mock(ProtocolContext.class),
|
||||
mock(FilterManager.class),
|
||||
mock(TransactionPool.class),
|
||||
mock(MiningParameters.class),
|
||||
mock(MiningConfiguration.class),
|
||||
mock(PoWMiningCoordinator.class),
|
||||
new NoOpMetricsSystem(),
|
||||
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.blockcreation.PoWMiningCoordinator;
|
||||
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.Synchronizer;
|
||||
import org.hyperledger.besu.ethereum.eth.EthProtocol;
|
||||
@@ -115,14 +115,14 @@ class JsonRpcHttpServiceTlsMisconfigurationTest {
|
||||
synchronizer,
|
||||
MainnetProtocolSchedule.fromConfig(
|
||||
new StubGenesisConfigOptions().constantinopleBlock(0).chainId(CHAIN_ID),
|
||||
MiningParameters.MINING_DISABLED,
|
||||
MiningConfiguration.MINING_DISABLED,
|
||||
new BadBlockManager(),
|
||||
false,
|
||||
new NoOpMetricsSystem()),
|
||||
mock(ProtocolContext.class),
|
||||
mock(FilterManager.class),
|
||||
mock(TransactionPool.class),
|
||||
mock(MiningParameters.class),
|
||||
mock(MiningConfiguration.class),
|
||||
mock(PoWMiningCoordinator.class),
|
||||
new NoOpMetricsSystem(),
|
||||
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.blockcreation.PoWMiningCoordinator;
|
||||
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.Synchronizer;
|
||||
import org.hyperledger.besu.ethereum.eth.EthProtocol;
|
||||
@@ -116,14 +116,14 @@ public class JsonRpcHttpServiceTlsTest {
|
||||
synchronizer,
|
||||
MainnetProtocolSchedule.fromConfig(
|
||||
new StubGenesisConfigOptions().constantinopleBlock(0).chainId(CHAIN_ID),
|
||||
MiningParameters.MINING_DISABLED,
|
||||
MiningConfiguration.MINING_DISABLED,
|
||||
new BadBlockManager(),
|
||||
false,
|
||||
new NoOpMetricsSystem()),
|
||||
mock(ProtocolContext.class),
|
||||
mock(FilterManager.class),
|
||||
mock(TransactionPool.class),
|
||||
mock(MiningParameters.class),
|
||||
mock(MiningConfiguration.class),
|
||||
mock(PoWMiningCoordinator.class),
|
||||
new NoOpMetricsSystem(),
|
||||
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.BlockHeader;
|
||||
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.mainnet.ProtocolSchedule;
|
||||
import org.hyperledger.besu.ethereum.mainnet.ProtocolSpec;
|
||||
@@ -77,13 +77,13 @@ public class EthGasPriceTest {
|
||||
@Mock private ProtocolSchedule protocolSchedule;
|
||||
@Mock private Blockchain blockchain;
|
||||
private EthGasPrice method;
|
||||
private MiningParameters miningParameters;
|
||||
private MiningConfiguration miningConfiguration;
|
||||
|
||||
@BeforeEach
|
||||
public void setUp() {
|
||||
ApiConfiguration apiConfig = createDefaultApiConfiguration();
|
||||
miningParameters =
|
||||
MiningParameters.newDefault().setMinTransactionGasPrice(DEFAULT_MIN_GAS_PRICE);
|
||||
miningConfiguration =
|
||||
MiningConfiguration.newDefault().setMinTransactionGasPrice(DEFAULT_MIN_GAS_PRICE);
|
||||
method = createEthGasPriceMethod(apiConfig);
|
||||
}
|
||||
|
||||
@@ -96,7 +96,7 @@ public class EthGasPriceTest {
|
||||
public void shouldReturnMinValueWhenNoTransactionsExist() {
|
||||
final JsonRpcRequestContext request = requestWithParams();
|
||||
final String expectedWei = "0x4d2"; // minGasPrice > nextBlockBaseFee
|
||||
miningParameters.setMinTransactionGasPrice(Wei.fromHexString(expectedWei));
|
||||
miningConfiguration.setMinTransactionGasPrice(Wei.fromHexString(expectedWei));
|
||||
final JsonRpcResponse expectedResponse =
|
||||
new JsonRpcSuccessResponse(request.getRequest().getId(), expectedWei);
|
||||
|
||||
@@ -117,7 +117,7 @@ public class EthGasPriceTest {
|
||||
final JsonRpcRequestContext request = requestWithParams();
|
||||
final String expectedWei =
|
||||
DEFAULT_BASE_FEE.toShortHexString(); // nextBlockBaseFee > minGasPrice
|
||||
miningParameters.setMinTransactionGasPrice(Wei.fromHexString(expectedWei));
|
||||
miningConfiguration.setMinTransactionGasPrice(Wei.fromHexString(expectedWei));
|
||||
final JsonRpcResponse expectedResponse =
|
||||
new JsonRpcSuccessResponse(request.getRequest().getId(), expectedWei);
|
||||
|
||||
@@ -234,7 +234,7 @@ public class EthGasPriceTest {
|
||||
@MethodSource("ethGasPriceAtGenesis")
|
||||
public void ethGasPriceAtGenesis(
|
||||
final Wei minGasPrice, final Optional<Wei> maybeGenesisBaseFee, final Wei expectedGasPrice) {
|
||||
miningParameters.setMinTransactionGasPrice(minGasPrice);
|
||||
miningConfiguration.setMinTransactionGasPrice(minGasPrice);
|
||||
|
||||
if (maybeGenesisBaseFee.isPresent()) {
|
||||
mockBaseFeeMarket();
|
||||
@@ -267,7 +267,7 @@ public class EthGasPriceTest {
|
||||
final Long lowerBoundCoefficient,
|
||||
final Long upperBoundCoefficient,
|
||||
final long expectedGasPrice) {
|
||||
miningParameters.setMinTransactionGasPrice(Wei.of(100));
|
||||
miningConfiguration.setMinTransactionGasPrice(Wei.of(100));
|
||||
|
||||
mockBaseFeeMarket();
|
||||
|
||||
@@ -423,7 +423,7 @@ public class EthGasPriceTest {
|
||||
Optional.empty(),
|
||||
Optional.empty(),
|
||||
apiConfig,
|
||||
miningParameters),
|
||||
miningConfiguration),
|
||||
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.BlockDataGenerator;
|
||||
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.TransactionReceipt;
|
||||
import org.hyperledger.besu.ethereum.mainnet.ProtocolSchedule;
|
||||
@@ -93,7 +93,7 @@ public class EthGetBlockByNumberTest {
|
||||
blockchainQueries =
|
||||
spy(
|
||||
new BlockchainQueries(
|
||||
protocolSchedule, blockchain, worldStateArchive, MiningParameters.newDefault()));
|
||||
protocolSchedule, blockchain, worldStateArchive, MiningConfiguration.newDefault()));
|
||||
|
||||
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.core.Block;
|
||||
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.TransactionReceipt;
|
||||
import org.hyperledger.besu.ethereum.mainnet.ProtocolSchedule;
|
||||
@@ -86,7 +86,7 @@ public class EthGetBlockReceiptsTest {
|
||||
blockchainQueries =
|
||||
spy(
|
||||
new BlockchainQueries(
|
||||
protocolSchedule, blockchain, worldStateArchive, MiningParameters.newDefault()));
|
||||
protocolSchedule, blockchain, worldStateArchive, MiningConfiguration.newDefault()));
|
||||
protocolSchedule = mock(ProtocolSchedule.class);
|
||||
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.ChainHead;
|
||||
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.proof.WorldStateProof;
|
||||
import org.hyperledger.besu.ethereum.worldstate.StateTrieAccountValue;
|
||||
@@ -89,7 +89,7 @@ class EthGetProofTest {
|
||||
blockchainQueries =
|
||||
spy(
|
||||
new BlockchainQueries(
|
||||
protocolSchedule, blockchain, archive, MiningParameters.newDefault()));
|
||||
protocolSchedule, blockchain, archive, MiningConfiguration.newDefault()));
|
||||
when(blockchainQueries.getBlockchain()).thenReturn(blockchain);
|
||||
when(blockchainQueries.headBlockNumber()).thenReturn(14L);
|
||||
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.BlockHeader;
|
||||
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.TransactionReceipt;
|
||||
import org.hyperledger.besu.ethereum.mainnet.PoWHasher;
|
||||
@@ -195,7 +195,7 @@ public class EthGetTransactionReceiptTest {
|
||||
protocolSchedule,
|
||||
blockchain,
|
||||
mock(WorldStateArchive.class),
|
||||
MiningParameters.newDefault()));
|
||||
MiningConfiguration.newDefault()));
|
||||
private final EthGetTransactionReceipt ethGetTransactionReceipt =
|
||||
new EthGetTransactionReceipt(blockchainQueries, protocolSchedule);
|
||||
private final String receiptString =
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user