Detailed EIP-7706 and sorted out the latest Ethereum GAS mechanism

Author:@web3mario

introductionThe

Vitalik released the EIP-7706 proposal on May 13, 2024, proposed a supplementary plan for the existing GAS model, peeling out the GAS calculation of CALLDATA, and customizing the BLOB GAS BASE Fee pricing mechanism to further reduce L2 L2Operating cost.The related proposal also needs to be traced back to the EIP-4844 proposed in February 2022, which is a long time apart. Therefore, checking relevant information and hope to make a review of the latest Ethereum Gas mechanism to facilitate everyone to understand quickly.

The Ethereum GAS model currently supported-EIP-1559 and EIP-4844

In the initial design, Ethereum used a simple auction mechanism to price the transaction fee, which requires users to actively bid for their own transactions, that is, setting up Gas Price. Generally, the transaction fee paid by the user will belong to the miner.Therefore, the miners will determine the transaction packaging order according to the highest economic principle according to the principle of economic optimal. Note that this is when I ignore MEV.From the point of view of the core developer at that time, this mechanism was facing the following four questions:

  • The volatility and transaction of the transaction cost levelconsensusDo not match the costTheFor the blockchain in an active state, the packaging demand for transactions is sufficient, which means that the block can be easily filled, but this often means that the overall cost is extremely volatility.For example, when the average GAS Price is 10 GWEI, the marginal cost generated by the network due to a transaction in a block is 10 times when the average GAS Price is 1 GWEI, which is unacceptable.

  • Unnecessary delay for users:Because each block has the hard limit of Gas Limit and the natural fluctuations of historical transactions, transactions usually wait for several blocks to be packaged, but this is inefficient for the overall network; that is, there is no allowed one to allow oneThe “relaxation” mechanism with a larger block and the smaller block of the next block meets the differences in demand for blocks one by one.

  • PricingLow efficiency:Because the simple auction mechanism has caused the low efficiency of fair price discovery, which means that for users, it is difficult to give a reasonable pricing, which means that in a lot of cases, the user pays higher.Handling fee.

  • Blockchain without block rewardsWillUnstable: When the block reward brought by mining and adopt a simple handling fee model, it may cause a lot of instability, such as the “sister block” that inspires the stealing transaction costs, and opens a stronger selfish mining attack vector.

Until the proposal and execution of the EIP-1559, the GAS model has a first iteration, EIP-1559, which is proposed by core developers such as Vitalik on April 13, 2019, and at the LONDON upgrade on August 5, 2021, was upgraded to be upgraded by the LONDON upgrade on August 5, 2021.Using, this mechanism has abandoned the auction mechanism and adopted a dual pricing model of Base Fee and Priority Fee. Among them, Base Fee will be between the GAS consumption of the GAS generated in the parent’s block and a floating and recursive Gas targetThe relationship is quantitatively calculated through a established mathematical model. The intuitive effect is that when the use of the GAS in the previous block exceeds the scheduled GAS TARGET, the BASE Fee is up.It can better reflect the supply and demand relationship, and make the prediction of reasonable GAS more accurate. It will not occur to the sky -high price Gas Price due to misunderstanding, because the calculation of Base Fee is directly determined by the system rather than the user’s freedom.The specific code is as follows:

It can be seen that when Parent_GAS_USED is larger than Parent_GAS_TARGET, then the Base Fee of the current block will be compared to the Base Fee of the previous block plus a offset value.Compared with the offset of Gas Target and the maximum value of GAS TARGET and a constant balance and 1.The logic is similar.

In addition, Base Fee is no longer assigned to the miners as rewards, but is directly destroyed. Therefore, ETH’s economic model is in a state of shrinking, which is conducive to stability of value.On the other hand, Priority Fee is equivalent to rewards for users to give miners freely. To a certain extent, the sorting algorithm of the miners can be reused to a certain extent.

As time advanced to 2021, the development of Rollup gradually entered a good realm. We know that both OP Rollup and ZK Rollup mean that some proof data that need to be compressed after L2 data needed to be compressed to the chain to achieve data through callData to achieve data.Data Available or directly to the chain for verification.This allows these Rollup solutions to face a large GAS cost when maintaining the final nature of L2, and these costs will eventually be passed on to users. Therefore, most of the L2 protocol use costs at that time were not as low as expected.

At the same time, Ethereum is also facing the dilemma of block space competition. We know that there is a Gas Limit in each block, which means that the GAS consumption of all transactions in the current block cannot exceed this value. According to the current GASLimit is calculated at 300,000, and theoretically there is a limit of 30,000,000 / 16 = 1,875,000 bytes. The 16 refers to the GAS of 16 units of the EVM processing of each CALLDATA byte, which means that the data that can be carried up to up to up to is up toThe scale is about 1.79 MB.The Rollup -related data generated by the L2 sorter is usually large in data, which makes it compete with the transaction confirmation of other main chain users, resulting in smaller transaction volume that can be packaged by a single block, which will affect the main chain’s TPS.

In order to solve this dilemma, the core developers put forward the EIP-4844 proposal on February 5, 2022, and were implemented after the DENCUN upgrade in the second quarter of 2024.The proposal proposes a new type of transaction called Blob Transaction. Compared with the traditional type of transaction, the core idea of ​​Blob Transaction is to supplement a new data type, that is, Blob Data.Different from the CALLDATA type, the Blob Data cannot be direct by EVM, but can only access its hash, also known as VersionedHash.In addition, there are two designs accompanied by each other. Compared with ordinary transactions, the GC cycle of Blob Transaction is shorter, thereby ensuring that the block data is not too bloated.The effect of the presentation is similar to the EIP-1559, but the natural index function is selected in the mathematical model to make it perform better in response to the transaction scale fluctuations, because the slope of the natural index function is also the natural index function, which means that no matter whetherAt this time, what state is in the scale of the network transaction? When the scale of the transaction is soaring rapidly, the BLOB GAS Base Fee response is more fully reacted, thereby effectively curbing transaction activity. At the same time, the function also has an important feature., The function value is 1.

base_fee_per_blob_gas = min_base_fee_per_blob_gas*e ** (excess_blob_gas / blob_base_fee_update_fraction)

Among them, min_base_fee_per_blob_gas and blob_base_fee_update_fractions are two constants, while Excess_blob_GAS consumes a target_blob_gas_per_block constant constant. The difference is determined that the total Blob GAS consumes the target value, that is, the difference is positive time, E ** (Excess_blob_gas / Blob_base_fee_update_fraction) greater than 1, then base_fee_per_blob_gas becomes larger, otherwise it becomes smaller.

In this way, some data that only hopes to use Ethereum’s consensus capabilities can be performed at low cost to ensure the availability scenarios to ensure availability.Taking the Rollup sorter as an example, you can encapsulate the key information of L2 into the Blob Data through the Blob Transaction, and use the exquisite design to use Versionedhash to achieve the logic of the linked chain by using the exquisite design.

What needs to be supplemented is that the current target_blob_gas_per_block and max_blob_gas_per_block brings a limit to the main network, that is, the average processing of 3 Blob (0.375 MB) of each block and up to 6 Blob (0.75 MB) limit.These initial restrictions are designed to minimize the pressure caused by the EIP to the network, and as the network shows reliability under large blocks, it is expected to increase in the future upgrade.

Reconstruction of the execution environment GAS consumption model-EIP-7706

After clarifying the current Ethereum Gas model, let’s take a look at the goals and implementation details of the EIP-7706 proposal.The proposal was proposed on May 13, 2024.Similar to Blob Data, the proposal is peeled off the GAS model corresponding to another special data field. This data field is callData.And optimize the corresponding code implementation logic.

In principle, the Base Fee computing logic of CallData is the same as the Base Fee for Blob Data in EIP-4844, all of which use the index function and calculate the deviation value of the actual GAS value and target value in the parent block to calculate the current Base FeeScaling ratio.

It is worth noting that a new parameter design, limit_target_ratios = [2,2,4], where Limit_target_ratios [0] indicates the target ratio of the operating class, limit_target_ratios [1] means the target ratio of blob data class, Limit_t_t_t Arget_ratios [2] Indicates the target ratio of the CALLDATA class GAS. This vector is used to calculate the GAS Target value corresponding to the three types of GAS in the parent block. The calculation logic is as follows, that is, use the Limit_Target_ratios to do the control of the Gas Limit:

The setting logic of Gas_limits is as follows:

Gas_limits [0] must follow the existing adjustment formula

Gas_limits [1] must be equal to max_blob_gas_per_block

Gas_limits [2] must be equal to Gas_limits [0] // calldata_gas_limit_ratio

We know that the current Gas_limits [0] is 30000,000, calldata_gas_limit_ratio is preset to 4, which means that the current callData Gas target is about 30000000 // 4 // 4 = 1875000. Because of the current callData Gas calculation logic, each non -non -nonZero BYTES consumes 16 GAS and zero Bytes consumes 4 GAS. Assuming that the distribution of Africa and zero BYTES in a paragraph accounted for 50%of the distribution of BYTES, the average processing of 1 bytes requires 10 GAS.Therefore, the current CALLDATA GAS TARGET should correspond to the CALLDATA data of 187500 bytes, which is about twice the current average dose.

The advantage of this is that it greatly reduces the probability of the case of CallData reaching the situation of the Gas Limit. Through the economic model, the amount of CALLDATA is maintained in a relatively consistent state, and it also eliminates the abuse of callData.The reason for this design is to dispel obstacles for the development of L2. With the Blob Data, the cost of the sorter is further reduced.

  • Related Posts

    The potential of Ethereum is not only passed in the spot ETF

    Jessy, Bitchain Vision Realm Regarding Ethereum’s unanimous sings and decline, a transformation occurred after the Ethereum spot ETF passed. It is reported that the probability of Ethereum’s spot ETF passed…

    Ethereum governance reflection: Why are you dissatisfied with the EIP-3074 incident?

    Source: Buyu said This article explains my thinking on the recent EIP-3047 incident, thanks to Vitalik and YOAV for review of content. If you don’t know this incident,Let’s review it…

    Leave a Reply

    Your email address will not be published. Required fields are marked *

    You Missed

    From traditional replication to innovation Can Backpack seize the future?

    • By jakiro
    • March 26, 2025
    • 21 views
    From traditional replication to innovation Can Backpack seize the future?

    Saylor’s $200 trillion BTC strategy: U.S. BTC domination and immortality

    • By jakiro
    • March 26, 2025
    • 20 views
    Saylor’s $200 trillion BTC strategy: U.S. BTC domination and immortality

    Ethereum’s two major upgrades to Pectra and Fusaka are explained in detail. What will be brought to ETH?

    • By jakiro
    • March 26, 2025
    • 22 views
    Ethereum’s two major upgrades to Pectra and Fusaka are explained in detail. What will be brought to ETH?

    Coingecko: How do investors view the potential of crypto AI technology?

    • By jakiro
    • March 26, 2025
    • 52 views
    Coingecko: How do investors view the potential of crypto AI technology?

    Galaxy: Research on the current situation of Futarchy governance system and on-chain forecast market

    • By jakiro
    • March 26, 2025
    • 18 views
    Galaxy: Research on the current situation of Futarchy governance system and on-chain forecast market

    The latest updates from ETH and Solana: What are the things to pay attention to?

    • By jakiro
    • March 25, 2025
    • 19 views
    The latest updates from ETH and Solana: What are the things to pay attention to?
    Home
    News
    School
    Search