Juan Benet analyzes Filecoin’s EIP-1559 practice and planning


 233 total views

Juan Benet, the founder of Filecoin, shared the principles of EIP-1559, the problems and improvements encountered in Filecoin practice.

Original title: “Hu An, Founder of Protocol Lab: Application of EIP-1559 in Filecoin Network and Improvement Measures”
Speech: Juan Benet, Founder of Filecoin Source: IPFS China Community

We all know that Filecoin’s gas has a deep relationship with EIP-1559. On December 17th, Beijing time, Hu An, the founder of Protocol Labs, gave a speech on the theme of “EIP-1559 in Filecoin”. This speech mainly explained why Filecoin uses the EIP-1559 pricing structure and EIP-1559 for supply and Community influence, related improvement measures and future plans of EIP-1559 by the Protocol Laboratory, etc. The following are the main contents of the speech:

About frist price auction

Suppose there is a blockchain. From right to left, each block has a series of transactions. We can treat them as transaction fees. Assuming that the green ones have higher transaction fees and the red ones have lower transaction fees, the mine The quotient can decide which way to use, but in fact each block looks different.

Of course, this is just a simplified model. When we actually enter the block, the transactions are arranged in an orderly manner and submitted to the EVM, and then the EVM executes each transaction and changes the state tree. These transactions will consume calculations when they are executed. Resources, and the amount of calculation is measured by gas.

Juan Benet analyzes Filecoin's EIP-1559 practice and planning

Therefore, gas is the resource used by the Ethereum blockchain to run blockchain calculations. The blockchain that executes transactions is to execute function calls in the virtual machine and change the state in the state tree. Each transaction requires a gas fee to be paid to the miner, and each transaction requires a transaction fee.

Many function calls will use a lot of gas, it is difficult to predict how much; but users must choose the gas fee and accept the frist price auction, which means that all transactions are in the available transaction pool, and miners can mine A block is then classified by the miner and selected according to the highest fee (the one with the higher price will get).

The frist price auction has led to a bad user experience. For example, if there is any type of network congestion, some people will increase transaction fees to increase processing speed as soon as possible. This is “oppressive” for most small and medium miners. of.

Juan Benet analyzes Filecoin's EIP-1559 practice and planning“Frist price auction” model network view

In summary, the original frist price auction method is not the most reasonable way of resource and capital operation.

Why does Filecoin adopt EIP-1559?

Juan said that EIP-1559 is implemented by multiple people and may exist in multiple networks, which may be ETH1.0 or ETH2.0.

The reason why the Filecoin team implemented EIP-1559 in the Filecoin code and let it run in real time on the network and manage all our transactions is because the old model has a lot of problems, and Filecoin is especially suitable for very fast and requires rules. Rhythm enters certain types of transactions in the blockchain, so EIP-1559 is very attractive to Filecoin.

Juan Benet analyzes Filecoin's EIP-1559 practice and planning

In EIP-1559, the basic cost is related to the network. At any specific time, the basic cost will increase or decrease according to the network situation, so it allows these blocks to shrink by themselves. In terms of total gas, if there is a specific network congestion If there are many transactions with funds higher than the basic fee, then more funds will enter the block and the block will expand, which will cause an increase in the basic fee.

So for the next block, increase the price threshold for entering the transaction.

Eventually, the size of these blocks will start to shrink, the utilization rate will be less than 100%, and then the basic cost will drop, so Filecoin becomes a more efficient market.

Juan Benet analyzes Filecoin's EIP-1559 practice and planning

As Juan said, “We have been working on different models, but we finally chose EIP-1559.”

Current status of EIP-1559 in the Filecoin network

Juan believes that in many aspects, EIP-1559 in Filecoin works very well:

  • It is very easy to trade online, and the truly important information can be communicated through the network, which helps high-value transactions happen;
  • Has a more concise UX, which makes it easier for programs and tools to calculate and set up costs;
  • Optimize expenses. Compared with frist price auction, EIP-1559 can save more expenses for both miners and program providers.

Of course, Juan has also seen the very bad experience that EIP-1559 brings to users. On the blockchain browser, we can see that the gas fee has changed greatly in 24 hours, which is very important for miners, especially small miners. , Very unfriendly.

“In the community, I can feel the tremendous pain from the miners.”

Juan Benet analyzes Filecoin's EIP-1559 practice and planning

Each time congestion will increase the gas cost, which is very unfriendly and frustrating, and will also make windowpost more expensive, which means that the daily windowpost expenditure required by miners will greatly increase.

Juan Benet analyzes Filecoin's EIP-1559 practice and planning

As shown in the figure below, in the Filecoin network, most of the gas consumption fees are ProveCommitSector and PreCommitSector. The remaining messages include other types of messages, such as windowpost.

Juan Benet analyzes Filecoin's EIP-1559 practice and planningSnapshot of the transaction

Although windowpost messages are relatively small, the usage rate is high.

Other transactions also require a lot of gas usage, and these transactions will slowly flow in. Therefore, windowpost and publish transactions will occupy an increasing share over time. With the expansion of the network, a problem will arise. It is the high pricing of storage that excludes windowpost and publish transactions.

Juan Benet analyzes Filecoin's EIP-1559 practice and planninggas usage view

Of course, the gas cost of windowpost is not endlessly high, it has an upper limit, which allows miners to pass without paying expensive fees.

Establishing a really good system is very effective for the Filecoin network. We can see the red line below. In 24 hours, the used capacity is actually 100.73%, which means that the basic cost is running very well and can be gas. Keep usage at around 100%.

Juan Benet analyzes Filecoin's EIP-1559 practice and planning

Of course, sometimes it will rise to 130% or even 200%. The basic cost fluctuates high and low, which is not friendly to the network. As for why this happens, whether it is too low elasticity, we think this is inherent in EIP-1559 Characteristic.

About improvement measures and future plans

Juan said that they have been considering dividing gas into two independent channels, one is the operational control level, which is critical to the operation of the protocol.

The other is the data level. This is a new type of transaction that all parties have joined. This will be a way to give priority access to certain transaction types, which must appear within a specific time frame.

Regarding this point, we can imagine that ambulances on highways pass on congested highways. The reason why ambulances can do this is not because they paid expensive fees, but their operation is very important.

Juan Benet analyzes Filecoin's EIP-1559 practice and planning

In addition, the protocol labs are also considering creating a fee structure for message types, which is not just for unoccurring gas, but to start pricing and create a market to determine how we should look at which messages.

How are these news priced?

For example, it allows the network and the community to formulate some policy guidance (for example, which types of transactions should be prioritized? What are the different types of fee structures?) to help the network create some leverage to determine the network’s pricing goals.

We also need some specific Filecoin operations, such as lever-oriented verification. Although we can’t verify everything, we can introduce a snark and create new methods to find faults.

Scaling consensus is another big thing we have to do. Because the network is very congested, we need to move quickly to sharding. Many of us have already begun to do this.

Juan Benet analyzes Filecoin's EIP-1559 practice and planning

future career

  • Data analysis: We have a lot of data about the network. We invite other interested researchers to cooperate with us, especially those from the Ethereum community. Protocol Labs looks forward to exploring important improvements with the Ethereum team;
  • Improve the gas model: Especially the difference between the control plane and the data plane, and it is expected that measures similar to Escalator will be implemented to reduce costs over time.
  • Introducing the queuing concept: It is planned to introduce the queuing concept into the gas model. This concept will come into play when the network receives computational constraints and constraints; when it is not restricted, the model will leave potential broadband for access.
  • Establishing QoS guarantees: Establishing QoS guarantees will be very useful for certain types of transactions and certain types of transactions in the network. It will be very useful and useful to think about how to establish certain types of transactions in certain types. It is helpful to the blockchain, which is also one of the future work.

Juan Benet analyzes Filecoin's EIP-1559 practice and planning

To make a brief summary, the protocol laboratory fully studied multiple gas models and finally decided to use EIP-1559, and the use of EIP-1559 is indeed helpful for Filecoin. However, there is no pure gold and no one is perfect. The application of EIP-1559 on the Filecoin network has also caused the gas cost to rise and fall, which is very frustrating for miners. In this situation, the protocol laboratory has also formulated and implemented Actively promote related improvement measures to minimize gas expenditures and fluctuations.

History tells us that although the development process of things is tortuous, the future is bright. With the joint efforts of all of us, we believe that gas costs will gradually be reduced and the Filecoin network will become better and better.