use variable length slice for Solution to permit regtest#541
Merged
LarryRuane merged 1 commit intozcash:masterfrom Jan 30, 2026
Merged
use variable length slice for Solution to permit regtest#541LarryRuane merged 1 commit intozcash:masterfrom
LarryRuane merged 1 commit intozcash:masterfrom
Conversation
Collaborator
Author
|
To test this using In another window, at the top level of the Without this PR, you'll see this in the log messages: |
…and mainnet This fixes the breaking of regtest by PR 505 (Change hash representation from slice to 32-byte array). See also PR 533. Co-authored-by: Larry Ruane <larry@electriccoin.co>
e40459e to
2f2637f
Compare
2 tasks
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.
This fixes the breaking of regtest caused by #505 (Change hash representation from slice to 32-byte array). There is no functional mainnet difference.
The
Solutionfield within the block header has different sizes for regtest (36 bytes) and mainnet and testnet (1344 bytes), and #505 added the assumption thatSolutionis always 1344 bytes long. This is the one field whose length is compact-length encoded in the serialization, so it makes sense to treat it as variable length -- it could change in the future. (The other fields in the header are fixed-sized.) There is some unit test code that assumes 1344 bytes, but that's okay.This PR replaces #533, which has been in draft status for a long time and seems to have been abandoned.