As you may know, the BFL single, while being a great mining asset, cannot be used efficiently with P2Pool. The reason for this is that P2Pool has a share time of 10 seconds, on average, and the BFL single scans a whole 2^32 nonce range before reporting results. This means it constantly ends up doing stale work. Scanning a whole nonce range on a BFL single takes about 5 seconds.
Here are the firmware modifications that would be required to use BFL singles on P2Pool:
- Add a new "ZDX"-like command that accepts a nonce range to scan, this would add communication overhead, but would allow the mining software to control the maximum work change latency. This would work pretty much like the cgminer -I "intensity" to control the work batch size. This would also allow splitting a single getwork across multiple devices. While not perfect in isolation, this modification should be simple enough and would make mining on P2Pool at least possible.
- Make the new "do work" command abort and replace the current work. This would lower the reaction time to a longpoll significantly. Somewhat harder to implement than the previous change, but should still feasible with the current hardware (taking a guess here).
- Once a nonce that hashes to an acceptable value, report the finding to the host immediately instead of waiting for the end of the work batch. This change is much harder than the others, since it requires modifying the hashing inner-loop and would break the current protocol. This would reduce stales significantly.
I would greatly appreciate if someone from BFL can ring in on this and tell us if it is at all possible.
These changes would preferably only require a firmware change, but I don't know if this is possible as the BFL hardware is a black box (pun intended).
Any and all comments welcome.
New commands (Including new job-issuing command and new status-read command) will be added
to the future firmware. This will include nonce-range selection and other changes/improvements that
we decide to present.
Full specification of new commands will be published as soon as they are finalized.
Good Luck,
BF Labs Inc.
Whatever you do, try to avoid having the host poll the BFL device like crazy, try to be somewhat asynchronous if you can.
Polling over sychronous was chosen for several reasons:
1) Unit can respond to other commands while it's processing other data/tasks
(e.g. Temperature-reading, new job request while the previous one hasn't finished, etc)
2) Polling is very easy to implement in opensource softwares. Synchronouse design
will face all kinds of different challenges during development/debug cycle.
3) And most important of them all, designing multi-thread applications that can
communicate with BFL units operating in an asychronous environment is a lot easier
than designing the same system in a synchronous environment.
Please let me know if you have other questions.
Good Luck,
BF Labs Inc.