feat(framework,actuator,common): replace fastjson with jackson#6701
feat(framework,actuator,common): replace fastjson with jackson#6701halibobo1205 wants to merge 9 commits intotronprotocol:developfrom
Conversation
|
Direction is right — fastjson 1.2.83 has been a long-standing security overhang, and consolidating on Jackson + a thin wrapper is the obvious move. Waiting on the MUST items @lxcmyf and @waynercheung raised before LGTM. One additional question worth pinning down in the PR description: after this change, are there any remaining Also worth a sentence in the PR description on hot-path performance posture: fastjson 1.2.x has a historically-fast parse path, and Jackson has different characteristics under |
|
@yanghang8612 Performance: |
Replace `com.alibaba:fastjson` with Jackson-backed drop-in
wrappers (`org.tron.json.{JSON, JSONObject, JSONArray, JSONException}`).
No external API changes — all HTTP and JSON-RPC responses remain identical.
Motivation:
- Fastjson 1.2.83 is EOL with 20+ CVEs including critical RCE
- Upgrade jackson-databind 2.18.3 → 2.18.6 (GHSA-72hv-8253-57qq)
- Unify JSON handling (previously split between Jackson and Fastjson)
Core changes (common):
- Add org.tron.json wrappers backed by a shared ObjectMapper
- Remove fastjson from common/build.gradle
HTTP & servlet changes (framework):
- Swap imports from com.alibaba.fastjson → org.tron.json across
all HTTP servlets, JSON-RPC layer, and event/log parsers
Test changes:
- Add BaseHttpTest base class for servlet test lifecycle
Build:
- Update jackson to 2.18.6
- Remove fastjson
close tronprotocol#6607
…ndexV2ServletTest
0210c18 to
0116365
Compare
8f82a26 to
669321a
Compare
Summary
Replace
com.alibaba:fastjsonwith Jackson-backed drop-in wrappers (org.tron.json.{JSON, JSONObject, JSONArray, JSONException}). No external API changes — all HTTP and JSON-RPC responses remain identical.Motivation
Core changes
(common):
org.tron.jsonwrappers backed by a sharedObjectMappercommon/build.gradlemaxNestingDepth/maxTokenCountonCommonParameterandNodeConfig.HttpConfig, with defaults100/100_000inreference.conf(framework): HTTP & servlet changes
com.alibaba.fastjson→org.tron.jsonacross all HTTP servlets, JSON-RPC layer, and event/log parsersConfiguration
Two new
node.httpkeys (defaults shown):Beyond either ceiling, parsing fails with
StreamConstraintsExceptionbefore any business logic runs. Defaults are sized to comfortably accommodate every legitimate java-tron HTTP payload.Build:
close #6607