A question triggered by a new message from Starknet: Will increasing TPS reduce gas fees?

23-02-03 15:57
Read this article in 13 Minutes
总结 AI summary
View the summary 收起
Original author: CryptoNerdCn


(Web3 Dumbing Down Series) A question triggered by a new message from Starknet: Will increasing TPS reduce gas fees? This article is a submission to @StarkNetAstroCN.


Web3 Dumbing Down Series is a popular science series aimed at non-technical people. It uses misunderstandings of some knowledge and concepts in daily communication as a starting point, and aims to make it easy to understand even when your brain is in a dumbing down state after a busy day. The series focuses on design concepts rather than external performance, and tries to avoid specific formulas and code. It will start in 2023.


Last month, @Starknet announced that they are developing a new open-source Sequencer, called blockifier, written in Rust.



When MAX, a practitioner in the encryption industry, saw this message, he immediately shared it with enthusiasm in the Astro group. Then I called him to do his homework:



So, why is it wrong to say that the new sequencer can reduce gas?


Let's first take a brief look at the architecture of StarkNet and the position and function of the Sequencer within the architecture.



Sequencer is responsible for managing and coordinating the execution order of transactions. Sequencer can be thought of as a transaction queue, which ensures that all transactions within the same block are executed in the specified order and ensures that no transaction is executed repeatedly. Sequencer is also responsible for verifying the validity of transactions and writing them to the blockchain.


Prover is responsible for generating cryptographic proofs about the validity of the execution trace of the Sequence. Currently, this task is performed by a single Prover, namely "Share Prover" or "SHARP".


Verifier is located on L1 and is used to verify the proofs generated by Starknet Prover smart contracts. If successful, it will update the state on Ethereum L1 for record keeping.


If you are not familiar with ZK-related knowledge, you can imagine the sequencer as part of the Ethereum client (as shown in the figure) like Max did.



So the question is, can the improvement of Ethereum client performance bring about a reduction in gas consumption?


To answer this question, we need to know what gas is:


In Ethereum, Gas is a pricing unit used to measure the cost of executing smart contracts on the Ethereum network. Gas is used to offset the computational and network resources required to execute smart contracts.


When executing a smart contract, each operation requires a certain amount of Gas to be consumed. The amount of Gas consumed by each operation can be calculated by the EVM opcodes required to execute it (refer to Evm opCodes Gas cost for specific values). The sender of the smart contract execution needs to prepay the Gas fee in the transaction to ensure that the miner has the incentive to execute the smart contract.


If Gas is used up during the execution process, the smart contract will stop executing. Therefore, the sender needs to estimate the required Gas amount to avoid transaction failure.


Gas prices are dynamic and change with the congestion of the Ethereum network. During busy times, gas prices may rise, while during idle times they may decrease.


Therefore, Gas is a mechanism that ensures the execution of smart contracts and it has two responsibilities:


1. The gas mechanism is a mechanism that ensures computing resources are not abused.

2, the gas mechanism is a bidding mechanism.


Obviously, improving the performance of the client does not directly lead to a decrease in gas. As mentioned above, on the EVM, the gas consumed by each step of calculation is determined by the opcodes that need to be executed, and the gas consumed by each opcode is fixed. The performance of the client only affects the speed of opcode execution, and does not affect the number of gas consumed by the opcode itself. Therefore, we can say that the increase in TPS caused by the improvement of client performance will not directly affect gas consumption.


However, improving the performance of the client can indirectly reduce gas consumption. Why is this so?


Because gas is also a bidding mechanism. I believe everyone knows that on Ethereum, in addition to the gas consumed by the transaction itself, you can speed up your transaction by paying more gas, that is, Priority fee (tips, transaction fee). The more tips you add, the more likely it is to be executed first. Adding tips is generally due to the following two situations:


1. You need to rush, for example, with MEV bots, or when regular users rush to mint limited NFTs.


2, the network is too congested, even a simple operation requires you to wait for an unacceptable amount of time.


For the first scenario, improving client performance does not have much significance in reducing your own gas unless it is a self-built node. The second scenario is more common, which is low TPS - exactly what the Rust rewrite sequencer mentioned in the news wants to improve.


For example, this is like queuing for rides in an amusement park. If the wait time for a ride is one or two hours, visitors who are willing to spend money will consider buying a fast pass. Improving client performance is like expanding the capacity of the amusement park ride, allowing it to accommodate several times more visitors at once. With the total number of visitors remaining the same, the wait time will be greatly reduced, and the need for a fast pass will be less necessary.


Therefore, improving client performance actually reduces the gas consumption spent on such tips.


But when we return to the topic of StarkNet's sequencer, can the above conclusion still apply? Unfortunately, not yet.


Before the release of the new open-source sequencer blockifier, StarkNet Alpha was running on a closed-source highly centralized sequencer that strictly ordered transactions according to FIFO (first in, first out), without any Priority fee mechanism to adjust transaction order.


And the new sequencer, blockifier, according to the current code, does not have any mechanism related to Priority fee, so it is still FIFO. Therefore, it is obvious that the development of the new sequencer will not affect gas consumption on StarkNet in the short term.


However, according to @milancermak, a senior enthusiast, StarkNet may introduce a priority fee market in the future.


Finally, at the strong request of Max (which didn't actually happen), I will advertise Starknet Astro:


Starknet Astro is the most creative media of Starknet, providing the most cutting-edge and in-depth ecological research. We are maintaining a Starknet knowledge base.


Original Link


欢迎加入律动 BlockBeats 官方社群:

Telegram 订阅群:https://t.me/theblockbeats

Telegram 交流群:https://t.me/BlockBeats_App

Twitter 官方账号:https://twitter.com/BlockBeatsAsia

举报 Correction/Report
Choose Library
Add Library
Cancel
Finish
Add Library
Visible to myself only
Public
Save
Correction/Report
Submit