Filecoin network is about to upgrade, talk about Filecoin gas fee calculation method

In the last article, we explained to you the source and definition of Filecoin  gas, why the gas cost is so high, how to treat Filecoin mining, etc. (click the picture below to view the content of the previous issue) . Today, we will mainly talk about The calculation method of Filecoin gas, the definition and characteristics of P1, P2, C1, C2, and Filecoin's official solutions to reduce gas.

image

 

image

About Filecoin Gas fee calculation 

In the Filecoin blockchain browser, we click and enter the gas column to see the basic gas rate trend chart. The 24-hour gas data is actually a display of gas cost consumption details.

image

 

The consumption of gas fees is mainly divided into two parts: the gas consumed to increase the computing power and the gas consumed to maintain the computing power.

Among them, the gas consumed to increase computing power is mainly in the P2 and C2 stages, namely PreCommitSector and ProveCommitSector; because Filecoin is a storage type public chain, the basic unit of Filecoin is Sector (also known as sector), and the effective calculation of 1TB The force is composed of 32 32GB sectors (32X32=1024).

Therefore, the gas cost required to increase the effective computing power of 1TB is: (0.2185+0.08)X 32=9.552 FIL

 

image

 

In addition to increasing computing power, you can get FIL block rewards. You can also get block rewards by maintaining computing power and providing proofs as required. For every TB of effective computing power, you can submit time-space proofs to participate in block rewards. The gas cost is: 32/2349X1.5194 =0.0206FIL  (32 is because 1TB has 32 sectors, and 2349 is because a spatiotemporal proof message contains 2349 sectors) .

image

 

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

image

About P1, P2, C1, C2

As a storage type blockchain, the basic storage unit of Filecoin is a 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 into advance and preparation, therefore, it is translated into pre-package one stage, pre-package two stage, package one stage, and package two stage.

The P1 stage is mainly to shred and fragment files, and calculate the merkle tree of the original data. This stage mainly consumes CPU.

The P2 stage needs to generate Replica, calculate Column Hash, and generate a merkle tree based on the calculation result of the column hash, and then need to perform another encoding based on the calculation result of the label to generate the merkle tree. Among them, calculating Column Hash also needs to go through 11layer, Label, and use poseidon Hash, so the P2 stage is not only time-consuming, but also requires a relatively large gas. At this stage, the GPU is mainly working.

The C1 stage is not on the chain and probably only takes more than ten seconds. Therefore, 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 space-time proof, and space-time proof is for obtaining block rewards. Prepared ( zero-knowledge proof: on the premise that the miner does not know the content of the file, prove to the system that the miner did save the file ).

In general, the process is from the data fragmentation and encapsulation in the P1 stage to the generation of DHT in the P2 stage. After the completion of the P2 stage, it will involve sending messages on the chain, and then enter the C1 and C2 stages. The P1 stage is expected It takes 4 hours, the C1 phase is expected to be more than ten seconds, and the C2 is expected to be an hour.

Since the C2 stage requires a lot of parallel calculations, it needs to spend a lot of gas. The gas consumed in the C2 stage is expected to account for two-thirds of the total gas consumed. 

image

About Filecoin FIP-9 proposal

Faced with unreasonable gas costs, Filecoin officials are working hard to solve the problem in many ways.

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

image

 

This time, it will be upgraded before the Filecoin block height reaches 343,200. This upgrade includes the FIP-9 proposal. The main content of the proposal is to exempt the baseFee from successfully executing SubmitWindowedPoSt. 

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

The FIP proposal can reduce Window PoSt congestion to a certain extent and reduce the cost of Filecoin miners submitting time-space proofs. However, as mentioned above, the gas cost for submitting the time-space proof is not the main gas cost of the miner. Therefore, objectively speaking, this proposal cannot fundamentally solve the problem of excessive gas cost.

However, we don’t have to be pessimistic, because several programs "FIPS42, FIPS49, FIPS50" that are still in the "drafting" stage are expected to further reduce the long-term cost of Window PoSt and reduce the long-term congestion of the chain, just because of these major programs. It takes a lot of work to develop and test, so it takes a certain amount of time.

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

 

Investors who want to learn more about IPFS and Filecoin can follow the official website of the IPFS China Community: http://ipfs.cn  and the official website of Space Cloud Technology: http://yunos.io

Guess you like

Origin blog.csdn.net/ewfhqwohfr/article/details/111311048