Repository navigation
Replies: 1 comment 1 reply
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Ok so we have the gas fees problem.
Since DVM is not built into the blockchain, but rather as another layer, transaction fees and gas fees are separated.
Transaction fees are paid to miners which include the transaction in a block, while gas fees are paid to make the method call / contract deployment on the DVM (who these gas fees are sent to it's a problem we'll discuss in another thread).
In the EVM, gas is calculated by the VM itself, as Solidity is a language which has been made for this. But here we're using python.
Since we cannot (at least in an efficient way) calculate real resource usage, gas fees in DVM should be treated in another way.
Single method calls will have a limited execution time of some ms, as this is the only real way to avoid resource wasting.
Although execution time can be different from machine to machine, it does not really matter because if a method call is not malicious, it won't hit any limit.
The only things we can really know about a method call are:
And we can implement a sort of gas on top of that, like we treat every method call as 16 fake bytes and every contract new instance as 128 fake bytes, then we sum it with |Δstate size| (bytes added/removed) and we multiply the result by transaction fee rate.
Example: a transaction which pays 10 eao/byte (1 eao = 0.000001 dnr) which calls a method which calls another two methods of another contract and adds 1000 bytes to the VM.
Main method call (16 fake bytes)
New contract instance (128 fake bytes)
Other contract method 1 call (16 fake bytes)
Other contract method 2 call (16 fake bytes)
Total: 176 fake bytes + 1000 bytes = 1176 bytes
Transaction fee rate is 10 eao/byte so this would cost 1176 * 10 = 11760 eao (0.011760 dnr).
Of course the numbers are examples, but that's a problem too: why DVM nodes should agree on fees they don't even receive?
This bring us to the other problem (who receives gas fess), but hopefully we'll find a way to reward DVM nodes too.
But now, I think this is a topic of DVM which needs a solution. Feel free to ask and propose anything
All reactions