Fix standard SV2 Merkle root byte order - #4
Open
feepool wants to merge 1 commit into
Open
Conversation
feepool
marked this pull request as ready for review
August 18, 2026 01:45
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.
Summary
Fix standard Stratum V2 mining jobs so the advertised
NewMiningJob.merkle_rootmatches the Merkle root used when CKPool validates submitted shares.
Problem
The standard-SV2 path computed the raw SHA256d Merkle digest and then applied
CKPool's existing
flip_32()conversion before placing it in the SV2 U256field. SV2 carries the digest bytes in little-endian integer order, so this
word swap advertised a different Merkle root from the one used by
submission_diff().Miners consequently hash a different header than CKPool validates. V1 is not
affected because this conversion is specific to the standard-SV2 job path.
Fix
field.
word-swap regression is caught.
Validation
Built from current upstream
master(5fca384e) with:Configuration confirmed IPC mining and SV2 enabled. The upstream test suite
passed all 9 tests with 0 failures. The corrected binary also built
successfully with no compiler warnings from this change.