-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Audit Lotus's default gas params #4344
Comments
|
We should also try to write down and iterate on our 'gas pricing theory', that is, how should people be thinking about what gas prices to set for a particular message? Caution, general exploration of the problem space ahead: In each of these cases, the message landing on chain within some given time frame has a particular value to us. The gas fee CAP we specify is the Maximum value we are willing to pay to make that happen. If the chain is going to demand more than that, we are fine with it not getting in on time. That said, pricing theory should probably adapt to certain bits of knowledge about how long your deadline is (~10 minutes for windowed post is very different than 24 hours for ProveCommit, but that ProveCommit is likely to be head of line blocking other messages you might want to land... so...) A separate value we can specify is the GasPremium, the gas premium is what we typically think about when discussing gas fees, its paid to the miner as an incentive to include your message over the messages of others. Since we have the network base fee, this tends to get forgotten a bit, but its still pretty important. The fee cap still gates how much you might pay in total, but the gas premium value specifies how much of that value could go to the miner, increasing the minimum amount you might pay. So, all of these things really only matter if the chain is full. If the chain is not at capacity, theres no reason for all messages to not make it onto the chain as they come in (barring external incentives, and the fact that a message with no gas premium probably isnt worth a miners time to include). When the chain is 'full' this means there are enough messages to fill up 100% of the chains 'available' space. However, the chain always has 'extra' capacity that can be used, but using this capacity increases the network base fee. A 'steady state' congested network is one where all the messages being sent center around a particular fee cap value, and the chain will end up using only 100% capacity (on average). This happens because if the fee is low enough to include >100% capacity, then the fee goes up, and fewer messages make it into the next tipset, which lowers the base fee again. When the chain is in this state, you can change either or both of the fees to get your message included more quickly: Increasing the base fee of your message under congestion ensures that when the base fee oscilates back upwards next, the chain will have space for your message to be included. This does not necessarily prioritize your message, but it does result in it getting included as soon as base fees rise above the median. (which, given the spikiness of the base fee mechanism, happen often). If you have honestly priced your message, and the rest of the network are honestly pricing their messages, then this gets your message in quickly without any other side effects, however if the network is not honestly pricing messages, someone specifying a higher fee can cause a change in the median which shifts the congestion fee baseline higher. Increasing the gas premium of your message will cause miners to prioritize your message above other messages within the same candidate inclusion pool. That is, if your message can get into a particular block, and you increase the gas premium, your message can jump the queue ahead of other messages that can make it into that particular block. However, in a steady state of network congestion, this won't have much of an effect because the network base fee takes priority on claiming funds from your messages fee, so if your fee cap is right at the limit of being includable in a block, the miner won't get much anyways. Given all that, it seems prudent to give the miners enough of a premium to bother processing your message, then set the fee cap to satisfy |
Heres the current defaults, along with some average gas limit values for those messages, and implied base fee numbers:
|
Right off the bat i'll note that 0.1 for the 'unspecified default' seems way too high. That should probably be 0.01 or less. |
And here's a recent collection of chain usage (as a percentage of block gas space used) by method:
|
Ideally we should ship any low-hanging fruit in 0.10.1. Any obviously wrong things we can stick into a PR to begin correcting things? @arajasek |
Based on an analysis, only minor changes were deemed appropriate and shipped in #4408 |
We should make a pass over default gasfeecaps (and any other gas-related params) in Lotus. The task should be roughly:
The text was updated successfully, but these errors were encountered: