Skip to content

Bind Stratum work queue items to source epochs - #1855

Open
Distortions81 wants to merge 2 commits into
bitaxeorg:masterfrom
Distortions81:fix/sv2-work-ownership
Open

Bind Stratum work queue items to source epochs#1855
Distortions81 wants to merge 2 commits into
bitaxeorg:masterfrom
Distortions81:fix/sv2-work-ownership

Conversation

@Distortions81

@Distortions81 Distortions81 commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Give every queued work item an immutable type and matching destructor.
  • Bind items to source epochs so clean jobs and reconnects invalidate stale work.
  • Replace the oldest item under the queue lock at capacity.
  • Generate work from the owned item type, not mutable protocol state.
  • Snapshot and validate extended-channel extranonce state inside owned jobs.

Root cause and impact

The shared queue stored untyped pointers and chose their interpretation/destructor from mutable global state. V1/V2 failover or SV2 standard/extended transitions could cast or free work as the wrong type. Mining modes and the trusted-network model are unchanged.

Related work

CI follow-up

The first run resolved a new test component relative to symlinked test-ci/ incorrectly. ../test/components now works from both local test/ and CI.

Validation

  • ESP-IDF 6.0.2 firmware and ESP32-S3 test builds passed
  • Exact CI QEMU environment: 74 passed, 0 failed
  • Typed destruction, source mismatch, stale epoch, capacity, clear, and timeout tests
  • git diff --check

Live failover and standard/extended transitions remain desirable.

@github-actions

github-actions Bot commented Aug 7, 2026

Copy link
Copy Markdown

Test Results

  2 files    2 suites   1s ⏱️
122 tests 122 ✅ 0 💤 0 ❌
124 runs  124 ✅ 0 💤 0 ❌

Results for commit 4f22ae2.

@Distortions81
Distortions81 marked this pull request as ready for review August 7, 2026 22:29
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.

1 participant