represent share work as u64 (where appropriate)#2138
Merged
Conversation
plebhash
force-pushed
the
2026-04-22-share-work-u64
branch
from
April 22, 2026 18:31
1541fc7 to
767d510
Compare
GitGab19
approved these changes
Apr 24, 2026
Member
Author
|
reverting back to draft, see: #2092 (comment) |
plebhash
marked this pull request as draft
April 25, 2026 00:05
plebhash
force-pushed
the
2026-04-22-share-work-u64
branch
from
May 15, 2026 22:24
767d510 to
3a7c287
Compare
plebhash
marked this pull request as ready for review
May 15, 2026 23:57
Member
Author
adapted to the new direction now client side keeps track of server side only truncates on |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
close #2092
companion stratum-mining/sv2-apps#449
client side
work acknowledged by upstream arrives over the wire as
u64(SubmitSharesSuccess.new_shares_sum), but for auditability we now track two values:acknowledged_work_sum(u64): what upstream acknowledged over SV2 messagesvalidated_work_sum(f64): what the client validated locally (tracked by job difficulty)this keeps wire accounting aligned with protocol types, while still allowing client to detect mismatches between what it validated vs what server acknowledged
server side
if we truncated every share's work into
u64before storing it in memory, repeated truncation would cause accumulated accounting drift over timeso on the server side, truncation stays limited to
get_last_batch_work_sum(used for craftingSubmitSharesSuccess), while in-memory work accounting remainsf64