Starknet Quantum Leap Upgrade: Will this update unlock 100 TPS?
The first phase of the Starknet Quantum Leap upgrade went live on Wednesday (July 12). It resulted in a peak of 54 transactions per second, among the fastest speeds ever seen for a single block on Layer 2.
However, this is just the start of Starknet’s evolution. Wednesday’s upgrade, Cairo v0.12.0, is the first in a series designed to dramatically accelerate Starknet’s TPS. The ultimate goal is to create the fastest rollup in crypto, combining web2 speed with web3 possibilities.
v0.12.0 focused on the Starknet sequencer, replacing the original Python version with a more dynamic alternative written in Rust. The next wave of improvements will include a greater focus on process efficiency – and one particular improvement will be crucial.
v0.12.1., the next stage of the Quantum Leap upgrade, will address the way the network handles failed transactions, a key drag on Starknet’s TPS to this point. Rejected transactions will incur a fee, first in a trusted manner and later in a trustless one. In fact, they will be part of the proof sent to Layer 1.
This will provide a deterrent to anyone who wishes to disrupt the network or has been sloppy in their submission. Above all, it will create more capacity for the sequencer to process genuine, valid trades.
Why does Starknet need to address this problem?
At present, there are no costs for failed transactions on Starknet. This allows people to send erroneous transactions for either malicious or non-malicious reasons, with no consequences.
- Bots can send hundreds of transactions, even though they fail constantly, in the hope of gaining a trading advantage. For example, when trying to gain arbitrage from an automated market maker (AMM), a user may send a transaction with a high expected return. If the transaction succeeds (perhaps another user had previously moved the price with a big swap) then the user will earn money. If not, nothing will happen and the user will not lose anything, so there is no downside.
- Malicious actors can mount a malicious DOS attack which floods the sequencer with spam transactions. This drains computation capacity, while leaving legitimate transactions clogged up in the mempool (the holding bay that stores transactions before they are taken by the sequencer and added to blocks).
So even if a transaction fails mid-execution, the sequencer must be able to add it to a block and charge fees on all the computations performed up to the point of failure, thereby creating disincentives for those trying to jam the system.
However, Starknet’s initial alpha design did not meet this need.
The first version of Cairo, the language used to write Starknet’s smart contracts, is incapable of proving reverted transactions natively. As Starknet notes, Cairo 0 contains no separating layer between user code and what is being proven. So users can write code that is unprovable.
This means that either:
- A transaction is valid and can be included in a proof, thus fees can be charged.
- It is unprovable and cannot be included, so no fees are charged.
How is the Starknet Quantum Leap Upgrade solving this problem?
Starknet plans to introduce a validation stage to the mempool to prevent invalid transactions from draining sequencer time. Furthermore, transactions that fail during execution will be added to the block, with the status REVERTED.
The new structure will be implemented over two stages.
At first, the inclusion of failed transactions will operate on a trusted basis, meaning they will not be proved.
However, in version 0.15.0, Starknet will introduce the ability to prove failed transactions, transitioning the process to a trustless framework. This means failed transactions will be part of the state and they will be proved and verified on Layer 1.
So will this upgrade catapult Starknet to 100TPS?
It’s hard to predict with certainty right now. The Starknet TPS may have passed 50 after the initial v0.12.0 update shipped on Wednesday, but further acceleration will depend on a range of factors.
What we can say with certainty, however, is that the inclusion of failed transactions in Starknet’s proofs as part of the Quantum Leap upgrade will release a huge amount of computing power.
In a recent tweet, Starknet noted that “rejected transactions sometimes represent >50% of the work of the sequencer. And those transactions are not necessarily malicious!
“Most likely, they are accounts that send a lot of transactions that fail, and don’t get charged for this. So they have little incentive to fix their scripts.”
In a separate blog post, Starknet claimed that up to 66% of sequencer capacity is being wasted on transactions that don’t reach the block.
Now a vast chunk of that capacity will be freed up for legitimate transactions and committed users, who want to make Starknet the best Layer 2 rollup in crypto.