feat(framework,actuator,common): replace fastjson with jackson#6701
feat(framework,actuator,common): replace fastjson with jackson#6701halibobo1205 wants to merge 5 commits intotronprotocol:developfrom
Conversation
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
|
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 |
…ndexV2ServletTest
|
@yanghang8612 Performance: |
| } | ||
|
|
||
| public JSONObject put(String key, Integer value) { | ||
| if (value == null) { |
There was a problem hiding this comment.
[SHOULD] The following logic is used in multiple places and can be encapsulated into a function.
if (value == null) {
node.remove(key);
} else {
node.put(key, value);
}
return this;
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):
(framework): HTTP & servlet changes
com.alibaba.fastjson→org.tron.jsonacross all HTTP servlets, JSON-RPC layer, and event/log parsersBuild:
close #6607