Skip to content

fix(channels_sv2): migrate ShareAccounting from f64 to u64#2116

Closed
Alkamal01 wants to merge 16 commits intostratum-mining:mainfrom
Alkamal01:fix/issue-2092-share-accounting
Closed

fix(channels_sv2): migrate ShareAccounting from f64 to u64#2116
Alkamal01 wants to merge 16 commits intostratum-mining:mainfrom
Alkamal01:fix/issue-2092-share-accounting

Conversation

@Alkamal01
Copy link
Copy Markdown

@Alkamal01 Alkamal01 commented Mar 14, 2026

Refactor share tracking fields to use u64 instead of f64 to avoid precision loss when accumulating shares.

Fixes #2092

companion stratum-mining/sv2-apps#332

@Alkamal01 Alkamal01 changed the title fix(channels_sv2): migrate ShareAccounting from f64 to u64 companion https://github.com/stratum-mining/sv2-apps/pull/#332 Mar 24, 2026
@Alkamal01 Alkamal01 changed the title companion https://github.com/stratum-mining/sv2-apps/pull/#332 fix(channels_sv2): migrate ShareAccounting from f64 to u64 Mar 24, 2026
@Alkamal01 Alkamal01 closed this Mar 24, 2026
@Alkamal01 Alkamal01 reopened this Mar 24, 2026
Copy link
Copy Markdown
Collaborator

@Shourya742 Shourya742 left a comment

Choose a reason for hiding this comment

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

It seems like this might have been generated with AI. Please be mindful of the reviewer’s time and effort

/// _mining.extranonce.subscribe()_
/// Indicates to the server that the client supports the mining.set_extranonce method.
/// https://en.bitcoin.it/wiki/BIP_0310
/// <https://en.bitcoin.it/wiki/BIP_0310>
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.

Why this?

Comment thread sv1/src/json_rpc.rs
@@ -1,4 +1,4 @@
//! https://www.jsonrpc.org/specification#response_object
//! <https://www.jsonrpc.org/specification#response_object>
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.

Why this?

Comment thread sv1/src/lib.rs
Comment on lines +34 to +38
//! [<https://docs.google.com/document/d/17zHy1SUlhgtCMbypO8cHgpWH73V5iUQKk_0rWvMqSNs/edit?hl=en_US#>]
//! [<https://braiins.com/stratum-v1/docs>]
//! [<https://en.bitcoin.it/wiki/Stratum_mining_protocol>]
//! [<https://en.bitcoin.it/wiki/BIP_0310>]
//! [<https://docs.google.com/spreadsheets/d/1z8a3S9gFkS8NGhBCxOMUDqs7h9SQltz8-VX3KPHk7Jw/edit#gid=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.

Why this?

Comment thread Cargo.toml
"integration-test-framework",
"fuzz"
"fuzz",
"sv2-apps"
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.

Why this?

@Alkamal01
Copy link
Copy Markdown
Author

Hey @Shourya742, fair questions, both were added for CI reasons.
The angle brackets fix rustdoc::bare_urls warnings that break the build under -D warnings on MSRV. The sv2-apps exclusion is just a local workaround so I could test alongside sv2-apps#332 without Cargo treating it as a workspace member. Neither should affect anything in production.
If you want I can handle the rustdoc warnings differently — just say the word.

@GitGab19
Copy link
Copy Markdown
Member

This PR is changing many things which are not related to the original issue, it has 16 commits for such a simple task, and can definitely lead to time loss for reviewers.

As agreed during last PR Review Club call, @plebhash will deal with this with a clean PR during this milestone.

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

3 participants