Repository navigation
Conversation
Andezion
force-pushed
the
fix/blockhash-endianness-9465
branch
from
October 26, 2026 13:29
6d4b145 to
4b01482
Compare
Andezion
force-pushed
the
fix/blockhash-endianness-9465
branch
2 times, most recently
from
November 3, 2026 13:48
78b9750 to
d227f75
Compare
sangbida
force-pushed
the
fix/blockhash-endianness-9465
branch
from
November 23, 2026 07:13
d227f75 to
deafa2e
Compare
sangbida
approved these changes
Nov 23, 2026
sangbida
left a comment
Collaborator
There was a problem hiding this comment.
The change is good but I think it needs a changelog!
Andezion
force-pushed
the
fix/blockhash-endianness-9465
branch
from
November 23, 2026 19:12
deafa2e to
3a8846e
Compare
This branch has not been deployed
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.
Fixes #9465
Summary
getrawblockbyheight_callback()parsed the plugin sblockhashfield withjson_to_sha256(), which hex-decodes without reversing bytes. Every other block hash / txid parser in the codebase (likebitcoin_blkid_from_hex,bitcoin_txid_from_hex,json_to_bitcoin_blkid) reverses the bytes after decoding, since bitcoind displays hashes in rpc/json in the opposite byte order to the internal representation used for hashing and db storageMost callers of
bitcoind_getrawblockbyheight()ignore the parsedblkidand recompute it from the block header instead, so they were unaffected. Butprocess_getfilteredblock_step1()(used for on-demand gossip block backfill) trusts the parsed value directly, andwallet_filteredblock_add()writes it straight intoblocks.hash- producing rows with inconsistent endianness relative to rows written by normal chain-tip syncFix
Parse
blockhashwithjson_to_bitcoin_blkid()instead, matching every other blkid parser in the codebaseChangelog-None
Important
26.09 FREEZE August 5th: Non-bugfix PRs not ready by this date will wait for 26.12.
RC1 is scheduled on August 17th
The final release is scheduled for September 7th.
Checklist
Before submitting the PR, ensure the following tasks are completed. If an item is not applicable to your PR, please mark it as checked:
tools/lightning-downgrade