Skip to content

Doge Task/Solution Processing#810

Merged
Franziska-Mueller merged 25 commits intodevelopfrom
feature/2026-03-19-process-doge-packets
Apr 10, 2026
Merged

Doge Task/Solution Processing#810
Franziska-Mueller merged 25 commits intodevelopfrom
feature/2026-03-19-process-doge-packets

Conversation

@Franziska-Mueller
Copy link
Copy Markdown
Collaborator

@Franziska-Mueller Franziska-Mueller commented Mar 26, 2026

This PR adds processing of doge tasks and solutions to the core node.

A new CustomQubicMiningStorage class 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:

  • oracle queries that are scheduled for a specific tick but end up not being included in the tick are rescheduled (currently indefinitely until inclusion)
  • oracle queries that were excuted but failed (e.g. due to timeout) are retried up to a maximum of currently 3 tries

@Franziska-Mueller Franziska-Mueller changed the base branch from main to develop March 26, 2026 18:08
@Franziska-Mueller Franziska-Mueller marked this pull request as draft March 26, 2026 18:12
@Franziska-Mueller Franziska-Mueller marked this pull request as ready for review March 27, 2026 11:19
Copy link
Copy Markdown
Contributor

@philippwerner philippwerner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, overall looks good to me. Just a few minor comments:

@philippwerner
Copy link
Copy Markdown
Contributor

LGTM 👍

Copy link
Copy Markdown
Collaborator

@cyber-pc cyber-pc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also is a reset of customQubicMiningStorage required at beginning of epoch ?

copyMem(queryData + offset, dogeSol->nonce, 4); offset += 4;
copyMem(queryData + offset, task.dispatcherTarget, 32); offset += 32;

customQubicMiningStorage.addOracleQuery(tx);
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this customQubicMiningStorage.addOracleQuery(tx) return false, do we need to broadcast this tx ?

Copy link
Copy Markdown
Collaborator Author

@Franziska-Mueller Franziska-Mueller Apr 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In case of storage full customQubicMiningStorage.addSolution(sol, messageSize - SIGNATURE_SIZE, reinterpret_cast<unsigned char*>(&task)) == 0 we are still processing this sol ?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@Franziska-Mueller
Copy link
Copy Markdown
Collaborator Author

Also is a reset of customQubicMiningStorage required at beginning of epoch ?

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.

Copy link
Copy Markdown
Collaborator

@cyber-pc cyber-pc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@Franziska-Mueller Franziska-Mueller merged commit 52d1d80 into develop Apr 10, 2026
1 check passed
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.

3 participants