Filecoin network is about to be upgraded. Let’s talk about how to calculate Filecoin gas fees

Filecoin network is about to be upgraded. Let’s talk about how to calculate Filecoin gas fees
In our previous article, we explained the origin and definition of Filecoin gas, why gas fees are so high, how to view Filecoin mining, etc. (click on the picture below to view the previous content) . Today, we will mainly talk about the calculation method of Filecoin gas, the definition and characteristics of P1, P2, C1, and C2, as well as Filecoin’s official solution to reduce gas.
About Filecoin Gas Fee Calculation  
In the Filecoin blockchain browser, we click and enter the gas column, we can see the gas basic rate trend chart. The 24-hour gas data is actually a display of the gas fee consumption details.
The consumption of gas fees is mainly divided into two parts: the gas consumed to increase computing power and the gas required to maintain computing power.
The gas consumed by increasing computing power is mainly in the P2 and C2 stages, namely PreCommitSector and ProveCommitSector. Since Filecoin is a storage-type public chain, the basic unit of Filecoin is Sector (also known as sector). 1TB of effective computing power consists of 32 32GB sectors (32X32=1024).
Therefore, the gas fee required to increase the effective computing power by 1TB is: (0.2185+0.08)X 32=9.552 FIL


In addition to increasing computing power to obtain FIL block rewards, maintaining computing power and providing proofs as required can also obtain block rewards. The gas fee generated for submitting time-space proofs for each TB of effective computing power to participate in block rewards is: 32/2349X1.5194=0.0206FIL (32 is because 1TB has 32 sectors, and 2349 is because a time-space proof message contains 2349 sectors) .


From the above, we can know that the newly added effective computing power is the link that consumes the most gas. Why? This has to start with Filecoin's P1, P2, C1, and C2 .

About P1, P2, C1, C2

As a storage-type blockchain, Filecoin's basic storage unit is the sector. How to prove that the sector has stored data and how to convert the committed capacity into effective computing power is what we often call precommit1, precommit2, commit1, and commit2. Pre can be translated as advance or preparation, so it can also be translated as pre-packaging stage 1, pre-packaging stage 2, packaging stage 1, and packaging stage 2.

The P1 stage mainly breaks up and fragments the files and calculates the merkle tree of the original data. This stage mainly consumes the CPU.

In the P2 phase, it is necessary to generate Replica, calculate Column Hash, and generate a merkle tree based on the calculation result of column hash. Then, it is necessary to encode the calculation result of label again to generate a merkle tree . The calculation of Column Hash also needs to go through 11layer, Label, and use poseidon Hash. Therefore, the C2 phase is not only very time-consuming, but also has a relatively large demand for gas. GPU is mainly responsible for this phase.

The C1 stage is not chained and only takes about ten seconds, so the C1 stage can be ignored.

Next, we come to the C2 stage, which consumes the most gas. The C2 stage is mainly the circuit processing of zero-knowledge proof and the process of generating zero-knowledge proof . Zero-knowledge proof is prepared for time-space proof, and time-space proof is prepared for obtaining block rewards ( zero-knowledge proof: under the premise that the miner does not know the content of the file, prove to the system that the miner has indeed saved the file ) .

In general, the process is from data segmentation and encapsulation in the P1 stage to the generation of DHT in the P2 stage. After the P2 stage is completed, it will involve sending messages to the chain, and then entering the C1 and C2 stages. It is estimated to take 4 hours from P1 to P2, more than ten seconds from P2 to C1, and two hours from C1 to C2.

Since the C2 stage requires a large amount of parallel computing, it consumes a lot of gas. The gas consumed in the C2 stage is estimated to account for two-thirds of the total gas consumption.

About Filecoin FIP-9 Proposal

Faced with unreasonable gas fees, Filecoin officials are working hard to solve the problem from multiple aspects.

At 12:10 Beijing time on December 16, Filecoin official Aayush Rajasekaran released the latest announcement in the slack channel, saying that the Lotus v1.3.0 test version will be released tonight (the project's tonight is tomorrow morning) , and hopes to release the v1.3.0 official version shortly after all implementations are approved.


This upgrade will be carried out before the Filecoin block height reaches 343200. This upgrade includes the FIP-9 proposal, the main content of which is to exempt the baseFee for the successful execution of SubmitWindowedPoSt.

In short, if a miner sends a "SubmitWindowedPoSt" message and the message is successfully executed, the system will refund the gas fee consumed by the miner.

This FIP proposal can reduce Window PoSt congestion to a certain extent and reduce the cost of Filecoin miners submitting proof of time and space. However, as mentioned above, the gas fee consumed by submitting proof of time and space is not the main gas fee expenditure of miners. Therefore, objectively speaking, this proposal cannot fundamentally solve the problem of high gas fees.

However, we do not have to be pessimistic, because several plans that are still in the "draft" stage, "FIPS42, FIP S 49, FIP S 50", are expected to reduce the long-term cost of Window PoSt and reduce the long-term congestion of the chain from a deeper level. It is just because these major plans require a large amount of work in development and testing, so it takes some time.

In short, we need to make it clear that Filecoin officials and the community are working hard to further solve problems, and everything is improving and developing in a better direction .


<<:  Bitcoin breaks through $20,000! Next...

>>:  Opinion | Bitcoin at $20,000 is just the beginning

Recommend

The palmistry of a man with a gentle personality but no responsibility

The palmistry of a man with a gentle personality ...

What kind of palmistry means people are born rich

Everyone is striving for a better life. Some peop...

Do women with moles on their noses have good fortune? Are you blessed?

Moles can be divided into broad and narrow meaning...

What does it mean when a woman has droopy eyes?

Any form of facial expression has different meani...

Analysis of the facial features of men with moles on the bridge of their noses

1. Interpersonal relationship analysis: In physio...

Palmistry for Diseases in Old Age

Palmistry for Diseases in Old Age 1. Short lifeli...

Japan's SBI Sumishin Bank launches blockchain proof-of-concept project

On December 17, Japan’s SBI Sumishin Internet Ban...