Skip to content

Commit 9f44b3b

Browse files
author
plebhash
committed
clarify SubmitShares.Success
it's not clear what the `new_shares_sum` field of `SubmitShares.Success` really means after reaching out to @jakubtrnka , he described the following: > `new_submits_accepted_count` is number of submits. > `new_shares_sum` is "integral" over difficulty of work to be confirmed by this success msg this commit clarifies both `SubmitShares.Success` and `SubmitShares.Error` with detailed descriptions and new visual diagrams.
1 parent 90f0ccb commit 9f44b3b

File tree

7 files changed

+580
-2
lines changed

7 files changed

+580
-2
lines changed

.idea/vcs.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/workspace.xml

Lines changed: 104 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

05-Mining-Protocol.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -356,17 +356,21 @@ Because it is a common case that shares submission is successful, this response
356356
| channel_id | U32 | Channel identification |
357357
| last_sequence_number | U32 | Most recent sequence number with a correct result |
358358
| new_submits_accepted_count | U32 | Count of new submits acknowledged within this batch |
359-
| new_shares_sum | U64 | Sum of shares acknowledged within this batch |
359+
| new_shares_sum | U64 | Sum of difficulty of shares acknowledged within this batch |
360360

361361
The server does not have to double check that the sequence numbers sent by a client are actually increasing.
362362
It can simply use the last one received when sending a response.
363363
It is the client’s responsibility to keep the sequence numbers correct/useful.
364364

365+
The illustration below assumes a mining server that acknowledges every 10 successful submissions, and that a `SetTarget` message was sent to increase the difficulty from `Da` to `Db` in the middle of the batch submission.
366+
367+
<img width="800" src="img/submit_shares_success.png">
368+
365369
### 5.3.14 `SubmitShares.Error` (Server -> Client)
366370

367371
An error is immediately submitted for every incorrect submit attempt.
368372
In case the server is not able to immediately validate the submission, the error is sent as soon as the result is known.
369-
This delayed validation can occur when a miner gets faster updates about a new prevhash than the server does (see `NewPrevHash` message for details).
373+
This delayed validation can occur when a miner gets faster updates about a new prevhash than the server does (see `SetNewPrevHash` message for details).
370374

371375
| Field Name | Data Type | Description |
372376
| --------------- | --------- | ----------------------------------------------------------- |
@@ -381,6 +385,10 @@ Possible error codes:
381385
- `difficulty-too-low`
382386
- `invalid-job-id`
383387

388+
The illustration below also assumes a mining server that acknowledges every 10 successful submissions.
389+
390+
<img width="800" src="img/submit_shares_error.png">
391+
384392
### 5.3.15 `NewMiningJob` (Server -> Client)
385393

386394
The server provides an updated mining job to the client through a standard channel. This MUST be the first message after the channel has been successfully opened. This first message will have min_ntime unset (future job).

0 commit comments

Comments
 (0)