Skip to content

represent share work as u64 (where appropriate)#2138

Draft
plebhash wants to merge 1 commit intostratum-mining:mainfrom
plebhash:2026-04-22-share-work-u64
Draft

represent share work as u64 (where appropriate)#2138
plebhash wants to merge 1 commit intostratum-mining:mainfrom
plebhash:2026-04-22-share-work-u64

Conversation

@plebhash
Copy link
Copy Markdown
Member

@plebhash plebhash commented Apr 22, 2026

close #2092

companion stratum-mining/sv2-apps#449


for the client side, everything is going to arrive over the wire as u64, so there's no point in representing work as f64

but on the server side, if we truncated every share's work into u64 before it was stored on memory, repeated truncation would cause the accumulated work accounting to drift away from its real value over time

so on the server side, it's sufficient to keep truncation limited to get_last_batch_work_sum (which is the getter used for crafting SubmitSharesSuccess), while maintaing f64 for in-memory representation of work

@plebhash plebhash force-pushed the 2026-04-22-share-work-u64 branch from 1541fc7 to 767d510 Compare April 22, 2026 18:31
@plebhash
Copy link
Copy Markdown
Member Author

reverting back to draft, see: #2092 (comment)

@plebhash plebhash marked this pull request as draft April 25, 2026 00:05
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.

need to switch ShareAccounting work representation from f64 to u64 on channels_sv2

2 participants