## Keyboard shortcuts

Press `←` or `→` to navigate between chapters

Press `S` or `/` to search in the book

Press `?` to show this help

Press `Esc` to hide this help

- Auto
- Light
- Dark

# Algorand Specifications

This function determines which transaction groups should be passed to the pending [Block Evaluator](https://specs.algorand.co/ledger/non-normative/ledger-nn-block-commitment) for possible inclusion in the next block, and which ones should be deferred for evaluation in a future round.

When deferring transactions, the node checks that their remaining validity period is sufficient for future inclusion; otherwise, they are marked for removal if they exceed their validity period.

The TxPoolTxPool also verifies that each transaction group meets the minimum required fee to qualify for execution.

A BlockEvaluatorBlockEvaluator is the construct used to ingest TxnGroupTxnGroup.

The following pseudocode snippet illustrates how this ingestion process could be implemented:

* * *

Algorithm 4: Transaction Ingestion

1: function Ingest(TxnGroup gtx)
2: …
3: if ¬BlockEvaluator then
4: return No pending Block Evaluator exists
5: endif
6: if ¬recompute then
7: r ← Ledger.getLatestRound()
8: t* ← now() + δnewBlock
9: while BlockEvaluator.round() ≤ r ∧ now() < t* do
10: Give time to the BlockEvaluator to catch up
11: end while
12: if ¬CheckSufficientFee(gtx) then
13: return gtx Discarded for insufficient fees
14: endif
15: endif
16: TxPool ← BlockEvaluator.add(gtx)
17: …
18: end function

* * *

> Transaction ingestion [reference implementation](https://github.com/algorand/go-algorand/blob/b6e5bcadf0ad3861d4805c51cbf3f695c38a93b7/data/pools/transactionPool.go#L440).

This algorithm requires a pending BlockEvaluatorBlockEvaluator to be already initialized and ready to process transaction groups.

It uses a recomputerecompute flag to verify whether the `Update` function has handled the latest block. If not, the algorithm enters a wait phase, controlled by the δNBδNB parameter (as described in the [parameters section](https://specs.algorand.co/ledger/non-normative/ledger-nn-txpool-parameters)).

This waiting period can end early if the pending BlockEvaluatorBlockEvaluator catches up to the current round. Once synchronized, the algorithm performs a preliminary check to ensure that the candidate transaction group gtx is adequately funded, per the [fee prioritization rules](https://specs.algorand.co/ledger/non-normative/ledger-nn-txpool-prioritization).

Finally, an attempt is made to add gtx to the pending BlockEvaluatorBlockEvaluator. After evaluating gtx and performing all necessary checks, this step effectively enqueues the transaction group into the TxPool.
