The observable latency of StarkEx is based not only on the actual amount of computational time required to process a given transaction, but also on several logistical factors, such as the amount of time a transaction might wait in a queue to be processed.
For more information on the processing and validation stages, see StarkEx backend architecture.
The StarkEx gateway validates transactions in parallel for stateless criteria, such as formatting and value ranges. Response latency is between 100-200 milliseconds for up to 1,000 transactions sent in parallel.
Once the gateway acknowledges that the transaction passes initial validation, you can be confident that the transaction will be executed and you can present the transaction as complete in the application’s frontend, without waiting for finalization on-chain. Exceptions are rare, but causes include bugs in one of the systems, or a reorganization of the blockchain.
StarkEx batches and validates all transactions according to more complex criteria. This stage of validation is sequential, as the validity of a transaction is often determined by its predecessors. For example, a withdrawal is only valid after a deposit.
The observable latency of this phase of validation can be a few minutes if the transaction enters the queue at the end of batch creation, or up to four hours if the transaction enters the queue at the beginning.
The maximum amount of time allocated to create a batch is configurable. The default is four hours.
If a job is the last one required to close a proof, then this phase can complete in approximately two hours. A job submitted at the beginning of a proving period must wait either for enough proofs to fill up the recursion tree, or the maximum time permitted, which is 12 hours.
After constructing the recursive proof, SHARP transmits it to the on-chain Verifier smart contract. Assuming normal gas prices, this transmission should require up to approximately 50 seconds.
Finally, StarkEx applies the state transition to your application’s smart contract. To ensure that SHARP verified it, the customer application’s smart contract corroborates that the transition statement is registered in the Verifier smart contract. This fact-polling can take up to five minutes, assuming normal gas prices.
StarkEx includes a custom mechanism to increase gas prices if necessary.