-
Notifications
You must be signed in to change notification settings - Fork 403
Support multiple underlying uint256 libraries #399
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
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Remove all reference of primitive_types except in evm_interpreter::uint. Eventually this will allow us to support multiple underlying uint types.
We still need to implement those trait functions.
There's no reason to break it, just adding a few old functions back.
We expect frequent change in this trait, so we don't want it to be part of the public API.
External crates are not allowed to use U256Ext.
Too different compared with primitive-types and ruint to reliably support. Some semantics doesn't follow common uint standard. Perhaps at a later date when we have type alias impl trait.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The implementation of uint256 plays a considerable role for EVM performance. The underlying uint256 library used right now in
rust-evmisprimitive-types, but it's known that it's not the best performant out there.This PR adds an alternative implementation,
ruint, which is known to be faster thanprimitive-typesin certain situations.The alternative implementations will be used if the corresponding feature flags are enabled (if no feature flag is enabled, then by default it will continue to use
primitive-types).A long-term goal for this design choice of this PR is also to unify where the uint256 type is referred -- if, one day, Rust gets a native
u256type, then we want to move to it (and hopefully without much hassle).