-
-
Notifications
You must be signed in to change notification settings - Fork 667
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
Deterministic IntegerMath #481
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good overall
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, but wondering whether IntegerMath
does quite cut it compared to let's name it SafeMath
that also works with floats but does NaN canonicalization (or whatever is necessary to make it deterministic). IntegerMath feels a bit like it's most useful for games, which is great, but then it might or might not cross the line for what should be included with the standard library and what should become a userland module? Other than that I'd absolutely use it if I had a use case, OK to merge for me, but mentioning. Any thoughts?
@dcodeIO NaN canonicalization should be done on virtual machine side because this would be faster, safer and don't increase binary size. |
@MaxGraey this is also better for us cause e.g. in distributed consensus context we cannot trust that contract is compiled to canonicalize NaNs, unless it happens either on VM or post-processing stage (vs on compile stage). |
@vgrichina Currently there are pretty basic concept of IntegerMath without overflow checking yet. All others functions will be stubs with "not supported" exceptions. WDYT?
Relate to #465
DONE
сс @Jannis