Update - Algorand Specifications

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

Algorand Specifications

The Update function is called each time a new block is confirmed.

During this process, the TxPool removes all transactions that have either already been committed or whose lastValid field has expired.

The adjustment of the fee prioritization mechanism depends on how many full blocks are currently pending in the TxPool queue.

The state of the TxPool is then updated as follows:


Algorithm 3: Update TxPool

1: function Update(newBlock b, stateDeltas d)
2:    if TxPool is empty or outdated then
3:        switch TxPool.pendingFullBlocks
4:            case 0:
5:                feeThresholdMultiplier ← FeeMul FeeExp
6:            case 1:
7:                Intentionally left blank to maintain the value of feeThresholdMultiplier
8:            case default:
9:                if feeThresholdMultiplier = 0 then
10:                   feeThresholdMultiplier ← 1
11:               else
12:                   feeThresholdMultiplier ← feeThresholdMultiplier ⋅ expFeeFactor
13:               end if
14:       end switch
15:   end if
16:   TxPool.Prune(b, d)
17: end function

IMPLEMENTATION: Update on a new block reference implementation.

The algorithm above updates the feeThresholdMultiplier based on the current state of the pending queue. Specifically, it checks whether the queue is either empty (no leftover transactions from the previous block assembly) or outdated (i.e., the remaining transactions were grouped into full blocks from a round r such that r ≥ r_p, where r is the current round).

The adjustment logic works as follows:

After updating the fee prioritization mechanism, the TxPool is pruned by removing: