Skip to content

rpc: unescape JSON object keys in fillMessage - #35587

Merged
jrhea merged 1 commit into
ethereum:masterfrom
cuiweixie:rpc-unescape-json-keys
Sep 1, 2026
Merged

jrhea merged 1 commit into
ethereum:masterfrom
cuiweixie:rpc-unescape-json-keys

Conversation

@cuiweixie

Copy link
Copy Markdown
Contributor

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

  • go test ./rpc/ -run TestParseMessage
  • Confirm TestParseMessage/unicode-escaped_method_key fails without the unescape change
  • go test ./rpc/ -run=FuzzFillMessage -fuzz=FuzzFillMessage -fuzztime=10s

Comment thread rpc/json.go Resolved
@cuiweixie
cuiweixie force-pushed the rpc-unescape-json-keys branch from 8639923 to bdcfde7 Compare August 27, 2026 00:01
@cuiweixie
cuiweixie marked this pull request as ready for review August 27, 2026 00:02
@cuiweixie
cuiweixie requested a review from fjl as a code owner August 27, 2026 00:02
@cuiweixie
cuiweixie marked this pull request as draft August 31, 2026 06:30

@jrhea jrhea left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@jrhea

jrhea commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

@cuiweixie if you mark this as "ready for review", then i will merge

@jrhea jrhea added this to the 1.17.6 milestone Aug 31, 2026
@cuiweixie
cuiweixie marked this pull request as ready for review August 31, 2026 23:27
@cuiweixie

Copy link
Copy Markdown
Contributor Author

@cuiweixie if you mark this as "ready for review", then i will merge

please merge this pr.

@jrhea
jrhea merged commit fbc1c37 into ethereum:master Sep 1, 2026
10 checks passed
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`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants