starknet_api_openrpc.json
in the starknet-specs
GitHub repository
DECLARE | Introduces a new contract class to Starknet, enabling other contracts to either deploy instances of it or use it via a library call For more information about contract classes and instances, see the Cairo Book. |
INVOKE | Invokes a function in an existing contract instance, undergoing validation and execution initiated by the caller account’s __validate__ and __execute__ functions (respectively).The validation stage verifies that the caller account approves the transaction. Because an account’s __validate__ and __execute__ functions can contain any logic, the caller account ultimately determines how to handle the INVOKE transaction. |
DEPLOY_ACCOUNT | Deploys a new account contract to Starknet. For more information about deploying a new account, see Accounts. |
L1HandlerTransaction
type is also a valid transaction type within Starknet, be it cannot be broadcast through the Starknet API like other transaction types, as it was specifically designed for internal Starknet operations (particularly, handling messages from L1 to L2).The DEPLOY
transaction type existed in Starknet for deploying account before being replaced by DEPLOY_ACCOUNT
. DEPLOY
only had one version (v0) and is now unsupported by Starknet.Type | Current version | Deprecated versions | Unsupported versions |
---|---|---|---|
INVOKE | v3 | None | v1, v0 |
DECLARE | v3 | None | v2, v1, v0 |
DEPLOY_ACCOUNT | v3 | None | v1 |
max_fee
value, assuring the transaction’s calldata length is within the legal limit, and more. If the transaction is invalid, it does not proceed.
INVOKE
and DEPLOY_ACCOUNT
transactions and for DECLARE
transactions (i.e., no declares with future nonces)
tip
and max_l2_gas_price
increased by at least 10%
DECLARE
transactions time-to-mature (TTM): Before being inserted into the mempool, DECLARE
transactions are sent to a “waiting room” until they exceed their TTM, where TTM < TTL but is still TBD. While in the “waiting room”, DECLARE
transactions can’t be replaced, and transactions sent with the same nonce as a transaction in the “waiting room” by the same account are rejected
Type | Status | Description |
---|---|---|
Finality | NOT_RECEIVED | The transaction is not yet known to the sequencer. |
RECEIVED | The transaction was received by the mempool. The transaction is now either executed successfully, rejected, or reverted. | |
REJECTED | The transaction was received by the mempool but failed the validation by the sequencer. Such transactions are not included in a block. A rejected transaction is stored in the mempool. You cannot send another transaction with the same transaction hash. | |
ACCEPTED_ON_L2 | The transaction was executed and included in a block. | |
ACCEPTED_ON_L1 | The transaction was accepted on Ethereum. | |
Execution | REVERTED | The transaction passed validation but failed during the execution by the sequencer, and is included in a block as reverted. Since the DEPLOY_ACCOUNT and DECLARE transactions don’t have an execution phase, they cannot be reverted. |
SUCCEEDED | The transaction was successfully executed by the sequencer and is included in a block. |
Type | Status | Description |
---|---|---|
Finality | NOT_RECEIVED | The transaction is not yet known to any sequencer. |
RECEIVED | A full node has successfully submitted the transaction to a sequencer. As there is currently no P2P protocol between full nodes for updating on each other about received transactions, querying a different node than the one that submitted the transaction for its status will result in a Transaction hash not found error. Therefore, relying on RECEIVED statuses requires initiating sticky HTTP sessions with your full node provider. | |
CANDIDATE | The transaction was written to the feeder gateway’s storage by a sequencer. As the transaction hasn’t been executed yet, no execution information is available and only the transaction hash is written to the feeder gateway’s storage. | |
PRE_CONFIRMED | The transaction was successfully executed by a sequencer and its receipt was written to the feeder gateway’s storage. | |
ACCEPTED_ON_L2 | The transaction was included in a block finalized by the consensus protocol. | |
ACCEPTED_ON_L1 | The Starknet state on L1 moved to a block height which is greater than or equal to the height of the block containing the transaction. | |
Execution | REVERTED | The transaction failed during execution by a sequencer, and was included in a block as reverted. Since the DEPLOY_ACCOUNT and DECLARE transactions don’t have an execution phase, they cannot be reverted. |
SUCCEEDED | The transaction was successfully executed by a sequencer and is included in a block. |
REVERTED
, the following state implications occur:
Nonce increases | The nonce value for the account of the failed transaction iterates despite the failure. |
Fee charge | The sequencer charges a fee for the execution of the transaction up to the point of failure, and a respective Transfer event is emitted. |
Partial reversion | All changes that occurred during the validation stage are not reverted. However, all changes that occurred during the execution stage are reverted, including all messages to L1 or any events that were emitted during this stage. Events might still be emitted from the validation stage or the fee charge stage. |
Fee calculation | The fee charged for REVERTED transactions is the smaller of the following two values:• The maximum fee that the user is willing to pay, either max_fee (pre-v3 transactions) or (v3 transactions).• The total consumed resources. Consumed resources are resources used for the execution of the transaction up to the point of failure, including Cairo steps, builtins, syscalls, L1 messages, events, and state diffs during the validation and execution stages. |
starknet_getTransactionReceipt
endpoint and contains the following fields:
transaction_hash | The hash of the transaction. |
actual_fee | The actual fee paid for the transaction. |
finality_status | The finality status of the transaction. |
execution_status | The execution status of the transaction. |
block_hash | The hash of the block that includes the transaction |
block_number | The sequential number of the block that includes the transaction |
messages_sent | A list of messages sent to L1. |
events | The events emitted. |
execution_resource | A summary of the execution resources used by the transaction. |
type | The type of the transaction. |