Class TransactionSelectionResult

java.lang.Object
org.hyperledger.besu.plugin.data.TransactionSelectionResult

public class TransactionSelectionResult extends Object
Represent the result of the selection process of a candidate transaction, during the block creation phase.
  • Field Details

    • SELECTED

      public static final TransactionSelectionResult SELECTED
      The transaction has been selected to be included in the new block
    • SELECTED_ROLLBACK

      public static final TransactionSelectionResult SELECTED_ROLLBACK
      Relate to transactions that are evaluated in group (aka bundle), when a previously selected transaction decision is reverted due to the selection result of a following transaction in the same group
    • BLOCK_FULL

      public static final TransactionSelectionResult BLOCK_FULL
      The transaction has not been selected since the block is full.
    • BLOBS_FULL

      public static final TransactionSelectionResult BLOBS_FULL
      The block already contains the max number of allowed blobs.
    • SELECTION_CANCELLED

      public static final TransactionSelectionResult SELECTION_CANCELLED
      The block creation has been cancelled
    • BLOCK_SELECTION_TIMEOUT

      public static final TransactionSelectionResult BLOCK_SELECTION_TIMEOUT
      There was no more time to add transaction to the block
    • BLOCK_SELECTION_TIMEOUT_INVALID_TX

      public static final TransactionSelectionResult BLOCK_SELECTION_TIMEOUT_INVALID_TX
      There was no more time to add transaction to the block, and the transaction is invalid
    • PLUGIN_SELECTION_TIMEOUT

      public static final TransactionSelectionResult PLUGIN_SELECTION_TIMEOUT
      There was no more time for plugins to add transaction to the block
    • PLUGIN_SELECTION_TIMEOUT_INVALID_TX

      public static final TransactionSelectionResult PLUGIN_SELECTION_TIMEOUT_INVALID_TX
      There was no more time for plugins to add transaction to the block, and the transaction is invalid
    • TX_EVALUATION_TOO_LONG

      public static final TransactionSelectionResult TX_EVALUATION_TOO_LONG
      Transaction took too much to evaluate, but it was valid
    • INVALID_TX_EVALUATION_TOO_LONG

      public static final TransactionSelectionResult INVALID_TX_EVALUATION_TOO_LONG
      Transaction took too much to evaluate, and it was invalid
    • INTERNAL_ERROR

      public static final TransactionSelectionResult INTERNAL_ERROR
      There was an unhandled exception during the evaluation of the transaction. If this occurs, it indicates there is a bug somewhere.
    • TX_TOO_LARGE_FOR_REMAINING_GAS

      public static final TransactionSelectionResult TX_TOO_LARGE_FOR_REMAINING_GAS
      The transaction has not been selected since its gas limit is greater than the block remaining gas, but the selection should continue.
    • TX_TOO_LARGE_FOR_REMAINING_BLOB_GAS

      public static final TransactionSelectionResult TX_TOO_LARGE_FOR_REMAINING_BLOB_GAS
      The transaction has not been selected since there is not enough remaining blob gas in the block to fit the blobs of the tx, but selection should continue.
    • TOO_LARGE_FOR_REMAINING_BLOCK_SIZE

      public static final TransactionSelectionResult TOO_LARGE_FOR_REMAINING_BLOCK_SIZE
      The transaction has not been selected since there is not enough remaining block bytes in the block to fit the transaction, but selection should continue.
    • BLOCK_ACCESS_LIST_ITEM_BUDGET_EXCEEDED

      public static final TransactionSelectionResult BLOCK_ACCESS_LIST_ITEM_BUDGET_EXCEEDED
      The transaction has not been selected because merging its execution access view would exceed the EIP-7928 block access list item budget for the pending block gas limit, but selection should continue.
    • CURRENT_TX_PRICE_BELOW_MIN

      public static final TransactionSelectionResult CURRENT_TX_PRICE_BELOW_MIN
      The transaction has not been selected since its current price is below the configured min price, but the selection should continue.
    • BLOB_PRICE_BELOW_CURRENT_MIN

      public static final TransactionSelectionResult BLOB_PRICE_BELOW_CURRENT_MIN
      The transaction has not been selected since its blob price is below the current network blob price, but the selection should continue.
    • PRIORITY_FEE_PER_GAS_BELOW_CURRENT_MIN

      public static final TransactionSelectionResult PRIORITY_FEE_PER_GAS_BELOW_CURRENT_MIN
      The transaction has not been selected since its priority fee is below the configured min priority fee per gas, but the selection should continue.
    • SENDER_WITH_PREVIOUS_TX_NOT_SELECTED

      public static final TransactionSelectionResult SENDER_WITH_PREVIOUS_TX_NOT_SELECTED
      The transaction has not been selected since its sender already had a previous transaction not selected
  • Constructor Details

    • TransactionSelectionResult

      protected TransactionSelectionResult(TransactionSelectionResult.Status status)
      Create a new transaction selection result with the passed status
      Parameters:
      status - the selection result status
    • TransactionSelectionResult

      protected TransactionSelectionResult(TransactionSelectionResult.Status status, String invalidReason)
      Create a new transaction selection result with the passed status and invalid reason
      Parameters:
      status - the selection result status
      invalidReason - string with a custom invalid reason
  • Method Details

    • invalidTransient

      public static TransactionSelectionResult invalidTransient(String invalidReason)
      Return a selection result that identify the candidate transaction as temporarily invalid, this means that the transaction could become valid at a later time.
      Parameters:
      invalidReason - the reason why transaction is invalid
      Returns:
      the selection result
    • invalidPenalized

      public static TransactionSelectionResult invalidPenalized(String invalidReason)
      Return a selection result that identify the candidate transaction as temporarily invalid and that it should be penalized, this means that the transaction could become valid at a later time.
      Parameters:
      invalidReason - the reason why transaction is invalid
      Returns:
      the selection result
    • invalid

      public static TransactionSelectionResult invalid(String invalidReason)
      Return a selection result that identify the candidate transaction as permanently invalid, this means that it could be removed safely from the transaction pool.
      Parameters:
      invalidReason - the reason why transaction is invalid
      Returns:
      the selection result
    • stop

      public boolean stop()
      Is the block creation done and the selection process should stop?
      Returns:
      true if the selection process should stop, false otherwise
    • discard

      public boolean discard()
      Should the candidate transaction removed from the transaction pool?
      Returns:
      true if the candidate transaction should be removed from transaction pool, false otherwise
    • penalize

      public boolean penalize()
      Should the score of this transaction be decremented?
      Returns:
      yes if the score of this transaction needs to be decremented
    • selected

      public boolean selected()
      Is the candidate transaction selected for block inclusion?
      Returns:
      true if the candidate transaction is included in the new block, false otherwise
    • maybeInvalidReason

      public Optional<String> maybeInvalidReason()
      Optionally return the reason why the transaction is invalid if present
      Returns:
      an optional with the invalid reason
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object