-
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
Switch GasInt
to uint64
#2292
Comments
A note: Some of the gas calculation depends on the int signedness, e.g. in |
Something to be careful about: code like nimbus-eth1/nimbus/core/validate.nim Line 329 in 32c51b1
|
The initial choice in #35 (comment) is argued to simplify development by raising a
Defect
whenever an out-of-bounds computation happens.While this might have been an appropriate choice in early-stages design, it is not a reliable choice for production code, also because types where
GasInt
is used are RLP-serialized and RLP doesn't support signed integers.Since
geth
usesuint64
, this will also ensure that our handling is similar to that of geth:https://github.com/ethereum/go-ethereum/blob/682ae838b2312a4ec8e5581069039b567e33c7c2/core/types/block.go#L76C2-L76C10
As an alternative to plain
uint64
, we could also develop a special "checked uint64" in which all operations return an overflow flag that is checked where applicable.The text was updated successfully, but these errors were encountered: