Bitget App
Trade smarter
Buy cryptoMarketsTradeCopyBotsEarnWeb3

Vitalik's new article: Multi-dimensional Gas pricing will bring wider applications

BlockBeats2024/05/10 04:26
By:BlockBeats
Original title: Multidimensional gas pricing
Original author: Vitalik Buterin
Original translation: Asher, Odaily Planet Daily


In the Ethereum network, resources are limited and priced through a single resource called "Gas". Gas is a measure of the "computational effort" required to process a specific transaction or block. Gas incorporates multiple types of "effort", the most important of which are:


· Raw computation (such as ADD, MULTIPLY)

· Reading and writing Ethereum storage (such as SSTORE, SLOAD, ETH transfers)

· Data bandwidth

· The cost of generating block ZK-SNARK proofs


For example, this transaction cost a total of 47085 Gas. This includes: (i) a "base fee" of 21,000 Gas; (ii) 1,556 Gas for the calldata bytes that are part of the transaction; (iii) 16,500 Gas for reading and writing storage; (iv) 2,149 Gas for logs; and the rest for EVM execution. The transaction fee that a user must pay is proportional to the Gas consumed by the transaction. A block can contain a maximum of 30 million Gas, and the Gas price is constantly adjusted through the EIP-1559 target mechanism to ensure that blocks contain an average of 15 million Gas.


Demonstration Case


This approach has a major advantage: since all transactions are merged into a single virtual resource, market design is very simple. It is easy to optimize transactions to minimize costs, it is relatively easy to optimize blocks to charge the highest possible fees (excluding MEV), and there are no strange incentives to encourage certain transactions to be bundled with other transactions to save fees.


But this approach also suffers from a major inefficiency: it treats different resources as convertible into each other, when the actual fundamental limits on what the network can handle are not. One way to understand this problem is to look at the following diagram:



If there are clear safety limits on the n resources, then one-dimensional Gas could reduce throughput by up to a factor of n. As a result, there has been a long-standing interest in the concept of multi-dimensional Gas, and with EIP-4844, we can actually use multi-dimensional Gas on Ethereum today. This post explores the benefits of this approach, and the prospects for improving it further.


Blobs: Multidimensional Gas after Cancun


At the beginning of the year, the average block size was 150 kB. A large portion of this was calldata: L2 protocols that store data on-chain for security purposes. This data is expensive: while transactions on calldata are 5-10x cheaper than corresponding transactions on Ethereum L1, even this cost is prohibitive for many use cases.


This problem was ultimately solved by introducing a separate, calldata-friendly space in each block, called "Blobs".


After Cancun, an Ethereum block can contain at most (i) 30 million Gas and (ii) 6 Blobs, each of which can contain about 125 kB of calldata. Both resources have independent prices, regulated by independent pricing mechanisms similar to EIP-1559, targeting an average of 15 million Gas and 3 Blobs per block.


Thus, convolution is 100x cheaper, and convolution transactions are more than 3x larger, while the theoretical maximum block size has only increased slightly: from 1.9MB to 2.6MB.


Rolling transaction fees, courtesy of growthepie.xyz. The Dencun fork occurred on March 13, 2024, and introduced multi-dimensionally priced Blobs


Multi-dimensional Gas and Stateless Clients


In the future, stateless clients will face the problem of storage proof. Stateless clients are a new type of client that is able to verify the blockchain while storing little or no data locally. It accepts proofs to verify the Ethereum state of a specific part of a block without storing any data itself.


A block performs about 1,000 storage read and write operations on average, but the theoretical maximum could be tens of millions. The current plan is to support stateless clients by migrating Ethereum's state tree design from a Merkle Patricia tree to a Verkle tree. However, the Verkle tree is not quantum-resistant and does not work with the newer STARK proof system.


Therefore, many people hope to support stateless clients through binary Merkle trees and STARKs, either skipping Verkle entirely or upgrading a few years after the Verkle migration. Although STARK proofs for binary hash tree branches have many advantages, the slow speed of generating proofs cannot meet the needs of high speed.


It is expected that there will be a time in the future when it is possible to prove 1000 values in less than a second, but it is impossible to prove 14,285 values at the same speed. To address this problem, the concept of multi-dimensional Gas was proposed. This approach can limit and charge storage access separately, ensuring an average of 1000 storage accesses per block, while setting a limit of 2000 per block to improve the security and efficiency of the network.


Wider Applications of Multi-Dimensional Gas


State size growth is another resource to consider. When increasing the size of the Ethereum state, full nodes need to hold more data. Unlike other resources, the limit on state size growth is mainly derived from long-term sustained usage rather than short-term peaks. Therefore, in order to handle operations with state size growth, a separate Gas dimension can be considered. The goal of this approach is to set a floating price that targets a specific average usage rather than setting a limit per block.


This demonstrates the power of multi-dimensional Gas, which allows different questions to be asked for each resource: (i) what is the ideal average usage of each resource; and (ii) what is the safe maximum usage of each resource per block. By setting these parameters, the price of Gas can be adjusted based on the security of the network, rather than based on the maximum usage per block. When dealing with more complex cases, multiple Gas can be used. For example, a zero to non-zero SSTORE operation may require the consumption of different types of Gas, such as stateless client proof Gas and storage expansion Gas.


Maximum per transaction: A weaker but simpler strategy for obtaining multi-dimensional Gas


In a single-dimensional Gas system, the Gas cost of a transaction is determined based on the Gas consumed by both data and computation. However, in a multi-dimensional Gas system, the Gas cost can be determined based on the primary resource consumed by the transaction. This approach improves throughput while maintaining security.


EIP-7623 proposed a similar solution, reducing the space taken up by transactions in blocks by increasing the minimum price per byte, but this also led to some problems, such as individual resource-intensive transactions still having to pay high fees, and also created an incentive for data-intensive and compute-intensive transactions to be bundled together to save costs. While this approach has its limitations, the benefits are worth it, but there are more ideal solutions if you are willing to invest more development work.


Multidimensional EIP-1559: A more difficult but more ideal strategy


At its core, Multidimensional EIP-1559 adjusts the base fee of Blobs by tracking the excess_blobs parameter to ensure that the average usage of blocks remains at a target level.


When a block contains more blobs than the target, the base fee increases to reduce usage, and decreases if it does not. This pricing mechanism allows transaction prices within a block to dynamically adjust to keep the block half-filled. At the same time, short-term spikes in usage will trigger the limit mechanism, ensuring reasonable competition for transactions.


Gas has been priced this way in Ethereum for many years: EIP-1559 introduced a very similar mechanism as early as 2020. With the introduction of EIP-4844, there are now two floating prices for Gas and Blobs.


For users and block builders, the experience is similar to before, but they need to adapt to two separate fees. However, for developers, the need to redesign EVM functionality to adapt to a multi-price and multi-limit environment may add some challenges.


Multi-dimensional pricing, EVM, and subcalls


In the EVM, there are two types of gas limits: a total gas limit set for each transaction, and individual gas limits when contracts call other contracts. This allows contracts to call untrusted contracts while ensuring that there is still gas left after the call for other computations. However, there are challenges in implementing multi-dimensional gas pricing between different types of execution. Such a multi-dimensional scheme would require subcalls to provide multiple limits for each gas type, which would be a profound change to the EVM and incompatible with existing applications.


Multi-dimensional gas proposals typically stop at just two dimensions: data and execution. Data is allocated outside the EVM, so no internal changes are required to price it separately. For developers, this means that the EVM and its surrounding infrastructure need to be redesigned to accommodate multiple prices and multiple limits. In some cases, optimizations will also become more difficult because it is not clear which approach is more efficient, which may affect the development process.


While there are some challenges, these issues can be addressed by implementing something like EIP-7623, which charges an additional fee for storage operations and refunds them at the end of the transaction to ensure that the main call still has enough Gas to perform subsequent operations.


Summary


In either case, it is worth emphasizing that once you start introducing multi-dimensional execution Gas, the complexity of the system will increase significantly, which seems inevitable.


So we are faced with a complex decision: are we willing to accept more complexity at the EVM level in exchange for the significant gains of unlocking L1 scalability, and if so, which specific proposal is better suited to the protocol economy and application developers? It is very likely that the best solution is neither of the ones mentioned previously nor the ones mentioned above, and we still have room to come up with more elegant and effective solutions.


Original link


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

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

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

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

0

Disclaimer: everything in the article represents the author's point of view and has nothing to do with this platform. This article is not intended to be used as a reference for making investment decisions.

You may also like

Decoding the Altcoin Crash: Report Points to Market Forces, Not VC Dumping

Coinedition2024/05/20 19:31

US House to vote on FIT21 bill before holiday weekend

Cointelegraph2024/05/20 19:25

Sei Foundation proposes version 2 network upgrade to bring EVM compatibility

Quick Take The Sei Foundation has proposed an upgrade to the Sei blockchain, targeting a transition to version 2. This upgrade aims to introduce a high-performance, parallelized Ethereum Virtual Machine.

The Block2024/05/20 18:10

Uniswaps Labs and Across Protocol introduce token standard ERC-7683 for better cross-chain interoperability

Quick Take Uniswap Labs and Across Protocol introduced a new Ethereum token standard called ERC-7683. ERC-7683 aims to create a universal filler network for all cross-chain intents to follow in their order structure, tackling relayer fragmentation. This would result in lower costs for fillers, a broader filler network for apps to use and lower costs passed onto users.

The Block2024/05/20 17:52

‌Spot copy trading

More
AIOnline
AIOnline
insight1000/1000
8914.74%
ROI
Total profit $45465.19
AI-Six
AI-Six
insight500/500
2194.93%
ROI
Total profit $5048.19

Bot copy trading

More
GoldenEgg
GoldenEgg
insight96/150
$18930.69
Total profit
Total subscriber profits $-280.75
Morgee
Morgee
insight49/150
$18317.89
Total profit
Total subscriber profits $-160.46