Skip to content

fix(scenarios): probe accepted protocols in C-SC-7 - #29

Open
lucasbalieiro wants to merge 3 commits into
stratum-mining:mainfrom
lucasbalieiro:fix/17-c-sc-7-protocol-probe
Open

lucasbalieiro wants to merge 3 commits into
stratum-mining:mainfrom
lucasbalieiro:fix/17-c-sc-7-protocol-probe

Conversation

@lucasbalieiro

@lucasbalieiro lucasbalieiro commented Nov 15, 2026 •

Copy link
Copy Markdown
Collaborator

closes #17

C-SC-7 assumed the app type configured for the suite was the only Sv2 sub-protocol the endpoint served, so any SetupConnection.Success for another protocol was treated as a violation.

That assumption is not in the spec: 3.6.1 only requires SetupConnection.Error when the server does not support the requested protocol, and one deployment may serve several sub-protocols on the same address.

The scenario now probes every other defined protocol with its own SetupConnection flags, sends that protocol’s first client message (OpenStandardMiningChannel, AllocateMiningJobToken, or CoinbaseOutputConstraints), and classifies the reply.

A same-family reply passes and notes that the endpoint serves both; a reply from another protocol family fails; no reply fails for Mining and Template Distribution because both specs require a first server response, while Job Declaration silence is reported as not exercised because 6.4.2 rate-limits the token request and leaves user_identifier restrictions to the server.

COVERAGE.md and the mock-endpoint tests were updated to cover rejection, multi-protocol service, JD silence, TD silence, and wrong-family replies.

Describe the conditional §3.6.1 requirement, the per-protocol probe, and the Template Distribution and Job Declaration outcomes. A bare SetupConnection.Success is no longer described as a violation.
C-SC-7 treated the selected app type as exclusive and failed any SetupConnection.Success for another protocol. The §3.6.1 MUST is conditional and §3 allows one deployment to serve several sub-protocols on the same address, so .Success alone is not evidence of a violation.

Probe every other defined protocol with its own SetupConnection flags and classify the first protocol-family reply. A same-family reply passes as a multi-protocol endpoint; another family fails. No reply fails only where a first server response is mandated (Mining §5.3.2, Template Distribution §7). Job Declaration silence is not exercised because §6.4.2 rate-limits the token request and leaves user_identifier restrictions to the server.

Closes stratum-mining#17
Cover the protocol probe against mock endpoints: both other protocols rejected, another protocol served, Job Declaration silence reported as not exercised, Template Distribution silence reported as failed, and a reply from the wrong protocol family reported as failed.
@lucasbalieiro
lucasbalieiro marked this pull request as ready for review November 15, 2026 20:04
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.

C-SC-7can trigger false positives

1 participant