Conversation
|
Looks fine to me. What's the status of this PR? Is it the final version? |
|
I'm not planning any modifications to this PR unless something comes up during the review. The changes are fairly small, so it's mostly about the concept. One thing to note is that batched hashing using the |
That wouldn't be an issue for mining software because it only needs to remember the previous nonce value (4 bytes). But yes, |
src/randomx.cpp
Outdated
| void randomx_calculate_hash_v2(const void* input, size_t inputSize, const void* v1_in, void* v2_out) { | ||
| assert(inputSize == 0 || input != nullptr); | ||
| assert(v1_in != nullptr); | ||
| assert(v2_out != nullptr); |
There was a problem hiding this comment.
Hi, this can help prevent user error when calling the library.
assert(v1_in != v2_out);
There was a problem hiding this comment.
It will work perfectly fine with v1_in == v2_out.
|
I renamed the new function to |
Related to this proposal: monero-project/monero#8827
The commitment is calculated from the hash and its input (i.e. the block header). The idea is that the output of
randomx_calculate_hashwill be appended to the block header and the difficulty will be calculated based on the output ofrandomx_calculate_commitment, which is very fast.