Skip to content

sv1 api hardening - #996

Draft
bit-aloo wants to merge 8 commits into
stratum-mining:mainfrom
bit-aloo:2026-11-10-sv1-api-redesign
Draft

bit-aloo wants to merge 8 commits into
stratum-mining:mainfrom
bit-aloo:2026-11-10-sv1-api-redesign

Conversation

@bit-aloo

Copy link
Copy Markdown
Member

sv1_api 8 replaces the four-variant envelope, so the reader decodes with
Message::decode and the test builds the new Request and Response.
Notify, SetExtranonce and the other SV1 messages now come from the sv1_api
root with renamed fields. The crate no longer re-exports the removed
server_to_client module.
The trait has no setters, so the handlers write downstream state themselves
and return results the router replies with. Decoding a downstream message is
one ClientRequest::try_from, and a miner sending a response still disconnects.
Requests and notifications share one variant, IDs are sv1_api::Id, and
notifications parse through ServerNotification.
…m branch

Temporary: points stratum-core at bit-aloo/stratum 2026-11-10-sv1-api-redesign
so CI builds against the companion stratum PR. Drop this commit and update
stratum-core to stratum main once that PR lands.
sv1_api routers no longer return a reply or check session state, so each
handler queues its own reply, records setup progress and forwards an accepted
share upstream. The submit checks the router used to run (authorized worker,
extranonce2 size, version bits) move into check_submit_session, and
pending_share is gone.
ClientRequest and ServerNotification are now ClientToServer and
ServerToClient.
@bit-aloo
bit-aloo force-pushed the 2026-11-10-sv1-api-redesign branch from 04e18c8 to 593c7bb Compare November 16, 2026 13:57
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