Replies: 1 comment
-
YES! Thank you so much for bringing this up. I would 100% be in full support of removing the dynamic gas pricing entirely. It severely overcomplicates things in my opinion and the pros don't outweigh the cons. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Dynamic gas pricing as it is implemented today creates more problems than it solves.
First, what is dynamic gas pricing? Basically, when the sum of all gas across all chunks of a block is higher than 50% capacity, the NEAR token per gas unit price increases. But it is capped at 20x the base cost. In practice, it has almost always been at the bottom. It will end up at the top if the average capacity is consistently >50% . (Any price in between is going to be highly unstable because of exponential adjustment steps in every block.)
The problems with dynamic gas pricing are mostly tied to the concept of pessimistic gas pricing. When creating a receipt and buying the gas, we don't know the real gas price as it may change during execution. We do a pessimistic estimation, which is a piece of complicated protocol specification. This ensures the user has enough balance to pay for the transaction even if the gas price increases at the max step size in every block.
The pessimistic cost can be up to 6 times the actual cost. But the exact factor depends on the action type and the amount of attached gas. More attached gas => higher price per gas unit. Note that the difference is refunded at the end. But the user must have enough balance in the first place, just in case the gas price increases during execution.
Why is it bad?
Many more details about how gas pricing is implemented today can be found here: https://github.com/near/nearcore/blob/893ef06ad718bb44f4a2d57cf21b433bde249a5c/docs/architecture/how/gas.md
Suggestion:
If we go with option 2, I believe we can resolve a number of long standing issues:
gas_price
andgas_used
is confusing nearcore#6623cc @BenKurrek @mfornet @bowenwang1996 @abacabadabacaba
Edit: Relevant link to original discussion when dynamic pricing was introduced: #67
Beta Was this translation helpful? Give feedback.
All reactions