Skip to content

chore: sync upstream v4.8.2 API/P2P hardening fixes#55

Merged
nileTestNet merged 5 commits into
tron-nile-testnet:release_v4.8.2_build2from
tronprotocol:release_v4.8.2
Jun 24, 2026
Merged

chore: sync upstream v4.8.2 API/P2P hardening fixes#55
nileTestNet merged 5 commits into
tron-nile-testnet:release_v4.8.2_build2from
tronprotocol:release_v4.8.2

Conversation

@nileTestNet

Copy link
Copy Markdown

Summary

Syncs the Nile branch with the latest hardening fixes from upstream
tronprotocol/java-tron:release_v4.8.2. This brings in 5 commits focused
on API input validation, JSON-RPC limits, and P2P message safety — no
consensus or protocol behavior changes.

Changes

bladehan1 and others added 5 commits June 16, 2026 18:30
Improve the hand-rolled JsonFormat parser used by HTTP wallet APIs so field-heavy and deeply nested JSON no longer overflows the request thread stack.

mergeField now consumes one field per call and leaves comma iteration to the caller. JsonFormat also enforces Constant.MAX_NESTING_DEPTH for object/array descent and returns ParseException instead of allowing StackOverflowError to escape.

Compatibility notes: direct JsonFormat.merge callers now reject nesting beyond 100 levels; trailing commas on known-field parse paths (top-level fields, known message fields, and known repeated fields) may be accepted, while trailing commas inside unknown nested object/array fields remain rejected; malicious deep-nesting requests now surface as parse errors instead of container-level HTTP 500s.
* fix(jsonrpc): enforce maxBlockRange on eth_getFilterLogs

* style(jsonrpc): fix styles and comments
…#6851)

Validate the inventory type at the inbound entry points and reject any value
other than TRX or BLOCK with P2pException(BAD_MESSAGE), before the type is
used for cache insertion or outbound fetch construction:
- P2pEventHandlerImpl.checkInvRateLimit: add else branch for unknown type
- InventoryMsgHandler.check: add type allowlist check
- FetchInvDataMsgHandler.check: validate raw getInventoryType() instead of
  getInvMessageType() (which mapped non-BLOCK types to TRX)

Use getTypeValue() when building the error message to avoid calling
getNumber() on an UNRECOGNIZED enum value. Add regression tests for all
three entry points.

Co-authored-by: wb <wb@wbdeMacBook-Air.local>
@nileTestNet nileTestNet merged commit 9a449b2 into tron-nile-testnet:release_v4.8.2_build2 Jun 24, 2026
23 of 27 checks passed
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.

6 participants