Run Times - 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
- Auto
- Light
- Dark
Algorand Specifications
The Algorand Virtual Machine has two run-time (execution) modes:
Logic Signature (or Stateless) mode: executes Logic Signatures,
Application (or Stateful) mode: executes Smart Contracts.
For further details about the execution modes, refer to the AVM normative specification.
Each mode differs in opcode availability, Ledger resources accessibility, program sizes, and computational budget.
The following diagram shows the general flow when a Logic Signature is executed, starting from a transaction message reception in the Network Layer, going through the AVM for program execution, and all the way up to the transaction approval and subsequent push into the Transaction Pool, to be added to an upcoming block’s payset.
TxPoolAVMSigVerifierRateLimiterMessageCacheTxHandlerNetworkTxPoolAVMSigVerifierRateLimiterMessageCacheTxHandlerNetworkIncoming messageCheck forduplicate messagereturnsRate Limit CheckreturnsVerify LogicSigRun LogicSigreturnsreturnsPush verified tx to pool
The following diagram shows the execution path of a transaction containing a call to an Application. Note that code execution is done in a different pipeline; applications being stateful, a full block context is needed to evaluate their correctness, and so code execution happens at block evaluation time.
For further details on the block evaluation stage, see the Ledger non-normative specifications.
AVMTxTxGroupBlockEvaluatorAVMTxTxGroupBlockEvaluatorEval groupEval transactionApplication callreturnsreturnsreturns
A special way of executing an application is the internal cross-application call, (itxn_begin opcode).
Note that the beginning of this flow is the same as in a regular application call, as this constitutes a subcase of an Application mode call.
InternalTxInternalTxGroupAVMTxTxGroupBlockEvaluatorInternalTxInternalTxGroupAVMTxTxGroupBlockEvaluatorEval groupEval transactionApplication callitxn_beginProcess eachtransactionProcess ApplicationCall transactionreturnsreturnsreturnsreturnsreturnsreturns