toggle to allow raw display of miner tag as per WOC#441
Open
freemans13 wants to merge 2 commits intobsv-blockchain:mainfrom
Open
toggle to allow raw display of miner tag as per WOC#441freemans13 wants to merge 2 commits intobsv-blockchain:mainfrom
freemans13 wants to merge 2 commits intobsv-blockchain:mainfrom
Conversation
Contributor
|
🤖 Claude Code Review Status: Complete No issues found. The implementation is clean and well-tested:
|
|
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
Implements a toggle to allow raw (unsanitized) miner tag display, matching WhatsOnChain's behavior.
Fixes https://github.com/bitcoin-sv/teranode/issues/1298
Problem
There was a UTF-8/decoding issue with miner tags. For mainnet block 514587:
A% Zj?d?;?�^G^GA% Zj�d�;��TAAL wants to run comparisons and would prefer Teranode to use the same decoding as WhatsOnChain.
Solution
Added a new setting
blockchain_raw_miner_tag(default:false) that controls whether miner tags are returned raw or sanitized.When
blockchain_raw_miner_tag=false(default)Current behavior is preserved:
/is removedWhen
blockchain_raw_miner_tag=trueRaw coinbase arbitrary text is returned without any processing, preserving binary data.
Changes
New Setting
blockchain_raw_miner_taginBlockChainSettings- controls miner tag sanitizationNew Function
ExtractCoinbaseMinerRaw(coinbaseTx *bt.Tx, raw bool)- extracts miner with optional raw modeExtractCoinbaseMiner()preserved for backward compatibility (calls new function withraw=false)Updated Components
stores/blockchain/sql/): All miner extraction points now use the settingblock_helpers.goGetBlockHeader.goGetBlockHeaders.goGetBestBlockHeader.goGetLatestHeaderFromBlockLocator.goservices/asset/centrifuge_impl/centrifuge.go): WebSocket block notifications use the settingTests
TestExtractCoinbaseMinerRaw- verifies both raw and sanitized modesTestExtractCoinbaseMinerRawPreservesAllBytes- verifies raw mode preserves all bytes including binary dataUsage
To enable raw miner tags (to match WhatsOnChain behavior):
Testing
All existing tests pass, new tests added for raw mode extraction.