-
Notifications
You must be signed in to change notification settings - Fork 107
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
Gas computation: use uint64 instead of uint256 #35
Comments
Note that block gas limit and so transaction gas limits hovers arount 8M currently so a int64 can be better to avoid uint surprises when substracting. (Yellow paper, 4.3.4) There is still a question about dealing with int exceptions (on debug only) but if there are gas computation issues it might be safer to crash anyway. |
For the moment I will go ahead with this type. GasInt* = int64
## Type alias used for gas computation For reference:
There is also an open question on whether to use range types like On the plus side:
On the minus side:
|
Using uint64 instead of uint256 for gas computation like in Go-Ethereum would be much better for devices from a memory and performance standpoint.
See Go-Ethereum PR - ethereum/go-ethereum#3674.
Furthermore, gas prices can then be stored in a const array and replaced at instantiation site at compile-time instead of being loaded into memory.
This can be tested with
and checking the generated C code.
The text was updated successfully, but these errors were encountered: