$$ \newcommand \TxTail {\mathrm{TxTail}} $$
State Delta
A State Delta represents the changes made to the Ledger’s state from one round to the next.
It is a compact data structure designed to efficiently update all state Trackers after a block is committed. By recording only the parts of the state that were modified, it also simplifies block assembly and validation.
For a formal definition of this structure, refer to the Algorand Ledger normative specification.
⚙️ IMPLEMENTATION
State Delta reference implementation.
In the go-algorand
reference implementation, a State Delta includes the following
fields:
-
AccountStateDeltas
:
A set ofAccount State Deltas
, collecting changes to accounts affected by the block, detailing how their states were modified. -
KVMods
:
A key-value map of modified entries in the Key Value Store, represented as(string → KvValueDelta)
. -
TxIDs
:
A mapping of new transaction IDs to theirLastValid
round:(txid → uint)
. This is used to update the \( \TxTail \) and manage the transaction counter. -
Txleases
:
A mapping(TxLease → uint64)
of new transaction leases to their expiration rounds, also relevant to the \( \TxTail \) mechanism. -
Creatables
:
A mapping of data about newly created or deleted “creatable entities” such as Applications and Assets. -
*Hdr
:
A read-only reference to the header of the new block. -
StateProofNext
:
Reflects any update to theStateProofNextRound
in the block header. If the block includes a valid State Proof transaction, this is set to the next round for a proof; otherwise, it’s set to \( 0 \). -
PrevTimestamp
:
Stores the timestamp of the previous block as an integer. -
AccountTotals
:
A snapshot of the updated account totals resulting from the changes in this State Delta.