Original source:Filecoin Network

Original source:
first level title
How FVM is closely related to the Gas economy
- The launch of the Filecoin Virtual Machine (FVM) allows user-programmable smart contracts (actors) to land on the Filecoin blockchain. These smart contracts will be able to interact with Filecoin's data storage capabilities, enabling innovative applications such as Data DAOs and provably persistent storage. 
- While the deployment of FVM on Filecoin promises an exciting era of innovation and utility, it can also pose economic risks. If these risks are not addressed in the long term, there could be serious consequences. Fortunately, some simple and effective cryptoeconomic solutions can be incorporated to protect this network against the worst consequences. Let's recap the main points first: 
- The Gas consumed by Filecoin storage providers mainly comes from network-critical task consumption (such as submitting expensive cryptographic proofs when new sectors are uploaded, and continuous "maintenance" messages, or continuous daily confirmation that their sectors are still active). 
- If FVM's demand for gas is not adjusted, it may be a problem for network operation, because storage providers may be priced out of the gas economy. 
- In many cases, total network revenue (from gas fee burns) can be maximized by reducing the block size. Because FVM has the potential to absorb demand for Gas (through scaling solutions), related scenarios may also arise when the target block size is too large for the level of demand. 
The most straightforward solution that CryptoEconLab is researching is to set the Gas parameter and target block size separately for storage providers and ordinary FVM usage, that is, each has a different available Gas.
first level titleQuantitative assessment of the risk of middle classization and disorderly spread of GasThe remainder of this article is simplified from
CryptoEconLab's quantitative assessment of FVM Gas risk
This article.
In other cases, the demand for Gas may be absorbed by scaling solutions (such as interstellar consensus). The formalism of EIP 1559 encourages sending blocks of the same size as the target block even when demand is low, resulting in a waste of block space. We call this gas sprawl.
In this article, we will explore different scenarios to cover the demand scenario of Filecoin virtual machine Gas and how it affects the composition of blocks.
first level title
Filecoin Gas Demand Modeling
Our modeling of requirements is based on two main drivers: storage providers and FVM users. Naturally, both FVM users and storage providers need to pay when sending messages on this network. In our model, each individual user will have an individual value for his own information, and when the value is higher, it is more likely to send these messages to the Mempool (memory pool). Conversely, when the valuation is low, users submit fewer messages. This valuation is based on:Valuation = expected token gain - gas cost - operating costit's here,gas feeis a function of the base fee (increases with the base fee), while
Include external expenses (computers, office costs, etc.). This is a very subjective measurement, and each storage provider is different.

To account for this subjectivity, our model uses an "uncertainty quantification" technique to model the needs of storage providers and FVM users. This way, we can include how different storage providers and FVM users respond to price changes. The demand curve (as a function of price) generated by this methodology is shown below. The gray line corresponds to one version of the many demand curves. We can see that when the value of the basic fee is relatively low, our demand declines very slowly; when the basic fee reaches a certain threshold value, the demand declines rapidly. This corresponds to a base fee level - which can be simply understood as "too expensive for anyone".
first level title
When does FVM become a problem?An important purpose of this research is to try to understand the composition of the messages in the block; for example, at a given level of Gas demand, how much of the block will be used by FVM, and how much will be used by the storage provider to upload data and maintenance data use? Because actual FVM Gas usage data is currently lacking, we used a range of assumptions and investigated many possible future demand scenarios for FVM Gas, as well as assumptions about storage provider block plan preferences. We believe that these assumptions are appropriate for a first-order understanding of the problem. We also plan to continue building more complex Agent-Based models that will allow us to explore broader storage provider strategies - these will be tuned to new levels of FVM requirements.(Data onboarding network utility)As gas requirements and base fees increase, it leaves less utility for storage providers to upload data and maintain sectors. When gas demand is too high and storage providers operate with negative utility, gas gentrification will increase. we depictedData upload network availability, this indicator is in this

long technical report
Quantitative indicators are defined in detail to measure how network data uploads are affected by rising base fees and Gas demand. It can be seen that if we consider other conditions of the current Filecoin network to remain unchanged, network uploads will be affected when the base fee reaches 10 nanoFIL/Gas units.Our model divides messages into two categories: FVM messages and sector maintenance messages, each with different gas fee evaluation characteristics. Currently, 70% of block gas usage comes from storage provider maintenance messages, with an average of 3.5 billion gas units per block. As we increase FVM's demand for gas, gas fees are also pushed up. Therefore, we estimate that the proportion of gas used in a block is a function of the base fee, and the amount of gas used by FVM is a function of the current gas used.。
We simulated a range of FVM Gas demand scenarios, where the demand brought by FVM is: 1/10, 1/2, about the same, twice, five times and ten times the current storage provider maintenance demand

Assuming storage providers don't pick and choose messages, but simply accept messages that allow them to cover base fees and offer higher tips fees, we see the block composition shown in the chart below. The light-colored line represents one of several possible block compositions, while the solid-colored line represents the average composition. Based on our assumptions, we can see that the proportion of block usage in this example is very dependent on the initial FVM demand, and this proportion will decrease after the base fee increases. This is because after the base fee increases, the valuation of each message will decrease, which will make users submit less and less information.

We also investigated a situation where storage providers only include FVM-related messages if they have enough block space, preferring to include their own messages. In this scenario, we get a curve like the image below. We again observe that as the base fee increases, the proportion of block usage decreases, but the maximum amount required by FVM is capped at about 1.5 billion gas units per block. But this strategy requires storage providers to cooperate in rejecting messages that might give them higher tips fees. So, how likely is it that storage providers will self-regulate the gas market? The relevant situation is not yet clear, and it is also a topic that CryptoEconLab will study in the future.
first level title
Total network revenue, and suboptimal block size
Is EIP 1559 the optimal result?The EIP 1559 base fee mechanism adjusts the base fee with the goal of keeping all blocks at a fixed target level. This gives a higher chance of a suboptimally priced block being sent, even if there isn't enough demand to fill the entire block. If the gas usage demand is lower than the level specified by this target block size, the base fee will be reduced, which may affect the overall network revenue. This is especially a risk when FVM opens the door to various L2 scaling schemes, which could end up absorbing too much demand for gas usage.
From previous results, it is possible to deduce the optimal block size that needs to be filled to suit a specific level of demand.
Let's reinterpret the previous results: Assume that the reason why the block is partially empty is that the target block size is reduced to ( 1-prop empty)*B, where B is the current target block size. We can then find the optimal block size that maximizes the corresponding total network revenue (base fee * reduced target block size). This optimal block size is denoted by B* in the diagram above. .We found that in many cases, network revenue can be maximized by reducing the block size.
first level title
What can be done?
While exploring some solutions to address FVM Gas demand risks, the most direct tool is to design different Gas channels for FVM users and storage providers.Independent gas channels can combat the problem of gas gentrification. No matter how high the gas demand of FVM is, this scheme can ensure that the storage provider has a minimum block space to meet the critical network operation.At the same time, independent Gas channels can prevent the Gas sprawl problem. It allows us to maximize network revenue from FVM messages by optimizing the block space allocated to FVM messages. These independent Gas channels also allow us to
batch balancer
Currently, the base fee is determined by the gas requirements specified in EIP 1559 and the selection of the target block size. If you limit the overall block size, you can get several desired results, such as: optimize the network revenue that can be obtained from FVM messages, upgrade the batch balancer mechanism (inclined to earn explicit upload fees from storage providers), adjust Gas Supply (make the supply exactly match the demand for Gas).
In addition to the target block size, another important lever is the introduction of "gas channels". In our example, a portion of the total block gas can be reserved exclusively for key network messages of the storage provider, so that it will not be affected by the base fee increase brought by FVM.
- first level title 
- CryptoEconLab Next Steps 
- In the next few weeks, we will release a FIP improvement proposal discussion, introducing different gas paths for storage providers and general FVM messages, as a hedging tool for FVM-related gas risks. 
We will continue to build more complex agent-based simulations that will allow us to model the effectiveness of proposed solutions and the possibility of having storage providers self-regulate without changing the protocol.cryptoeconlab.ioAfter the release of FVM on March 14, 2023, we will start collecting and evaluating real FVM data, and use these meaningful data to improve our models.HackMD Almanac。


