Doge Task/Solution Processing#810
Conversation
Implement special handling of DogeShareValidation user queries
philippwerner
left a comment
There was a problem hiding this comment.
Thanks, overall looks good to me. Just a few minor comments:
|
LGTM 👍 |
| copyMem(queryData + offset, dogeSol->nonce, 4); offset += 4; | ||
| copyMem(queryData + offset, task.dispatcherTarget, 32); offset += 32; | ||
|
|
||
| customQubicMiningStorage.addOracleQuery(tx); |
There was a problem hiding this comment.
If this customQubicMiningStorage.addOracleQuery(tx) return false, do we need to broadcast this tx ?
There was a problem hiding this comment.
yes, the function may return false if the storage is full but we still want to give the comp a chance to get some rev points for this share. If the query tx is not included in the scheduled tick it's bad luck and there won't be any retries but it's better than not broadcasting the query tx at all.
| @@ -1582,36 +1582,36 @@ static void processBroadcastCustomMiningSolution(RequestResponseHeader* header) | |||
| if (customQubicMiningStorage.addSolution(sol, messageSize - SIGNATURE_SIZE, reinterpret_cast<unsigned char*>(&task)) < 0) | |||
There was a problem hiding this comment.
In case of storage full customQubicMiningStorage.addSolution(sol, messageSize - SIGNATURE_SIZE, reinterpret_cast<unsigned char*>(&task)) == 0 we are still processing this sol ?
There was a problem hiding this comment.
yes, similar reasoning to above with adding the query. I don't want the comp to miss out on revenue points just because the storage is full.
I don't think so. If it's non-seamless, the storage is anyways initialized from scratch. If it is seamless, I'd expect that we want to keep retrying queries from the previous epoch. |
This PR adds processing of doge tasks and solutions to the core node.
A new
CustomQubicMiningStorageclass is introduced to save active tasks and keep record of solutions to prevent duplicate solutions from triggering oracle queries. The class is designed to support other custom mining tasks apart from doge in the future.Apart from adding tasks and solutions to the storage, the core node will send an oracle query for share validation if the solution came from a computor pool matching its own comp id.
There are two retry mechanisms for sending oracle queries: