Skip to content

fix(net): reject empty inventory and transaction messages - #7129

Merged
kuny0707 merged 1 commit into
tronprotocol:release_v4.8.3from
317787106:hotfix/reject_empty_p2p_lists
Nov 27, 2026
Merged

kuny0707 merged 1 commit into
tronprotocol:release_v4.8.3from
317787106:hotfix/reject_empty_p2p_lists

Conversation

@317787106

@317787106 317787106 commented Nov 26, 2026 •

Copy link
Copy Markdown
Collaborator

What does this PR do?

Reject empty INVENTORY messages (both TRX and BLOCK) and empty TRXS batches as BAD_MESSAGE, causing the existing P2P exception handler to disconnect the sender with BAD_PROTOCOL.

Add regression tests for rejection at the handler and serialized-message dispatch levels, including no reply, no activity timestamp refresh, and no request-cache access for empty transaction batches.

Why are these changes required?

This follows up on #7123, which fixed empty FETCH_INV_DATA requests but left the same class of validation gap in INVENTORY and TRXS. Empty inventory messages contribute zero to element-based rate limits, while empty transaction batches skip per-transaction request validation. Rejecting these batches closes the remaining gaps reported in #7128.

Closes #7128.

This PR has been tested by:

Follow up

PBFT-related empty-list validation is deferred because PBFT is not enabled on mainnet. This PR only changes INVENTORY and TRXS validation.

Extra details

Targets release_v4.8.3.

Reject empty INVENTORY and TRXS payloads before per-item validation so
malformed peers disconnect with BAD_PROTOCOL.

Cover handler rejection and serialized-message dispatch, and use a
nonempty inventory in the existing sync and unsolidified-block checks.

Closes tronprotocol#7128
@halibobo1205 halibobo1205 added this to the GreatVoyage-v4.8.3 milestone Nov 27, 2026
@kuny0707
kuny0707 merged commit d5c5882 into tronprotocol:release_v4.8.3 Nov 27, 2026
19 of 21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

6 participants