Skip to content

enforce SetupConnection version ranges - #695

Merged
plebhash merged 6 commits into
stratum-mining:mainfrom
plebhash:2026-08-06-fix-setup-connection-version
Aug 11, 2026
Merged

enforce SetupConnection version ranges#695
plebhash merged 6 commits into
stratum-mining:mainfrom
plebhash:2026-08-06-fix-setup-connection-version

Conversation

@plebhash

@plebhash plebhash commented Aug 6, 2026

Copy link
Copy Markdown
Member

@bit-aloo bit-aloo left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks good. Some nits.

Comment thread miner-apps/jd-client/src/lib/downstream/common_message_handler.rs Outdated
Comment thread pool-apps/jd-server/src/lib/job_declarator/downstream/common_message_handler.rs Outdated
Comment thread pool-apps/jd-server/src/lib/job_declarator/downstream/common_message_handler.rs Outdated
@plebhash
plebhash force-pushed the 2026-08-06-fix-setup-connection-version branch 4 times, most recently from b377b63 to b212671 Compare August 8, 2026 19:17

@bit-aloo bit-aloo left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

ACK.

Single source of truth for the SV2 protocol version supported by the
apps in this workspace, to be used by SetupConnection handlers instead
of per-app local constants.

Related to stratum-mining#694
Per SV2 spec, SetupConnectionSuccess.used_version must be within the
client's [min_version, max_version] range, and the server must respond
with SetupConnectionError (protocol-version-mismatch) when it cannot
support any version in the requested range. The pool was unconditionally
responding with used_version=2.

Depends on the companion stratum PR introducing
ERROR_CODE_SETUP_CONNECTION_PROTOCOL_VERSION_MISMATCH in
common_messages_sv2.

Related to stratum-mining#694
Same defect as the pool: JDS was unconditionally responding with
used_version=2 without validating the client's version range.

Related to stratum-mining#694
…otocol version

Same defect as pool and JDS on the JDC downstream-facing interface: it
validated protocol and feature flags but not the client's version range,
unconditionally responding with used_version=2.

Related to stratum-mining#694
Assert that pool, JDS and JDC downstream reject a SetupConnection
requesting only version 3 with a SetupConnectionError carrying the
protocol-version-mismatch error code.

Related to stratum-mining#694
@plebhash
plebhash force-pushed the 2026-08-06-fix-setup-connection-version branch from b212671 to 5fb3885 Compare August 11, 2026 19:24
@plebhash
plebhash marked this pull request as ready for review August 11, 2026 19:48
@plebhash
plebhash force-pushed the 2026-08-06-fix-setup-connection-version branch from 5fb3885 to 85921f4 Compare August 11, 2026 19:53
@plebhash
plebhash merged commit b26cf78 into stratum-mining:main Aug 11, 2026
10 checks passed
@plebhash
plebhash deleted the 2026-08-06-fix-setup-connection-version branch August 11, 2026 20:05
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.

apps ignore SetupConnection version range

3 participants