Repository navigation
rpc: unescape JSON object keys in fillMessage - #35587
Merged
Merged
Conversation
jrhea
reviewed
Aug 26, 2026
jrhea
requested changes
Aug 26, 2026
cuiweixie
force-pushed
the
rpc-unescape-json-keys
branch
from
August 27, 2026 00:01
8639923 to
bdcfde7
Compare
cuiweixie
marked this pull request as ready for review
August 27, 2026 00:02
cuiweixie
marked this pull request as draft
August 31, 2026 06:30
Contributor
|
@cuiweixie if you mark this as "ready for review", then i will merge |
cuiweixie
marked this pull request as ready for review
August 31, 2026 23:27
Contributor
Author
please merge this pr. |
jimmyc256
pushed a commit
to Lambda256/go-ethereum-ralim
that referenced
this pull request
Sep 23, 2026
## Summary - `fillMessage` previously compared raw JSON object keys without unescaping, so unicode-escaped names like `"metho\u0064"` did not match `"method"`. - Unescape keys that contain `\` before matching, matching `encoding/json` map-key behavior. - Add regression coverage for unicode-escaped and double-escaped keys; let `FuzzFillMessage` also exercise escaped keys. ## Test plan - [x] `go test ./rpc/ -run TestParseMessage` - [x] Confirm `TestParseMessage/unicode-escaped_method_key` fails without the unescape change - [ ] `go test ./rpc/ -run=FuzzFillMessage -fuzz=FuzzFillMessage -fuzztime=10s`
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
fillMessagepreviously compared raw JSON object keys without unescaping, so unicode-escaped names like"metho\u0064"did not match"method".\before matching, matchingencoding/jsonmap-key behavior.FuzzFillMessagealso exercise escaped keys.Test plan
go test ./rpc/ -run TestParseMessageTestParseMessage/unicode-escaped_method_keyfails without the unescape changego test ./rpc/ -run=FuzzFillMessage -fuzz=FuzzFillMessage -fuzztime=10s