sv1_api + stratum-translation: BIP323 adaptations - #2237
Merged
plebhash merged 3 commits intoAug 4, 2026
Merged
Conversation
bit-aloo
reviewed
Aug 3, 2026
bit-aloo
left a comment
Member
There was a problem hiding this comment.
Some suggestions and rest looks good.
plebhash
force-pushed
the
2026-07-31-bip323-sv1-api-translation
branch
from
August 3, 2026 16:17
85efe09 to
b0f746c
Compare
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
force-pushed
the
2026-07-31-bip323-sv1-api-translation
branch
from
August 4, 2026 13:16
b0f746c to
8669359
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
close #2195
companion stratum-mining/sv2-apps#656