Repository navigation
Conversation
escapeText stopped at CharacterIterator.DONE, which equals U+FFFF, so string fields containing it were truncated in HTTP JSON while txID still covered the full bytes, causing SIGERROR on broadcast. Iterate by index, replace unpaired surrogates with '?' to match the encoded bytes, and drop the escapeNameStringText workaround.
halibobo1205
approved these changes
Nov 5, 2026
bladehan1
approved these changes
Nov 6, 2026
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.
What does this PR do?
JsonFormat.escapeTextby index instead ofCharacterIterator, sostringfields containing U+FFFF are printed in full.\uXXXX\uXXXX, and replace unpaired surrogates with?, the same character used when such a string is encoded to UTF-8.escapeNameStringText; name-stringbytesfields callescapeTextdirectly with identical output.Why are these changes required?
CharacterIterator.DONEequals U+FFFF, soescapeTextstopped at the first U+FFFF and the rest of the value was dropped from the HTTP JSON output.raw_data_hexandtxIDare computed from the full bytes, so a transaction rebuilt from that JSON by/wallet/broadcasttransactionhas a different txID and fails signature validation. Affected fields includeSmartContract.name, ABI entry/paramnameandtype,Permission.permission_name,AssetIssueContract.idandWitness.url.This PR has been tested by:
JsonFormatEscapeTest: U+FFFF/U+FFFE at different positions, surrogate pairs and unpaired surrogates, and print ->packTransactionround trips forCreateSmartContract,AccountPermissionUpdateContractandAssetIssueContractwithvisibletrue and false, asserting identicalraw_databytes and txID.Follow up
None.
Extra details
Behavior changes (release note)
buildTransactionresponses now return the full value ofstringfields containing U+FFFF instead of a truncated one. During a rolling upgrade, nodes that are not yet upgraded still return the truncated value.stringvalue is now printed as?instead of raising an error.