ifdefelse / ProgPOW

A Programmatic Proof-of-Work for Ethash. Forked from https://github.com/ethereum-mining/ethminer
GNU General Public License v3.0
257 stars 84 forks source link

Don't redefine and misuse ETHASH_MIX_BYTES #35

Closed solardiz closed 5 years ago

solardiz commented 5 years ago

The ProgPoW source tree changed the value of ETHASH_MIX_BYTES from 128 to 256 and made use of it for ProgPoW specifics while at the same time assuming that Ethash DAG is computed ignoring this macro and using the old value of 128. That was weird. This PR tries to fix that and it also paves the way for experiments with adjusting the value of PROGPOW_DAG_LOADS.

I tested that this compiles (both CUDA and OpenCL) and reports the same speeds as before. I didn't test that it actually computes the same hash values as before - is there a debugging mode included to test that?

lookfirst commented 5 years ago

Andrea added the benchmark mode to his ethminer fork, but it is no longer available. The last version of it is here: https://github.com/miscellaneousbits/ethminer

solardiz commented 5 years ago

@lookfirst Thanks. There's a benchmark mode right in this ProgPoW tree, but apparently no debug mode that would print test vectors, etc.

solardiz commented 5 years ago

I've just tested this PR's changes on top of those in #44 and #45 using the debugging output patch I posted in https://github.com/ifdefelse/ProgPOW/issues/25#issuecomment-498387585 and using block numbers 30000 and 10000000, but without any other changes (thus, computing ProgPoW 0.9.2). I got the expected correct digests (same as prior to this PR, and same as c-progpow's) for both blocks on both CUDA and OpenCL (and the latter using both AMD and NVIDIA cards).

I think this PR is ready to merge, along with my other 3 PRs that are currently open. I'm aware of good reasons to merge them into this tree, and unaware of any reasons not to.