[Feature Request] Dynamic GAS Fee Calculation #3688
Labels
area:stdlib
area:vm
Issue about vm
break
Issue will break blockchain's compatibility
enhancement
Enhancement
security
Feature Request
Describe the Feature Request
Now the gas fee of Starcoin's native method is a fixed value, which simplifies the difficulty of implementation, but it may bring great risks:
For example, the fixed GAS fee we use in the current Hash module may face an attacker who can implement a Hash Collision attack with a small amount of STC.
In other words, Vec and String, an attacker can spend a small amount of gas fee to execute a contract with a long expected execution cycle, which will be catastrophic for the infrastructure
Dynamic calculation of GAS fee can at least ensure that miners still get their due income when they are attacked, and at the same time, it can ensure that some newly added native modules with dynamic length can run normally so that similar problems will not occur.
Describe Preferred Solution
Describe Alternatives
Related Code
Additional Context
Although the implementation of the move language itself is cumbersome, it also uses dynamic calculation of gas, so doing so can keep us consistent with the official behavior
If the feature request is approved, would you be willing to submit a PR?
Yes / No (Help can be provided if you need assistance submitting a PR)
YES
The text was updated successfully, but these errors were encountered: