Software development for any bitcoin mining, solo or pooled, requires an excessively large hash rate to ensure block submission is correct. Effectively to submit a full difficulty network block before there is some certainly of the validity of the block generation code developed. Many developers do not test this properly and have lost blocks due to the developer’s ignorance or negligence.
If instead the difficulty of the block submitted could optionally only be tested last, then testing block generation by submitting a low difficulty block, that would fail with {“result”:“high-hash”,“error”:null,“id”:1} could directly imply that all other requirements and consensus tests have passed, only the low difficulty of the block has failed. Implementing this would greatly simplify testing block generation code, since testing could be run on a bitcoin on the live network which would also be under the full validation and consensus rules of the live network. A developer could simply stop their live bitcoin, restart it with the late difficulty validation flag and then run any testing required, then restart it without the flag.
This change would, of course, have to be optional, since saving one of the quickest and easiest tests of hashing the block header, moved much later in the validation, might open a DDoS exploit. The bitcoin code could have two paths doing the difficulty validation and run one or the other depending upon the runtime flag.
Using testnet is not an exact test of the bitcoin block validation code due to varying code paths and varying consensus rules.
My normal process to test this is to hack the difficulty test in current bitcoin code and submit a lower difficulty block. This however, means I must lock the development bitcoin behind a completely closed wall, since should it attempt to transmit the low difficulty block, it’s IP would be appropriately ostracized by the live network. The further result of this is the bitcoin having invalid blocks in it’s database, which I have found it unable to roll back on a restart during re-validation with an unmodified bitcoin, and thus having to delete it.
Using a live online bitcoin, with a simple restart with a flag to enable full testing other than difficulty being last, should promote better development of mining generation software.