|
|
|
@ -27,7 +27,6 @@ import static org.mockito.ArgumentMatchers.any; |
|
|
|
|
import static org.mockito.ArgumentMatchers.anyBoolean; |
|
|
|
|
import static org.mockito.ArgumentMatchers.eq; |
|
|
|
|
import static org.mockito.Mockito.mock; |
|
|
|
|
import static org.mockito.Mockito.spy; |
|
|
|
|
import static org.mockito.Mockito.verify; |
|
|
|
|
import static org.mockito.Mockito.when; |
|
|
|
|
|
|
|
|
@ -43,7 +42,6 @@ import org.hyperledger.besu.ethereum.GasLimitCalculator; |
|
|
|
|
import org.hyperledger.besu.ethereum.ProtocolContext; |
|
|
|
|
import org.hyperledger.besu.ethereum.blockcreation.txselection.BlockTransactionSelector; |
|
|
|
|
import org.hyperledger.besu.ethereum.blockcreation.txselection.TransactionSelectionResults; |
|
|
|
|
import org.hyperledger.besu.ethereum.blockcreation.txselection.selectors.AllAcceptingTransactionSelector; |
|
|
|
|
import org.hyperledger.besu.ethereum.chain.BadBlockManager; |
|
|
|
|
import org.hyperledger.besu.ethereum.chain.DefaultBlockchain; |
|
|
|
|
import org.hyperledger.besu.ethereum.chain.GenesisState; |
|
|
|
@ -82,9 +80,11 @@ import org.hyperledger.besu.evm.worldstate.WorldState; |
|
|
|
|
import org.hyperledger.besu.metrics.noop.NoOpMetricsSystem; |
|
|
|
|
import org.hyperledger.besu.plugin.data.TransactionSelectionResult; |
|
|
|
|
import org.hyperledger.besu.plugin.services.MetricsSystem; |
|
|
|
|
import org.hyperledger.besu.plugin.services.TransactionSelectionService; |
|
|
|
|
import org.hyperledger.besu.plugin.services.txselection.PluginTransactionSelector; |
|
|
|
|
import org.hyperledger.besu.plugin.services.txselection.PluginTransactionSelectorFactory; |
|
|
|
|
import org.hyperledger.besu.plugin.services.txselection.TransactionEvaluationContext; |
|
|
|
|
import org.hyperledger.besu.services.TransactionSelectionServiceImpl; |
|
|
|
|
import org.hyperledger.besu.services.kvstore.InMemoryKeyValueStorage; |
|
|
|
|
import org.hyperledger.besu.util.number.PositiveNumber; |
|
|
|
|
|
|
|
|
@ -121,8 +121,6 @@ import org.mockito.stubbing.Answer; |
|
|
|
|
public abstract class AbstractBlockTransactionSelectorTest { |
|
|
|
|
protected static final double MIN_OCCUPANCY_80_PERCENT = 0.8; |
|
|
|
|
protected static final double MIN_OCCUPANCY_100_PERCENT = 1; |
|
|
|
|
protected static final PluginTransactionSelectorFactory NO_PLUGIN_TRANSACTION_SELECTOR_FACTORY = |
|
|
|
|
() -> AllAcceptingTransactionSelector.INSTANCE; |
|
|
|
|
protected static final BigInteger CHAIN_ID = BigInteger.valueOf(42L); |
|
|
|
|
protected static final KeyPair keyPair = |
|
|
|
|
SignatureAlgorithmFactory.getInstance().generateKeyPair(); |
|
|
|
@ -135,9 +133,8 @@ public abstract class AbstractBlockTransactionSelectorTest { |
|
|
|
|
protected TransactionPool transactionPool; |
|
|
|
|
protected MutableWorldState worldState; |
|
|
|
|
protected ProtocolSchedule protocolSchedule; |
|
|
|
|
protected final MiningParameters defaultTestMiningParameters = |
|
|
|
|
createMiningParameters( |
|
|
|
|
Wei.ZERO, MIN_OCCUPANCY_80_PERCENT, DEFAULT_NON_POA_BLOCK_TXS_SELECTION_MAX_TIME); |
|
|
|
|
protected TransactionSelectionService transactionSelectionService; |
|
|
|
|
protected MiningParameters defaultTestMiningParameters; |
|
|
|
|
|
|
|
|
|
@Mock protected EthScheduler ethScheduler; |
|
|
|
|
|
|
|
|
@ -153,6 +150,14 @@ public abstract class AbstractBlockTransactionSelectorTest { |
|
|
|
|
public void setup() { |
|
|
|
|
genesisConfigFile = getGenesisConfigFile(); |
|
|
|
|
protocolSchedule = createProtocolSchedule(); |
|
|
|
|
transactionSelectionService = new TransactionSelectionServiceImpl(); |
|
|
|
|
defaultTestMiningParameters = |
|
|
|
|
createMiningParameters( |
|
|
|
|
transactionSelectionService, |
|
|
|
|
Wei.ZERO, |
|
|
|
|
MIN_OCCUPANCY_80_PERCENT, |
|
|
|
|
DEFAULT_NON_POA_BLOCK_TXS_SELECTION_MAX_TIME); |
|
|
|
|
|
|
|
|
|
final Block genesisBlock = |
|
|
|
|
GenesisState.fromConfig(genesisConfigFile, protocolSchedule).getBlock(); |
|
|
|
|
|
|
|
|
@ -228,7 +233,7 @@ public abstract class AbstractBlockTransactionSelectorTest { |
|
|
|
|
blockHeader, |
|
|
|
|
miningBeneficiary, |
|
|
|
|
Wei.ZERO, |
|
|
|
|
NO_PLUGIN_TRANSACTION_SELECTOR_FACTORY); |
|
|
|
|
transactionSelectionService); |
|
|
|
|
|
|
|
|
|
final TransactionSelectionResults results = selector.buildTransactionListForBlock(); |
|
|
|
|
|
|
|
|
@ -249,7 +254,7 @@ public abstract class AbstractBlockTransactionSelectorTest { |
|
|
|
|
blockHeader, |
|
|
|
|
miningBeneficiary, |
|
|
|
|
Wei.ZERO, |
|
|
|
|
NO_PLUGIN_TRANSACTION_SELECTOR_FACTORY); |
|
|
|
|
transactionSelectionService); |
|
|
|
|
|
|
|
|
|
final Transaction transaction = createTransaction(1, Wei.of(7L), 100_000); |
|
|
|
|
transactionPool.addRemoteTransactions(List.of(transaction)); |
|
|
|
@ -276,7 +281,7 @@ public abstract class AbstractBlockTransactionSelectorTest { |
|
|
|
|
blockHeader, |
|
|
|
|
miningBeneficiary, |
|
|
|
|
Wei.ZERO, |
|
|
|
|
NO_PLUGIN_TRANSACTION_SELECTOR_FACTORY); |
|
|
|
|
transactionSelectionService); |
|
|
|
|
|
|
|
|
|
final List<Transaction> transactionsToInject = Lists.newArrayList(); |
|
|
|
|
for (int i = 0; i < 5; i++) { |
|
|
|
@ -317,7 +322,7 @@ public abstract class AbstractBlockTransactionSelectorTest { |
|
|
|
|
blockHeader, |
|
|
|
|
miningBeneficiary, |
|
|
|
|
Wei.ZERO, |
|
|
|
|
NO_PLUGIN_TRANSACTION_SELECTOR_FACTORY); |
|
|
|
|
transactionSelectionService); |
|
|
|
|
|
|
|
|
|
final List<Transaction> transactionsToInject = Lists.newArrayList(); |
|
|
|
|
for (int i = 0; i < 5; i++) { |
|
|
|
@ -358,7 +363,7 @@ public abstract class AbstractBlockTransactionSelectorTest { |
|
|
|
|
blockHeader, |
|
|
|
|
miningBeneficiary, |
|
|
|
|
Wei.ZERO, |
|
|
|
|
NO_PLUGIN_TRANSACTION_SELECTOR_FACTORY); |
|
|
|
|
transactionSelectionService); |
|
|
|
|
|
|
|
|
|
// Add 3 transactions to the Pending Transactions, 79% of block, 100% of block and 10% of block
|
|
|
|
|
// should end up selecting the first and third only.
|
|
|
|
@ -393,7 +398,7 @@ public abstract class AbstractBlockTransactionSelectorTest { |
|
|
|
|
blockHeader, |
|
|
|
|
miningBeneficiary, |
|
|
|
|
Wei.ZERO, |
|
|
|
|
NO_PLUGIN_TRANSACTION_SELECTOR_FACTORY); |
|
|
|
|
transactionSelectionService); |
|
|
|
|
|
|
|
|
|
// Add 4 transactions to the Pending Transactions 15% (ok), 79% (ok), 25% (too large), 10%
|
|
|
|
|
// (not included, it would fit, however previous transaction was too large and block was
|
|
|
|
@ -427,12 +432,15 @@ public abstract class AbstractBlockTransactionSelectorTest { |
|
|
|
|
final BlockTransactionSelector selector = |
|
|
|
|
createBlockSelectorAndSetupTxPool( |
|
|
|
|
createMiningParameters( |
|
|
|
|
Wei.ZERO, MIN_OCCUPANCY_100_PERCENT, DEFAULT_NON_POA_BLOCK_TXS_SELECTION_MAX_TIME), |
|
|
|
|
transactionSelectionService, |
|
|
|
|
Wei.ZERO, |
|
|
|
|
MIN_OCCUPANCY_100_PERCENT, |
|
|
|
|
DEFAULT_NON_POA_BLOCK_TXS_SELECTION_MAX_TIME), |
|
|
|
|
transactionProcessor, |
|
|
|
|
blockHeader, |
|
|
|
|
miningBeneficiary, |
|
|
|
|
Wei.ZERO, |
|
|
|
|
NO_PLUGIN_TRANSACTION_SELECTOR_FACTORY); |
|
|
|
|
transactionSelectionService); |
|
|
|
|
|
|
|
|
|
final long minTxGasCost = getGasCalculator().getMinimumTransactionCost(); |
|
|
|
|
|
|
|
|
@ -486,12 +494,15 @@ public abstract class AbstractBlockTransactionSelectorTest { |
|
|
|
|
final BlockTransactionSelector selector = |
|
|
|
|
createBlockSelectorAndSetupTxPool( |
|
|
|
|
createMiningParameters( |
|
|
|
|
Wei.ZERO, MIN_OCCUPANCY_100_PERCENT, DEFAULT_NON_POA_BLOCK_TXS_SELECTION_MAX_TIME), |
|
|
|
|
transactionSelectionService, |
|
|
|
|
Wei.ZERO, |
|
|
|
|
MIN_OCCUPANCY_100_PERCENT, |
|
|
|
|
DEFAULT_NON_POA_BLOCK_TXS_SELECTION_MAX_TIME), |
|
|
|
|
transactionProcessor, |
|
|
|
|
blockHeader, |
|
|
|
|
miningBeneficiary, |
|
|
|
|
Wei.ZERO, |
|
|
|
|
NO_PLUGIN_TRANSACTION_SELECTOR_FACTORY); |
|
|
|
|
transactionSelectionService); |
|
|
|
|
|
|
|
|
|
final long minTxGasCost = getGasCalculator().getMinimumTransactionCost(); |
|
|
|
|
|
|
|
|
@ -543,7 +554,7 @@ public abstract class AbstractBlockTransactionSelectorTest { |
|
|
|
|
blockHeader, |
|
|
|
|
miningBeneficiary, |
|
|
|
|
Wei.ZERO, |
|
|
|
|
NO_PLUGIN_TRANSACTION_SELECTOR_FACTORY); |
|
|
|
|
transactionSelectionService); |
|
|
|
|
|
|
|
|
|
final Transaction validTransaction = createTransaction(0, Wei.of(10), 21_000); |
|
|
|
|
|
|
|
|
@ -610,6 +621,8 @@ public abstract class AbstractBlockTransactionSelectorTest { |
|
|
|
|
return SELECTED; |
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
transactionSelectionService.registerPluginTransactionSelectorFactory( |
|
|
|
|
transactionSelectorFactory); |
|
|
|
|
|
|
|
|
|
final BlockTransactionSelector selector = |
|
|
|
|
createBlockSelectorAndSetupTxPool( |
|
|
|
@ -618,7 +631,7 @@ public abstract class AbstractBlockTransactionSelectorTest { |
|
|
|
|
blockHeader, |
|
|
|
|
miningBeneficiary, |
|
|
|
|
Wei.ZERO, |
|
|
|
|
transactionSelectorFactory); |
|
|
|
|
transactionSelectionService); |
|
|
|
|
|
|
|
|
|
transactionPool.addRemoteTransactions( |
|
|
|
|
List.of(selected, notSelectedTransient, notSelectedInvalid)); |
|
|
|
@ -676,17 +689,22 @@ public abstract class AbstractBlockTransactionSelectorTest { |
|
|
|
|
return SELECTED; |
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
transactionSelectionService.registerPluginTransactionSelectorFactory( |
|
|
|
|
transactionSelectorFactory); |
|
|
|
|
|
|
|
|
|
final Address miningBeneficiary = AddressHelpers.ofValue(1); |
|
|
|
|
final BlockTransactionSelector selector = |
|
|
|
|
createBlockSelectorAndSetupTxPool( |
|
|
|
|
createMiningParameters( |
|
|
|
|
Wei.ZERO, MIN_OCCUPANCY_80_PERCENT, DEFAULT_NON_POA_BLOCK_TXS_SELECTION_MAX_TIME), |
|
|
|
|
transactionSelectionService, |
|
|
|
|
Wei.ZERO, |
|
|
|
|
MIN_OCCUPANCY_80_PERCENT, |
|
|
|
|
DEFAULT_NON_POA_BLOCK_TXS_SELECTION_MAX_TIME), |
|
|
|
|
transactionProcessor, |
|
|
|
|
blockHeader, |
|
|
|
|
miningBeneficiary, |
|
|
|
|
Wei.ZERO, |
|
|
|
|
transactionSelectorFactory); |
|
|
|
|
transactionSelectionService); |
|
|
|
|
|
|
|
|
|
transactionPool.addRemoteTransactions(List.of(selected, notSelected, selected3)); |
|
|
|
|
|
|
|
|
@ -703,9 +721,14 @@ public abstract class AbstractBlockTransactionSelectorTest { |
|
|
|
|
public void transactionSelectionPluginShouldBeNotifiedWhenTransactionSelectionCompletes() { |
|
|
|
|
final PluginTransactionSelectorFactory transactionSelectorFactory = |
|
|
|
|
mock(PluginTransactionSelectorFactory.class); |
|
|
|
|
PluginTransactionSelector transactionSelector = spy(AllAcceptingTransactionSelector.INSTANCE); |
|
|
|
|
PluginTransactionSelector transactionSelector = mock(PluginTransactionSelector.class); |
|
|
|
|
when(transactionSelector.evaluateTransactionPreProcessing(any())).thenReturn(SELECTED); |
|
|
|
|
when(transactionSelector.evaluateTransactionPostProcessing(any(), any())).thenReturn(SELECTED); |
|
|
|
|
when(transactionSelectorFactory.create()).thenReturn(transactionSelector); |
|
|
|
|
|
|
|
|
|
transactionSelectionService.registerPluginTransactionSelectorFactory( |
|
|
|
|
transactionSelectorFactory); |
|
|
|
|
|
|
|
|
|
final Transaction transaction = createTransaction(0, Wei.of(10), 21_000); |
|
|
|
|
ensureTransactionIsValid(transaction, 21_000, 0); |
|
|
|
|
|
|
|
|
@ -720,7 +743,7 @@ public abstract class AbstractBlockTransactionSelectorTest { |
|
|
|
|
createBlock(300_000), |
|
|
|
|
AddressHelpers.ofValue(1), |
|
|
|
|
Wei.ZERO, |
|
|
|
|
transactionSelectorFactory); |
|
|
|
|
transactionSelectionService); |
|
|
|
|
|
|
|
|
|
transactionPool.addRemoteTransactions(List.of(transaction, invalidTransaction)); |
|
|
|
|
|
|
|
|
@ -756,7 +779,7 @@ public abstract class AbstractBlockTransactionSelectorTest { |
|
|
|
|
blockHeader, |
|
|
|
|
miningBeneficiary, |
|
|
|
|
Wei.ZERO, |
|
|
|
|
NO_PLUGIN_TRANSACTION_SELECTOR_FACTORY); |
|
|
|
|
transactionSelectionService); |
|
|
|
|
|
|
|
|
|
final Transaction futureTransaction = createTransaction(4, Wei.of(10), 100_000); |
|
|
|
|
|
|
|
|
@ -792,7 +815,7 @@ public abstract class AbstractBlockTransactionSelectorTest { |
|
|
|
|
blockHeader, |
|
|
|
|
miningBeneficiary, |
|
|
|
|
Wei.ZERO, |
|
|
|
|
NO_PLUGIN_TRANSACTION_SELECTOR_FACTORY); |
|
|
|
|
transactionSelectionService); |
|
|
|
|
|
|
|
|
|
transactionPool.addRemoteTransactions(List.of(transaction)); |
|
|
|
|
|
|
|
|
@ -828,7 +851,7 @@ public abstract class AbstractBlockTransactionSelectorTest { |
|
|
|
|
blockHeader, |
|
|
|
|
miningBeneficiary, |
|
|
|
|
Wei.ZERO, |
|
|
|
|
NO_PLUGIN_TRANSACTION_SELECTOR_FACTORY); |
|
|
|
|
transactionSelectionService); |
|
|
|
|
transactionPool.addRemoteTransactions(List.of(transaction)); |
|
|
|
|
|
|
|
|
|
ensureTransactionIsValid(transaction, 0, 5); |
|
|
|
@ -856,7 +879,7 @@ public abstract class AbstractBlockTransactionSelectorTest { |
|
|
|
|
blockHeader, |
|
|
|
|
miningBeneficiary, |
|
|
|
|
Wei.ZERO, |
|
|
|
|
NO_PLUGIN_TRANSACTION_SELECTOR_FACTORY); |
|
|
|
|
transactionSelectionService); |
|
|
|
|
|
|
|
|
|
final TransactionSelectionResults results2 = selector2.buildTransactionListForBlock(); |
|
|
|
|
|
|
|
|
@ -884,7 +907,7 @@ public abstract class AbstractBlockTransactionSelectorTest { |
|
|
|
|
blockHeader, |
|
|
|
|
AddressHelpers.ofValue(1), |
|
|
|
|
Wei.ZERO, |
|
|
|
|
NO_PLUGIN_TRANSACTION_SELECTOR_FACTORY); |
|
|
|
|
transactionSelectionService); |
|
|
|
|
|
|
|
|
|
transactionPool.addRemoteTransactions(List.of(txSelected, txNotSelected)); |
|
|
|
|
|
|
|
|
@ -987,15 +1010,20 @@ public abstract class AbstractBlockTransactionSelectorTest { |
|
|
|
|
mock(PluginTransactionSelectorFactory.class); |
|
|
|
|
when(transactionSelectorFactory.create()).thenReturn(transactionSelector); |
|
|
|
|
|
|
|
|
|
transactionSelectionService.registerPluginTransactionSelectorFactory( |
|
|
|
|
transactionSelectorFactory); |
|
|
|
|
|
|
|
|
|
final BlockTransactionSelector selector = |
|
|
|
|
createBlockSelectorAndSetupTxPool( |
|
|
|
|
isPoa |
|
|
|
|
? createMiningParameters( |
|
|
|
|
transactionSelectionService, |
|
|
|
|
Wei.ZERO, |
|
|
|
|
MIN_OCCUPANCY_100_PERCENT, |
|
|
|
|
poaGenesisBlockPeriod, |
|
|
|
|
PositiveNumber.fromInt(75)) |
|
|
|
|
: createMiningParameters( |
|
|
|
|
transactionSelectionService, |
|
|
|
|
Wei.ZERO, |
|
|
|
|
MIN_OCCUPANCY_100_PERCENT, |
|
|
|
|
PositiveNumber.fromInt(blockTxsSelectionMaxTime)), |
|
|
|
@ -1003,7 +1031,7 @@ public abstract class AbstractBlockTransactionSelectorTest { |
|
|
|
|
blockHeader, |
|
|
|
|
miningBeneficiary, |
|
|
|
|
Wei.ZERO, |
|
|
|
|
transactionSelectorFactory); |
|
|
|
|
transactionSelectionService); |
|
|
|
|
|
|
|
|
|
transactionPool.addRemoteTransactions(transactionsToInject); |
|
|
|
|
|
|
|
|
@ -1136,15 +1164,20 @@ public abstract class AbstractBlockTransactionSelectorTest { |
|
|
|
|
mock(PluginTransactionSelectorFactory.class); |
|
|
|
|
when(transactionSelectorFactory.create()).thenReturn(transactionSelector); |
|
|
|
|
|
|
|
|
|
transactionSelectionService.registerPluginTransactionSelectorFactory( |
|
|
|
|
transactionSelectorFactory); |
|
|
|
|
|
|
|
|
|
final BlockTransactionSelector selector = |
|
|
|
|
createBlockSelectorAndSetupTxPool( |
|
|
|
|
isPoa |
|
|
|
|
? createMiningParameters( |
|
|
|
|
transactionSelectionService, |
|
|
|
|
Wei.ZERO, |
|
|
|
|
MIN_OCCUPANCY_100_PERCENT, |
|
|
|
|
poaGenesisBlockPeriod, |
|
|
|
|
PositiveNumber.fromInt(75)) |
|
|
|
|
: createMiningParameters( |
|
|
|
|
transactionSelectionService, |
|
|
|
|
Wei.ZERO, |
|
|
|
|
MIN_OCCUPANCY_100_PERCENT, |
|
|
|
|
PositiveNumber.fromInt(blockTxsSelectionMaxTime)), |
|
|
|
@ -1152,7 +1185,7 @@ public abstract class AbstractBlockTransactionSelectorTest { |
|
|
|
|
blockHeader, |
|
|
|
|
miningBeneficiary, |
|
|
|
|
Wei.ZERO, |
|
|
|
|
transactionSelectorFactory); |
|
|
|
|
transactionSelectionService); |
|
|
|
|
|
|
|
|
|
transactionPool.addRemoteTransactions(transactionsToInject); |
|
|
|
|
|
|
|
|
@ -1195,7 +1228,7 @@ public abstract class AbstractBlockTransactionSelectorTest { |
|
|
|
|
final ProcessableBlockHeader blockHeader, |
|
|
|
|
final Address miningBeneficiary, |
|
|
|
|
final Wei blobGasPrice, |
|
|
|
|
final PluginTransactionSelectorFactory transactionSelectorFactory) { |
|
|
|
|
final TransactionSelectionService transactionSelectionService) { |
|
|
|
|
|
|
|
|
|
transactionPool = createTransactionPool(); |
|
|
|
|
|
|
|
|
@ -1205,7 +1238,7 @@ public abstract class AbstractBlockTransactionSelectorTest { |
|
|
|
|
blockHeader, |
|
|
|
|
miningBeneficiary, |
|
|
|
|
blobGasPrice, |
|
|
|
|
transactionSelectorFactory); |
|
|
|
|
transactionSelectionService); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
protected BlockTransactionSelector createBlockSelector( |
|
|
|
@ -1214,7 +1247,7 @@ public abstract class AbstractBlockTransactionSelectorTest { |
|
|
|
|
final ProcessableBlockHeader blockHeader, |
|
|
|
|
final Address miningBeneficiary, |
|
|
|
|
final Wei blobGasPrice, |
|
|
|
|
final PluginTransactionSelectorFactory transactionSelectorFactory) { |
|
|
|
|
final TransactionSelectionService transactionSelectionService) { |
|
|
|
|
|
|
|
|
|
final BlockTransactionSelector selector = |
|
|
|
|
new BlockTransactionSelector( |
|
|
|
@ -1231,7 +1264,7 @@ public abstract class AbstractBlockTransactionSelectorTest { |
|
|
|
|
getFeeMarket(), |
|
|
|
|
new LondonGasCalculator(), |
|
|
|
|
GasLimitCalculator.constant(), |
|
|
|
|
transactionSelectorFactory.create(), |
|
|
|
|
transactionSelectionService.createPluginTransactionSelector(), |
|
|
|
|
ethScheduler); |
|
|
|
|
|
|
|
|
|
return selector; |
|
|
|
@ -1344,6 +1377,7 @@ public abstract class AbstractBlockTransactionSelectorTest { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
protected MiningParameters createMiningParameters( |
|
|
|
|
final TransactionSelectionService transactionSelectionService, |
|
|
|
|
final Wei minGasPrice, |
|
|
|
|
final double minBlockOccupancyRatio, |
|
|
|
|
final PositiveNumber txsSelectionMaxTime) { |
|
|
|
@ -1353,11 +1387,13 @@ public abstract class AbstractBlockTransactionSelectorTest { |
|
|
|
|
.minTransactionGasPrice(minGasPrice) |
|
|
|
|
.minBlockOccupancyRatio(minBlockOccupancyRatio) |
|
|
|
|
.build()) |
|
|
|
|
.transactionSelectionService(transactionSelectionService) |
|
|
|
|
.nonPoaBlockTxsSelectionMaxTime(txsSelectionMaxTime) |
|
|
|
|
.build(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
protected MiningParameters createMiningParameters( |
|
|
|
|
final TransactionSelectionService transactionSelectionService, |
|
|
|
|
final Wei minGasPrice, |
|
|
|
|
final double minBlockOccupancyRatio, |
|
|
|
|
final int genesisBlockPeriodSeconds, |
|
|
|
@ -1368,6 +1404,7 @@ public abstract class AbstractBlockTransactionSelectorTest { |
|
|
|
|
.minTransactionGasPrice(minGasPrice) |
|
|
|
|
.minBlockOccupancyRatio(minBlockOccupancyRatio) |
|
|
|
|
.build()) |
|
|
|
|
.transactionSelectionService(transactionSelectionService) |
|
|
|
|
.genesisBlockPeriodSeconds(genesisBlockPeriodSeconds) |
|
|
|
|
.poaBlockTxsSelectionMaxTime(minBlockTimePercentage) |
|
|
|
|
.build(); |
|
|
|
|