-
Notifications
You must be signed in to change notification settings - Fork 1k
Description
Summary or problem description
With the current way of calculating GAS, (I think) Neo has a significant disadvantage when adoption finally comes. Neo VM is very strict when it comes to to little GAS sent in and if multiple users do advanced invocations or contracts with randomness, it's likely that the transaction will fail on the chain with an Insufficient GAS message.
This is not a problem for static contracts but a huge problem for dynamic contracts or contracts that has randomness.
The way to solve this today is to add an extra sys fee in the wallet invocation, which makes it more expensive for the user. It is still not safe as it can still fail in times of traffic spikes.
We do this for Flamingo Orderbook (add GAS, so at least ten people can trade at once), but in most cases, when the traffic is low, users pay 2x GAS cost but it's the only way for us to make sure that ten people can trade at once.
Today it can feel a bit like traveling on a toll road that has a high traffic fee of 1 USD and after paying the regular toll of 5 USD you are still denied access since you did not have the last 1 USD. This makes it so you need to go back to get more money and hope that this time you have enough.
Do you have any solution you want to propose?
Let contracts have a parameter of how much GAS they require to run. As a contract developer, you input a parameter saying that you want the wallet to have at least 1 GAS; after contract execution, it's the real GAS fee that is deducted from the user's wallet (not burn everything as it is now). This can be viewed as a gasLimit and will make sure that the invocation doesn't fail unless it costs more than the parameter. This will also make it easier for the users to know the expected cost of an invocation, and if you only used 0.1 GAS it's viewed as a bonus.
Neo Version
- Neo 3
Where in the software does this update applies to?
- VM
- Contracts