-
Notifications
You must be signed in to change notification settings - Fork 863
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WIP] Adds GPU Mining #14
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
First, all your commits need "DCO" sign off - https://wiki.hyperledger.org/display/BESU/How+to+Contribute
Second, please refer to externalMining
not gpuMining
- Ethash ASICs exist and in theory other nodes could be CPU mining. Stratum supports all of the above.
.pruningConfiguration(buildPruningConfiguration()) | ||
.genesisConfigOverrides(genesisConfigOverrides); | ||
|
||
if (isGpuMiningEnabled) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This does not need to be an if block with two clauses. Used a ?:
statement, but the odds are it won't be needed as mining will still need a coinbase and not an address of zero.
@@ -33,6 +33,8 @@ | |||
|
|||
private final MiningCoordinator miner; | |||
private static final Logger LOG = getLogger(); | |||
private Boolean solverWasPresent = false; | |||
private String[] storedResult; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't store the stored result in the RPC method, query it from the mining co-ordinator.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mining coordinator doesn't store previous results. In-between results, there would be cases where miner.getWorkDefinition().isPresent()
would return false, returning JsonRpcError.NO_MINING_WORK_FOUND
. This would cause EthMiner connections to abort upon connecting for a few seconds.
@Override | ||
public JsonRpcResponse response(final JsonRpcRequest req) { | ||
// Confirm login request | ||
boolean result = true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this just a stub or should there be more logic here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mining pools use this route to add a miner to their database for purposes such as withholding payouts until a certain threshold is met, collecting fees, and notifying users by email when a miner becomes inactive, while notifying mining software that connection has been established. Here, we're simply accepting all mining software connection requests, notifying mining software connection has been established.
@@ -54,6 +54,7 @@ | |||
private final ProtocolSchedule<C> protocolSchedule; | |||
private final Subscribers<MinedBlockObserver> observers; | |||
private final AbstractBlockScheduler scheduler; | |||
private Boolean gpuMining = false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't call it GPU mining, call it externalMining
, here and throughout.
(block.getHeader().getGasUsed() * 100.0) / block.getHeader().getGasLimit(), | ||
block.getHash(), | ||
taskTimeInSec)); | ||
String.format( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is formatted incorrectly. ./gradlew spotlessApply
will fix all formatting errors.
Signed-off-by: Edson Ayllon <eayllon1@gmail.com>
Signed-off-by: Edson Ayllon <eayllon1@gmail.com>
I added excess commits during rebase and sign off. I'll make these changes, close this pull, and open a new PR with one commit signed off to have a cleaner PR. |
Signed-off-by: Fabio Di Fabio <fabio.difabio@consensys.net>
PR description
Allows GPU Mining using EthMiner. Documentation added as GPU-MINING.md.
Fixed Issue(s)
Consensys/protocol-BountiedWork#20