Interface BlockTransactionSelectionService
public interface BlockTransactionSelectionService
A service that can be used by plugins to include their pending transactions during block
creation. Proposed pending transactions need to be first evaluated and based on the result of the
evaluation of one or more pending transactions the plugin can apply its logic to commit or not
the inclusion of the evaluated in the block.
The process of including plugin proposed pending transactions starts when PluginTransactionSelectorFactory.selectPendingTransactions(BlockTransactionSelectionService, ProcessableBlockHeader, List) is called.
-
Method Summary
Modifier and TypeMethodDescriptionbooleancommit()Commit the changes applied by all the evaluated pending transactions since the previous commit.evaluatePendingTransaction(org.hyperledger.besu.datatypes.PendingTransaction pendingTransaction) Evaluate a plugin proposed pending transaction for block inclusionvoidrollback()Rollback the changes applied by all the evaluated pending transactions since the previous commit.
-
Method Details
-
evaluatePendingTransaction
TransactionSelectionResult evaluatePendingTransaction(org.hyperledger.besu.datatypes.PendingTransaction pendingTransaction) Evaluate a plugin proposed pending transaction for block inclusion- Parameters:
pendingTransaction- the pending transaction proposed by the plugin- Returns:
- the result of the evaluation
-
commit
boolean commit()Commit the changes applied by all the evaluated pending transactions since the previous commit. As part of thisPluginTransactionSelectorstate of commited.- Returns:
- false only if a timeout occurred during the selection of the pending transaction, meaning that the pending transaction is not included in the current block
-
rollback
void rollback()Rollback the changes applied by all the evaluated pending transactions since the previous commit.As part of this
PluginTransactionSelectorstate of rolled back.
-