Skip to content
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

Closed
wants to merge 6 commits into from
Closed

[WIP] Adds GPU Mining #14

wants to merge 6 commits into from

Conversation

edsonayllon
Copy link

PR description

Allows GPU Mining using EthMiner. Documentation added as GPU-MINING.md.

demo

Fixed Issue(s)

Consensys/protocol-BountiedWork#20

Copy link
Contributor

@shemnon shemnon left a 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) {
Copy link
Contributor

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;
Copy link
Contributor

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.

Copy link
Author

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;
Copy link
Contributor

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?

Copy link
Author

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;
Copy link
Contributor

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(
Copy link
Contributor

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.

@edsonayllon
Copy link
Author

edsonayllon commented Sep 17, 2019

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.

@edsonayllon
Copy link
Author

edsonayllon commented Sep 17, 2019

@shemnon New PR: #20

fab-10 added a commit to fab-10/besu that referenced this pull request Jan 10, 2024
Signed-off-by: Fabio Di Fabio <fabio.difabio@consensys.net>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants