-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Rust implementations to replace data tables (#161) #482
Conversation
It looks like @peterjoel hasn't signed our Contributor License Agreement, yet. Appreciation of efforts, clabot |
b4998e2
to
a127d8b
Compare
@@ -34,6 +34,10 @@ pub const ETHASH_MIX_BYTES: usize = 128; | |||
pub const ETHASH_ACCESSES:usize = 64; |
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.
double space.
logic and tests look reasonable. more attention needed to consistency of whitespace. |
@peterjoel Try running rustfmt with those settings: https://github.com/ethcore/parity/blob/a8045ed37ea09d6650e871fdfd35836ec84ab67a/rustfmt.toml |
looks good to me |
Implementations of get_cache_size and get_data_size in Rust (issue openethereum#161) Removed sizes module, containing replaced data tables Fixed whitespace issues after code review
@ethcore-cla-bot help |
[clabot:check] |
It looks like @peterjoel hasn't signed our Contributor License Agreement, yet. Appreciation of efforts, clabot |
Where can I find the CLA? The bot itself doesn't provide any links and there is no mention of it in the project's README. |
sorry about that - clabot appears to have misconfigured itself. link is https://cla.ethcore.io/ |
[clabot:check] |
@ethcore It looks like @peterjoel signed our Contributor License Agreement. 👍 Many thanks, Ethcore CLA Bot |
Rust implementations to replace data tables (#161)
A few points to discuss, as it's my first PR to this project:
I introduced a dependency on Primal. I couldn't see a better alternative and could never get the same speed without it.
My tests look at the highest and lowest values found in the original hard-coded data tables, with extra cases on the step boundaries. The functions will support much higher input values, which I didn't search for corresponding test values for, since they would only be needed 20 years in the future.
I wasn't sure about which constants to use versus introducing new ones. For example the python code I borrowed from Ethereum had HASH_BYTES = 64, while this project had a constant NODE_BYTES with the same value. I'm not confident enough of what these values actually mean to know if it would be correct to use them to mean the same thing.
The codebase seems to have a lot of files with lines ending in whitespace. My editor is correcting those (I think this is what is happening at least), so my commits are riddled with unnecessary whitespace changes. I'm not 100% sure how to prevent this, short of manually modifying all my commits afterwards. I left them in for now, so you can see. For comparison, the Servo project does not permit trailing whitespace at all, which prevents this issue.