Skip to content

sv1_api + stratum-translation: BIP323 adaptations - #2237

Merged
plebhash merged 3 commits into
stratum-mining:mainfrom
plebhash:2026-07-31-bip323-sv1-api-translation
Aug 4, 2026
Merged

sv1_api + stratum-translation: BIP323 adaptations#2237
plebhash merged 3 commits into
stratum-mining:mainfrom
plebhash:2026-07-31-bip323-sv1-api-translation

Conversation

@plebhash

@plebhash plebhash commented Jul 31, 2026

Copy link
Copy Markdown
Member

bit-aloo

This comment was marked as outdated.

@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.

Some suggestions and rest looks good.

Comment thread sv1/src/methods/server_to_client.rs Outdated
Comment thread sv1/src/methods/server_to_client.rs Outdated
@plebhash
plebhash force-pushed the 2026-07-31-bip323-sv1-api-translation branch from 85efe09 to b0f746c Compare August 3, 2026 16: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

@GitGab19 GitGab19 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

Replace hardcoded BIP320 mask (0x1FFFE000, bits 13-28) with BIP323
mask (0x1FFFFFE0, bits 5-28). Define a single constant
VERSION_ROLLING_MASK in sv1_api::utils for reuse by other crates.

- Add pub const VERSION_ROLLING_MASK: u32 = 0x1FFFFFE0 in utils.rs
- VersionRollingParams::new: use the constant; tail check << 19 -> << 27
- Configure::version_rolling_mask: default to VERSION_ROLLING_MASK
- error.rs: update InvalidVersionMask message (13 -> 5 reserved tail bits)
Replace "1fffe000" hex strings and HexU32Be(0x1fffe000) assertions
with the BIP323 mask value "1fffffe0" / HexU32Be(0x1fffffe0) in
parsing test fixtures. These are parsing-only tests and pass either
way; this is for spec consistency.
Use v1::utils::VERSION_ROLLING_MASK instead of the hardcoded BIP320
value 0x1fffe000 in the sv1_to_sv2 test.

The runtime function build_sv2_submit_shares_extended_from_sv1_submit
already takes the mask as a parameter; only the test fixture needed
updating.
@plebhash
plebhash force-pushed the 2026-07-31-bip323-sv1-api-translation branch from b0f746c to 8669359 Compare August 4, 2026 13:16
@plebhash
plebhash merged commit 45cd8b2 into stratum-mining:main Aug 4, 2026
14 of 16 checks passed
@plebhash
plebhash deleted the 2026-07-31-bip323-sv1-api-translation branch August 4, 2026 14:08
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.

sv1_api + stratum-translation need BIP323 adaptations

3 participants