-
Notifications
You must be signed in to change notification settings - Fork 90
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
Add RPCs for external RandomX mining #997
Conversation
utACK 9974e54 |
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.
ACK 9974e54
NIT - Please remove commented out code.
@@ -901,7 +751,7 @@ static UniValue getblocktemplate(const JSONRPCRequest& request) | |||
result.pushKV("proofoffullnodehash", pblock->hashPoFN.GetHex()); | |||
result.pushKV("mining_disabled", (!CheckConsecutivePoW(*pblock , pindexPrev))? true : false ); | |||
|
|||
if (pblock->IsProgPow()) { | |||
if constexpr (nPoWType == CBlockHeader::PROGPOW_BLOCK) { // if (pblock->IsProgPow()) { |
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.
Remove commented code.
@@ -919,10 +769,214 @@ static UniValue getblocktemplate(const JSONRPCRequest& request) | |||
lastheader = pblock->GetProgPowHeaderHash().GetHex(); | |||
} | |||
} | |||
if constexpr (nPoWType == CBlockHeader::RANDOMX_BLOCK) { // if (pblock->IsRandomX()) { |
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.
Remove commented code.
Now you merged it with the commented code still there? |
Yes, I wanted to get it merged. I need to update the copyrights before the release. I will clean this up then if it hasn't been already. |
Problem
getblocktemplate
RPC uses for its blocks depends on the value the user selects for mining in the GUI of the wallet / in the config.Root Cause
Not implemented yet.
Solution
The solution was to:
algo
parameter to thegetblocktemplate
RPC which overrides any mining algorithm specified in the config / GUI.rxrpcsb
for submitting randomx blocks, analogous topprpcsb
.This makes it possible to mine at the same time progpow, randomx and sha256d externally, independently of what you may additionally mine using the wallet.
Bounty PR
?
Bounty Payment Address
sv1qqpjsrc60t60jhaywj5krmwla52ska70twc7wun6qnee65guxhvtxegpqwhuxypra4jn3pq86s24ryltcw6g2ss4573hyqac9u4g23m9mvxpyqqqwny49k
Unit Testing Results
Tested by mining at the same time progpow blocks with t-rex miner and randomx blocks with xmrig, where both found at least one block.