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

ProgPoW CPU validation is not implemented #42

Open solardiz opened 5 years ago

solardiz commented 5 years ago

As I understand, this ProgPoW tree relies on never finding a solution below target, or else it'd try to validate the solution on CPU as Ethash, which will fail. The fork at https://github.com/BitcoinInterestOfficial/ProgPOW does simply:

    // ProgPoW CPU validation is not implemented, override
    s_noeval = true;

Does any other tree implement lightweight ProgPoW validation on CPU?

[My c-progpow based off this ProgPoW tree's README.md currently only implements (cached-)full-DAG-based computation on CPU. Not lightweight.]

solardiz commented 5 years ago

To answer my own question, there's lightweight ProgPoW validation on CPU in:

https://github.com/BitcoinInterestOfficial/BitcoinInterest/blob/master/src/crypto/progpow/ethash.cpp

(For whatever revision of ProgPoW they use, which is somewhat different from what we have here - at least the parameters are different.)

AndreaLanfranchi commented 5 years ago

You can find a working (0.9.2) CPU validation here https://github.com/chfast/ethash/blob/master/lib/ethash/progpow.cpp

solardiz commented 5 years ago

@AndreaLanfranchi @chfast Would one of you perhaps integrate that code into this upstream ProgPoW tree?

chfast commented 5 years ago

@AndreaLanfranchi @chfast Would one of you perhaps integrate that code into this upstream ProgPoW tree?

I'm not going to. I don't see a point of doing so.

solardiz commented 5 years ago

"A point of doing so" could be to allow for testing of the GPU implementations with a realistic target, so that some hashes meeting target are found once in a while and would be validated with the CPU implementation. Right now, we have to add debugging output in order to test the GPU implementations, and this involves changing those implementations either to record many more of the computed hashes than usual or to record/print hashes for a specific global id. Both kinds of changes have the risk of affecting whether an implementation works correctly (especially in presence of potential compiler bugs), thereby potentially invalidating the testing results.

chfast commented 5 years ago

I simply don't want to spend time on it. You can take code for the ethash library and "upstream" it yourself. If by "upstreaming" you mean to put it here and not to the ethminer this repo is a fork of.

Oh, by the way, the upstream ethminer already has the ethash library integrated. You can also simulate pool mining using GPU and verify results on CPU. Also, @AndreaLanfranchi has integrated ProgPoW GPU mining to ethminer, but this work was never merged. This last one we can reconsider.