Transaction lifecycle
Transaction flow

The transaction lifecycle in Starknet involves the following high level steps:
1. Transaction Submission
A transaction is submitted to one of the gateways, functioning as the Mempool and marks the transaction status as RECEIVED
.
2. Validation
Transaction status
The diagram below illustrates how each transaction status fits into the overall transaction flow:

The following are the possible statuses of a transaction from the moment it’s sent by the user to the moment it’s validated by L1:
Finality statuses
Execution statuses
REJECTED
The transaction was received by the Mempool but failed validation in the sequencer. Such transactions will not be included in a block.
State Implications of a REVERTED
Transaction
When a transaction is marked as REVERTED
, the following state implications occur:
- Nonce increases
-
The nonce value for the account of the failed transaction will increase despite the failure.
- Fee charge
-
A fee will be charged for the execution of the transaction up to the point of failure.
- Partial Reversion
-
All changes that occurred during the
validate
stage are not reverted. However, all changes that occurred during theexecute
stage are reverted, including no messages to L1 or events. - Fee Calculation
-
The fee charged for
REVERTED
transactions will be calculated as follows:
fee = Min(max_fee, consumed_resources)
- Consumed Resources
-
The
consumed_resources
are the resources used for the execution of the transaction up to the point of failure. This includes Cairo steps, builtins, syscalls, L1 messages, events, and state diffs during thevalidate
andexecute
stages.
Transaction receipt
The transaction receipt contains:
-
Basic transaction details (block identifiers and the index within the block).
-
A summary of the execution resources used by the transaction.
-
The events emitted .
-
A list of messages sent to L1.
-
A consumed L1 message (in case the transaction invokes an L1 handler).
The following is an example of a receipt:
{
"execution_status": "SUCCEEDED",
"finality_status": "ACCEPTED_ON_L2",
"block_hash": "0x65fd9e8926b116fb51bf0955cc431cf6720ccea1afdc3769cbd39c1f5fc4973",
"block_number": 307039,
"transaction_index": 0,
"transaction": {
"transaction_hash": "0x7b5de063c4f341dacca79ceae12ff309da719a79e50e9b54b9f7c2dae3d6893",
"version": "0x1",
"max_fee": "0x2386f26fc10000",
"signature": [
"0x7bd8d271a6eef3dba6da8c5380ab880ea17b27a3c05af7ad8a3b4035dbebb64",
"0x3c5c432d64fd4777df8198baa5e40a02b532e0ba7553b913177de08478e8d4c"
],
"nonce": "0x1739",
"sender_address": "0x219937256cd88844f9fdc9c33a2d6d492e253ae13814c2dc0ecab7f26919d46",
"calldata": [
"0x1",
"0x7812357541c81dd9a320c2339c0c76add710db15f8cc29e8dde8e588cad4455",
"0x3d7905601c217734671143d457f0db37f7f8883112abd34b92c4abfeafde0c3",
"0x0",
"0x2",
"0x2",
"0x4ebba09c4dd53270868365e0064826264ea916e6901af7e05bb1758b1bf5adc",
"0x106ffe440d7c2192ec5f377b82538816e009b862a9afa9059c2e57c6a7c2242"
],
"type": "INVOKE_FUNCTION"
}
}