Skip to content

fix(M-OEMCS-3): probe min_extranonce_size 4/10/32 - #27

Draft
lucasbalieiro wants to merge 2 commits into
stratum-mining:mainfrom
lucasbalieiro:fix/18-extranonce-size-probes
Draft

lucasbalieiro wants to merge 2 commits into
stratum-mining:mainfrom
lucasbalieiro:fix/18-extranonce-size-probes

Conversation

@lucasbalieiro

@lucasbalieiro lucasbalieiro commented Nov 7, 2026 •

Copy link
Copy Markdown
Collaborator

closes #18

I needed to update the sv2-apps and stratum deps after hitting a deadlock in the buffer pool. A patch had already been applied, so I just needed to pull in the updates here.

The M-OEMCS-3 now exercises extranonces with sizes 4, 10, and 32.

The test is working, and Braiins is failing this check. We should create a proper issue in the tracker once this gets merged.

cargo run -- --config ci.targets.toml 
   Compiling interoperability_tests_sv2 v0.1.0 (/Users/lucasbalieiro/dev/stratumv2_workspace/interoperability-tests-sv2)
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 1.16s
     Running `target/debug/sv2-compliance --config ci.targets.toml`
── Braiins Pool: MiningServer at 172.65.65.63:3333 ──
  ✓ C-SCS-1 framed-setup-connection-response (used_version=2)
  ✓ C-SCS-2 used-version-within-range (used_version=2)
  ✗ C-SC-7 unsupported-protocol-rejected: endpoint accepted the SetupConnection with used_version=2
  ✓ C-SC-8 unsupported-version-rejected ((3,3), (3,2), (1,1) rejected)
  ✓ M-OSMCS-1 request-id-echo (channel_id=1, group_channel_id=0)
  ✓ M-OEMCS-1 request-id-echo (channel_id=1, group_channel_id=0, extranonce_size=6)
  ✗ M-OEMCS-3 extranonce-size-at-least-min: min_extranonce_size=10: server granted extranonce_size=6, smaller than requested
  ✓ M-NMJ-1 first-message-after-open-is-job
  ✓ M-NMJ-2 first-job-is-future-job
  ✓ M-NEMJ-1 first-message-after-open-is-job
  ✓ M-NEMJ-2 first-job-is-future-job

✗ 9/11 scenarios passed, 2 failed across 1 target(s)

Move the lockfile to sv2-apps b6a26a41 and stratum 2220f62d, which brings buffer_sv2 4.0.0. In that version BufferPool no longer spin-waits in Drop for slices held by other tasks, so dropping a Tokio current-thread runtime while a frame still references pool memory cannot deadlock. That deadlock showed up when two networked tests in this suite ran in parallel.
@lucasbalieiro

lucasbalieiro commented Nov 7, 2026 •

Copy link
Copy Markdown
Collaborator Author

this is so fun, another pool is failing.

NexusPool:

── NexusPool: MiningServer at 144.202.61.15:3350 ──
  ✓ C-SCS-1 framed-setup-connection-response (used_version=2)
  ✓ C-SCS-2 used-version-within-range (used_version=2)
  ✓ C-SC-7 unsupported-protocol-rejected (error_code="unsupported-protocol")
  ✓ C-SC-8 unsupported-version-rejected ((3,3), (3,2), (1,1) rejected)
  ✓ M-OSMCS-1 request-id-echo (channel_id=157, group_channel_id=0)
  ✓ M-OEMCS-1 request-id-echo (channel_id=158, group_channel_id=0, extranonce_size=4)
  ✗ M-OEMCS-3 extranonce-size-at-least-min: min_extranonce_size=32: server granted extranonce_size=16, smaller than requested
  ✓ M-NMJ-1 first-message-after-open-is-job
  ✓ M-NMJ-2 first-job-is-future-job
  ✓ M-NEMJ-1 first-message-after-open-is-job
  ✓ M-NEMJ-2 first-job-is-future-job

@lucasbalieiro

Copy link
Copy Markdown
Collaborator Author

I'll be keeping this in draft because I think I can make some updates in the integration_tests_sv2 to make the life here easier

@lucasbalieiro

lucasbalieiro commented Nov 8, 2026 •

Copy link
Copy Markdown
Collaborator Author

I'll be keeping this in draft because I think I can make some updates in the integration_tests_sv2 to make the life here easier

I've adapted the code here on top of stratum-mining/sv2-apps#991;

@lucasbalieiro
lucasbalieiro force-pushed the fix/18-extranonce-size-probes branch 2 times, most recently from db90c06 to 81efb0d Compare November 11, 2026 04:34
A pool that silently caps the rollable extranonce space at 6 bytes passed the previous single probe at 4. Probe 4, 10 and 32 on fresh connections and reject any Success that grants fewer bytes than requested. An explicit OpenMiningChannel.Error remains compliant under section 5.3.4.

Add regression tests that simulate pools with fixed 6-byte and 31-byte caps, answer them through MockUpstream::with_handler, and update the detection text in COVERAGE.md. The sv2-apps dependencies temporarily point at PR #991's branch for MockUpstream and channel_open_success_with_size; switch back to stratum-mining/sv2-apps main once it lands.

Refs: stratum-mining/sv2-apps#991
@lucasbalieiro
lucasbalieiro force-pushed the fix/18-extranonce-size-probes branch from 81efb0d to d43c79a Compare November 11, 2026 18:59
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.

consider increasing MIN_EXTRANONCE_SIZE in the suite to 10 in M-OEMCS-3

1 participant