Skip to content

Show pending SV2 shares on the dashboard#1735

Open
warioishere wants to merge 3 commits into
bitaxeorg:masterfrom
warioishere:feature/sv2-pending-shares
Open

Show pending SV2 shares on the dashboard#1735
warioishere wants to merge 3 commits into
bitaxeorg:masterfrom
warioishere:feature/sv2-pending-shares

Conversation

@warioishere

@warioishere warioishere commented May 30, 2026

Copy link
Copy Markdown
Contributor

Closes #1728.

On SV2 the pool can batch its share acks, so submitted shares get no feedback until the ack comes in — it looks like they're being ignored. This adds a small "+N pending" badge next to the accepted shares that counts up while shares are waiting and clears once the pool acknowledges them.

Pending is computed in the backend (submitted minus resolved shares, tracked per connection) and exposed as sharesPending in the API. SV1 always reports 0, so the badge only shows on SV2 and only if the pool does batch acks shares..

Tested on hardware against a live SRI reference pool which batch acks 10 shares..

grafik

@github-actions

github-actions Bot commented May 30, 2026

Copy link
Copy Markdown

Test Results

 2 files  ±0   2 suites  ±0   0s ⏱️ ±0s
92 tests ±0  92 ✅ ±0  0 💤 ±0  0 ❌ ±0 
94 runs  ±0  94 ✅ ±0  0 💤 ±0  0 ❌ ±0 

Results for commit 9a857dc. ± Comparison against base commit 5d4afbb.

♻️ This comment has been updated with latest results.

@mutatrum

Copy link
Copy Markdown
Collaborator

Try to limit comments, they're overly verbose.

SV2 pools can batch/buffer share acks, leaving submitted shares with no
visual feedback until the ack arrives — it looks like they're ignored.

Track resolved_shares per connection and derive pending = submitted -
resolved (sharesPending in the API, 0 for SV1). The dashboard shows a
small "+N pending" badge next to accepted shares that clears once the
pool catches up.
@warioishere warioishere force-pushed the feature/sv2-pending-shares branch from 2433977 to 1bd08e7 Compare May 30, 2026 20:29
@warioishere

Copy link
Copy Markdown
Contributor Author

Done — dropped the comments from -vvv to -v 😄

@mutatrum mutatrum added the enhancement New feature or request label Jun 3, 2026
</span>
<div class="text-900 font-medium text-2xl">
{{info.sharesAccepted | number: '1.0-0'}}
<span *ngIf="(info.sharesPending ?? 0) > 0" class="text-base font-medium text-yellow-500 ml-2" pTooltip="Shares submitted to the pool but not yet acknowledged. The pool may batch acks, so this clears once it catches up." tooltipPosition="top">+{{ info.sharesPending }} pending</span>

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.

Drop the '+'. Just the number. It's cleaner.

<justin-timberlake-meme.gif>

Comment thread main/tasks/stratum_v2_task.c Outdated
if (len < 0) return -1;

stratum_v2_record_submit_time(sequence_number);
stratum_v2_update_pending_shares(GLOBAL_STATE);

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.

These two functions can be combined, they're always called together.

…reset

- badge shows just the number
- record_submit_time + update_pending_shares merged into track_submit
- pending no longer reset by hand; derived from the two conn counters
  (memset zeroes both, then update_pending_shares)
@warioishere

Copy link
Copy Markdown
Contributor Author

Pushed a commit addressing all three:

  • Badge shows just the number now.
  • record_submit_time and update_pending_shares merged into a single stratum_v2_track_submit at the submit sites.
  • On the counter reset: good catch. shares_pending is derived from the two conn counters (sequence_number and resolved_shares), so resetting it by hand alongside the memset was redundant and asymmetric. I dropped the manual reset — the memset already zeroes both source counters, and a single stratum_v2_update_pending_shares() after it derives the 0. Also removed the same hand-reset I had added in stratum_v2_close_connection, so pending is now purely derived everywhere.

Let me know if that's clean enough.

@WantClue WantClue added the design Design Enhancements label Jun 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

design Design Enhancements enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add an indicator for submitted shares on SV2

3 participants